Usually I post on WC3C, but I decided to post here for a change.
I have a trigger that I converted into JASS because I needed to edit it a lot, and it fires after one of several events.
So you can see it fires when a unit enters either region Player0, Player1, Player2, etc. In the actions function I need to detect which of those units was entered. How do I do this?
I tried things like "if the triggering unit is in rect Player3 then" but that didn't work for some reason. I also tried to check if a point (location of triggering unit) was in the each of the regions. So anyway, I need to set a variable based on which of those units was the one entered. Thanks.
I have a trigger that I converted into JASS because I needed to edit it a lot, and it fires after one of several events.
JASS:
function InitTrig_New takes nothing returns nothing
set gg_trg_New = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_New, gg_rct_Player0 )
call TriggerRegisterEnterRectSimple( gg_trg_New, gg_rct_Player1 )
call TriggerRegisterEnterRectSimple( gg_trg_New, gg_rct_Player2 )
call TriggerRegisterEnterRectSimple( gg_trg_New, gg_rct_Player3 )
call TriggerRegisterEnterRectSimple( gg_trg_New, gg_rct_Player4 )
call TriggerRegisterEnterRectSimple( gg_trg_New, gg_rct_Player5 )
call TriggerRegisterEnterRectSimple( gg_trg_New, gg_rct_Player6 )
call TriggerRegisterEnterRectSimple( gg_trg_New, gg_rct_Player7 )
call TriggerRegisterEnterRectSimple( gg_trg_New, gg_rct_Player8 )
call TriggerRegisterEnterRectSimple( gg_trg_New, gg_rct_Player9 )
call TriggerAddCondition( gg_trg_New, Condition( function Trig_New_Conditions ) )
call TriggerAddAction( gg_trg_New, function Trig_New_Actions )
endfunction
So you can see it fires when a unit enters either region Player0, Player1, Player2, etc. In the actions function I need to detect which of those units was entered. How do I do this?
I tried things like "if the triggering unit is in rect Player3 then" but that didn't work for some reason. I also tried to check if a point (location of triggering unit) was in the each of the regions. So anyway, I need to set a variable based on which of those units was the one entered. Thanks.