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 12-08-2002, 10:32 PM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Unhappy Condensed Endless Loop...

NPC Code:

if (timeout){
if (i=17){
if (this.key5=true){
this.key5=false;
i=16;
timeout=1;
}
else{
this.key5=false;
i=16;
timeout=1;
}
}
}



Yes, I have tried changing i=17 to i==17 but it didn't work .
__________________
Reply With Quote
  #2  
Old 12-09-2002, 12:16 AM
Ningnong Ningnong is offline
Registered User
Ningnong's Avatar
Join Date: Nov 2002
Location: < -- way
Posts: 262
Ningnong is on a distinguished road
yes, well keep the i==17 in because thats the correct format. At least thats one problem solved. Also, you have:

if (this.key5=true) it should be if (this.key5==true)

like Falcor said, = is an assignment, == means equal to

eg
this.var = 5; // Makes this.var equal to 5

Also, heres an example of a very simple timeout loop that is stopped:

NPC Code:

//#CLIENTSIDE
if (playerenters){
this.time = 100;
this.on = 1;
timeout = .05;
}

if (timeout && this.on == 1){
this.time --;
if (this.time<=0){
this.on = 0;
}
timeout = .05;
}



I suggest using :

if (timeout && i == 17) { //thingys; }

-Ning
Reply With Quote
  #3  
Old 12-09-2002, 01:11 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
last time i checked graal checks = and == in if/while/for statements as being equals, i always use == but i think = works as well, even though it is technically incorrect
Reply With Quote
  #4  
Old 12-09-2002, 01:48 AM
Ningnong Ningnong is offline
Registered User
Ningnong's Avatar
Join Date: Nov 2002
Location: < -- way
Posts: 262
Ningnong is on a distinguished road
kool :P
__________________
Former Global Scripting Team Member


Reply With Quote
  #5  
Old 12-09-2002, 02:11 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
NPC Code:

if (timeout&&i==17){
if (this.key5==true){
this.key5=false;
timeout=1;
i=16;
}
else{
this.key5=false;
timeout=1;
i=16;
}
}



, that's the script now. It still doesn't work though...
__________________
Reply With Quote
  #6  
Old 12-09-2002, 02:39 AM
Ningnong Ningnong is offline
Registered User
Ningnong's Avatar
Join Date: Nov 2002
Location: < -- way
Posts: 262
Ningnong is on a distinguished road
In the timeout loop, you set i to 16. SO the timeout loop could never start...I may be reading it wrong, but at a glance thats how it looks

w00t im a member now (not junior) <3
__________________
Former Global Scripting Team Member


Reply With Quote
  #7  
Old 12-09-2002, 03:01 AM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
it says &&i==17, meaning it has to be 17 in the first place, so you have to set that somewhere
(dunno if thats what ningnong meant or not, sorry if it was :X)
__________________

Reply With Quote
  #8  
Old 12-09-2002, 03:10 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by CheeToS2
it says &&i==17, meaning it has to be 17 in the first place, so you have to set that somewhere
(dunno if thats what ningnong meant or not, sorry if it was :X)
Starting the loop isn't the problem. Since that isn't the whole script, the problem is that the loop won't end.
__________________
Reply With Quote
  #9  
Old 12-09-2002, 03:25 AM
Ningnong Ningnong is offline
Registered User
Ningnong's Avatar
Join Date: Nov 2002
Location: < -- way
Posts: 262
Ningnong is on a distinguished road
hmm, why do you have

if (this.key5 == true) this.key5 = false ?

since the script is confusing, maybe you should explain in english what your trying to do, then I could whip you up an alternate script :P
__________________
Former Global Scripting Team Member


Reply With Quote
  #10  
Old 12-09-2002, 04:12 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Okay, at the time that this part of the script is executed...

this.key5 could be true or false.
i=17
__________________
Reply With Quote
  #11  
Old 12-09-2002, 04:34 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
the timeout stops for me. *shrugs*
__________________

subliminal message: 1+1=3
Reply With Quote
  #12  
Old 12-09-2002, 05:35 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Falados, I'll send you the whole script whenever you get on AIM.
__________________
Reply With Quote
  #13  
Old 12-09-2002, 06:39 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
If you need a variable to be stored longer than the current "frame", you should use this. variables, because other scripts might use the variable as well and therefore mess up your script.
Reply With Quote
  #14  
Old 12-09-2002, 07:49 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by Loriel
If you need a variable to be stored longer than the current "frame", you should use this. variables, because other scripts might use the variable as well and therefore mess up your script.
I tried that before using i.
__________________
Reply With Quote
  #15  
Old 12-09-2002, 10:40 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally posted by Python523
last time i checked graal checks = and == in if/while/for statements as being equals, i always use == but i think = works as well, even though it is technically incorrect
I always use '==',works better for me.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #16  
Old 12-10-2002, 04:14 PM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan will become famous soon enough
Please explain what you're trying to do in plain english and give us an idea of how you will be applying it, none of us are interested in stealing it

Until then, all i can tell is you want to set i equal to 16 and set this.key5 to false which doesn't require a timeout at all because the way it's set up no matter if the timeout checks the given requirement, it still does the same thing
__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
  #17  
Old 12-11-2002, 10:05 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Well, I tried to get some private help, but because I seem to script strangely, nobody could understand my script. But then, when I was playing Survivor on 2K1, I innexplicably randomly knew what I was doing wrong. Strange indeed, but fortunate aswell. Anyways, thank you for trying :grin:. You can close this thread if you like Kai.
__________________
Reply With Quote
  #18  
Old 12-11-2002, 11:10 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Quote:
Originally posted by Googi
Well, I tried to get some private help, but because I seem to script strangely, nobody could understand my script. But then, when I was playing Survivor on 2K1, I innexplicably randomly knew what I was doing wrong. Strange indeed, but fortunate aswell. Anyways, thank you for trying :grin:. You can close this thread if you like Kai.
That happens to me as well.

I screw something up and then I know what's wrong while I'm not even worrying about scripting.
Reply With Quote
  #19  
Old 12-11-2002, 11:11 AM
sage_chaozu sage_chaozu is offline
Registered User
sage_chaozu's Avatar
Join Date: Feb 2002
Location: Florida, USA
Posts: 143
sage_chaozu will become famous soon enough
Send a message via ICQ to sage_chaozu Send a message via AIM to sage_chaozu Send a message via MSN to sage_chaozu Send a message via Yahoo to sage_chaozu
Talking I understood it

I understood the script, because I am pyschotic, insane, crazy and a dork. You have to think in the 3 x 3 method instead of the 2 x 4. It works much better due to crisp triangles than sorry rectangles. It's just that Googi logged off AIM right before I was going to send it X_X.




hehe, I need to make a leet signature :grin:
Reply With Quote
  #20  
Old 12-11-2002, 11:38 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
XD, yes, just after I figure it out, Sage sent me another fixed version of the script, which worked just as good, but was only about 3/4 the length.
__________________
Reply With Quote
  #21  
Old 12-11-2002, 03:34 PM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan will become famous soon enough
since your topic was resolved and i don't want to start a separate pointless thread... what's with your icons? x.x it's so... femminine... i thought you were a guy
__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
  #22  
Old 12-11-2002, 10:21 PM
sage_chaozu sage_chaozu is offline
Registered User
sage_chaozu's Avatar
Join Date: Feb 2002
Location: Florida, USA
Posts: 143
sage_chaozu will become famous soon enough
Send a message via ICQ to sage_chaozu Send a message via AIM to sage_chaozu Send a message via MSN to sage_chaozu Send a message via Yahoo to sage_chaozu
Chrono something?

I believe his icon is from Chrono Trigger or Chrono Cross. He told me that she has that teenager way of speaking. You know like "Like whatever." Or wait that could be his other icon. I forgot, you guys go ask him.

What do you want him to have as an icon, a big bad man with a big bad gun and a big bad sword with some big pecs that show from his muscle T-Shirt.
Reply With Quote
  #23  
Old 12-12-2002, 01:01 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by HoudiniMan
since your topic was resolved and i don't want to start a separate pointless thread... what's with your icons? x.x it's so... femminine... i thought you were a guy
That is MARCY, and she is there because I'm rotating Chrono Cross characters in my avatar at a very slow rate. A while ago I had Guile (Strangely enough, the only male ever to make it into my avatar).
__________________
Reply With Quote
  #24  
Old 12-12-2002, 04:29 PM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan will become famous soon enough
She just scares me ._.

So demonic! OH THE HUMANITY!
__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
  #25  
Old 12-13-2002, 03:32 AM
sage_chaozu sage_chaozu is offline
Registered User
sage_chaozu's Avatar
Join Date: Feb 2002
Location: Florida, USA
Posts: 143
sage_chaozu will become famous soon enough
Send a message via ICQ to sage_chaozu Send a message via AIM to sage_chaozu Send a message via MSN to sage_chaozu Send a message via Yahoo to sage_chaozu
Marcy.. tee hee

heh, Marcy reminds me of Chun-li with her head ornaments.
Reply With Quote
  #26  
Old 12-13-2002, 06:59 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by HoudiniMan
She just scares me ._.

So demonic! OH THE HUMANITY!
Hahaha, there used to be this guy at Gamefaqs with a sig that said "As soon as I find out how Marcy got so strong, my kids are going to be national security threats"
__________________
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 11:50 AM.


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