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

Modify damage formula

Status
Not open for further replies.
Level 4
Joined
Jan 2, 2016
Messages
66
I would like to make a map where (damage) = (attack rating) - (armor), with a minimum of 1 damage per attack, as is found in most other RTS games including StarCraft.

Of course, the usual WarCraft 3 formula is (damage) = (attack rating)*[1-(0.06*armor)/(1+0.06*armor)].

I have thought of one way to do this: set the gameplay constant representing the 0.06 to 0, and then give every unit a modified version of Hardened Skin with the reduction set equal to the armor and the minimum damage set to 1, then hide the ability in a disabled Spellbook. This seems fine for most purposes, as armor upgrades can just level up the ability.

However, it will require very complex and annoying triggers to deal with any spells that increase armor, which I plan to have. Also, I can't think of any way at all to have this work with negative armor (and I also plan to have abilities that decrease armor).

Is this some way to do this through triggers? This would be needed for the WarCraft 2 recreation that is hosted on this site, so there must be a way. I would look at those campaigns to see how it is done; however, I can't open them without an error that crashes the Editor.

If I recall correctly, there is some Damage Detection system that will work. Please advise.
 
Level 7
Joined
Jan 23, 2011
Messages
350
Damage Engine would be easier than use Hardened Skin with tons of levels(i don't know if the ability stacks with itself to use severals abis of 1 level)

But, whatever you decide to use for your armor, you have to learn how to detect the current armor. If you use Hardened Skin with lots of levels(worse case) you have to detect the current level and no more. Now, if you choose any other method(like Dmg Engine) you need to set a variable(or save a value in a hash) unique for each unit, a way to do it would be
Set armor[Custom value of YourUnit]
Or
Save armor as 0 of (Handle Id of YourUnit) in hashtable

You just need to decide
 
Status
Not open for further replies.
Top