So i want it that everytime a unit is created then a custom value will be assigned to that unit, and when a unit dies then every unit that has a bigger custom value than that dying unit will be decreased, i managed to create it but just curious though, will it work properly? and also should i change "Dying Unit" and "Trained Unit" to "Triggering Unit" ?
-
OnUnitCreate
-
Events
-
Unit - A unit Finishes training a unit
-
-
Conditions
-
Actions
-
Set Max_Value = (Max_Value + 1)
-
Unit - Set the custom value of (Trained unit) to Max_Value
-
-
-
OnUnitDie
-
Events
-
Unit - A unit Dies
-
-
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
-
(Custom value of (Picked unit)) Greater than (Custom value of (Dying unit))
-
-
Then - Actions
-
Set Max_Value = (Max_Value - 1)
-
Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) - 1)
-
-
Else - Actions
-
-
-
-
-