• 🏆 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] Crash to Desktop

Status
Not open for further replies.
Level 3
Joined
Aug 22, 2010
Messages
34
  • Trigger - Add to Bonus Undead Damage <gen> the event (Unit - (Last created unit) Takes damage)
  • Bonus Undead Damage
    • Events
    • Conditions
      • ((Triggering unit) is Undead) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Damage source)) Equal to High Elven Guard Tower
        • Then - Actions
          • Unit - Cause (Damage source) to damage (Attacked unit), dealing 3.00 damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Orc\EtherealForm\SpiritWalkerChange.mdl
        • Else - Actions
When a unit takes damage this crashes the game to desktop. If I remove the cause damage bit it doesn't.

Why does this happen?
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
Good infinite loop example ;P

How your trigger could work with (Attacked unit) reference? o_O
(Position of (Triggering unit)) leaks.

This should help:
  • Bonus Undead Damage
    • Events
    • Conditions
      • ((Triggering unit) is Undead) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Damage source)) Equal to High Elven Guard Tower
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Unit - Cause (Damage source) to damage (Triggering unit), dealing 3.00 damage of attack type Spells and damage type Normal
          • Trigger - Turn on (This trigger)
          • Set p = (Position of (Triggering unit))
          • Special Effect - Create a special effect at p using Abilities\Spells\Orc\EtherealForm\SpiritWalkerChange.mdl
          • Custom script: call RemoveLocation(udg_p)
        • Else - Actions
Make sure you destroy effect too, when it won't be needed no more.
 
Status
Not open for further replies.
Top