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 08-22-2003, 12:00 AM
SilentSkripter1988 SilentSkripter1988 is offline
Banned
Join Date: Aug 2003
Posts: 56
SilentSkripter1988 is on a distinguished road
Whats the differance between timeout and sleep?

Sleep seems to stop the npc, timeout seems to do nothing, and also gani's wont play for me, how do I get a dang gani to play ?
Reply With Quote
  #2  
Old 08-22-2003, 12:05 AM
Neoreno Neoreno is offline
Cerebrate
Neoreno's Avatar
Join Date: Aug 2001
Location: England
Posts: 1,663
Neoreno is on a distinguished road
Send a message via AIM to Neoreno
Sleep pauses the script for a certain time. Timeout is a countdown.
__________________

Quote:
Exitus Acta Probat: The Outcome Justifies the Deed.
Reply With Quote
  #3  
Old 08-22-2003, 12:06 AM
SilentSkripter1988 SilentSkripter1988 is offline
Banned
Join Date: Aug 2003
Posts: 56
SilentSkripter1988 is on a distinguished road
So like if I do timeout=10 it will keep going with the script but nothing will happen when timeout is finished therefore making timeout utterly useless ?
Reply With Quote
  #4  
Old 08-22-2003, 12:07 AM
Riot-Starter Riot-Starter is offline
Registered User
Join Date: Aug 2001
Location: Central Florida, USA
Posts: 79
Riot-Starter is on a distinguished road
Send a message via AIM to Riot-Starter
Timeout waits the given seconds then calls to the "timeout" statement without stoping the script.

Sleep delays execution.

as for ganis:
Make shure you have the .gani extension on the filename and use
setani gani name w/o .gani,params;
Reply With Quote
  #5  
Old 08-22-2003, 12:09 AM
marcoR marcoR is offline
Registered User
Join Date: Jul 2003
Posts: 1,349
marcoR is on a distinguished road
sleep is a pause in the script, for as long as you tell it to, timeout is a loop. e.g.:

NPC Code:


if (created){ //starts a code block
timeout=0.05; //this sets the loop refresh;
} //ends a code block

if (timeout)//this begins the loop{ //starts a code block
message Fat People; //the NPC says Fat People
sleep 0.5; //sleeps half a second
message Skinny People; //the NPC says Skinny People
timeout=0.05; //this completes the loop
} //ends a code block




A sleep

NPC Code:


if (created)//if the NPC is created{ //starts a code block
message Fat people; //the NPC says Fat People
sleep 2; //pauses 2 seconds
message Skinny People; //the NPC says Skinny People
} //ends a code block




this is as far as my feeble mind understands this exact script, tho my wording probably isn't great. (i tried tho)
__________________
If this is your account, contact me.
- loriel
email, jabber: [email protected]
icq: 67530805
aim: lorielvictrix
Reply With Quote
  #6  
Old 08-22-2003, 12:11 AM
Riot-Starter Riot-Starter is offline
Registered User
Join Date: Aug 2001
Location: Central Florida, USA
Posts: 79
Riot-Starter is on a distinguished road
Send a message via AIM to Riot-Starter
Quote:
Originally posted by marcoR
sleep is a pause in the script, for as long as you tell it to, timeout is a loop. e.g.:

NPC Code:


if (created){ //starts a code block
timeout=0.05; //this sets the loop refresh;
} //ends a code block

if (timeout)//this begins the loop{ //starts a code block
message Fat People; //the NPC says Fat People
sleep 0.5; //sleeps half a second
message Skinny People; //the NPC says Skinny People
timeout=0.05; //this completes the loop
} //ends a code block




A sleep

NPC Code:


if (created)//if the NPC is created{ //starts a code block
message Fat people; //the NPC says Fat People
sleep 2; //pauses 2 seconds
message Skinny People; //the NPC says Skinny People
} //ends a code block


