Timer
BlitzPlus Forums/BlitzPlus Beginners Area/Timer
| ||
Just wondering... how does the createtimer()/delaytimer() system work? It seems that the higher the number, the less it delays! What does the number actually do? |
| ||
Um...I looked through the command Ref. for B+ and didn't find any delaytimer. If you meant delay, then it will delay 1 sec for every 1000 you put after delay:delay(1000) Createtimer should be used with waitTimer in that a variable is used for createtimer and waittimer waits untill the specified time is reached. |
| ||
CreateTimer takes a FREQUENCY as its parameter. This means that a timer with a frequency of 1 will tick once per second, but a frequency of 60 will tick 60 times per second. If you wish to create, say, a 10 second timer then just pass 0.1 to CreateTimer. It will work as expected. Basically, just give CreateTimer the INVERSE of the time you want your timer to wait: 10 second timer = 1/10 = .1 2 second timer = 1/2 = .5 .5 (half) second timer = 1/.5 = 2 .1 (tenth) second timer = 1/.1 = 10 |
| ||
Ahh |