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!
So I need to detect when a unit's life become greater than 200 and when that happens I need to set it back to 200, my goal is to not let unit's life get past that number, can anyone help ?
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of YourUnit) Greater than 200.00
Then - Actions
Unit - Set life of YourUnit to 200.00
Else - Actions
It depends on when you want to detect it. For example, you want to detect it when the unit takes a damage, then you should use DDS.
However, if you want to detect it all the time, you probably should use Periodic Timer as an event.
All right, so I'm trying to detect the life of a unit that is currently under the effect of life bonus (current life > max life) and it seems that the editor can't detect past 100% life, how can I overcome this ?
You have to keep track of what units you added the life bonus to and how much that life bonus is. In addition, as system like DDS, detects instances of damage and will not respond to life regeneration or heals (depending on how you implement your heals). You'll have to supplement this with some periodic check to account for life regeneration. A damage detection system which detects all damage instances on the map is overkill if this buff (or effect?) will only be active on one or two easily tracked units. However, for a map that regularly requires damage detection on a large number of units - you should consider using DDS.
Edit: Say for example - you add an ability based on the item bonus health ability which grants 200 health. Now when you want to get the original life of the unit, you simply deduct 200 from the life if he has the ability.
I'm not that familiar with the API of DDS myself - but you have 2 problems:
Getting the true life of an unit: Unfortunately there is no native function for doing so, so you have to have an way of obtain the original life value.
Detecting any changes to the unit's health and adjust its health as required.
Use a timer to check the units health (or group of units if this effect is active on multiple units). This is required for things life health regeneration and ensuring that the unit doesn't exceed its pseudo max life.
Use a self created trigger (or dds) to detect any changes due to damage. This is required since a unit might regain some life between the ticks of your timer and you want to reset the life before damage gets done.
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.