I'm wondering if someone can help me with my tweaked respawn system, it needs to be specifically made to maintain what I already had implemented before recently made changes (due to adding bribe's unit indexer into the level and no longer being able to use "Set custom value [+1]"). The reason I need it specifically made is the "Engine hackery" I had going on before was imperative to how I want my game to progress.
-'Ancients' are non-respawnable bosses,
-Every unit that is placed in the level editor and not spawned in through triggers or abilities will be respawnable,
-Every unit that is not already placed during the level startup will be non-respawnable, (There are unique locations that will be treated like dungeons, where after a player enters the units will spawn, if you fail they will be removed. These units should not be able to respawn)
-Lastly Player 8 and Neutral hostile are both treated as Neutral Hostile, but with a unique relationship.
So I'm trying to make this respawn work here and keep it leakless, though I need some help.
This is the full trigger sequence:
What I'm wondering is:
Will the "Last created unit" bug, because it is after a "Wait"?
Do I need the "bj_wantdestroygroup"s even though they are being added to a unit group?
Also, I'm not sure how to call upon in game variables through custom code, but this is something I need help with & couldn't find google results:
-'Ancients' are non-respawnable bosses,
-Every unit that is placed in the level editor and not spawned in through triggers or abilities will be respawnable,
-Every unit that is not already placed during the level startup will be non-respawnable, (There are unique locations that will be treated like dungeons, where after a player enters the units will spawn, if you fail they will be removed. These units should not be able to respawn)
-Lastly Player 8 and Neutral hostile are both treated as Neutral Hostile, but with a unique relationship.
So I'm trying to make this respawn work here and keep it leakless, though I need some help.
This is the full trigger sequence:
-
RespawnInitialization
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
Set VariableSet Respawn_Timer_Creep = 5.00
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units owned by Neutral Hostile matching ((((Matching unit) is A Hero) Equal to False) and ((((Matching unit) is An Ancient) Equal to False) and ((((Matching unit) is Summoned) Equal to False) and (((Matching unit) is A structure) Equal to False)))).) and do (Actions)
-
Loop - Actions
-
Unit Group - Add (Picked unit) to RespawnUnitGroup
-
Set VariableSet Creep_Point[(Custom value of (Picked unit))] = (Position of (Picked unit))
-
-
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units owned by Player 8 (Pink) matching ((((Matching unit) is A Hero) Equal to False) and ((((Matching unit) is An Ancient) Equal to False) and ((((Matching unit) is Summoned) Equal to False) and (((Matching unit) is A structure) Equal to False)))).) and do (Actions)
-
Loop - Actions
-
Unit Group - Add (Picked unit) to RespawnUnitGroup
-
Set VariableSet Creep_Point[(Custom value of (Picked unit))] = (Position of (Picked unit))
-
-
-
-
-
The Respawn
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
((Dying unit) is in RespawnUnitGroup.) Equal to True
-
-
Actions
-
Wait Respawn_Timer_Creep game-time seconds
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of (Dying unit)) Equal to Neutral Hostile
-
-
Then - Actions
-
Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Hostile at Creep_Point[(Custom value of (Dying unit))] facing (Random angle) degrees
-
Unit Group - Add (Last created unit) to RespawnUnitGroup
-
-
Else - Actions
-
Unit - Create 1 (Unit-type of (Dying unit)) for Player 8 (Pink) at Creep_Point[(Custom value of (Dying unit))] facing (Random angle) degrees
-
Unit Group - Add (Last created unit) to RespawnUnitGroup
-
-
-
Custom script: call RemoveLocation(udg_Creep_Point[X])
-
Set VariableSet Creep_Point[(Custom value of (Last created unit))] = (Position of (Last created unit))
-
-
Will the "Last created unit" bug, because it is after a "Wait"?
Do I need the "bj_wantdestroygroup"s even though they are being added to a unit group?
Also, I'm not sure how to call upon in game variables through custom code, but this is something I need help with & couldn't find google results:
-
Custom script: call RemoveLocation(udg_Creep_Point["X"])