Dont use "//" comments then put {, it's the same as not putting it at all. Drop it down to the next line
Reply With Quote
  #7  
Old 08-22-2003, 12:12 AM
marcoR marcoR is offline
Registered User
Join Date: Jul 2003
Posts: 1,349
marcoR is on a distinguished road
... I was just trying to make it easy for him to understand.
__________________
If this is your account, contact me.
- loriel
email, jabber: [email protected]
icq: 67530805
aim: lorielvictrix
Reply With Quote
  #8  
Old 08-22-2003, 12:17 AM
Riot-Starter Riot-Starter is offline
Registered User
Join Date: Aug 2001
Location: Central Florida, USA
Posts: 79
Riot-Starter is on a distinguished road
Send a message via AIM to Riot-Starter
Just sayin something, if he copies and pastes:
"Error: Unknown command: }"
Reply With Quote
  #9  
Old 08-22-2003, 12:23 AM
marcoR marcoR is offline
Registered User
Join Date: Jul 2003
Posts: 1,349
marcoR is on a distinguished road
well if he does copy and paste it, i'll break his thumbs, because I have that exact script copyrighted
__________________
If this is your account, contact me.
- loriel
email, jabber: [email protected]
icq: 67530805
aim: lorielvictrix
Reply With Quote
  #10  
Old 08-22-2003, 12:26 AM
Riot-Starter Riot-Starter is offline
Registered User
Join Date: Aug 2001
Location: Central Florida, USA
Posts: 79
Riot-Starter is on a distinguished road
Send a message via AIM to Riot-Starter
I seriously doubt you can copyright such a simple script
Reply With Quote
  #11  
Old 08-22-2003, 12:27 AM
KainDaMan KainDaMan is offline
Registered User
Join Date: Jul 2003
Location: Virginia,USA
Posts: 51
KainDaMan is on a distinguished road
Send a message via AIM to KainDaMan
timeout is not a loop unless you make it a loop

NPC Code:

if (playerenters) {
timeout=5;
}
if (timeout) {
message #n sucks!;
}


This accomplishes the same thing as
NPC Code:

if (playerenters) {
sleep 5;
message #n sucks!;
}


but at the same time, isn't a loop.
Like Kiirar said above, timeout is litterally a countdown
the command
NPC Code:

timershow;


does the equivelent to message of the time it has until the timeout event is called
__________________
---Kain Morbid
Reply With Quote
  #12  
Old 08-22-2003, 06:21 AM
SilentSkripter1988 SilentSkripter1988 is offline
Banned
Join Date: Aug 2003
Posts: 56
SilentSkripter1988 is on a distinguished road
About the Gani's, what are params for? Btw read my post under playerworlds era about banned. see how pissed off i am, 3 p2p accounts, grr.
Reply With Quote
  #13  
Old 08-22-2003, 04:57 PM
Neoreno Neoreno is offline
Cerebrate
Neoreno's Avatar
Join Date: Aug 2001
Location: England
Posts: 1,663
Neoreno is on a distinguished road
Send a message via AIM to Neoreno
Read the gani forum.
__________________

Quote:
Exitus Acta Probat: The Outcome Justifies the Deed.
Reply With Quote
  #14  
Old 08-22-2003, 04:59 PM
Snakeandy7 Snakeandy7 is offline
"Member ID=2610"
Snakeandy7's Avatar
Join Date: Mar 2003
Posts: 987
Snakeandy7 is on a distinguished road
params = #p
:P
__________________
"Freedom is best I tell thee
of all things to be won
then never live within the bond
of slavery my son".


Reply With Quote
  #15  
Old 08-22-2003, 07:57 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
Timeout is an invisible flag that is 'created' when the timeout count reach 0. Another example:

NPC Code:

if(playerenters){
timeout=5;
}

if(timeout){
say2 Chasam;
}



When timeout be 0,it will 'create' the flag and will execute the code inside that timeout block.

By the way,Kaidaman,timeout & sleep aren't the same thing and won't execute the same thing as you said.
__________________
"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 08-22-2003, 08:22 PM
Spark910 Spark910 is offline
Ex-Graal Global
Spark910's Avatar
Join Date: Oct 2001
Location: England
Posts: 10,892
Spark910 has a spectacular aura about
Unless I didnt read it, I think you all missed out the big part.

NPC Code:

if (playertouchsme) {
sleep 2;
hide;
}



You touch it, you wait until 2 before it hides, it does not execute ANYTHING until it has waken from sleep. So it wont do anything until it stops sleeping.

NPC Code:

if (playertouchsme) {
timeout=2;
}

if (timeout) {
hide;
}



If I keep touching it, the timeout will go back to 2. But sleep will not, as it is asleep and can not take any more commands.
If its not correct what I have said, then its because im not a scripter.
__________________
--Spark911
Reply With Quote
  #17  
Old 08-22-2003, 08:48 PM
marcoR marcoR is offline
Registered User
Join Date: Jul 2003
Posts: 1,349
marcoR is on a distinguished road
i'm not a scripter either, that's all right, but i've never looked at it that specific way.. kinda like it
__________________
If this is your account, contact me.
- loriel
email, jabber: [email protected]
icq: 67530805
aim: lorielvictrix
Reply With Quote
  #18  
Old 08-22-2003, 11:06 PM
KainDaMan KainDaMan is offline
Registered User
Join Date: Jul 2003
Location: Virginia,USA
Posts: 51
KainDaMan is on a distinguished road
Send a message via AIM to KainDaMan
Osrs, you obviously failed to read correctly what I had said because the thing is that what I had said was correct and in that particular case, would do the same thing as a sleep, save for the very valid point spark pointed out.
__________________
---Kain Morbid
Reply With Quote
  #19  
Old 08-23-2003, 12:44 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Important point: On a lower level, sleep basically just makes a note of where the instruction counter is and sets a timeout, then jumps to the same place when the timeout occurs. People often try to combine the two (never a good idea) and end up going crazy.
__________________
Reply With Quote
  #20  
Old 08-24-2003, 12:26 AM
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 KainDaMan
Osrs, you obviously failed to read correctly what I had said because the thing is that what I had said was correct and in that particular case, would do the same thing as a sleep, save for the very valid point spark pointed out.
Sleep pauses the script execution,timeout doesn't,so both systems are working same?
I understand what you had said,it will execute the same effect on script,but won't work same...
__________________
"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
  #21  
Old 08-24-2003, 01:01 PM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Quote:
Originally posted by SilentSkripter1988
So like if I do timeout=10 it will keep going with the script but nothing will happen when timeout is finished therefore making timeout utterly useless ?
Uh, you sure act pretty knowledgeable for someone who has no idea what they are talking about. :|

If you don't know what timeout does, don't say it is useless, it makes you look like an idiot.
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


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 05:28 AM.


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