• 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.

[Solved] Wait for Conditions

Status
Not open for further replies.
Level 7
Joined
Jun 19, 2017
Messages
144
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 ?
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
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
 

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,241
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.
Top