Axe Software Forums
  Quest Developer Forum
  Could somebody give me a timer example?


Author Topic:   Could somebody give me a timer example?
Tyrant posted 01-08-2001 07:02 GMT     
Even after reading the documents, I'm still having timer troubles. Could somebody just give me a timer example and tell me how to use it? I'm just fooling around with timers right now so I can get a better understanding of how to use them. Just give me a runthrough of how to implement a timer, as well as how to configure it and to use it... thanks.
Tyrant posted 01-08-2001 07:04 GMT          
Ummm.... I don't recall pressing the Submit button twice, so I don't know why my message was cloned. Anyway, Alex, you can delete one of the clone posts if you want unless there are replies. Sorry about the inconvenience (whatever it was).
Tyrant posted 01-08-2001 07:06 GMT          
Sorry I'm replying again, but WHAT'S HAPPENING?! Something's wrong with the board! Nothing big or anything, but it just cloned my message TWICE. First, I posted, and my message was cloned. Next, I replied to ONE of the messages, and then that was cloned into the other one. I have a feeling that this reply is going to be put into the other clone post for some reason...
Computer Whizz posted 01-08-2001 11:19 GMT          
Well, In QDK you can put the raw timer code in misc ASL.... that appears down the bottom of the .ASL file. Now on your startscript, or enter room script on your case, you will have to start the timer by using "Timeron <>" or something like that. Now you can set the timer to do actions every 5 seconds, every 10 seconds, ANYTIME! I'm personally going to increment the time by 3 seconds every second... so it will take 8 hours for the whole day to change (unless they go to sleep or something!).
Does this help?
I don't have any ASL documentation on me at the moment but post specific questions if you want to....

--CW

Computer Whizz posted 01-08-2001 11:19 GMT          
Well, In QDK you can put the raw timer code in misc ASL.... that appears down the bottom of the .ASL file. Now on your startscript, or enter room script on your case, you will have to start the timer by using "Timeron <>" or something like that. Now you can set the timer to do actions every 5 seconds, every 10 seconds, ANYTIME! I'm personally going to increment the time by 3 seconds every second... so it will take 8 hours for the whole day to change (unless they go to sleep or something!).
Does this help?
I don't have any ASL documentation on me at the moment but post specific questions if you want to....

--CW

Computer Whizz posted 01-08-2001 11:19 GMT          
Well, In QDK you can put the raw timer code in misc ASL.... that appears down the bottom of the .ASL file. Now on your startscript, or enter room script on your case, you will have to start the timer by using "Timeron <>" or something like that. Now you can set the timer to do actions every 5 seconds, every 10 seconds, ANYTIME! I'm personally going to increment the time by 3 seconds every second... so it will take 8 hours for the whole day to change (unless they go to sleep or something!).
Does this help?
I don't have any ASL documentation on me at the moment but post specific questions if you want to....

--CW

Russell posted 01-08-2001 14:59 GMT          
Alex or computer whizz could you create an .asl file that has a timer in it? I think this is something that Tyrant and I could use (Like you mention in your 26-8-2000 post)
I know I am being incredebly thick headed on this one but I just don't get it.I've updated my email, so my posts will be more timely. Thanks
Tyrant posted 01-08-2001 18:13 GMT          
Actually, like Russell said, I would like some sort of example that I can copy and paste to work off of. I put what the documents had inside the MISC ASL:

define timer
interval <10>
action msg <Timer works>
enabled
end define

But I only get an error when trying to play the game. Is Interval the amount of time (seconds) that pass by before the action takes place, or is it the amount of seconds per interval? Also, I put TIMERON <TIMER> in the startscript so it begins right away.

Alex posted 01-08-2001 18:25 GMT          
Unless I'm missing something fundamental with regards to my own software products, you shouldn't be using QDK at the moment to create an ASL3 game, so sticking timer code in there probably won't work well at all.

Also I noticed the other day the documentation on the timers page has forked up because I forgot to replace < and > with < and > in the HTML. Your example:

define timer
interval <10>
action msg <Timer works>
enabled
end define

...should have a parameter after "define timer", like

define timer <myclock>

Tyrant posted 01-08-2001 20:15 GMT          
Thanks Alex, it works now. Also, this actually does work in QDK. Just use an Other Script Command to turn the timer on, then do the define timer function in MISC ASL, and it will work.

I also have another question. Is there a way to set timer properties to a collectible, or at least be able to print the amount of time in the timer for the player to see? I want the player to know what time it is, and the day changes accordingly to the time.

Luridii posted 01-08-2001 21:28 GMT          
Ummm doesn't qdk write in asl-version 200?
Computer Whizz posted 01-08-2001 23:58 GMT          
Well, it *shouldn't* work until he alters the asl version to 284.
Glad your timer works now, it took me 2/3 tries as well!

--CW

Tyrant posted 02-08-2001 01:41 GMT          
Hmmm, that's odd since I tested the timer using QDK, and it did work...
Alex posted 02-08-2001 22:17 GMT          
quote:

Is there a way to set timer properties to a collectible, or at least be able to print the amount of time in the timer for the player to see?

I would say the obvious solution would be to get your timer script to update some status variable (collectables are obsolete in ASL3).

As for QDK 1.x being able to output ASL3, Quest only checks the ASL version when it's really important. And QDK might just output an asl-version of something other than 217 if you loaded in a file with an asl-version of something other than 217. However I don't actually know - I've not tried it.