I
IKilledKEnny
Guest
The following system was suggested by SerraAvenger, he gave the basic idea and I made it into triggers.
Here are the triggers, I will go over each one.
Here we set the strings that will color the text. Each string is it's players color, thus Global_Array_16_String[4] will color text to purple and so on.
Becuase takes damage is not a generic event we need to add the event for each unit.
Does the same to units which are not pre-placed.
The core of the system, when a unit is hit it will show by hit the amount of damage done it and will color the text with the same color of the damaging unit.
Say you want to also show the current life of the unit as well? Sure.
There is a template attached, feel free to take a look and comment.
Here are the triggers, I will go over each one.
Code:
Set Strings
Events
Map initialization
Conditions
Actions
Set Global_Array_16_String[1] = |CFFFF0303
Set Global_Array_16_String[2] = |CFF0042FF
Set Global_Array_16_String[3] = |CFF1CB619
Set Global_Array_16_String[4] = |CFF540081
Set Global_Array_16_String[5] = |CFFFFFF01
Set Global_Array_16_String[6] = |CFFFE8A0E
Set Global_Array_16_String[7] = |CFF20C000
Set Global_Array_16_String[8] = |CFFE55BB0
Set Global_Array_16_String[9] = |CFF959697
Set Global_Array_16_String[10] = |CFF7EBFF1
Set Global_Array_16_String[11] = |CFF106246
Set Global_Array_16_String[12] = |CFF4E2A04
Set Global_Array_16_String[13] = |CFF000000
Set Global_Array_16_String[14] = |CFF000000
Set Global_Array_16_String[15] = |CFF000000
Set Global_Array_16_String[16] = |CFF000000
Here we set the strings that will color the text. Each string is it's players color, thus Global_Array_16_String[4] will color text to purple and so on.
Code:
Init Set
Events
Time - Elapsed game time is 1.00 seconds
Conditions
Actions
Set Global_Unit_Group = (Units in (Entire map))
Unit Group - Pick every unit in Global_Unit_Group and do (Actions)
Loop - Actions
Trigger - Add to Show Damage <gen> the event (Unit - (Picked unit) Takes damage)
Custom script: call DestroyGroup(udg_Global_Unit_Group)
Becuase takes damage is not a generic event we need to add the event for each unit.
Code:
Ingame Set
Events
Unit - A unit enters (Entire map)
Conditions
Actions
Trigger - Add to Show Damage <gen> the event (Unit - (Triggering unit) Takes damage)
Does the same to units which are not pre-placed.
Code:
Show Damage
Events
Conditions
Actions
Set TempLoc[1] = (Position of (Triggering unit))
Set TempLoc[2] = (TempLoc[1] offset by 50.00 towards 315.00 degrees)
Floating Text - Create floating text that reads ((Global_Array_16_String[(Player number of (Owner of (Damage source)))] + (String((Integer((Damage taken)))))) + !) at TempLoc[2] with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 25.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 45.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 0.65 seconds
Custom script: call RemoveLocation(udg_TempLoc[1])
Custom script: call RemoveLocation(udg_TempLoc[2])
The core of the system, when a unit is hit it will show by hit the amount of damage done it and will color the text with the same color of the damaging unit.
Say you want to also show the current life of the unit as well? Sure.
Code:
Show Damage and Life
Events
Conditions
Actions
Set TempLoc[1] = (Position of (Triggering unit))
Set TempLoc[2] = (TempLoc[1] offset by 50.00 towards 315.00 degrees)
Floating Text - Create floating text that reads ((Global_Array_16_String[(Player number of (Owner of (Damage source)))] + (String((Integer((Damage taken)))))) + (! + (|cffffff( + ((String((Integer((Life of (Triggering unit)))))) + ))))) at TempLoc[2] with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 25.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 45.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 0.65 seconds
Custom script: call RemoveLocation(udg_TempLoc[1])
Custom script: call RemoveLocation(udg_TempLoc[2])
There is a template attached, feel free to take a look and comment.