Hi there, first post, anyway I have a slightly annoying problem. I got this trigger that won't fire and I have no idea why.
That's the trigger and it will never show the "success" message.
The condition currently always return true for testing purposes.
I declare the globals in the global decleration like this.
While googling my problem i noticed that other people don't seem to need to set the regions to null, if I don't however the initz crashes. Here is a part of the Initz.
I first Create the region then i add a pre-placed rect to it.
That part is done for all the regions with different rects and units ofc.
So anyone see any problem?
JASS:
function Entering_Conditions takes nothing returns boolean
return true // GetTriggeringRegion() == LoadRegionHandle(udg_PH_HT, GetHandleId(GetTriggerUnit()), 7)
endfunction
function Trig_Enters_Region_Actions takes nothing returns nothing
call BJDebugMsg("success")
endfunction
//===========================================================================
function InitTrig_Enters_Region takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterEnterRegion(t, AREGION1, null)
call TriggerRegisterEnterRegion(t, AREGION2, null)
call TriggerRegisterEnterRegion(t, AREGION3, null)
call TriggerRegisterEnterRegion(t, AREGION4, null)
call TriggerRegisterEnterRegion(t, AREGION5, null)
call TriggerRegisterEnterRegion(t, AREGION6, null)
call TriggerRegisterEnterRegion(t, AREGIONX1, null)
call TriggerRegisterEnterRegion(t, AREGIONX2, null)
//call TriggerAddCondition( t, Condition(function Entering_Conditions ))
call TriggerAddAction( t, function Trig_Enters_Region_Actions )
set t = null
endfunction
That's the trigger and it will never show the "success" message.
The condition currently always return true for testing purposes.
I declare the globals in the global decleration like this.
JASS:
globals
region AREGION1 = null
region AREGION2 = null
region AREGION3 = null
region AREGION4 = null
region AREGION5 = null
region AREGION6 = null
region AREGIONX1 = null
region AREGIONX2 = null
endglobals
While googling my problem i noticed that other people don't seem to need to set the regions to null, if I don't however the initz crashes. Here is a part of the Initz.
JASS:
local unit u
local integer int
local integer int2
local region rgn
set udg_TownID_HT = InitHashtable()
set udg_Wall_HT = InitHashtable()
set udg_PH_HT = InitHashtable()
set AREGION1 = CreateRegion()
set AREGION2 = CreateRegion()
set AREGION3 = CreateRegion()
set AREGION4 = CreateRegion()
set AREGION5 = CreateRegion()
set AREGION6 = CreateRegion()
set AREGIONX1 = CreateRegion()
set AREGIONX2 = CreateRegion()
set u = gg_unit_h003_0000
call RegionAddRect(AREGION1, gg_rct_ARegion1)
set rgn = AREGION1
set int = GetHandleId(u)
set int2 = GetHandleId(rgn)
//Link town to its Region
call SaveRegionHandle(udg_TownID_HT, int, 10, rgn)
call SaveUnitHandle(udg_TownID_HT, int2, 10, u)
I first Create the region then i add a pre-placed rect to it.
JASS:
set u = gg_unit_h003_0000
call RegionAddRect(AREGION1, gg_rct_ARegion1)
set rgn = AREGION1
set int = GetHandleId(u)
set int2 = GetHandleId(rgn)
//Link town to its Region
call SaveRegionHandle(udg_TownID_HT, int, 10, rgn)
call SaveUnitHandle(udg_TownID_HT, int2, 10, u)
That part is done for all the regions with different rects and units ofc.
So anyone see any problem?