HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

my respawning trigger doesnt work

08-15-2004, 06:08 PM#1
High Loremaster
This is what I have for a creep respawn trigger:

Events
A unit Dies
Conditions
(Owner of (Dying unit)) Equal to Player 11 (Dark Green)
Actions
Wait 300.00 seconds
Unit- Create 1 (Unit-type of (Dying unit)) for Player 11 (Dark Green) at (Position of (Dying Unit)) facing Default building facing degrees

For some reason, the creeps don't respawn. Can anyone help?
08-15-2004, 07:03 PM#2
Rafael Br
After 300 seconds the unit has alredy decayed, it is removed from the game, I think you can fix your trigger by doing this:
Code:
Events
    Unit - A unit Dies
Conditions
    (Owner of (Dying unit)) Equal to Player 11 (Dark Green)
Actions
    Custom script:   local location udg_DyingUnitPoint
    Custom script:   local string udg_DyingUnitType
    Set DyingUnitType = (Name of (Dying unit))
    Set DyingUnitPoint = (Position of (Dying unit))
    Wait 300.00 seconds
    Unit - Create 1 (Unit-type(DyingUnitType)) for Player 11 (Dark Green) at DyingUnitPoint facing Default building facing degrees
Create a String variable (DyingUnitType) and a point variable (DyingUnitPoint), on the create unit action, use conversion - convert string to unit-type.I don't know if the unit keeps it's name when dies, but there is no local type for "unit type" variable.
EDIT: If you want to clean leaks, use this after all of the above actions:
Custom script: call RemoveLocation (udg_DyingUnitPoint)
08-15-2004, 07:10 PM#3
Jeltz
You have to use local variables since several units could die before 300 seconds have passed.
08-17-2004, 02:39 AM#4
High Loremaster
If I made it so units do not decay, would that work? I don't have access to WC3 at the moment, so I can't test it.

EDIT: I was able to test it. I set the decay time under "Gameplay Constants" to 400 seconds, and used my original trigger above. It seems to be working fine. Thank you anyway.