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

[JASS] Terrain kill trig not working

Status
Not open for further replies.
Level 2
Joined
Jun 26, 2007
Messages
14
JASS:
function Trig_Snow_Actions takes nothing returns nothing
    local unit u=GetEnumUnit()
    local real x=GetUnitX(u)
    local real y=GetUnitY(u)
    local integer t=GetTerrainType(x,y)
    if(t==udg_TerrainKill)then
        if ( GetUnitTypeId(u) == 'Edem' ) then
            call AddSpecialEffectTargetUnitBJ( "origin", u, "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl" )
            call KillUnit(u)
        endif
    endif
    set u=null
endfunction

function InitTrig_Snow takes nothing returns nothing
    set gg_trg_Snow = CreateTrigger(  )
    call TriggerRegisterTimerEvent(gg_trg_Snow, 0.01, true) 
    call TriggerAddAction( gg_trg_Snow, function Trig_Snow_Actions )
endfunction

udg_TerrainKill is set to the tile Ywmb in a seperate trigger.

I just cant find anything wrong, maybe one of you can?
 
Level 6
Joined
Aug 19, 2006
Messages
187
you have a trigger that runs every 0.01 seconds but he can't really do anything because the actions don't fit the Init functions. because you need to register an unitevent so he can refer to your unit and run the actions.

so you need another initfunction for the trigger but i never did something like that and don't know the right functions actually
 
Status
Not open for further replies.
Top