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

Ez to do Unit Revival

Status
Not open for further replies.
Level 6
Joined
Aug 15, 2007
Messages
209
Hawk, that's only to have clean scripts. DoNothing...does nothing. LordGnex, the problem you have is tha a TriggerSleepAction (Or a Wait for GUIers) causes data to be lost in the function. I think it atleast loses the position of triggering unit, meaning it won't work because there is no position for it to spawn. It might also lose the triggering unit too. I will make a JASS trigger that does EXACTLY what yours does, so copy it to the word.

JASS:
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local location p = GetUnitLoc(u)
local player a = GetOwningPlayer(u)
if GetOwningPlayer(GetDyingUnit()) == Player(0) then
call TriggerSleepAction(5)
call CreateUnitAtLoc(a, GetUnitTypeId(u), p, 270)
endif
set u = null
set p = null
set a = null
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_001, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction
 
Last edited:
Status
Not open for further replies.
Top