Hello everyone,
I have tried to make simple unit respawn system what remeber unit's original position (working only for placed units, I can divide units spawned during game/by spells from system).
Using Bribe's Indexing system works fine at start, but during respawn time (10 seconds) every custom value of respawning unit is set to latest killed unit.
Any ideas to improve effecienty/remove leaks/make it working would be handy.
I have tried to make simple unit respawn system what remeber unit's original position (working only for placed units, I can divide units spawned during game/by spells from system).
Using Bribe's Indexing system works fine at start, but during respawn time (10 seconds) every custom value of respawning unit is set to latest killed unit.
Any ideas to improve effecienty/remove leaks/make it working would be handy.
-
RespawnAdd
-
Events
-
Time - Elapsed game time is 0.01 seconds
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of (Picked unit)) Equal to Neutral Hostile
-
-
Then - Actions
-
Set Res_i = (Custom value of (Picked unit))
-
Set Res_p[Res_i] = (Position of (Picked unit))
-
Game - Display to (All players) the text: (String(Res_i))
-
-
Else - Actions
-
-
-
-
-
-
RespawnDie
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
(Owner of (Triggering unit)) Equal to Neutral Hostile
-
-
Actions
-
Set Res_i = (Custom value of (Triggering unit))
-
Game - Display to (All players) the text: (String(Res_i))
-
Wait 10.00 seconds
-
Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at Res_p[Res_i] facing (Random real number between 0.00 and 360.00) degrees
-
Game - Display to (All players) the text: (String(Res_i))
-
Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
-
Special Effect - Destroy (Last created special effect)
-
-