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

[Trigger] Trigger Causing Crash

I need help figuring out what is causing the crash. I've posted the triggers and a link to the map.

Custom Race: Order of the Eternal Flame

Phoenix - Burning Plumage
(Active) The Phoenix molts, leaving a burning trail behind as he moves dealing 15 damage in 100 AoE. Requires 15 Mana to activate.

This a unit ability.


  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Phoenix - Burning Plumage
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • BlazeIndexsize Equal to 0
      • Then - Actions
        • Trigger - Turn on SS loop <gen>
      • Else - Actions
    • Set VariableSet BlazeIndexsize = (BlazeIndexsize + 1)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • BlazeIndexsize Greater than BlazeMaxsize
      • Then - Actions
        • Set VariableSet BlazeInteger[BlazeIndexsize] = BlazeIndexsize
        • Set VariableSet BlazeMaxsize = BlazeIndexsize
      • Else - Actions
    • Set VariableSet BlazeTemp = BlazeInteger[BlazeIndexsize]
    • -------- Thats all no need for many variables for this spell --------
    • Set VariableSet BlazeCaster[BlazeTemp] = (Triggering unit)
    • Set VariableSet BlazeDuration[BlazeTemp] = ((Real((Level of Phoenix - Burning Plumage for BlazeCaster[BlazeTemp]))) + 7.00)


  • Events
    • Time - Every 0.25 seconds of game time
  • Conditions
  • Actions
    • For each (Integer BlazeLoop) from 1 to BlazeIndexsize, do (Actions)
      • Loop - Actions
        • Set VariableSet BlazeTemp = BlazeInteger[BlazeLoop]
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • BlazeDuration[BlazeTemp] Greater than 0.00
          • Then - Actions
            • Set VariableSet BlazeDuration[BlazeTemp] = (BlazeDuration[BlazeTemp] - 0.25)
            • -------- this is the fire trail --------
            • Set VariableSet BlazePoint = (Position of BlazeCaster[BlazeTemp])
            • Unit - Create 1 Dummy - Burning Plumage for (Owner of BlazeCaster[BlazeTemp]) at BlazePoint facing Default building facing degrees
            • Unit - Add Dummy - Burning Plumage to (Last created unit)
            • Unit - Set level of Dummy - Burning Plumage for (Last created unit) to (Level of Phoenix - Burning Plumage for BlazeCaster[BlazeTemp])
            • Unit - Order (Last created unit) to Human Blood Mage - Flame Strike BlazePoint
            • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
            • Custom script: call RemoveLocation(udg_BlazePoint)
          • Else - Actions
            • Set VariableSet BlazeInteger[BlazeLoop] = BlazeInteger[BlazeIndexsize]
            • Set VariableSet BlazeInteger[BlazeIndexsize] = BlazeTemp
            • Set VariableSet BlazeIndexsize = (BlazeIndexsize - 1)
            • Set VariableSet BlazeLoop = (BlazeLoop - 1)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • BlazeIndexsize Equal to 0
      • Then - Actions
        • Trigger - Turn off (This trigger)
      • Else - Actions
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,534
Please post your triggers using this method so we can easily read and edit them. Thanks!

I'll edit this comment with a solution if I find one.

[Edit] Copying what Tristronic posted below, which looks like it addresses all of the issues, here's some minor improvements just for the sake of efficiency.
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Phoenix - Burning Plumage
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • BlazeIndexsize Equal to 0
      • Then - Actions
        • Trigger - Turn on SS loop <gen>
      • Else - Actions
    • Set VariableSet BlazeIndexsize = (BlazeIndexsize + 1)
    • -------- Thats all no need for many variables for this spell --------
    • Set VariableSet BlazeCaster[BlazeIndexsize] = (Triggering unit)
    • Set VariableSet BlazeDuration[BlazeIndexsize] = ((Real((Level of Phoenix - Burning Plumage for BlazeCaster[BlazeIndexsize]))) + 7.00)
    • -------- Let's track our Dummy unit now --------
    • Set VariableSet BlazePoint = (Position of BlazeCaster[BlazeIndexsize])
    • Unit - Create 1 Dummy - Burning Plumage for (Owner of BlazeCaster[BlazeIndexsize]) at BlazePoint facing Default building facing degrees
    • Set VariableSet BlazeDummy[BladeIndexsize] = (Last created unit)
    • Unit - Add Dummy - Burning Plumage to BlazeDummy[BladeIndexsize]
    • Unit - Set level of Dummy - Burning Plumage for BlazeDummy[BladeIndexsize] to (Level of Phoenix - Burning Plumage for BlazeCaster[BlazeIndexsize])
    • Custom script: call RemoveLocation(udg_BlazePoint)
