• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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