I'm triggering a unit in my map. The drone follows the Medic around. It detects units around the medic who are injured, that is, it is not at 100% health.
Once the unit is damaged, the drone detects the unit's damage. It heals the unit. Then the damaged unit is properly removed from the group. All good? The trigger runs once after this and detects no damaged units. It runs again and then it detects a damaged unit?!?!!
The real initially reads the unit's health at 96.125% (after the unit receives damage) and so the drone heals him. Then the real starts reading 0.000. I assume because the reading is 0%, the Drone think the unit is damaged when he clearly is not. Why is the real giving me a reading of 0%? The unit's health is full so it should be 100%.
Once the unit is damaged, the drone detects the unit's damage. It heals the unit. Then the damaged unit is properly removed from the group. All good? The trigger runs once after this and detects no damaged units. It runs again and then it detects a damaged unit?!?!!
The real initially reads the unit's health at 96.125% (after the unit receives damage) and so the drone heals him. Then the real starts reading 0.000. I assume because the reading is 0%, the Drone think the unit is damaged when he clearly is not. Why is the real giving me a reading of 0%? The unit's health is full so it should be 100%.
-
Heal Drone
-
Events
- Time - Every 3.00 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in (Units of type Medic) and do (Actions)
-
Loop - Actions
- Set TempPoint = (Position of (Picked unit))
-
Unit Group - Pick every unit in (Units within 566.00 of TempPoint) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked unit) belongs to an ally of Player 1 (Red)) Equal to True
- (Percentage life of (Picked unit)) Less than 100.00
-
Then - Actions
- Unit Group - Add (Picked unit) to DroneInjuredGroup[(Player number of (Owner of DroneMedic[1]))]
- Unit Group - Add (Picked unit) to DroneInjuredGroup[(Player number of (Owner of DroneMedic[2]))]
- Game - Display to (All players) the text: (Real: + (String((Percentage life of (Picked unit)))))
- Game - Display to (All players) the text: (String((Number of units in DroneInjuredGroup[(Player number of (Owner of DroneMedic[1]))])))
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call RemoveLocation (udg_TempPoint)
-
Loop - Actions
-
Unit Group - Pick every unit in (Units of type Drone) and do (Actions)
-
Loop - Actions
- Set DroneUnit[(Player number of (Owner of (Picked unit)))] = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (DroneUnit[(Player number of (Owner of (Picked unit)))] has buff Heal (Drone's Indicator)) Equal to True
-
Then - Actions
- Game - Display to (All players) the text: Drone's heal is on cooldown
- -------- Drone has buff so it's heal is on cooldown --------
- -------- Drone issued a patrol order --------
-
Unit Group - Pick every unit in (Units of type Medic) and do (Actions)
-
Loop - Actions
- Game - Display to (All players) the text: (Name of (Picked unit))
- Set TempPoint = (Position of (Picked unit))
- Set TempPoint2 = (TempPoint offset by (Random real number between 0.00 and 360.00) towards (Random real number between 0.00 and 366.00) degrees)
- Unit - Order DroneUnit[(Player number of (Owner of (Picked unit)))] to Move To TempPoint2
- Game - Display to (All players) the text: (Name of DroneUnit[(Player number of (Owner of (Picked unit)))])
- Custom script: call RemoveLocation (udg_TempPoint)
- Custom script: call RemoveLocation (udg_TempPoint2)
-
Loop - Actions
-
Else - Actions
- -------- Drone doesn't have buff so heal is off cooldown --------
- -------- Drone issued a heal order --------
- Game - Display to (All players) the text: Drone's heal is ready
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in DroneInjuredGroup[(Player number of (Owner of (Picked unit)))]) Greater than or equal to 1
-
Then - Actions
- Game - Display to (All players) the text: A damaged unit is found
-
Unit Group - Pick every unit in (Random 1 units from DroneInjuredGroup[(Player number of (Owner of (Picked unit)))]) and do (Actions)
-
Loop - Actions
- Unit - Order DroneUnit[(Player number of (Owner of DroneMedic[1]))] to Human Priest - Heal (Picked unit)
- Unit - Order DroneUnit[(Player number of (Owner of DroneMedic[2]))] to Human Priest - Heal (Picked unit)
-
Loop - Actions
-
Else - Actions
- Game - Display to (All players) the text: No damage unit found
- -------- Drone's heal is ready but nobody needs healing --------
- -------- Drone issued a patrol order --------
-
Unit Group - Pick every unit in (Units of type Medic) and do (Actions)
-
Loop - Actions
- Game - Display to (All players) the text: (Name of (Owner of DroneUnit[(Player number of (Owner of (Picked unit)))]))
- Set TempPoint = (Position of (Picked unit))
- Set TempPoint2 = (TempPoint offset by (Random real number between 0.00 and 400.00) towards (Random real number between 0.00 and 360.00) degrees)
- Unit - Order DroneUnit[(Player number of (Owner of (Picked unit)))] to Move To TempPoint2
- Custom script: call RemoveLocation (udg_TempPoint)
- Custom script: call RemoveLocation (udg_TempPoint2)
-
Loop - Actions
-
If - Conditions
-
If - Conditions
-
Loop - Actions
- Unit Group - Remove all units from DroneInjuredGroup[(Player number of (Owner of DroneMedic[1]))]
- Unit Group - Remove all units from DroneInjuredGroup[(Player number of (Owner of DroneMedic[2]))]
- Game - Display to (All players) the text: (String((Number of units in DroneInjuredGroup[(Player number of (Owner of DroneMedic[1]))])))
-
Unit Group - Pick every unit in (Units of type Medic) and do (Actions)
-
Events