Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
Triggers
Simple damage detection.w3x
Variables
Initialization
init
Damage Source
Simple damage detection trigger created by DatnessX. Give me credits if you use, thanks :)
Name
Type
is_array
initial_value
Group
group
No
Hashtable
hashtable
No
Point
location
No
Real
real
No
Real2
real
No
Default melee game initialization for all players
init
Events
Map initialization
Conditions
Actions
Hashtable - Create a hashtable
Set Variable Set Hashtable = (Last created hashtable)
- This function checking every 0.03 seconds, if any unit in the map is damaged
- if so, the function going to pick only the unit, that is damaged, sets amout of damage, show the damage
as Floating text, and sets the new hitpoints as current, so the function will not pick the same unit again untill
the unit is damaged again
- the Real variable = amout of clear damage
Damage Source
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Set Variable Set Group = (Units in (Playable map area) matching ((Life of (Matching unit)) Not equal to (Load (Key life.) of (Key (Matching unit).) from Hashtable.)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in Group) Greater than 0
Then - Actions
Unit Group - Pick every unit in Group and do (Actions)
Loop - Actions
Set Variable Set Real = (Load (Key life.) of (Key (Picked unit).) from Hashtable.)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of (Picked unit)) Less than Real
Then - Actions
Set Variable Set Real = (Real - (Life of (Picked unit)))
Set Variable Set Point = (Position of (Picked unit))
Floating Text - Create floating text that reads (String(Real)) at Point with Z offset 0 , using font size 9.00 , color ( 100.00 %, 10.00 %, 10.00 %), and 10.00 % transparency
Floating Text - Set the velocity of (Last created floating text) to 84.00 towards 90 degrees
Floating Text - Change (Last created floating text) : Disable suspend state
Floating Text - Change (Last created floating text) : Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
Custom script: call RemoveLocation(udg_Point)
Hashtable - Save (Life of (Picked unit)) as (Key life.) of (Key (Picked unit).) in Hashtable .
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of (Picked unit)) Greater than Real
Then - Actions
Hashtable - Save (Life of (Picked unit)) as (Key life.) of (Key (Picked unit).) in Hashtable .
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.