Trigger:
- HitpointFloatingTextAttacked
- Events
- Unit - A unit Is attacked
- Conditions
- (Life of (Attacked unit)) Greater than or equal to 20000.00
- Actions
- Trigger - Run HitpointFloatingText <gen> (ignoring conditions)
But when its show the percentage hitpoint of my unit, its show 3 number after the "point". Like: 89.453%HitpointFloatingText
Trigger:
- Events
- Conditions
- Actions
- Set TempPoint = (Position of (Attacked unit))
- Floating Text - Create floating text that reads (HitpointPercentage + %) at TempPoint with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 30.00 towards 90.00 degrees
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 0.90 seconds
yay. I have created a trigger and its work.
But when its show the percentage hitpoint of my unit, its show 3 number after the "point". Like: 89.453%
Idk how to put only: Exemple: 89%
yeah it leaks >.<put in a custom script
call DestroyLocation(udg_TempPoint)
srry for double post... I got an error when i set a Custom script: call DestroyLocation(udg_TempPoint)yeah it leaks >.<put in a custom script
call DestroyLocation(udg_TempPoint)
It show alway the number after the point.Im too lazy to dig too deep but a cheap easy way would be setting your Health variable to the Absolute value of the units health percent. So youd have one more variable that said the number = Abs(HitpointPercentage)
call DestroyLocation(udg_TempPoint)
Trigger:
- HitpointFloatingTextAttacked
- Events
- Unit - A unit Is attacked
- Conditions
- (Life of (Attacked unit)) Greater than or equal to 20000.00
- Actions
- Trigger - Run HitpointFloatingText <gen> (ignoring conditions)
1: The trigger alway show the number after the point.Trigger:
- HitpointFloatingText
- Events
- Conditions
- Actions
- Set TempPoint = (Position of (Attacked unit))
- Set HitpointPercentage = (String((Abs((Percentage life of (Attacked unit))))))
- Floating Text - Create floating text that reads (HitpointPercentage + %) at TempPoint with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 30.00 towards 90.00 degrees
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 0.90 seconds
- Custom script: call DestroyLocation(udg_TempPoint)
call RemoveLocation(udg_TempPoint)
I Convert Real To Formatted StringTrigger:
- Set HitpointPercentage = (String((Percentage life of (Attacked unit)), 0, 1))
Thank you anyway:thup:Trigger:
- HitpointFloatingText
- Events
- Conditions
- Actions
- Set HitpointPercentage = (String((Percentage life of (Attacked unit)), 0, 1))
- 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
- Then - Actions
- Set TempPoint = (Position of (Attacked unit))
- Floating Text - Create floating text that reads (HitpointPercentage + %) at TempPoint with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 30.00 towards 90.00 degrees
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 0.90 seconds
- Custom script: call RemoveLocation(udg_TempPoint)
- Else - Actions