• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to Wait for a very very short time

Status
Not open for further replies.
Level 12
Joined
Feb 22, 2010
Messages
1,115
There is no way without timer, it is a limitation of waits.Convert your trigger such a way that it works with timer.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
How do I wait 0.01 seconds without using a timer?
There is no way to do that. TriggerSleepAction is limited at 0.1 seconds best case (single player, more if multiplayer).

Well, if I use a timer, how do I detect when it expires in the very same trigger I create it? I need this Wait for actions that execute more times.. (the "For Each Integer A" action)
You cannot. You need to either use the timer callback or a trigger that runs when it expires. You then need to instance the local state so that it follows the timer around as it expires. I forget the programming term for this sort of pattern but there is one I am sure.

A real pain it is, but that is the only way to do it.

Isn't it just the same as the GUI 'Wait'?
Yes it is the same as a GUI Wait. Wait game time also uses it but in a leaky way that is more accurate for long timeouts.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
Lets say you want to move your unit 600 range forward.

  • Trigger 1
  • Events
    • Unit - A unit starts effect of an ability
  • Conditions
    • Ability being cast is blablabla
  • Actions
    • Set MovingUnit = Triggering Unit
    • Set MoveCount = 40
    • Trigger - Turn on Trigger2
Trigger 2 is initially off.
  • Trigger 2
  • Events
    • Time - Every 0.03 seconds of the game time
  • Conditions
  • Actions
    • Unit - Move MovingUnit instantly 15 range forward
    • Set MoveCount = MoveCount - 1
    • If (MoveCount equal to 0)
      • Trigger - turn off this trigger
    • else
The idea is basicly this.
 
Status
Not open for further replies.
Top