• 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.

Trigger not running

Status
Not open for further replies.
Level 5
Joined
Sep 27, 2011
Messages
141
The following trigger Isn't running and I can't figure out why. hoping someone can provide some insight.
Useful(Maybe) Information:

-BLOOD_RAIDER, STOMP, BERSERK, etc are constant global integers set in the trigger above it at init and represent numbers 0 -22
-The trigger is not initially on but does get enabled when it needs to be (Checked with DebugMsg)
-TOTAL_CAST_GROUPS is set to 23

What I've tried:

-replacing constants with their number equivalents
-replacing call TriggerRegisterTimerEventPeriodic( gg_trg_CastAbilities, 1/(TOTAL_CAST_GROUPS / 2) ) with call TriggerRegisterTimerEventPeriodic( gg_trg_CastAbilities, 0.032 )
-Debug msgs to check that the group im trying to test actually has units in it

Unfortunately, let alone cast the abilities none of the messages in the trigger even show up.

Thanks for any Help.

JASS:
function F_STORM_BOLT_TARGET takes nothing returns boolean
    return IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(castingUnit))
endfunction

function F_STORM_BOLT takes nothing returns nothing
    call BJDebugMsg("Storm Bolt")
    if GetUnitStateSwap(UNIT_STATE_MANA, castingUnit) >= 15 then
        set udg_TempPoint = GetUnitLoc( castingUnit )
        set targets = GetUnitsInRangeOfLocMatching(250, udg_TempPoint, Condition( function F_STORM_BOLT_TARGET ))
        call IssueTargetOrderById( castingUnit,852095, GroupPickRandomUnit(targets))
        call RemoveLocation( udg_TempPoint )
        call DestroyGroup( targets )
    endif
endfunction

function F_FAN_OF_KNIVES takes nothing returns nothing
    call IssueImmediateOrderById( castingUnit, 852526 )
endfunction

function FunctionExecutor takes nothing returns nothing
    set castingUnit = GetEnumUnit()
    call BJDebugMsg("Executing: " + castGroupFunctions[currentCastGroup])
    call ExecuteFunc( castGroupFunctions[currentCastGroup] )
    set castingUnit = null
endfunction

function Trig_CastAbilities_Actions takes nothing returns nothing
    call BJDebugMsg("For Group: " + castGroupFunctions[currentCastGroup])
    call ForGroup( CastGroups[currentCastGroup], function FunctionExecutor )
    set currentCastGroup = currentCastGroup + 1
    call BJDebugMsg("For Group: " + castGroupFunctions[currentCastGroup])
    call ForGroup( CastGroups[currentCastGroup], function FunctionExecutor )
    set currentCastGroup = currentCastGroup + 1
endfunction

//===========================================================================
function InitTrig_CastAbilities takes nothing returns nothing
    globals
        integer currentCastGroup
        string array castGroupFunctions
        unit castingUnit
        group targets
    endglobals

    set gg_trg_CastAbilities = CreateTrigger(  )
    call DisableTrigger( gg_trg_CastAbilities )
    call TriggerRegisterTimerEventPeriodic( gg_trg_CastAbilities, 1/(TOTAL_CAST_GROUPS / 2) ) //1.0/I2R(TOTAL_CAST_GROUPS / 2)
    call TriggerAddAction( gg_trg_CastAbilities, function Trig_CastAbilities_Actions )

    set castGroupFunctions[BLOOD_RAIDER]        = "F_BLOOD_RAIDER"
    set castGroupFunctions[STOMP]            = "F_STOMP"
    set castGroupFunctions[BERSERK]            = "F_BERSERK"
    set castGroupFunctions[UNHOLY_FRENZY_SELF]    = "F_UNHOLY_FRENZY_SELF"
    set castGroupFunctions[UNHOLY_FRENZY_ENEMY]    = "F_UNHOLY_FRENZY_ENEMY"
    set castGroupFunctions[UNHOLY_FRENZY_ALLY]    = "F_UNHOLY_FRENZY_ALLY"
    set castGroupFunctions[CLUSTER_ROCKETS]        = "F_CLUSTER_ROCKETS"
    set castGroupFunctions[CHAIN_LIGHTNING]        = "F_CHAIN_LIGHTNING"
    set castGroupFunctions[GATE_GUARD]        = "F_GATE_GUARD"
    set castGroupFunctions[GOBLIN_BLASTER]        = "F_GOBLIN_BLASTER"
    set castGroupFunctions[BATTLE_CRY]        = "F_BATTLE_CRY"
    set castGroupFunctions[HADES]            = "F_HADES"
    set castGroupFunctions[HARBINGER]        = "F_HARBINGER"
    set castGroupFunctions[FROST_ARMOUR_ALLY]    = "F_FROST_ARMOUR_ALLY"
    set castGroupFunctions[FROST_ARMOUR_SELF]    = "F_FROST_ARMOUR_SELF"
    set castGroupFunctions[LORD_OF_DEATH]        = "F_LORD_OF_DEATH"
    set castGroupFunctions[MIRROR_IMAGE]        = "F_MIRROR_IMAGE"
    set castGroupFunctions[DRUNKEN_HAZE]        = "F_DRUNKEN_HAZE"
    set castGroupFunctions[NECROLYTE]        = "F_NECROLYTE"
    set castGroupFunctions[NECROMANCER]        = "F_NECROMANCER"
    set castGroupFunctions[RAIDER]            = "F_RAIDER"
    set castGroupFunctions[STORM_BOLT]        = "F_STORM_BOLT"
    set castGroupFunctions[FAN_OF_KNIVES]        = "F_FAN_OF_KNIVES"
endfunction
 
Status
Not open for further replies.
Top