- Joined
- Jul 6, 2009
- Messages
- 1,885
I made a trigger which runs when a unit enters any of 10 regions (10 events,for each region). Is there a way to get the region triggering unit entered in? I tried using GetTriggeringRegion() but didn't seem to work.
EDIT: Well,it seems my event is malfunctioning (which belongs to Triggers & Scripts,sorry for wrong section)
The Debug message doesn't run,anyone knows why?
The TurnRegions and TurnRects are globals declared in map custom script:
Rect initialization in init trigger: (They are initialized,i tested it by creating a unit in a region center)
EDIT: Well,it seems my event is malfunctioning (which belongs to Triggers & Scripts,sorry for wrong section)
The Debug message doesn't run,anyone knows why?
JASS:
function Turn_Filter takes nothing returns boolean
call BJDebugMsg("Filter Debug")
return IsUnitInGroup(GetFilterUnit(),udg_Travellers)
endfunction
function InitTrig_Travelling takes nothing returns nothing
local trigger t = CreateTrigger()
local integer index = 0
loop
set index = index + 1
exitwhen index > 10
set TurnRegions[index] = CreateRegion()
call RegionAddRect(TurnRegions[index],TurnRects[index])
call TriggerRegisterEnterRegion(t,TurnRegions[index],Filter(function Turn_Filter))
endloop
set t = null
endfunction
The TurnRegions and TurnRects are globals declared in map custom script:
JASS:
globals
region array TurnRegions
rect array TurnRects
endglobals
Rect initialization in init trigger: (They are initialized,i tested it by creating a unit in a region center)
JASS:
set TurnRects[1] = gg_rct_Turn_1
set TurnRects[2] = gg_rct_Turn_2
set TurnRects[3] = gg_rct_Turn_3
set TurnRects[4] = gg_rct_Turn_4
set TurnRects[5] = gg_rct_Turn_5
set TurnRects[6] = gg_rct_Turn_6
set TurnRects[7] = gg_rct_Turn_7
set TurnRects[8] = gg_rct_Turn_8
set TurnRects[9] = gg_rct_Turn_9
set TurnRects[10] = gg_rct_Turn_10
Last edited: