• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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

Status
Not open for further replies.
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.
Back
Top