• 🏆 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!

[JASS] Destructable problem

Status
Not open for further replies.
Hi, i'm interfering some strange problems with my code; inside some of the functions i call
JASS:
call ModifyGateBJ(bj_GATEOPERATION_OPEN, gg_dest_DTg3_1120)
and i most certainly know that the destructable name is correct, since i made a trigger using it and converted it to custom text and retrieved in therefrom.

Still, i cant save the script and WE says that i need a name.
What am i doing wrong?

If you want to check my script i can post it.
 
Well here's the script anyway, it is being triggered by a timer as you might see.
Yet, the gate wont ever open. Still, other things work, like the effects; but the sound only plays once! So if the function is called again it wont. Help me clean up this mess!

JASS:
function charge takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local group g
    local location loc1 = GetRectCenter(gg_rct_FX1)
    local location loc2 = GetRectCenter(gg_rct_FX2)    
    call DestroyTimer(t)
    call DestroyTimerDialog(udg_JOB_SlayTimer)
    call CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE), 'n011', loc1, 0.)
    call UnitApplyTimedLife(GetLastCreatedUnit(), 'BTLF', 1.40)
    call CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE), 'n011', loc2, 0.)
    call UnitApplyTimedLife(GetLastCreatedUnit(), 'BTLF', 1.40)
    call ModifyGateBJ( bj_GATEOPERATION_OPEN, gg_dest_DTg3_1120 )
    call StartSound(CreateSoundFromLabel("BattleNetDoorsStereo2",false,false,false,0,0))
    call KillSoundWhenDone(GetLastPlayedSound())
    set g = GetUnitsInRectAll(gg_rct_Spawn)
    call ForGroup(g, function Attack)
    call DestroyGroup(g)
    set g = null
    set t = null
    call RemoveLocation(loc1)
    call RemoveLocation(loc2)
    set loc1 = null
    set loc2 = null
    endfunction
 
Status
Not open for further replies.
Top