HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Life Timer help

11-20-2003, 03:17 AM#1
Garu
Sorry for such a stupid question, but I'm having a little trouble using the life timer. What I want to have happen is when unit X is trained, he has a timer as if he were a summoned unit. After the timer expires, I want unit X to be replaced by unit Y. Any help would be appreciated.
11-20-2003, 03:31 AM#2
Biflspud
Errm. That's going to be tricky. The unit dies when the timer expires. Just a hunch, however - just because the unit dies doesn't mean it's hit points are =0.

Try this:

E: A unit dies
C: Unit type = X
Hit points of dying unit > 0
A: Create Unit Y at position of dying unit

You may also want to set Unit Y's relative life to that of the dying unit.
11-20-2003, 03:57 AM#3
Garu
Nice thought, but it didn't work. Besides, with this method I suspect it would be hard to get the unit to have both a standard death when killed, and just disapearing after the timer expires. It would have to be one or the other. Seems like there should be an event for life timer expiration. Oh well.

Anyone have any other ideas?
11-20-2003, 04:14 AM#4
DarkenPride
E - Unit is Trained
C - Unit Trained = Footman
A - Give Trained Unit a Generic Timer for 60 seconds.

EDIT : Give that footman the "Spawn Hydra/Spider" ability. When the unit dies, the new unit is spawned from the dead unit. :D
11-20-2003, 04:22 AM#5
Garu
Aha, I found a decent workaround. Unfortunatly, the timer doesn't quite expire, but that's only a minor aesthetic problem.

A: Unit enters region(entire map)
C: Triggering unit is equal to unit type X
A: Unit - Set timed life for unit (Triggering unit) with buff ID 1 and duration 10 seconds
Wait 9.70 game-time seconds
If (((Triggering unit) is alive) Equal to True) then do (Unit - Replace (Triggering unit) with a Unit Y using The old unit's relative life and mana) else do (Skip remaining actions)


Are there any potential problems that might arise from this method? What is buff ID, exactly?