HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

trigger doesnt work

09-20-2003, 03:17 PM#1
Fire-Dragons
got a big problem with the following trigger... it doesnt work... nothing happens do you see a mistake??

function Trig_creep_revive_Kopieren_Actions takes nothing returns nothing
call TriggerSleepAction( 120.00 )
call CreateNUnitsAtLoc( 1, GetUnitTypeId(GetDyingUnit()), GetOwningPlayer(GetDyingUnit()), GetUnitLoc(GetDyingUnit()), GetUnitFacing(GetDyingUnit()) )
call AddSpecialEffectLocBJ( GetUnitLoc(GetDyingUnit()), "Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl" )
call TriggerSleepAction( 10.00 )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endfunction

//===========================================================================
function InitTrig_creep_revive_Kopieren takes nothing returns nothing
set gg_trg_creep_revive_Kopieren = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_creep_revive_Kopieren, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple(
call TriggerAddAction( gg_trg_creep_revive_Kopieren, function Trig_creep_revive_Kopieren_Actions )
endfunction
09-20-2003, 03:27 PM#2
Zachary_Shadow
What is it trying to do? Is it in JASS...?
09-20-2003, 03:56 PM#3
Fire-Dragons
it does:
if a unit of neutral hostile dies it should be revived after 120 seconds at the same point ...
the problem is...
after 120 the corpse is gone so there is no position of the unit/corpse thats why it doesnt work
its just in jass because i wanna learn a little jass
any ideas???
09-20-2003, 04:43 PM#4
Draco
If you wanna learn jass, try converting different types on triggers to custom text. After that, use WinMPQ to extract the common.j (from war3.mpq) and open it in notepad for more JASS info.
09-20-2003, 04:55 PM#5
Saethori
If your problem is that corpses no longer are there to be revived, then I see two ways to fix it..

1- Go to Game Constants, and set corpse decay time to longer than 120 seconds (150 should be fine)

2- Set a trigger that whenever an enemy dies, it's decay timer is paused.
09-20-2003, 05:02 PM#6
Oinkerwinkle
Try this:

function Trig_creep_revive_Kopieren_Actions takes nothing returns nothing
local unittype theDyingUnitType = GetUnitTypeId(GetDyingUnit())
local player theOwner = GetOwningPlayer(GetDyingUnit())
local real theFacing = GetUnitFacing(GetDyingUnit())
local location theLocation = GetUnitLoc(GetDyingUnit())
local effect theEffect
call TriggerSleepAction( 120.00 )
call CreateNUnitsAtLoc( 1, theDyingUnitType, TheOwner, theLocation, theFacing )
call AddSpecialEffectLocBJ( theLocation, " Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl" )
set theEffect = GetLastCreatedEffectBJ()
call TriggerSleepAction( 10.00 )
call DestroyEffectBJ( theEffect)
endfunction

// ==================================================
=========================
function InitTrig_creep_revive_Kopieren takes nothing returns nothing
set gg_trg_creep_revive_Kopieren = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_creep_revive_Kopieren, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple(
call TriggerAddAction( gg_trg_creep_revive_Kopieren, function Trig_creep_revive_Kopieren_Actions )
endfunction