• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Function (FadeFire) is not executing?

Status
Not open for further replies.
Level 15
Joined
Nov 30, 2007
Messages
1,202
JASS:
private function FadeFire takes nothing returns nothing
        local unit u = tempFire 
        call KillUnit(u)
        set u = null
    endfunction
    
    private function ForGroup_Periodic takes nothing returns nothing
        local unit u = GetEnumUnit()
        local integer i = GetUnitUserData(u)
        local real dmg = 10
        set stackTime[i] = stackTime[i] - 1
        call BJDebugMsg("Index: " + I2S(i) + " | time  " + I2S(stackTime[i]) + " | damage " + R2S(stackDmg[i]))
      
        if GetUnitState(u, UNIT_STATE_LIFE) <= 0 then
            set tempFire = fire[i]
            call ExecuteFunc("FadeFire")
            set tempFire = null
        endif
        
       if stackTime[i] == 0 then
            set stackDmg[i] = 0
            call GroupRemoveUnit(stackGroup, u)
            set stackGroupCount = stackGroupCount - 1
            if stackGroupCount == 0 then
                call DisableTrigger(trgPeriodic)
            endif
            // Start Fire 
            // fire[i] == null (temporary)
        elseif fire[i] == null then
            if stackDmg[i] >= REQ_STACK*GetUnitState(u, UNIT_STATE_MAX_LIFE)*(1 + fireResistance[i]) then
                set fire[i] = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), FIRE_DUMMY, GetUnitX(u), GetUnitY(u), 0)
            endif
        else 
            call UnitDamageTarget(fire[i], u, dmg, true, false, ATTACK_TYPE_SIEGE, DAMAGE_TYPE_FIRE, WEAPON_TYPE_WHOKNOWS)
        endif        
        
        set u = null
    endfunction
 
FadeFire is a private function. After jasshelper compiles private functions, it'll add a prefix to them (depending on the scope/library container name), with a random number of underscores. So ExecuteFunc("FadeFire") won't work. You have to use:
call ExecuteFunc(SCOPE_PRIVATE + "FadeFire")
SCOPE_PRIVATE is a special keyword that tells the compiler to use the appropriate prefix of the given scope.
http://www.wc3c.net/vexorian/jasshelpermanual.html#sconst
 
Status
Not open for further replies.
Top