• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Filtering out cause damage trigger from damage engine

Status
Not open for further replies.
Hello. I am having trouble filtering out the "Cause damage unit" trigger when using the damage engine by Bribe.

What I am doing here is I am blocking/preventing the damage of all units because I want the units to be damaged from the missile/dummy unit with my missile system (Units should get the damage from the Cause Damage trigger - trigger provided below) instead of getting damage from the damage set in the Object Editor.

Scenario
- There is a damage set in the OE, a rifleman for example, with 40 damage. When the rifleman shoots an enemy rifleman, it should not get 40 damage instantly, instead a missile (with missile system) will spawn until it reaches the point of the enemy rifleman. The enemy rifleman will get damaged from the "Cause Damage Unit" trigger when the missile hits it, this time the enemy rifleman will get the 40 damage.

Damage engine config that prevents physical damages

  • Damage Setup
    • Events
      • Game - DMG_DamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Set DMG_DamageEventAmount = 0.00
Shoot_Damage[Shoot_CurrentIndex] is equal to the damage set in the Object Editor.

  • ...
  • Unit Group - Pick every unit in (Units within Shoot_DetectAOE of Shoot_TempLoc) and do (Actions)
    • Loop - Actions
      • Set Shoot_TempUnit = (Picked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Shoot_TempUnit is alive) Equal to True
              • (Shoot_TempUnit belongs to an enemy of (Owner of Shoot_Dummy[Shoot_CurrentIndex])) Equal to True
        • Then - Actions
          • Set Shoot_TempUnitLoc = (Position of Shoot_Dummy[Shoot_CurrentIndex])
          • Unit - Kill Shoot_Dummy[Shoot_CurrentIndex]
          • Unit - Cause Shoot_Caster[Shoot_CurrentIndex] to damage Shoot_TempUnit, dealing 100.00 damage of attack type Spells and damage type Normal
        • Else - Actions
          • Do nothing
I tried doing this but no luck.

  • Actions
    • Set DMG_IsDamageSpell = DMG_LastDamageWasSpell[0]
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • DMG_IsDamageSpell Equal to False
      • Then - Actions
        • Set DMG_DamageEventAmount = 0.00
        • Set DMG_DamageEventType = DMG_DamageTypeBlocked
      • Else - Actions
        • Do nothing
The problem here is that the Cause Damage trigger doesn't damage the Shoot_TempUnit because of the Damage Engine. I want Cause Damage trigger and preventing the physical damage to work at the same time, if that's possible.

If someone can help I'll really appreciate it.
 
Last edited:
Level 41
Joined
Feb 27, 2007
Messages
5,184
You don't need to use the "Do Nothing" action, it's literally pointless.

I believe I understand your issue, and the way I would solve it is simply setting a boolean variable to true before ordering the damage then setting it back to false after the damage. Only block damage in your trigger when that variable is false:
  • Damage Setup
    • Events
      • Game - DMG_DamageEvent becomes Equal to 1.00
    • Conditions
      • DMG_ByTrigger equal to Fasle
    • Actions
      • Set DMG_DamageEventAmount = 0.00
  • Set DMG_ByTrigger = True
  • Unit - Cause UNIT to damage OTHERUNIT for...
  • Set DMG_ByTrigger = False
 
Why does the ability in the Object Editor have to deal damage? You can detect when 0 damage is dealt using:

I don't want the player to think that the unit will do no damage to player's units.

At least you can do this is in the newer versions. Are you using an older version?

Sadly yes, v3.8.

You don't need to use the "Do Nothing" action, it's literally pointless.

My poor eyes confuse me everytime there are triggers under the If statements, I see it like it is in the Else - Action so I had to put Do Nothing there. I apologize if I keep doing that one. :D

By the way the boolean trick works, thanks!
 
Last edited:
Status
Not open for further replies.
Top