- Joined
- Jul 25, 2009
- Messages
- 3,091
I'm using Bribe's healevent to detect when a unit gains health.
When the unit gains health and the conditions are true (the number of units in the unit group is less than the maximum number of units allowed, and the HP threshold for adding units back to the group has been crossed), a unit is added back to the group, which unit should be determined by
Set TempUnit2 = (Random unit from (Units in (Playable map area) matching ((((Matching unit) is in GMemberGroup[TempInt]) Equal to True) and (((Matching unit) is dead) Equal to True))))
However, it only finds one type of unit, and adds that type of unit to the squad, no matter how many other types of units are, both dead and in GMemberGroup (a group I add all squad members to when they are created)
When the unit gains health and the conditions are true (the number of units in the unit group is less than the maximum number of units allowed, and the HP threshold for adding units back to the group has been crossed), a unit is added back to the group, which unit should be determined by
Set TempUnit2 = (Random unit from (Units in (Playable map area) matching ((((Matching unit) is in GMemberGroup[TempInt]) Equal to True) and (((Matching unit) is dead) Equal to True))))
However, it only finds one type of unit, and adds that type of unit to the squad, no matter how many other types of units are, both dead and in GMemberGroup (a group I add all squad members to when they are created)
-
Reinforcing Units
-
Events
-
Game - HealEvent becomes Equal to 1.00
-
Game - HealEvent becomes Equal to 0.50
-
-
Conditions
-
(Level of Squad Leader Attachment for heal_target) Greater than 0
-
-
Actions
-
Set TempInt = (Custom value of heal_target)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
GCurrentSquadSize[TempInt] Less than (Real(GCurrentMaxSize[TempInt]))
-
(Percentage life of GLeader[TempInt]) Greater than (GPercentage[TempInt] x (GCurrentSquadSize[TempInt] - 0.00))
-
-
Then - Actions
-
Set TempUnit2 = (Random unit from (Units in (Playable map area) matching ((((Matching unit) is in GMemberGroup[TempInt]) Equal to True) and (((Matching unit) is dead) Equal to True))))
-
Unit Group - Remove TempUnit2 from GMemberGroup[TempInt]
-
Set GPoint[1] = (Position of heal_target)
-
Set tempLoc2 = (GPoint[1] offset by 160.00 towards (72.00 x (Real(GInt))) degrees)
-
Unit - Create 1 Locust Dummy for (Owner of heal_target) at tempLoc2 facing (Facing of heal_target) degrees
-
Unit - Add Locust Switcher to (Last created unit)
-
Custom script: call UnitAddAbility(GetLastCreatedUnit(),'Aloc')
-
Custom script: call UnitRemoveAbility(GetLastCreatedUnit(),'Aloc')
-
Unit - Set level of Locust Switcher for (Last created unit) to (Point-value of (Unit-type of TempUnit2))
-
AI - Ignore (Last created unit)'s guard position
-
Unit - Set the custom value of (Last created unit) to TempInt
-
Special Effect - Create a special effect at tempLoc2 using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
-
Special Effect - Destroy (Last created special effect)
-
Unit - Disable supply usage for (Last created unit)
-
Set GCurrentSquadSize[TempInt] = (GCurrentSquadSize[TempInt] + 1.00)
-
Custom script: call RemoveLocation(udg_GPoint[1])
-
Custom script: call RemoveLocation(udg_tempLoc2)
-
-
Else - Actions
-
-
-