Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-08-2002, 04:02 AM
lordhelmut lordhelmut is offline
Registered User
lordhelmut's Avatar
Join Date: Aug 2001
Posts: 710
lordhelmut is on a distinguished road
Send a message via ICQ to lordhelmut Send a message via AIM to lordhelmut Send a message via Yahoo to lordhelmut
Golem

Anyone know why this f***s up?

// NPC made by Floating Head
if(created){
this.mode=0;
}
if (playertouchsme) {
toweapons Golem;
}
if(weaponfired){
if(this.mode=0){
this.mode=1;
timeout=.05;
}
if(this.mode=1){
this.mode=0;
setani idle,;
}
}
if(timeout){
if(keydown(0)){
setani golem_walk-up,;
timeout=.05;
}
if(keydown(1)){
setani golem_walk-left,;
timeout=.05;
}
if(keydown(2)){
setani golem_walk-down,;
timeout=.05;
}
if(keydown(3)){
setani golem_walk-right,;
timeout=.05;
}
if(keydown(5)){
setani golem_slam,;
timeout=.05;
}
else{
setani golem_down-idle,;
}
timeout=.05;
}

For some reason if u stand still it walks and if u hold down a key its idle =/
__________________

Check out the development at:
http://razza.org/lordhelmut/FantasyTales/index

Last edited by Kaimetsu; 02-08-2002 at 10:32 AM..
Reply With Quote
  #2  
Old 02-08-2002, 04:14 AM
Aknts Aknts is offline
Level Designer
Aknts's Avatar
Join Date: Apr 2001
Location: USofA
Posts: 3,340
Aknts will become famous soon enough
Send a message via AIM to Aknts
Umm Golem from Diablo...
__________________
Reply With Quote
  #3  
Old 02-08-2002, 04:17 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
Re: Golem

Quote:
Originally posted by lordhelmut
Anyone know why this ****s up?

// NPC made by Floating Head
if(created){
this.mode=0;
}
if (playertouchsme) {
toweapons Golem;
}
if(weaponfired){
if(this.mode=0){
this.mode=1;
timeout=.05;
}
if(this.mode=1){
this.mode=0;
setani idle,;
}
}
if(timeout){
if(keydown(0)){
setani golem_walk-up,;
timeout=.05;
}
if(keydown(1)){
setani golem_walk-left,;
timeout=.05;
}
if(keydown(2)){
setani golem_walk-down,;
timeout=.05;
}
if(keydown(3)){
setani golem_walk-right,;
timeout=.05;
}
if(keydown(5)){
setani golem_slam,;
timeout=.05;
}
else{
setani golem_down-idle,;
}
timeout=.05;
}

For some reason if u stand still it walks and if u hold down a key its idle =/

okay, here is the problem

NPC Code:

if(weaponfired){
if(this.mode=0){ // If this.mode equals zero (then it will set to 1;
this.mode=1;
timeout=.05;
}
if(this.mode=1){ // then it checks to see if this.mode is 1 and then sets it back to 0
this.mode=0;
setani idle,;
}
}



try doing this

if (weaponfired) {
if (this.mode=0) {
this.mode=1; timeout=.05;
} else if (this.mode==1) {
this.mode=0; setani idle,; }
}
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #4  
Old 02-08-2002, 04:18 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
also, dont put the timeouts inside the keydowns

