| 04-07-2007, 12:33 AM | #1 |
JASS:function Trig_Enter_Conditions takes nothing returns boolean return GetPlayerController(GetOwningPlayer(GetEnteringUnit())) == MAP_CONTROL_USER endfunction function Trig_Enter_Actions takes nothing returns nothing local unit e = GetEnteringUnit() local real ex = GetUnitX(e) local real ey = GetUnitY(e) if RectContainsCoords( gg_rct_Enter1, ex, ey ) then call ShowUnit(e, false) call TriggerSleepAction(0.5) call SetUnitPosition( e, -4611, -5146 ) call ShowUnit(e, true) call PanCameraToTimed( ex, ey, 0 ) elseif RectContainsCoords( gg_rct_Enter2, ex, ey ) then call KillUnit(gg_unit_emow_0011) elseif RectContainsCoords( gg_rct_Enter22, ex, ey ) then call KillUnit(gg_unit_emow_0010) elseif RectContainsCoords( gg_rct_Enter222, ex, ey ) then call KillUnit(gg_unit_emow_0009) endif set e = null endfunction //=========================================================================== function InitTrig_Enter takes nothing returns nothing local region r = CreateRegion() set gg_trg_Enter = CreateTrigger() call RegionAddRect( r, gg_rct_Enter1 ) call RegionAddRect( r, gg_rct_Enter2 ) call RegionAddRect( r, gg_rct_Enter22 ) call RegionAddRect( r, gg_rct_Enter222 ) //call RegionAddRect( r, gg_rct_Enter3 ) call TriggerRegisterEnterRegion( gg_trg_Enter, r, null ) call TriggerAddCondition( gg_trg_Enter, Condition( function Trig_Enter_Conditions ) ) call TriggerAddAction( gg_trg_Enter, function Trig_Enter_Actions ) set r = null endfunction the 2 that are highlighted dont trigger. All the regions are spelled right, but some dont work. Anyone know why? the 1st one that is highlighted worked before i added the if/thens Edit: I moved the regions somewhere else, and they worked fine, but when i moved them back, they stopped working again... |
| 04-07-2007, 02:26 PM | #2 |
Okay I believe in your event it triggers when your unit goes into any one of those regions, right? So, I'm not sure, but are you sure that the region they enter is the correct one you want? Oh and I think GetTriggeringUnit() runs faster than GetEnteringUnit(), though it doesn't matter much. |
