[Solved] Wait for Conditions

Status
Not open for further replies.
Level 7
Joined
Jun 19, 2017
Messages
147
Hello hivers, again i have a simple question about the following Action
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Wait until (1 Equal to 2), checking every 1.00 seconds
Can this action cause in-game lag ?
 
yes it can, but it depends on the condition and the interval.
if the condition causes lag, this action will lag as well.
If the interval is very low, it will also lag more.
In general it should be safe though, because most conditions are very fast and even the slow conditions won't be a problem in most cases.
This condition for example can be problenmatic, if you have too many units in that group.
  • (Number of units in UnitGroup) Equal to 0

The wait for condition is very similar to this:
  • WaitForCondition
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • 1 Equal to 2
        • Then - Actions
        • Else - Actions
 
A simple system to make it work like described above would be something like:
JASS:
trigger callbackDUmp = CreateTrigger()
public function boolexpr.run()
TriggerClearConditions(callbackDUmp)
TriggerAddCondition(callbackDUmp, this)
TriggerEvaluate(callbackDUmp)

then make a system that stores the callback.
 
Status
Not open for further replies.
Back
Top