• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

[Solved] Wait for Conditions

Status
Not open for further replies.
Level 7
Joined
Jun 19, 2017
Messages
141
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 15
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 40
Joined
Jun 9, 2011
Messages
13,183
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