Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: ktalebian on Sat 25/02/2006 03:32:20

Title: Temp. Variable
Post by: ktalebian on Sat 25/02/2006 03:32:20
Hey, is there such thing as temp variable? So that after 10 seconds, for example, it expires, and once it does, something happens?
Title: Re: Temp. Variable
Post by: Gilbert on Sat 25/02/2006 03:42:50
Check for SetTimer() from the manual.
Title: Re: Temp. Variable
Post by: ktalebian on Sat 25/02/2006 05:21:50
Thanks, there is one tiny problem. And that is that IsTimerExpired is used to see whether the time has expired, but that will only load once! You know what I mean? I want the timer to be checked continously, so basically, I have a given amount of time to do something!
Title: Re: Temp. Variable
Post by: Gilbert on Sat 25/02/2006 05:31:47
Why? Just put IsTimerExpired() in repeatedly_execute() event to make it check continuously. I think you may read more tutorials and the manual first and experience with the package before attempting something concrete.
Title: Re: Temp. Variable
Post by: ktalebian on Sat 25/02/2006 05:54:11
Well, I am learning, as I go on! :D
btw, where can I find the list of all these functions? I went to that manual site (But the things are not in alphabatical order!), and my F1 does not work for some reasons!

For example, this repeated thing, how exatly is it used?
Title: Re: Temp. Variable
Post by: Gilbert on Sat 25/02/2006 06:11:20
Check out the Scripting section.
You may also use the manual provided by the package instead, in which you can search, etc.
Title: Re: Temp. Variable
Post by: strazer on Sat 25/02/2006 12:49:35
Gilbert, according to the manual:

"Note that this function will only return 1 once - after that, the timer is placed into an OFF state where it will always return 0 until restarted."

So ktalebian, put IsTimerExpired in the repeatedly_execute function and restart the timer there.
Title: Re: Temp. Variable
Post by: Gilbert on Sun 26/02/2006 03:53:41
That's right, then what's the problem? He meant to check it continuously until it expires, right? From what I understand, was that he just wanted to do it once, not doing something continuously every set loops.
Title: Re: Temp. Variable
Post by: ktalebian on Sun 26/02/2006 04:18:53
yeaah, it works noww, thxx to everyone!