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

Simple DDS

Status
Not open for further replies.
Level 14
Joined
Oct 16, 2010
Messages
749
Hi,

I've recently tried importing the below DDS into my map, I seem to have a very large number of errors appear so not sure what I've done wrong...


However before trying to fix this, all I want from a DDS if to detect abilities on the attacking and attacked units and change spell damage to be affected by armor. These seem pretty simply in comparison to what you COULD do with a DDS so not sure if this full system is the best thing to be trying to use?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
A trigger like this should work:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • (Damage From Normal Attack) Equal to False
    • Actions
      • Event Response - Set Damage Type of Unit Damaged Event to Normal
      • Event Response - Set Attack Type of Unit Damaged Event to Normal
You could also manually calculate armor:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • (Damage From Normal Attack) Equal to False
    • Actions
      • Set VariableSet Armor = (Armor of (Damage Target))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Armor Greater than or equal to 0.00
        • Then - Actions
          • Set VariableSet ArmorMultiplier = ((0.06 x Armor) / ((0.06 x Armor) + 1.00))
          • Event Response - Set Damage of Unit Damaged Event to ((Damage taken) x (1.00 - ArmorMultiplier))
        • Else - Actions
          • Set VariableSet ArmorMultiplier = (1.00 - (Power((1.00 - 0.06), (Armor x -1.00))))
          • Event Response - Set Damage of Unit Damaged Event to ((Damage taken) x (1.00 - (Abs(ArmorMultiplier))))
My math may be off for the ArmorMultiplier calculation.
 

Attachments

  • Armor Formula.w3m
    16.9 KB · Views: 4
Last edited:
Level 14
Joined
Oct 16, 2010
Messages
749
A trigger like this should work:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • (Damage From Normal Attack) Equal to False
    • Actions
      • Event Response - Set Damage Type of Unit Damaged Event to Normal
      • Event Response - Set Attack Type of Unit Damaged Event to Normal
You could also manually calculate armor:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • (Damage From Normal Attack) Equal to False
    • Actions
      • Set VariableSet Armor = (Armor of (Damage Target))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Armor Greater than or equal to 0.00
        • Then - Actions
          • Set VariableSet ArmorMultiplier = ((0.06 x Armor) / ((0.06 x Armor) + 1.00))
          • Event Response - Set Damage of Unit Damaged Event to ((Damage taken) x (1.00 - ArmorMultiplier))
        • Else - Actions
          • Set VariableSet ArmorMultiplier = (1.00 - (Power((1.00 - 0.06), (Armor x -1.00))))
          • Event Response - Set Damage of Unit Damaged Event to ((Damage taken) x (1.00 - (Abs(ArmorMultiplier))))
My math may be off for the ArmorMultiplier calculation.

Could this be used to decrease damage? Even if the unit would normally have died?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Could this be used to decrease damage? Even if the unit would normally have died?
You can set the Damage to whatever you want, these changes will take place before it actually gets applied to the (Damage Target).
  • Event Response - Set Damage of Unit Damaged Event to X
Use the (Damage taken) function to get how much damage is going to be dealt:
  • (Damage taken)
 
Level 29
Joined
Sep 26, 2009
Messages
2,595
You could also manually calculate armor:
It may be better to use the other event which runs when unit takes damage but before any armor/spell reductions are applied:
  • Unit - A unit About to take damage
So you can create a trigger with the event above and just change the attack and damage type to normal there.
In the "unit takes damage" event you should see that the spell damage was lowered by armor
 
Level 14
Joined
Oct 16, 2010
Messages
749
It may be better to use the other event which runs when unit takes damage but before any armor/spell reductions are applied:
  • Unit - A unit About to take damage
So you can create a trigger with the event above and just change the attack and damage type to normal there.
In the "unit takes damage" event you should see that the spell damage was lowered by armor
Changing the spell type seemed to do some weird stuff, so I've detected the spell damage in the original trigger and used the armor formula to do the same job. Seems to work and it still allows me to have units with armor that shows the % reduction and everything
 
Status
Not open for further replies.
Top