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

Triggering (referencing to) unit's base damage

Status
Not open for further replies.
Level 2
Joined
May 19, 2017
Messages
7
I'm sure this has been asked before, but I've tried searching for the last 25ish minutes and haven't found anything.

Is there a way to reference to a unit's base damage stat that is displayed above their armor stat when you click on them?
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
the base damage (without the green + damage) can easily be stored for every unit type using a hashtable. You only have to take upgrades into consideration, as they are the only thing modifying the base damage.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
the base damage (without the green + damage) can easily be stored for every unit type using a hashtable. You only have to take upgrades into consideration, as they are the only thing modifying the base damage.
Let us not also forget about hero stats, tomes, and chaos based unit morphs...

In StarCraft II one can compute such damage dynamically, especially thanks to the catalog natives.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Yes, for heroes it's a bit more complicated, but still not much of a problem.
You have to keep in mind that attribute bonus abilities, that grant the green + in their attribute still increase base damage, even though the damage from this attribute bonus is also displayed as green +.
So in the end you only have to know the primary attribute, which you can simply get with triggers. It does not matter if the attribute comes from an ability, item, tome or the hero itself, since all increase base damage.
and chaos based unit morphs...
Does chaos based morph not change the unit type?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Does chaos based morph not change the unit type?
No it is not a form based morph like raven form or whatever. It not only alters the unit type but also reapplies all base attribute modifications, eg tomes and hero stats, so that the resulting unit has different base stats. This is one of the reasons why chaos Hellscream was so powerful in the campaign as all stat modifiers were applied twice to him after the conversion so he had more health, damage and armor than he should have had.

Morph based unit type conversions just change the unit type, they do not apply an extra copy of the current base stat boost permanently like chaos does. This is why they are the only viable way to change unit type dynamically without upgrading the unit to a new type or replacing it with a different unit.
 
Status
Not open for further replies.
Top