• 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 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,243
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: 68
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