• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Triggers Not Initializing

Status
Not open for further replies.
Level 9
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
 
Status
Not open for further replies.
Top