• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] Damage Target Event Crashes Game

Level 22
Joined
Dec 3, 2020
Messages
560
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 22
Joined
Dec 3, 2020
Messages
560
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