• 🏆 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!

[General] Does "Wait for condition" works properly?

Status
Not open for further replies.
Level 17
Joined
Dec 11, 2014
Messages
2,004
Very inaccurate. It's just a loop with a wait in it.

JASS:
function SomeAction takes nothing returns nothing
    loop
        exitwhen MyCondition
        call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, someInterval)) //RMaxBJ makes sure the interval isn't lower than 0.1
    endloop
endfunction

//===========================================================================
function InitTrig_MyTrigger takes nothing returns nothing
    set gg_trg_MahTrig = CreateTrigger()
    call TriggerAddAction(gg_trg_MahTrig, function SomeAction)
endfunction

//I changed the code a little bit, so you can actually read it

If you understand JASS, this is how it works. If you don't, this is a trigger that has a single action, the Wait for Condition action, where the condition is MyCondition, the interval is someInterval, MahTrig is your trigger name and SomeAction are your actions.
 
Status
Not open for further replies.
Top