• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[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