• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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