Pastebin.w3x I am still adding final touches, but this seems to work a little better than before. I realized I should be testing it in a small map with no other triggers and the lag practically disappeared. However, I am fairly sure that if it was used in a 4-8 player map it would lag again. Also, I realized there is a limit to floatin' text. This will be a problem.
HP Units init
Events
Time - Elapsed game time is 0.01 seconds
Conditions
Actions
-------- Selects all units already in the map to get HP bars --------
Set Mana_Group = (Units in (Playable map area))
Unit Group - Pick every unit in Mana_Group and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of (Picked unit)) Greater than or equal to 100.00
(Owner of (Triggering unit)) Not equal to Neutral Passive
Then - Actions
-------- Sets the length of the Bar --------
Set StateString = llllllllllllllllllllllllllllllllllllllllllllllllllllllllll
Set HP_int = (HP_int + 1)
-------- sets an index number for each of the units --------
Set HP_Unit[HP_int] = (Picked unit)
Set HPstatus = (((Life of (Picked unit)) / (Max life of (Picked unit))) x (Real((Length of StateString))))
Set tempp1 = (Position of HP_Unit[HP_int])
Set tempp2 = (tempp1 offset by 40.00 towards 180.00 degrees)
Floating Text - Create floating text that reads StateString at tempp2 with Z offset 0.00, using font size 4.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
Set HP_Text[HP_int] = (Last created floating text)
Floating Text - Show (Last created floating text) for (All players)
Custom script: call RemoveLocation(udg_tempp1)
Custom script: call RemoveLocation(udg_tempp2)
Trigger - Turn on Loops <gen>
Else - Actions
Custom script: call DestroyGroup(udg_Mana_Group)
Add HP Units
Events
Unit - A unit enters (Entire map)
Unit - A unit Finishes reviving
Conditions
Actions
-------- Sets the length of the Bar --------
Set StateString = llllllllllllllllllllllllllllllllllllllllllllllllllllllllll
Set HP_int = (HP_int + 1)
-------- sets an index number for each of the units --------
Set HPstatus = (((Life of (Triggering unit)) / (Max life of (Triggering unit))) x (Real((Length of StateString))))
Set HP_Unit[HP_int] = (Triggering unit)
Set tempp1 = (Position of HP_Unit[HP_int])
Set tempp2 = (tempp1 offset by 40.00 towards 180.00 degrees)
Floating Text - Create floating text that reads StateString at tempp2 with Z offset 0.00, using font size 4.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
Set HP_Text[HP_int] = (Last created floating text)
Floating Text - Show (Last created floating text) for (All players)
Custom script: call RemoveLocation(udg_tempp1)
Custom script: call RemoveLocation(udg_tempp2)
The loop is too long now to post in a VM.
HP Units init
Events
Time - Elapsed game time is 0.01 seconds
Conditions
Actions
-------- Selects all units already in the map to get HP bars --------
Set Mana_Group = (Units in (Playable map area))
Unit Group - Pick every unit in Mana_Group and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of (Picked unit)) Greater than or equal to 100.00
(Owner of (Triggering unit)) Not equal to Neutral Passive
Then - Actions
-------- Sets the length of the Bar --------
Set StateString = llllllllllllllllllllllllllllllllllllllllllllllllllllllllll
Set HP_int = (HP_int + 1)
-------- sets an index number for each of the units --------
Set HP_Unit[HP_int] = (Picked unit)
Set HPstatus = (((Life of (Picked unit)) / (Max life of (Picked unit))) x (Real((Length of StateString))))
Set tempp1 = (Position of HP_Unit[HP_int])
Set tempp2 = (tempp1 offset by 40.00 towards 180.00 degrees)
Floating Text - Create floating text that reads StateString at tempp2 with Z offset 0.00, using font size 4.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
Set HP_Text[HP_int] = (Last created floating text)
Floating Text - Show (Last created floating text) for (All players)
Custom script: call RemoveLocation(udg_tempp1)
Custom script: call RemoveLocation(udg_tempp2)
Trigger - Turn on Loops <gen>
Else - Actions
Custom script: call DestroyGroup(udg_Mana_Group)
Add HP Units
Events
Unit - A unit enters (Entire map)
Unit - A unit Finishes reviving
Conditions
Actions
-------- Sets the length of the Bar --------
Set StateString = llllllllllllllllllllllllllllllllllllllllllllllllllllllllll
Set HP_int = (HP_int + 1)
-------- sets an index number for each of the units --------
Set HPstatus = (((Life of (Triggering unit)) / (Max life of (Triggering unit))) x (Real((Length of StateString))))
Set HP_Unit[HP_int] = (Triggering unit)
Set tempp1 = (Position of HP_Unit[HP_int])
Set tempp2 = (tempp1 offset by 40.00 towards 180.00 degrees)
Floating Text - Create floating text that reads StateString at tempp2 with Z offset 0.00, using font size 4.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
Set HP_Text[HP_int] = (Last created floating text)
Floating Text - Show (Last created floating text) for (All players)
Custom script: call RemoveLocation(udg_tempp1)
Custom script: call RemoveLocation(udg_tempp2)
The loop is too long now to post in a VM.