Hey everyone, I have been having issues with my current creep respawn system as it sets a unit's custom value and that is conflicting with the unit indexer I have on my map and causing serious performance issues. My current respawn system is set up like this:
(on map init to set the value of preplaced units)
(on map init to set the value of preplaced units)
- Set VariableSet Creeps = (Units owned by Neutral Hostile.)
-
Unit Group - Pick every unit in Creeps and do (Actions)
-
Loop - Actions
- Set VariableSet I = (I + 1)
- Unit - Set the custom value of (Picked unit) to I
- Set VariableSet Angle[I] = (Facing of (Picked unit))
- Set VariableSet Position = (Position of (Picked unit))
- Set VariableSet X[I] = (X of Position)
- Set VariableSet Y[I] = (Y of Position)
- Custom script: call RemoveLocation(udg_Position)
-
Loop - Actions
- Custom script: call DestroyGroup(udg_Creeps)
- Set VariableSet I = 0
- Set VariableSet I = (I + 1)
- Set VariableSet Creep[I] = (Dying unit)
- Wait 417.00 game-time seconds
- Set VariableSet Position = (Center of (Playable map area))
- Set VariableSet J = (J + 1)
- Unit - Create 1 (Unit-type of Creep[J]) for Neutral Hostile at (Position offset by (X[(Custom value of Creep[J])], Y[(Custom value of Creep[J])])) facing Angle[(Custom value of Creep[J])] degrees
- Custom script: call RemoveLocation(udg_Position)
- Unit - Set the custom value of (Last created unit) to (Custom value of Creep[J])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- I Greater than or equal to 8000
-
Then - Actions
- Set VariableSet I = 0
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- J Greater than or equal to 8000
-
Then - Actions
- Set VariableSet J = 0
- Else - Actions
-
If - Conditions