• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Adding damage based on health lost

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
How would this sufficiently be done? I'm actually playing a game where its being sufficiently done without lag. I'm familliar with the system that allows you to add damage, hp, etc. but i need this to be based not only on health but on base damage too like cmd aura (so like say your at 1/5 health thatd give you +500% damage persay)

My main idea would be to make a timer that checks every 0.03 seconds and adds damage proportinately, but that might lag and i still cant do it based like cmd aura
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
How would this sufficiently be done? I'm actually playing a game where its being sufficiently done without lag. I'm familliar with the system that allows you to add damage, hp, etc. but i need this to be based not only on health but on base damage too like cmd aura (so like say your at 1/5 health thatd give you +500% damage persay)

My main idea would be to make a timer that checks every 0.03 seconds and adds damage proportinately, but that might lag and i still cant do it based like cmd aura

or damage detection system or timer, i dont think have any other way...

the adding 500% damage isnt problem, just u must put to damage detection syustem or to timer, but if u put to timer then maybe u can checj alot unit, also at damage detection system if u got too high attack speed maybe laggy a bit.

here a testmap, i dont know if have better way than just modify ability level.
character bar isnt refreshed instantly but isnt laggy ttoo, u can try if u add 300 unit around paladin
 

Attachments

  • hp based damage.w3x
    30.7 KB · Views: 69
Level 20
Joined
Jul 14, 2011
Messages
3,213
I think it's better with a loop, but doesn't need to be every 0.03. You can use 0.5 or so, since it doesn't need to be "that" accurate.

For the damage work with a Command Aura which the unit already has and targets available are "self" or with really small AoE (1). You can make it null on lvl 1 and keep it on the unit, and just increase/decrease depending on the unit hp.

Doing it with a DDS works for giving it when damage is dealt, but if you regen, you won't detect any damage, so you keep the damage bonus untill you're hit again, even if you're hp is full.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Doing it with a DDS works for giving it when damage is dealt, but if you regen, you won't detect any damage, so you keep the damage bonus untill you're hit again, even if you're hp is full.

whn u regen why needed to detect? if u regen and u dont attack/or dont attacked then no point in changeing bonus :p

but if u regen and got hit then its modified :p

both DDS and loop have advantage and disadvantage

periodic trigger allways change it even dont needed, lets say ur hp is going up in town then allways ability changed but another way its allways keep tracking the bonus damage

damage detection system work only if u reicive damage or u deal damage, one side it is good coz change only when needed, another side when u dont deal or reicive damage then bonus is stay

the engine is in both case similiar, add a dummy spellbook when hero created and in spellbook need 2 lv10 command aura ability, when needed just change the ability level (this still faster than add remove or use lv100 ability i think)

in both case also u can use a if for check if hp percentage is same than last time, else set abilities level
 
Status
Not open for further replies.
Top