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

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