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

[Crash] Game Stops

Status
Not open for further replies.
I don't get what's wrong but I'm sure these actions are the problem.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Damage source)) Equal to Corsair Chieftain
      • (Level of Tidal Blade for (Damage source)) Greater than 0
    • Then - Actions
      • Set TempPoint = (Position of (Damage source))
      • Set TempInteger = (Integer((Facing of (Damage source))))
      • Set TempReal = ((100.00 + (25.00 x (Real((Level of Tidal Blade for (Damage source)))))) + 5.00)
      • Set TempPoint = (TempPoint offset by TempReal towards (Real(TempInteger)) degrees)
      • Set TempGroup = (Units within TempReal of TempPoint matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Damage source))) Equal to True)))
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Set TempInteger = (Level of Tidal Blade for (Damage source))
      • Set TempReal = (((Real((Strength of (Damage source) (Include bonuses)))) / 2.00) x (Real(TempInteger)))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Position of (Picked unit))
          • Unit - Cause (Damage source) to damage (Picked unit), dealing TempReal damage of attack type Chaos and damage type Universal
          • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Other\CrushingWave\CrushingWaveDamage.mdl
          • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyGroup(udg_TempGroup)
    • Else - Actions
After the ability is learnt and the hero deals damage, the game just freezes.
 
Level 1
Joined
Apr 24, 2009
Messages
44
Unit - Cause (Damage source) to damage (Picked unit), dealing TempReal damage of attack type Chaos and damage type Universal

This may be causing the trigger to run again, which in the end produces an endless loop.
Try disabling the trigger before dealing damage and then enabling it after (or just disable it before the Unit Group actions and enable before cleaning leaks).
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
  • Unit - Cause (Damage source) to damage (Picked unit), dealing TempReal damage of attack type Chaos and damage type Universal
This deals damage to the target, which causes the trigger to fire and deal damage again => infinite loop.

Fix:

  • Trigger - Turn off this trigger
  • Unit - Cause (Damage source) to damage (Picked unit), dealing TempReal damage of attack type Chaos and damage type Universal
  • Trigger - Turn on this trigger
 
Status
Not open for further replies.
Top