"Wait for condition" Not Waiting

WolfieeifloW

WEHZ Helper
Reaction score
372
JASS:
if(GetRandomInt(1, intCasterB) >= intCasterO) then
            call TimerStart(EXPTIMER[GetPlayerId(GetOwningPlayer(caster))], EXPDELAY(QT), false, null)
            loop
            exitwhen(TimerGetRemaining(EXPTIMER[GetPlayerId(GetOwningPlayer(caster))]) <= 0.00)
                call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 0.03))
            endloop
            loop
            exitwhen i == CountUnitsInGroup(GSGROUP)
                set expu = GroupPickRandomUnit(GSGROUP)
                call GroupEnumUnitsInRange(EXPGROUP, GetUnitX(expu), GetUnitY(expu), EXPRANGE(QT), Condition(function EXPConditions))
                call ForGroup(EXPGROUP, function EXPActions)
                call GroupRemoveUnit(GSGROUP, expu)
                set expu = null
                set i = i + 1
            endloop
        endif

It doesn't wait for the timer to expire, it just goes right through the wait.
 

Naga'sShadow

Ultra Cool Member
Reaction score
49
No idea, its possible that the timer isn't starting since its got a null for the connected function. If you included a function that it would call upon expiration and then moved everything below your wait to the new function it would run the same. You would have to use some sort of attachment system to keep your variables though.

Edit: Another idea is to scrap the timer completely, since your using trigger sleep action anyway the timer is really a waste. Instead of this.

JASS:
call TimerStart(EXPTIMER[GetPlayerId(GetOwningPlayer(caster))], EXPDELAY(QT), false, null)
            loop
            exitwhen(TimerGetRemaining(EXPTIMER[GetPlayerId(GetOwningPlayer(caster))]) <= 0.00)
                call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 0.03))
            endloop


You could use something like this.

JASS:
local real r
loop 
exitwhen r >= EXPTIMER[GetPlayerId(GetOwningPlayer(caster)
call TriggerSleepAction(.2)
set r = r + .2
endloop
 

WolfieeifloW

WEHZ Helper
Reaction score
372
I actually tried making a new function with the wait and everything else in the new function.
Nothing even got run.
I'll just use a TSA I guess :eek: .
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top