and do, if (timeout&&this.mode==1) {
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #5  
Old 02-08-2002, 04:18 AM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 has a spectacular aura about
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
umm... yea, lol
__________________
Reply With Quote
  #6  
Old 02-08-2002, 04:27 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
// NPC made by screen_name

if(created){
this.mode=0; }

if (playertouchsme) {
toweapons Golem; }

if(weaponfired){
if(this.mode=0){
this.mode=1;
timeout=.1;
} else if (this.mode==1) {
this.mode=0;
setani idle,; }
}

if(timeout&&this.mode==1){
if (!keydown(0)&&!keydown(1)&&!keydown(2)&&!keydown(3 )&&!keydown(5)) { setani golem_down-idle,; }
if(keydown(0)){
setani golem_walk-up,; }
if(keydown(1)){
setani golem_walk-left,; }
if(keydown(2)){
setani golem_walk-down,; }
if(keydown(3)){
setani golem_walk-right,; }
if(keydown(5)){
setani golem_slam,; }
timeout=.1;
}
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #7  
Old 02-08-2002, 04:54 AM
lordhelmut lordhelmut is offline
Registered User
lordhelmut's Avatar
Join Date: Aug 2001
Posts: 710
lordhelmut is on a distinguished road
Send a message via ICQ to lordhelmut Send a message via AIM to lordhelmut Send a message via Yahoo to lordhelmut
still doesnt work =( u hold down a arrow key and it wont show walking animation. I think its cuz it restarts the animation to fast but i dont know how to fix that and keep it moving
__________________

Check out the development at:
http://razza.org/lordhelmut/FantasyTales/index
Reply With Quote
  #8  
Old 02-08-2002, 06:13 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Re: Golem

NPC Code:

// NPC made by Floating Head
if(created){
this.mode=0;
}
if (playertouchsme) {
toweapons Golem;
}
if(weaponfired){
if(this.mode=0){
this.mode=1;
timeout=.05;
}
if(this.mode=1){
this.mode=0;
setani idle,;
}
}
if(timeout){
if(keydown(0)){
setani golem_walk-up,;
timeout=.05;
}
if(keydown(1)){
setani golem_walk-left,;
timeout=.05;
}
if(keydown(2)){
setani golem_walk-down,;
timeout=.05;
}
if(keydown(3)){
setani golem_walk-right,;
timeout=.05;
}
if(keydown(5)){
setani golem_slam,;
timeout=.05;
}
else{ //Here is where you are messing up
setani golem_down-idle,;
}
timeout=.05;
}


Ok. So, basically, if key 5 is not down, it sets the Golem gani to idle. I recommend you fix the code like this:
NPC Code:

// NPC made by Floating Head
// Modified by Boco ^_^
if(created) this.mode=0;
if (playertouchsme) toweapons Golem;
if(weaponfired){
if(this.mode==0){
this.mode=1;
timeout=.05;
} else {
this.mode=0;
timeout=0;
}
setani idle,;
}
}
if (timeout) {
if(keydown(0)) setani golem_walk-up,;
if(keydown(1)) setani golem_walk-left,;
if(keydown(2)) setani golem_walk-down,;
if(keydown(3)) setani golem_walk-right,;
if(keydown(5)) setani golem_slam,;
if (!(keydown(0)&&keydown(1)&&keydown(2)&&keydown(3)& &keydown(5))) setani golem_down-idle,;
timeout=.05;
}

__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #9  
Old 02-08-2002, 08:09 AM
Shard_IceFire Shard_IceFire is offline
Registered User
Shard_IceFire's Avatar
Join Date: Jun 2001
Location: Eastern Harkoonia
Posts: 861
Shard_IceFire is on a distinguished road
Use disabledefmovement and then the animation won't loop so fast it doesn't work =)
__________________

-=Shard IceFire=-
Reply With Quote
  #10  
Old 02-08-2002, 08:14 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
i knew i forgot something
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #11  
Old 02-08-2002, 08:16 AM
Lomgren Lomgren is offline
Senior Member, Anti-Spam
Join Date: Mar 2001
Location: Missouri
Posts: 196
Lomgren will become famous soon enough
Quote:
Originally posted by BocoC
NPC Code:

if (!(keydown(0)&&keydown(1)&&keydown(2)&&keydown(3)

ok, but change the && to || otherwise you'll still have the same problem, (it will make the gani idle when you don't have up,left,down,right, and s depressed)
__________________
Lomgren - devoted to classic, even though I may be gone for months on end
Reply With Quote
  #12  
Old 02-08-2002, 09:59 AM
lordhelmut lordhelmut is offline
Registered User
lordhelmut's Avatar
Join Date: Aug 2001
Posts: 710
lordhelmut is on a distinguished road
Send a message via ICQ to lordhelmut Send a message via AIM to lordhelmut Send a message via Yahoo to lordhelmut
for some reason it still does the same thing =/ Bocos didnt work.
__________________

Check out the development at:
http://razza.org/lordhelmut/FantasyTales/index
Reply With Quote
  #13  
Old 02-08-2002, 10:48 AM
lordhelmut lordhelmut is offline
Registered User
lordhelmut's Avatar
Join Date: Aug 2001
Posts: 710
lordhelmut is on a distinguished road
Send a message via ICQ to lordhelmut Send a message via AIM to lordhelmut Send a message via Yahoo to lordhelmut
Re: Re: Golem

Quote:
Originally posted by Kaimetsu


HEY. No profanity here.
Oops sorry kai
__________________

Check out the development at:
http://razza.org/lordhelmut/FantasyTales/index
Reply With Quote
  #14  
Old 02-08-2002, 12:01 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Re: Re: Re: Golem

Quote:
Originally posted by lordhelmut


Oops sorry kai
stupid cusser!!!
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #15  
Old 02-10-2002, 08:47 AM
OutlawP2P OutlawP2P is offline
Registered User
Join Date: Dec 2001
Posts: 439
OutlawP2P is on a distinguished road
Send a message via AIM to OutlawP2P
eh Golem was from a lot of places, Diablo 2 and pokemon also I believe
__________________

Pandah Baerh
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:43 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.