If you want to increase its total health regen by some percentage, it will be pretty difficult as there is no way to directly query what a unit's current HP regen is (attributes, items, other abilities, blight, etc. might change from the default unit regen set in the OE). If it should be something like "unit gains 0.05 hp/s for each 1% health missing" then yes it can be done much more simply.
You quoted a post that mentioned two entirely separate things you could have meant. Which one?Yes that is what i mean
You quoted a post that mentioned two entirely separate things you could have meant. Which one?
The previous one, i want it to be like a passive, not an active ability.
If you want to increase its total health regen by some percentage, it will be pretty difficult as there is no way to directly query what a unit's current HP regen is (attributes, items, other abilities, blight, etc. might change from the default unit regen set in the OE).
These are both passive abilities that work in different ways.If it should be something like "unit gains 0.05 hp/s for each 1% health missing" then yes it can be done much more simply.
Try something like this
Rage Learn
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Wind Walk
Actions
Trigger - Turn on Rage Regen <gen>
Add (Triggering unit) to Rage_regen_group
Rage Regen
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
For every unit in Rage_regen_group do {
Set VariableSet TempReal = (TempReal + 200.00)
Set VariableSet RegenUnit =(Learning Hero)(Picked unit)
Unit - Set life of RegenUnit to TempReal%
}
This will try to set every hero's (that learned the ability) health to 200%, 400%, 600% and so on every half second.
Well, it comes from the way you "heal" your unit.
TempReal isn't nullified between iterations, so it steadely grows from 0 to infinity.
You should set life of your unit to current life of your unit plus something.
for example set TempReal = CurrentLifePercent + 5(1-(CurrentLifePercent)/100)
this will heal 5% of total life (every 0.5 sec) when unit is nearly dead and heal nothing when its's not damaged.
There is a function to do it: Screenshot
No problem, but I strongly recomend finding such functions on your own.
At least spend some time trying to do so.
Most of the time you'll be fine just choosing the most convinient option at each step.
And even if you didn't succeed, some idea of availible functions could help in the furure.
No, I ment "Unit - Percentage Life of (Picked unit)". It just seemed a little bit too long to use in a sentence."currentlifepercent", is that a variable of some sort?
No, I ment "Unit - Percentage Life of (Picked unit)". It just seemed a little bit too long to use in a sentence.
let p = ((Percentage life of (Picked unit)) to make it easier to read-------- Closest to work, but works in reverse --------
Set VariableSet TempReal = ((Percentage life of (Picked unit)) + (1.00 - (1.00 - ((Life of (Picked unit)) / 100.00))))
let p = ((Percentage life of (Picked unit)) to make it easier to read
You want to set health of your unit to
p + r*f where r is max regeneration rate, f is factor that equals 0 when unit is at full health and equals 1 when unit at 0 health.
I suggest f = (1 - p/100), so if r = 1.00
TempReal = p + r*(1 - p/100) = ((Percentage life of (Picked unit)) + 1.00 - (((Percentage life of (Picked unit)) / 100)
Wow! Thank you dude, appreciate that very muchEdit:
Attached two maps.
One with a Hero Ability example that scales in level and another for a basic unit (No Hero).
You should change rWhat number do i change if i want to change that? Been trying to change every "1" there is, but then it just works as an ordinary % of max hp regen.