[Solved] Damage Target Event Crashes Game

Status
Not open for further replies.
Level 28
Joined
Dec 3, 2020
Messages
968
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 33
Joined
Feb 19, 2011
Messages
2,112
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 28
Joined
Dec 3, 2020
Messages
968
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...
 
Status
Not open for further replies.
Top