• 🏆 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!

Percentage based damage?

Status
Not open for further replies.
Level 12
Joined
Mar 6, 2008
Messages
1,057
I am in the process of messing around with the editor, and from time to time working on my long term custom campaign project. Overall with everything in it made from scratch, I tend to keep my style of making that campaign more simplified than the usual ones. Perfect example would be units having health points ranging from 80 up to 250 for elites. Even heroes are semi-balanced with units, so they can't go around causing wreckage among enemy lines.

However, with those low numbers I have an issue with maintaining balance and proper damage values. It seems kind of dull having units with approximately 80 health points fighting each other for 20 damage, or whatever of that sort. Instead, I had come up with an idea but I am not sure whether it's possible or not.

What I had in mind is an ultimate trigger / script which converts the damage one unit receives into percentage instead. So for example, if I would like Footman to deal fixed 2% of unit's total health as damage with normal auto attack, I'd simply set their damage to 2-2. If I'd like to introduce more RNG with their damages, I could set their damage to be from 2 to 4, and then there'll be RNG for how much they'll harm the unit they're fighting.

I am aware there are flaws to this system, as in armor values and damage reduction. However, I could work even without those as I'm trying to simplify things by a lot. My main focus is tactics, strategy and timing of attacks rather than random unit bashing and having meta's in the game.

Same system could be introduced for spells, though their damage would range from 5 to 30 depending on sort and level, whether it's unit or hero spell and so on. So yeah, below I'll make a 'too long, didn't read' on my actual question.

TL;DR
Is there a way to make an universal trigger/script which will convert any incoming damage value into percentage number? This is applied to both auto attacks, spells and damages of all sorts.

Thanks in advance, and if someone thinks they know the way, help would be more than appreciated.
 
Level 14
Joined
Nov 17, 2010
Messages
1,265
If you had a damage detection system it allows you to change the damage done by an attack. It detects the attack and allows you to instantly change the damage. You would just have to save the percentage you want for each unit type in a hashtable and then load the values each time a unit attacks. You would have to set the damage to whatever sort of mathematical formula you want using the number saved in the hashtable for each unit type.

It could get a bit complicated, but look through the tutorials about hashtables and find a good damage detection system (I recommend the one by LOOKING_FOR_HELP or Bribe)

As far as the formula goes, you'll have to figure that out on your own.

Good luck!!
 
Status
Not open for further replies.
Top