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

[Solved] Damage Target Event Crashes Game

Level 21
Joined
Dec 3, 2020
Messages
520
Hi...
I have the following trigger:

  • Event - Unit Takes Damage
  • Conditions
  • [LIST]
  • [*]Unit-type of Damage Target equal to Water Elemental (level 1)
  • [*]Unit-type of Damage Source equal to Fel Beast
  • [/LIST]
  • Actions - Make Damage Source deal 15 (normal and normal values for the damage dealt) damage to Damage Target
The map crashes when the Damage Source (fel beast) attacks the damage target (water elemental)...
Any idea how to make this work?
 
Last edited:

Remixer

Map Reviewer
Level 31
Joined
Feb 19, 2011
Messages
1,957
You need to Disable the trigger before you make the code deal the damage, otherwise you will enter an infinite loop, where your code/trigger deals damage and checks its own damage.

You need to format it like this:
  • Actions
    • Trigger - Turn off (This trigger)
    • Unit - Cause (Triggering unit) to damage (Triggering unit), dealing 500.00 damage of attack type Spells and damage type Normal
    • Trigger - Turn on (This trigger)
Edit: Not sure of your exact conditions and target setups, but let me know if this doesn't fix it.
 
Level 21
Joined
Dec 3, 2020
Messages
520
You need to Disable the trigger before you make the code deal the damage, otherwise you will enter an infinite loop, where your code/trigger deals damage and checks its own damage.

You need to format it like this:
  • Actions
    • Trigger - Turn off (This trigger)
    • Unit - Cause (Triggering unit) to damage (Triggering unit), dealing 500.00 damage of attack type Spells and damage type Normal
    • Trigger - Turn on (This trigger)
Edit: Not sure of your exact conditions and target setups, but let me know if this doesn't fix it.
Worked flawlessly, thank you!
Sometimes my stupidity is astonishing... I should've known that damaging the desired target (without turning the trigger off) would cause the trigger to go in an infinite loop...
 
Top