• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Waits?

Status
Not open for further replies.
Level 30
Joined
Nov 29, 2012
Messages
6,637
Timers would be the best alternatives for waits because waits has really an added time in it like for example if you typed, 0.01, it will be actually 0.02 or more while Timers are accurate and exact. As far as I know though.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Instead of a wait, one can use a countdown timer or a periodic timer and an array depending on what you need to do. I recommend looking at the spell database for some examples.

Timers would be the best alternatives for waits because waits has really an added time in it like for example if you typed, 0.01, it will be actually 0.02 or more while Timers are accurate and exact. As far as I know though.

Low wait times have one of the following times added to them: 0.1, 0,125, 0,150, 0,175, 0,2 even in single player. So a 0.01 second wait is at least 0.11 and max of 0.21. Higher wait times are more accurate but still recommended to avoid.
 
If you use GUI, I think it's ok to use waits in some cases, if you dont want to have it 100% perfect.

For example you just want to wait a short moment and then do action, so you just use wait 1 second for example.
And afterall you don't really care if it's 0.8 or 1.2 seconds, you just want it to be something like this.

Otherwise you would need to create a new trigger and put your actions there. (in GUI)

Also Wait - 0 seconds can be useful sometimes if you want to start a new thread.

Bad point of wait:
If someone is lagging online, the game pets paused, but the wait function is not. So it will continue counting.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Wait actions in WC3 all use TriggerSleepAction to suspend the trigger thread to be rescheduled at a later time. The problem is that the way it is rescheduled is not very good. It makes little guarantee was to what the actual wait time will be and I suspect it even delays by multiple round trip time in multiplayer.

Timers are much more accurate and reliable. They also appear to have sub frame resolution for some reason.

In SC2 Blizzard smartened up and used the same schedualer for waits as it did for timers. This is accurate to 1 game frame, the lowest resolvable time in SC2. In SC2 you can use wait actions all you like as long as you keep the thread amount reasonable and make sure the thread will not crash if waiting in a loop.
 
Status
Not open for further replies.
Top