• 🏆 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] AOE SPELL CRASH

Status
Not open for further replies.
Level 13
Joined
Aug 23, 2011
Messages
647
full


On that lines, I get error ''out of memory'' everytime when I cast spell. Can someone tell me how to fix it.
 
Level 13
Joined
May 10, 2009
Messages
868
That trigger itself shouldn't cause that. However, you are using Integer A, which is a global variable. Well, I assume that there must be another trigger using it, and that is probably preventing Integer A from reaching its limit. Check triggers with "A unit enters (playable map area)" events. Or even better, create a new integer variable, and use it in that for loop function.
 
I presume that the ability inside the for loop is the same as the condition. If so, the issue is infinite recursion, where a trigger, while executing, executes itself again, leading to a nasty infinite loop.

[Case] Infinite Loop:
Effect -> Impale MANTEST,

For (bj_forLoopAIndex = 1, bj_forLoopAIndex <= 8, bj_forLoopAIndex++)
Create dummy
Add Impale MANTEST to dummy
Issue order (Must be instantaneous to cause such crash)
Instantaneous = goto (Effect -> Impale MANTEST)
// Restart thread from Effect -> Impale MANTEST
// Repeat, again, and again...​

To fix it, try disabling the trigger before the loop, and re-enabling it after the loop.
 
Level 5
Joined
Jul 27, 2017
Messages
73
Hm ... i did not get any errors.
At this map: the trigger was not activated --> it did nothing
When i activated it: There appeared some imale-waves going in the same direction every time the cryptlord casts his Impale.
And the skills are different: the trigger skill is a hero skill and the other one is a non-hero one --> no infinite loop
Are you using this skill in another map? if yes then the map causes some incompatibility (global variables?)

And still: the line "Set Caster = (Triggering unit)" is not necessary (or you change every following Triggering unit by using this variable.
 
Level 13
Joined
Aug 23, 2011
Messages
647
Hm ... i did not get any errors.
At this map: the trigger was not activated --> it did nothing
When i activated it: There appeared some imale-waves going in the same direction every time the cryptlord casts his Impale.
And the skills are different: the trigger skill is a hero skill and the other one is a non-hero one --> no infinite loop
Are you using this skill in another map? if yes then the map causes some incompatibility (global variables?)

And still: the line "Set Caster = (Triggering unit)" is not necessary (or you change every following Triggering unit by using this variable.

On my map: Main ability is non-hero ability. I tried shockwave/crushing wave/Impale on my main map and It crashed. Only changed thing are main ability is hero ability on that test map.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
Edit: I tested, It crashed.
Please stop ignoring us. The answer was posted long ago already...
every dummy unit that casts the ability is triggering this trigger again causing an infinite loop which causes game to go BANG
The solution literally is 1 line that took me 15 seconds to add...
  • Manaroth line spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Impale MANTEST
      • (Unit-type of (Triggering unit)) Not equal to dummy
    • Actions
      • Set Caster = (Triggering unit)
      • Set Real = 0.00
      • Set CasLoc = (Position of (Triggering unit))
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Unit - Create 1 dummy for (Owner of (Casting unit)) at CasLoc facing Default building facing degrees
          • Unit - Turn collision for (Last created unit) Off
          • Unit - Add Impale MANTEST to (Last created unit)
          • Set LocOffset[(Integer A)] = (CasLoc offset by 700.00 towards Real degrees)
          • Unit - Order (Last created unit) to Undead Crypt Lord - Impale LocOffset[(Integer A)]
          • Set Real = (Real + (360.00 / 8.00))
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_LocOffset[bj_forLoopAIndex])
      • Custom script: call RemoveLocation(udg_CasLoc)
It cannot infinite loop because it now rejects all executions caused by the dummies casting the same spell as the actual unit.
 

Attachments

  • Lord_Marrowgrath Spell.w3x
    681.5 KB · Views: 19
Level 13
Joined
Aug 23, 2011
Messages
647
Please stop ignoring us. The answer was posted long ago already...

The solution literally is 1 line that took me 15 seconds to add...
  • Manaroth line spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Impale MANTEST
      • (Unit-type of (Triggering unit)) Not equal to dummy
    • Actions
      • Set Caster = (Triggering unit)
      • Set Real = 0.00
      • Set CasLoc = (Position of (Triggering unit))
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Unit - Create 1 dummy for (Owner of (Casting unit)) at CasLoc facing Default building facing degrees
          • Unit - Turn collision for (Last created unit) Off
          • Unit - Add Impale MANTEST to (Last created unit)
          • Set LocOffset[(Integer A)] = (CasLoc offset by 700.00 towards Real degrees)
          • Unit - Order (Last created unit) to Undead Crypt Lord - Impale LocOffset[(Integer A)]
          • Set Real = (Real + (360.00 / 8.00))
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_LocOffset[bj_forLoopAIndex])
      • Custom script: call RemoveLocation(udg_CasLoc)
It cannot infinite loop because it now rejects all executions caused by the dummies casting the same spell as the actual unit.

Sorry for that. Thank you very much for sharing basic 1 line :)
 
Status
Not open for further replies.
Top