^ One Dummy is all that's needed.
  • Events
    • Time - Every 0.25 seconds of game time
  • Conditions
  • Actions
    • For each (Integer BlazeLoop) from 1 to BlazeIndexsize, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • BlazeDuration[BlazeLoop] Greater than 0.00
        • Then - Actions
          • Set VariableSet BlazeDuration[BlazeLoop] = (BlazeDuration[BlazeLoop] - 0.25)
          • -------- this is the fire trail --------
          • Set VariableSet BlazePoint = (Position of BlazeCaster[BlazeLoop])
          • Unit - Order BlazeDummy[BladeLoop] to Human Blood Mage - Flame Strike BlazePoint
          • Custom script: call RemoveLocation(udg_BlazePoint)
        • Else - Actions
          • Unit - Remove BlazeDummy[BlazeLoop] from the game
          • Set VariableSet BlazeCaster[BlazeLoop] = BlazeCaster[BlazeIndexsize]
          • Set VariableSet BlazeDuration[BlazeLoop] = BlazeDuration[BlazeIndexsize]
          • Set VariableSet BlazeDummy[BlazeLoop] = BlazeDummy[BlazeIndexsize]
          • Set VariableSet BlazeIndexsize = BlazeIndexsize - 1
          • Set VariableSet BlazeLoop = BlazeLoop - 1
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BlazeIndexsize Equal to 0
            • Then - Actions
              • Trigger - Turn off (This trigger)
            • Else - Actions
I tell the same Dummy to cast Flame Strike rather than creating a new one. I also only check to see if BlazeIndexsize is zero after subtracting 1 from it since that's the only time it would ever change from 1 to 0 (just make sure the Loop trigger is Initially Off). Also, you probably want to add a Condition to check if BlazeCaster[BlazeLoop] is Alive or not to prevent the spell from continuing while it's dead.

A Dummy unit should be based on the Locust with the following important changes:
Movement Type = None
Speed Base = 0
Attacks Enabled = None

This will allow it to cast spells immediately and without needing to turn to face the target.

Adding onto what was already said about the crash, maybe it's related to the Dummy unit casting Flame Strike? Perhaps that's causing another trigger to run which interferes.
 
Last edited:
Level 12
Joined
Jan 10, 2023
Messages
191
I think I've removed some unnecessary steps:

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Phoenix - Burning Plumage
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • BlazeIndexsize Equal to 0
      • Then - Actions
        • Trigger - Turn on SS loop <gen>
      • Else - Actions
    • Set VariableSet BlazeIndexsize = (BlazeIndexsize + 1)
    • -------- Thats all no need for many variables for this spell --------
    • Set VariableSet BlazeCaster[BlazeIndexsize] = (Triggering unit)
    • Set VariableSet BlazeDuration[BlazeIndexsize] = ((Real((Level of Phoenix - Burning Plumage for BlazeCaster[BlazeIndexsize]))) + 7.00)
I'm trying to find a definitive bug to point at, but all I have left to guess is some trigger interference with BlazeTemp (but it looks like you were on top of that) or maybe there is an issue with the loop. I'm forgetting how GUI loops handle their arguments and on what like the exit condition occurs. I'll convert a GUI loop when I get home if no one finds the solution sooner.

  • Events
    • Time - Every 0.25 seconds of game time
  • Conditions
  • Actions
    • For each (Integer BlazeLoop) from 1 to BlazeIndexsize, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • BlazeDuration[BlazeLoop] Greater than 0.00
        • Then - Actions
          • Set VariableSet BlazeDuration[BlazeLoop] = (BlazeDuration[BlazeLoop] - 0.25)
          • -------- this is the fire trail --------
          • Set VariableSet BlazePoint = (Position of BlazeCaster[BlazeLoop])
          • Unit - Create 1 Dummy - Burning Plumage for (Owner of BlazeCaster[BlazeLoop]) at BlazePoint facing Default building facing degrees
          • Unit - Add Dummy - Burning Plumage to (Last created unit)
          • Unit - Set level of Dummy - Burning Plumage for (Last created unit) to (Level of Phoenix - Burning Plumage for BlazeCaster[BlazeLoop])
          • Unit - Order (Last created unit) to Human Blood Mage - Flame Strike BlazePoint
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_BlazePoint)
        • Else - Actions
          • Set VariableSet BlazeCaster[BlazeLoop] = BlazeCaster[BlazeIndexsize]
          • Set VariableSet BlazeDuration[BlazeLoop] = BlazeDuration[BlazeIndexsize]
          • Set VariableSet BlazeIndexsize = BlazeIndexsize - 1
          • Set VariableSet BlazeLoop = BlazeLoop - 1
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • BlazeIndexsize Equal to 0
      • Then - Actions
        • Trigger - Turn off (This trigger)
      • Else - Actions
I think the problem was that in the last lines of your loop, in the else you did this
  • Set VariableSet BlazeInteger[Blazeloop] = ...
it should be: (on second thought, this was fine, but my method saves you from needing to hold BlazeInteger as a list that connects the loop order to the BlazeCaster order and you also won't need the MaxIndex variable that I assume you are using to clear the array when the timer trigger is turned off)
  • Set VariableSet BlazeInteger[Blazetemp] = ...
Thanks that was actually a nice mental exercise and yet I solved nothing...
 
Last edited:
Top