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

How to get a unit's base damage?

Status
Not open for further replies.
Level 28
Joined
Jan 26, 2007
Messages
4,789
Or you could do this:
Create a dummy unit with enough HP, no HP regen, no armor and I suggest you use divine armor (set all the damage values to 1.00, so it always takes 100% damage).
Create the unit whose base attack you want to store and attack the unit (only once!)
The dummy's max HP - the dummy's current HP should be about the base damage.

Of course, if some units have damage like 10-20, then it could differentiate from time to time.
There is no foolproof way of doing this without having to create variables to store all data in.
Either way, it's something Blizzard should have added, but didn't.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
You can create a data system using hashtables to store anything you want, even unit base damage. However there is no way to efficiently get unit base damage from a unit type or unit reference so you would probably need a lot of hard coded values. Some scripts can help to automate the process by looking up unit type values automatically.
 
Status
Not open for further replies.
Top