| 05-24-2009, 07:49 AM | #1 |
Hello, I'm trying to create a trigger that registers when a unit enters a region, then a text should be displayed, the problem is, it isn't. JASS:globals rect TriggerRect = gg_rct_Test region TriggerRegion = CreateRegion() boolean FirstSlope = false endglobals function Actions takes nothing returns nothing call BJDebugMsg("Test") endfunction function Init takes nothing returns nothing local trigger Trig = CreateTrigger() call RegionAddRect(TriggerRegion,TriggerRect) call TriggerRegisterEnterRegion(Trig,TriggerRegion,null) call TriggerAddAction(Trig, function Actions) endfunction |
| 05-24-2009, 09:24 AM | #2 |
The global rect TriggerRect is being assigned before gg_rct_Test has been created. Also creating the region in the global block will cause the map to crash while loading. JASS:globals region TriggerRegion boolean FirstSlope = false endglobals function Actions takes nothing returns nothing call BJDebugMsg("Test") endfunction function Init takes nothing returns nothing local trigger Trig = CreateTrigger() set TriggerRegion = CreateRegion() call RegionAddRect(TriggerRegion, gg_rct_Test) call TriggerRegisterEnterRegion(Trig,TriggerRegion,null) call TriggerAddAction(Trig, function Actions) endfunction |
