- Joined
- Apr 23, 2011
- Messages
- 460
In the following scripts my triggers are not initializing. I placed a
call BJDebugMsg("Hello World")
code line in and it didn't fire so I don't understand why the triggers aren't running.
JASS:
function DoInvulUnits takes nothing returns nothing
call InvulUnits.Main()
endfunction
function InitTrig_RunScripts takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerAddAction(t, function DoInvulUnits)
call BJDebugMsg("Hello World")
call TriggerRegisterTimerEvent(t, .5, false)
set t = null
endfunction
JASS:
function CheckUnitCond takes unit u returns boolean
local integer typeUnit = 'hfoo'
if GetUnitTypeId(u) == typeUnit and GetUnitCurrentOrder(u) == OrderId("hold") then
return true
else
return false
endif
endfunction
function GiveSpell takes nothing returns nothing
local unit u = GetEnteringUnit()
if CheckUnitCond(u) == true then
call Jump.Main()
endif
set u = null
endfunction
function InitTrig_Jump takes nothing returns nothing
local trigger t = CreateTrigger()
local region r = CreateRegion()
call RegionAddRect(r, gg_rct_GiveSpell)
call TriggerRegisterEnterRegion(t, r, null)
call TriggerAddAction(t, function GiveSpell)
set t = null
set r = null
endfunction