• 🏆 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 do I customize armor mechanics?

Status
Not open for further replies.
Level 2
Joined
Sep 14, 2007
Messages
17
For my map, I want a unit that has 3 armor to take 3 less damage, 10 armor to take 10 less damage, etc. I see no way of using the built-in armor coefficient to achieve this, how do I do it?

I've thought of setting the armor damage multiplier to 0, then using damage detection triggers, but again I'm not sure exactly how to do it. Thanks!
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
If you can't manipulate the gameplay constants by some multiple to your liking, you will have to do as you thought and Trigger All Damage and use a DDS configured to your liking.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
This is very easy with the magnificient damage detection system by Nesharus and the very useful armor utilities system by Rising_Dusk.

JASS:
library FlatArmor requires DDS
    struct Armor extends array
        private static method onDamage takes nothing returns nothing
            local real armor
            set DDS[targetId].enabled = false
            set armor = GetUnitArmor(target)
            set damage = GetFullDamage(damage, armor) - armor
            set DDS[targetId].enabled = true
            call DisplayTimedTextToPlayer(Player(0), 0, 0, 10, "Damage: " + R2S(damage))
            call DisplayTimedTextToPlayer(Player(0), 0, 0, 10, "Armor: " + R2S(armor))
        endmethod
        implement DDS
    endstruct
endlibrary

Copy the DDS and ArmorUtils folder into your map. Check the Readme of DDS to import it correctly. You need JNGP editor for this to work.
 

Attachments

  • Plugin Install Pack.w3x
    80.6 KB · Views: 65
Level 2
Joined
Sep 14, 2007
Messages
17
Thanks for the responses. About to board a plane but I'm excited to try these ideas out.
 
Status
Not open for further replies.
Top