• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[JASS] How to avoid waits

Status
Not open for further replies.
Level 19
Joined
Oct 12, 2007
Messages
1,821
Hmm this was something I wondered when I was making a littlebit JASS on my own.

I got a system that checks something every 0.50 seconds and does an action if a boolean is true. The only important info here is the 0.50 second interval.

Currently I got something like this:

Loop
exitwhen i > 5
if boolean == true then
blabla
set i = 6
else
set i = i + 1
call wait(0.50)
endloop

This is basically what I have atm, but the problem is that the waits aren't really secure, sometimes I can just see it in my map that it skips a 0.50 interval. Could someone tell me how to avoid waits? I once heard something about countdown timers but I'm not really sure about it.

Thanks.
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
I thought Rain. did all the coding for ya :p

Anyway timers as PurplePoot said.

Yeah RaiN is the coder for Oakwood. However I wanted to try something myself. Before RaiN joined the project I was Oakwood's "Coder". Had many leaks ofc and he fixed everything, but I still like to give it a shot once in a while.
Trying to make one of the smaller systems myself:grin:
 
Status
Not open for further replies.
Top