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

Questions about Damage Engine System

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,137
  • DamageBlockNew
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to False
    • Actions
      • Set DamageEventAmount = (DamageEventAmount - 20.00)
      • Set DamageEventType = DamageTypeReduced
Can someone tell me what is the logic behind this? When i attack the unit, it takes 19 damage, then it takes 2 damage per attack. Why it is changing? Let's start with this one.
For the other questions i have to learn this one first.
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,137
Can you clarify your question: are you asking why it isn't subtracting properly or are you asking why it changes the damage result?
Both would be nice actually. Because it was a difficult to get this system into my map, and still i don't know how to use it properly.
Currenly i am using it's takes damage replacement feature.
It will be nice to learn more about the system.
 
Level 14
Joined
Feb 7, 2020
Messages
387
When damage is done, the engine stores the initial amount as a variable before in-game damage is applied to a unit: this is 'DamageEventAmount' per your trigger.

You are then free to modify this amount with the various features of the engine using Game - DamageModifierEvent becomes Equal to 1.00, or simply do basic arithmetic on it (reduce, add, etc.). All the code in this trigger will run before damage is applied. This means you'll have to specify when you want damage to be modified in Conditions - e.g. based on unit type, or a unit variable, because this event fires after every damage event. You'll need to filter down to the damage you want to affect.

The engine then re-applies your next calculated value ('DamageEventAmount') using the native function BlzSetEventDamage. This is the new damage that will be applied.

It gets more complex based on WC3 calculations. For example, if the unit in your tests has armor, then the initial amount and final amount may be different because it is being reduced. Damage Engine has features you can read about to bypass this.
 
Level 14
Joined
Feb 7, 2020
Messages
387
Even this one not works.

  • Events
    • Game - DamageModifierEvent becomes Equal to 1.00
  • Conditions
  • Actions
    • Set DamageEventAmount = -10.00
Unit has 40 damage
First attack: 38 damage
Second and next attacks: 0 damage
It should be DamageEventAmount = DamageEventAmount - 10, you've set it to -10 which will get set to 0 in the engine.

Unless you post your map we don't really know what else to consider (armor type, weapon type, unit armor, etc.).
 
Level 17
Joined
Jun 2, 2009
Messages
1,137
It should be DamageEventAmount = DamageEventAmount - 10, you've set it to -10 which will get set to 0 in the engine.

Unless you post your map we don't really know what else to consider (armor type, weapon type, unit armor, etc.).
Wow wait it worked but i have to experiment on this because i have a few questions ok? But somehow it won't worked at the beginning (my first post)
 
Level 17
Joined
Jun 2, 2009
Messages
1,137
Question 2

  • THIS NOT WORKS. I have attacked minimum 20 times.
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Set Dice = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Dice Less than or equal to 50
        • Then - Actions
          • Set DamageEventAmount = 0.00
        • Else - Actions
  • BUT THIS WORKS
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Set DamageEventAmount = 0.00
Why?
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,137
Question 3
Here is the another issue. It decreases the game but

  • Events
    • Game - DamageModifierEvent becomes Equal to 1.00
  • Conditions
    • IsDamageSpell Equal to False
  • Actions
    • Set DamageEventAmount = (DamageEventAmount - 20.00)
    • Floating Text - Create floating text that reads +20 Direnç! above DamageEventTarget with Z offset 50.00, using font size 13.00, color (100.00%, 50.00%, 25.00%), and 0.00% transparency
    • Floating Text - Set the velocity of (Last created floating text) to 75.00 towards 90.00 degrees
    • Floating Text - Change (Last created floating text): Disable permanence
    • Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds
    • Floating Text - Change the fading age of (Last created floating text) to 1.40 seconds
If it deals 5 damage, it reduces 5 and heals 15. It is amazing and fantastic feature actually. But how can i make it completely block?
 
Level 19
Joined
Feb 27, 2019
Messages
590
Question 3
Here is the another issue. It decreases the game but

  • Events
    • Game - DamageModifierEvent becomes Equal to 1.00
  • Conditions
    • IsDamageSpell Equal to False
  • Actions
    • Set DamageEventAmount = (DamageEventAmount - 20.00)
    • Floating Text - Create floating text that reads +20 Direnç! above DamageEventTarget with Z offset 50.00, using font size 13.00, color (100.00%, 50.00%, 25.00%), and 0.00% transparency
    • Floating Text - Set the velocity of (Last created floating text) to 75.00 towards 90.00 degrees
    • Floating Text - Change (Last created floating text): Disable permanence
    • Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds
    • Floating Text - Change the fading age of (Last created floating text) to 1.40 seconds
If it deals 5 damage, it reduces 5 and heals 15. It is amazing and fantastic feature actually. But how can i make it completely block?
Theres a function called Math - Max. All it does is output the largest value of two input values. If you input -5 and 0 it will output 0 but if you input 5 and 0 it will output 5. You can use this function when you set the DamageEventAmount.
 
Level 17
Joined
Jun 2, 2009
Messages
1,137
  • BuHealAtiyor Copy 2
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventAmount Less than or equal to 15.00
        • Then - Actions
          • Set DamageEventAmount = 0.00
          • Floating Text - Create floating text that reads Engellendi! above DamageEventTarget with Z offset 50.00, using font size 9.00, color (100.00%, 50.00%, 25.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 75.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
        • Else - Actions
          • Set DamageEventAmount = (DamageEventAmount - 20.00)
          • Floating Text - Create floating text that reads +20 Direnç! above DamageEventTarget with Z offset 50.00, using font size 9.00, color (100.00%, 50.00%, 25.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 75.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
Ok guys after lot of test and experiment it looks fine but it feels somethings not right in there.
This is how i think in there: When i deal 5 damage but ability blocks 20 damage i was expecting = 0 damage. But somehow it decreases 5, and adds 15 to my damage and heals. I have accepted that this will not change and tried to think bit of different
I asked myself. What happens if i will detect damage below 20? Then i have created this condition.
It blocks any damage below 20 and it looks fine to me. Then i have decided to run -20 block part in the else part.

But still i feel somethings not right. Or maybe i made it. I am not sure yet.
 
Level 17
Joined
Jun 2, 2009
Messages
1,137
Theres a function called Math - Max. All it does is output the largest value of two input values. If you input -5 and 0 it will output 0 but if you input 5 and 0 it will output 5. You can use this function when you set the DamageEventAmount.
Ah sorry i have recently posted message then i saw your message. Now let me try to get it first. English and Math is big problem to me. I need a lot of time.
 
Question 2

  • THIS NOT WORKS. I have attacked minimum 20 times.
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Set Dice = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Dice Less than or equal to 50
        • Then - Actions
          • Set DamageEventAmount = 0.00
        • Else - Actions
  • BUT THIS WORKS
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Set DamageEventAmount = 0.00
Why?
Must be terrible seed if you use the test map feature. Does changing Dice from 50 to 100 fix it?
 
Status
Not open for further replies.
Top