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

Status
Not open for further replies.
Back
Top