TriggerSleepAction( why is it stopping my actions? )

D

dArKzEr0

Guest
I have this:
Code:
function TransportUnitToStart takes unit x returns nothing
    local unit transportUnit = x
    local player owner = GetOwningPlayer( transportUnit )
    local location startPoint = GetUnitLoc( transportUnit )
    local location endPoint = GetRectCenter(gg_rct_Revive_Point)
    local effect array transportEffect
    call PauseUnit( transportUnit, true )
    set transportEffect[1] = AddSpecialEffectLoc( "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTo.mdl", startPoint )
    call TriggerSleepAction( 1 )
    set transportEffect[2] = AddSpecialEffectLoc( "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl", startPoint )
    call DestroyEffect( transportEffect[1] )
    call TriggerSleepAction( .3 )
    call PanCameraToTimedLocForPlayer( owner, endPoint, 0.0 )
    call SetUnitPositionLoc( transportUnit, endPoint )
    set transportEffect[3] = AddSpecialEffectLoc( "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl", endPoint )
    call DestroyEffect( transportEffect[2] )
    call TriggerSleepAction( .3 )
    call PauseUnit( transportUnit, false )
    call DestroyEffect( transportEffect[3] )
    call RemoveLocation( startPoint )
    call RemoveLocation( endPoint )
    set transportUnit = null
    set owner = null
    set startPoint = null
    set endPoint = null
    set transportEffect[1] = null
    set transportEffect[2] = null
    set transportEffect[3] = null
endfunction

In my map header section, but the TriggerSleepActions stop all subsequent actions from occurring. Why does this happen?

-darkz
 

SFilip

Gone but not forgotten
Reaction score
634
i doubt he is since that trigger takes a unit.
perhaps showing your complete trigger would help...
 

SFilip

Gone but not forgotten
Reaction score
634
damn forgot about that :eek:
 
D

dArKzEr0

Guest
I call it with:

Code:
Set tempGroup = (units in BossRegion <gen> matching ((((Matching unit) is A Hero) Equal to True) and ((((Matching unit) belongs to an ally of Player 1 (Red) Equal to True) and (((Matching unit) is alive) Equal to True))))
Unit Group - Pick every unit in tempGroup and do (Actions)
    Loop - Actions
        Custom Script:   call TransportUnitToStart(GetEnumUnit())
Custom Script:    call DestroyGroup( udg_tempGroup )

So obviously it is a forgroup enumeration. How should I get around it?

-darkz
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Ever been reading the bit of description on "pick every"? :p

Anyway, why not do it yourself?

loop
- set u = FirstOfGroup(g)
- exitwhen u == null
- call GroupRemoveUnit(g,u)
- ...
endloop
 
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