• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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,286
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