• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

How to show Damage and DEF in Multiboard?

Status
Not open for further replies.
For example:
My hero has 210-215 Attack and 21 Defense and as he levels the number changes. I want my Multiboard to show the Attack and Defense of my hero everytime their values changes. Is there a way to do it?
 
You will need to play around with some damage systems, because Warcraft III won't let you get a unit's damage.

The first approach is with a damage system, such as LDD, or Anitarf's damage system. The second approach is to calculate damage statically, but checking all the items the unit has, upgrades, level and primary attribute.

For defense, I'm pretty sure there is a function for that somewhere around here. You just store the unit's HP, then damage it, then check how much HP it has based on the damage dealt, and the armor is the difference. (I think that's how it works).
 
Does the number only change when he levels, and does the number change by the same amount per level?

No, not just when he levels, whenever there is an increase in attack, the multiboard updates it and shows it. And so for the armor too. No, the number does not change by the same amount, I am afraid, what over there will be different types of heroes and so.. I cannot spend like 2 hours doing each and every single level increase for DMG and DEF for a hero and then another 20 hours for the rest + boring, also by doing it this way it would not work as there will be equipments involved changing DEF and DMG.
 
As I said before, there is no way of gathering a unit's "attack damage" or "defense" from the code. An option you could consider is keeping an accurate record (via variables) of the specific units' damage/defense --you would have to increase/decrease the stored records if your unit were to level up, pick up an item, or any other event that would possibly cause it's attack to increase.
 
Status
Not open for further replies.
Back
Top