Multiple dummy casters in one trigger?

Haette

New Member
Reaction score
2
I'm trying to make a "wall of fire" type spell, and naturally I need a bunch of dummy spells to be cast in a line. However, the trigger seems to be making just one dummy, and never the rest. The one dummy IS casting its spell properly, but the rest never appear no matter what I try.

These used to be one trigger BTW, but I tried placing the "create, cast, destroy" part in its own trigger. It didn't help. Any ideas?

Trigger:
  • Wall of Fire Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Wall of Fire
    • Actions
      • Set Point_WallofFire_Target = (Target point of ability being cast)
      • Set Integer_WallofFire_Level = (Level of Wall of Fire for (Triggering unit))
      • Set Real_WallofFire_Angle = (Facing of (Triggering unit))
      • Set Player_WallofFire = (Triggering player)
      • -------- Create the center section --------
      • Set Point_WallofFire_Section = Point_WallofFire_Target
      • Trigger - Run Wall of Fire Section <gen> (ignoring conditions)
      • Custom script: call RemoveLocation (udg_Point_WallofFire_Section)
      • -------- Create the left sections --------
      • For each (Integer A) from 1 to (8 + Integer_WallofFire_Level), do (Actions)
        • Loop - Actions
          • Set Point_WallofFire_Section = (Point_WallofFire_Target offset by ((Real((Integer A))) x 50.00) towards (Real_WallofFire_Angle + 90.00) degrees)
          • Trigger - Run Wall of Fire Section <gen> (ignoring conditions)
          • Custom script: call RemoveLocation (udg_Point_WallofFire_Section)
      • -------- Create the right sections --------
      • For each (Integer A) from 1 to (8 + Integer_WallofFire_Level), do (Actions)
        • Loop - Actions
          • Set Point_WallofFire_Section = (Point_WallofFire_Target offset by ((Real((Integer A))) x 50.00) towards (Real_WallofFire_Angle - 90.00) degrees)
          • Trigger - Run Wall of Fire Section <gen> (ignoring conditions)
          • Custom script: call RemoveLocation (udg_Point_WallofFire_Section)
      • Custom script: call RemoveLocation (udg_Point_WallofFire_Target)


Trigger:
  • Wall of Fire Section
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 Wall of Fire for Player_WallofFire at Point_WallofFire_Section facing Point_WallofFire_Section
      • Unit - Set level of Rain of Fire (Wall of Fire) for (Last created unit) to Integer_WallofFire_Level
      • Unit - Order (Last created unit) to Neutral Pit Lord - Rain Of Fire Point_WallofFire_Section
      • Unit - Add a (3.00 + (Real(Integer_WallofFire_Level))) second Generic expiration timer to (Last created unit)
 

Moridin

Snow Leopard
Reaction score
144
Just so you know, you could do this all in one trigger.

Your error (I think anyway) is that you're using the action:

Trigger:
  • Trigger - Add Wall of Fire Section <gen> to the trigger queue (Ignoring conditions)


...which adds the actions of Wall of Fire Section to the trigger queue. You have to understand that this means it will run after the entire Wall of Fire cast trigger is done....which is not what you want (seeing as you'll be casting in the same point a couple of times over).

So instead, use this action:

Trigger:
  • Trigger - Run Wall of Fire Section <gen> (Ignoring conditions)


Try that. I can't guarantee it working, but I think that's the problem you have.
So your final triggers (two of them) should look like this:
Trigger:
  • Wall of Fire Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Wall of Fire
    • Actions
      • Set Point_WallofFire_Target = (Target point of ability being cast)
      • Set Integer_WallofFire_Level = (Level of Wall of Fire for (Triggering unit))
      • Set Real_WallofFire_Angle = (Facing of (Triggering unit))
      • Set Player_WallofFire = (Triggering player)
      • -------- Create the center section --------
      • Set Point_WallofFire_Section = Point_WallofFire_Target
      • Trigger - Run Wall of Fire Section <gen> (Ignoring conditions)
      • Custom script: call RemoveLocation (udg_Point_WallofFire_Section)
      • -------- Create the left sections --------
      • For each (Integer A) from 1 to (8 + Integer_WallofFire_Level), do (Actions)
        • Loop - Actions
          • Set Point_WallofFire_Section = (Point_WallofFire_Target offset by ((Real((Integer A))) x 50.00) towards (Real_WallofFire_Angle + 90.00) degrees)
          • Trigger - Run Wall of Fire Section <gen> (Ignoring conditions)
          • Custom script: call RemoveLocation (udg_Point_WallofFire_Section)
      • -------- Create the right sections --------
      • For each (Integer A) from 1 to (8 + Integer_WallofFire_Level), do (Actions)
        • Loop - Actions
          • Set Point_WallofFire_Section = (Point_WallofFire_Target offset by ((Real((Integer A))) x 50.00) towards (Real_WallofFire_Angle - 90.00) degrees)
          • Trigger - Run Wall of Fire Section <gen> (Ignoring conditions)
          • Custom script: call RemoveLocation (udg_Point_WallofFire_Section)
      • Custom script: call RemoveLocation (udg_Point_WallofFire_Target)


Trigger:
  • Wall of Fire Section
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 Wall of Fire for Player_WallofFire at Point_WallofFire_Section facing Point_WallofFire_Section
      • Unit - Set level of Rain of Fire (Wall of Fire) for (Last created unit) to Integer_WallofFire_Level
      • Unit - Order (Last created unit) to Neutral Pit Lord - Rain Of Fire Point_WallofFire_Section
      • Unit - Add a (3.00 + (Real(Integer_WallofFire_Level))) second Generic expiration timer to (Last created unit)

At the same time, you could join the triggers into one, which would be something like this:
Trigger:
  • Wall of Fire Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Wall of Fire
    • Actions
      • Set Point_WallofFire_Target = (Target point of ability being cast)
      • Set Integer_WallofFire_Level = (Level of Wall of Fire for (Triggering unit))
      • Set Real_WallofFire_Angle = (Facing of (Triggering unit))
      • Set Player_WallofFire = (Triggering player)
      • -------- Create the center section --------
      • Set Point_WallofFire_Section = Point_WallofFire_Target
      • Unit - Create 1 Wall of Fire for Player_WallofFire at Point_WallofFire_Section facing Point_WallofFire_Section
      • Unit - Set level of Rain of Fire (Wall of Fire) for (Last created unit) to Integer_WallofFire_Level
      • Unit - Order (Last created unit) to Neutral Pit Lord - Rain Of Fire Point_WallofFire_Section
      • Unit - Add a (3.00 + (Real(Integer_WallofFire_Level))) second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Point_WallofFire_Section)
      • -------- Create the left sections --------
      • For each (Integer A) from 1 to (8 + Integer_WallofFire_Level), do (Actions)
        • Loop - Actions
          • Set Point_WallofFire_Section = (Point_WallofFire_Target offset by ((Real((Integer A))) x 50.00) towards (Real_WallofFire_Angle + 90.00) degrees)
          • Unit - Create 1 Wall of Fire for Player_WallofFire at Point_WallofFire_Section facing Point_WallofFire_Section
          • Unit - Set level of Rain of Fire (Wall of Fire) for (Last created unit) to Integer_WallofFire_Level
          • Unit - Order (Last created unit) to Neutral Pit Lord - Rain Of Fire Point_WallofFire_Section
          • Unit - Add a (3.00 + (Real(Integer_WallofFire_Level))) second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation (udg_Point_WallofFire_Section)
      • -------- Create the right sections --------
      • For each (Integer A) from 1 to (8 + Integer_WallofFire_Level), do (Actions)
        • Loop - Actions
          • Set Point_WallofFire_Section = (Point_WallofFire_Target offset by ((Real((Integer A))) x 50.00) towards (Real_WallofFire_Angle - 90.00) degrees)
          • Unit - Create 1 Wall of Fire for Player_WallofFire at Point_WallofFire_Section facing Point_WallofFire_Section
          • Unit - Set level of Rain of Fire (Wall of Fire) for (Last created unit) to Integer_WallofFire_Level
          • Unit - Order (Last created unit) to Neutral Pit Lord - Rain Of Fire Point_WallofFire_Section
          • Unit - Add a (3.00 + (Real(Integer_WallofFire_Level))) second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation (udg_Point_WallofFire_Section)
      • Custom script: call RemoveLocation (udg_Point_WallofFire_Target)


It's a bit weighty, but that's because you've drawn out the actions in those 3 sections instead of using the entire thing

Edit: And I forgot that spoilers don't work here :p.
 

Haette

New Member
Reaction score
2
I actually changed to that in between copying the trigger and posting it. Edited with the new code now, but it still isn't working.

Edit: Your suggestion to merge the two triggers was my original trigger verbatim, and I brought it here after neither one worked. I split it up in case you can only create one unit per trigger or something, I dunno if that's a quirk of the editor or not.
 

Moridin

Snow Leopard
Reaction score
144
Well, I looked through the code again, and I can't find anything wrong with it. It definitely shouldn't create only 1 unit.

Try placing Text messages spaced throughout the trigger to see what's happening when you cast the ability. Maybe something else is interrupting it.

Edit: Also, you have a few extra/unnecessary actions but we can deal with that later.
 

Haette

New Member
Reaction score
2
Yay, error messages! The little trigger is firing just as many times as I'm telling it to, but there's no new units. Could it have something to do with the "Last Created Unit" function? Does it only refer to a single unit per trigger? I've heard it can be troublesome, but I've gone through a couple multi-dummy triggers and never had problems like this.

Edit: I just tried taking out the repeated RemoveLocation calls and just called it once at the end of the trigger, and apparently that's what it needed. Works fine now. However, now I'm a little paranoid that this is leaking, can you tell offhand if it would?

Trigger:
  • Wall of Fire Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Wall of Fire
    • Actions
      • Set Point_WallofFire_Target = (Target point of ability being cast)
      • Set Integer_WallofFire_Level = (Level of Wall of Fire for (Triggering unit))
      • Set Real_WallofFire_Angle = (Facing of (Triggering unit))
      • Set Player_WallofFire = (Triggering player)
      • -------- Create the center section --------
      • Set Point_WallofFire_Section = Point_WallofFire_Target
      • Unit - Create 1 Wall of Fire for Player_WallofFire at Point_WallofFire_Section facing 0.00 degrees
      • Unit - Set level of Rain of Fire (Wall of Fire) for (Last created unit) to Integer_WallofFire_Level
      • Unit - Order (Last created unit) to Neutral Pit Lord - Rain Of Fire Point_WallofFire_Section
      • Unit - Add a (3.00 + (Real(Integer_WallofFire_Level))) second Generic expiration timer to (Last created unit)
      • -------- Create the left sections --------
      • For each (Integer A) from 1 to (8 + Integer_WallofFire_Level), do (Actions)
        • Loop - Actions
          • Set Point_WallofFire_Section = (Point_WallofFire_Target offset by ((Real((Integer A))) x 50.00) towards (Real_WallofFire_Angle + 90.00) degrees)
          • Unit - Create 1 Wall of Fire for Player_WallofFire at Point_WallofFire_Section facing 0.00 degrees
          • Unit - Set level of Rain of Fire (Wall of Fire) for (Last created unit) to Integer_WallofFire_Level
          • Unit - Order (Last created unit) to Neutral Pit Lord - Rain Of Fire Point_WallofFire_Section
          • Unit - Add a (3.00 + (Real(Integer_WallofFire_Level))) second Generic expiration timer to (Last created unit)
      • -------- Create the right sections --------
      • For each (Integer A) from 1 to (8 + Integer_WallofFire_Level), do (Actions)
        • Loop - Actions
          • Set Point_WallofFire_Section = (Point_WallofFire_Target offset by ((Real((Integer A))) x 50.00) towards (Real_WallofFire_Angle - 90.00) degrees)
          • Unit - Create 1 Wall of Fire for Player_WallofFire at Point_WallofFire_Section facing 0.00 degrees
          • Unit - Set level of Rain of Fire (Wall of Fire) for (Last created unit) to Integer_WallofFire_Level
          • Unit - Order (Last created unit) to Neutral Pit Lord - Rain Of Fire Point_WallofFire_Section
          • Unit - Add a (3.00 + (Real(Integer_WallofFire_Level))) second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Point_WallofFire_Section)
      • Custom script: call RemoveLocation (udg_Point_WallofFire_Target)
 

Moridin

Snow Leopard
Reaction score
144
I was going to suggest that later, but it looks like you've got to it already :p.

Anyway, I'm glad your trigger works. There are indeed a few leaks. However, to remove them, you're going to have to repeat the same actions you've just deleted. I'm a bit confused as to how those actions stopped the units from being created though :S.

Try this trigger out. I've optimized it as much as I can:

Trigger:
  • Wall of Fire Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Wall of Fire
    • Actions
      • Set Point_WallofFire_Target = (Target point of ability being cast)
      • Set Integer_WallofFire_Level = (Level of Wall of Fire for (Triggering unit))
      • Set Real_WallofFire_Angle = (Facing of (Triggering unit))
      • -------- Create the center section --------
      • Unit - Create 1 Wall of Fire for (Triggering Player) at Point_WallofFire_Section facing 0.00 degrees
      • Unit - Set level of Rain of Fire (Wall of Fire) for (Last created unit) to Integer_WallofFire_Level
      • Unit - Order (Last created unit) to Neutral Pit Lord - Rain Of Fire Point_WallofFire_Target
      • Unit - Add a (3.00 + (Real(Integer_WallofFire_Level))) second Generic expiration timer to (Last created unit)
      • -------- Create the left sections --------
      • For each (Integer A) from 1 to (8 + Integer_WallofFire_Level), do (Actions)
        • Loop - Actions
          • Set Point_WallofFire_Section = (Point_WallofFire_Target offset by ((Real((Integer A))) x 50.00) towards (Real_WallofFire_Angle + 90.00) degrees)
          • Unit - Create 1 Wall of Fire for (Triggering Player) at Point_WallofFire_Section facing 0.00 degrees
          • Unit - Set level of Rain of Fire (Wall of Fire) for (Last created unit) to Integer_WallofFire_Level
          • Unit - Order (Last created unit) to Neutral Pit Lord - Rain Of Fire Point_WallofFire_Section
          • Unit - Add a (3.00 + (Real(Integer_WallofFire_Level))) second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation (udg_Point_WallofFire_Section)
      • -------- Create the right sections --------
      • For each (Integer A) from 1 to (8 + Integer_WallofFire_Level), do (Actions)
        • Loop - Actions
          • Set Point_WallofFire_Section = (Point_WallofFire_Target offset by ((Real((Integer A))) x 50.00) towards (Real_WallofFire_Angle - 90.00) degrees)
          • Unit - Create 1 Wall of Fire for (Triggering Player) at Point_WallofFire_Section facing 0.00 degrees
          • Unit - Set level of Rain of Fire (Wall of Fire) for (Last created unit) to Integer_WallofFire_Level
          • Unit - Order (Last created unit) to Neutral Pit Lord - Rain Of Fire Point_WallofFire_Section
          • Unit - Add a (3.00 + (Real(Integer_WallofFire_Level))) second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation (udg_Point_WallofFire_Section)
      • Custom script: call RemoveLocation (udg_Point_WallofFire_Target)


Another way you could do it is:

Trigger:
  • Wall of Fire Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Wall of Fire
    • Actions
      • Set Point_WallofFire_Target = (Target point of ability being cast)
      • Set Integer_WallofFire_Level = (Level of Wall of Fire for (Triggering unit))
      • Set Real_WallofFire_Angle = (Facing of (Triggering unit))
      • For each (Integer A) from (-8 - Integer_WallofFire_Level) to (8 + Integer_WallofFire_Level), do (Actions)
        • Loop - Actions
          • If (All Conditions are true) then do (then actions) else do (else actions)
            • If - Conditions
              • (Integer A) Greater than 0
            • Then - Actions
              • Set Point_WallofFire_Section = (Point_WallofFire_Target offset by ((Real((Integer A))) x 50.00) towards (Real_WallofFire_Angle + 90.00) degrees)
            • Else - Actions
          • If (All Conditions are true) then do (then actions) else do (else actions)
            • If - Conditions
              • (Integer A) Less than 0
            • Then - Actions
              • Set Point_WallofFire_Section = (Point_WallofFire_Target offset by ((Real((Integer A))) x 50.00) towards (Real_WallofFire_Angle - 90.00) degrees)
            • Else - Actions
          • If (All Conditions are true) then do (then actions) else do (else actions)
            • If - Conditions
              • (Integer A) Equal to 0
            • Then - Actions
              • Set Point_WallofFire_Section = Point_WallofFire_Target
            • Else - Actions
          • Unit - Create 1 Wall of Fire for (Triggering Player) at Point_WallofFire_Section facing 0.00 degrees
          • Unit - Set level of Rain of Fire (Wall of Fire) for (Last created unit) to Integer_WallofFire_Level
          • Unit - Order (Last created unit) to Neutral Pit Lord - Rain Of Fire Point_WallofFire_Section
          • Unit - Add a (3.00 + (Real(Integer_WallofFire_Level))) second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation (udg_Point_WallofFire_Section)
      • Custom script: call RemoveLocation (udg_Point_WallofFire_Target)
 

Haette

New Member
Reaction score
2
Finally got it working, and drastically reduced in size, too! Thanks for the help :D

I guess it just doesn't like spawning units in multiple sets, or something. Should be useful to know.

Trigger:
  • Wall of Fire Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Wall of Fire
    • Actions
      • Set Point_WallofFire_Target = (Target point of ability being cast)
      • Set Real_WallofFire_Angle = (Facing of (Triggering unit))
      • Set Player_WallofFire = (Triggering player)
      • For each (Integer A) from (-4 - (Level of Wall of Fire for (Triggering unit))) to (4 + (Level of Wall of Fire for (Triggering unit))), do (Actions)
        • Loop - Actions
          • Set Point_WallofFire_Section = (Point_WallofFire_Target offset by ((Real((Integer A))) x 50.00) towards (Real_WallofFire_Angle + 90.00) degrees)
          • Unit - Create 1 Wall of Fire for Player_WallofFire at Point_WallofFire_Section facing 0.00 degrees
          • Unit - Set level of Rain of Fire (Wall of Fire) for (Last created unit) to (Level of Wall of Fire for (Triggering unit))
          • Unit - Order (Last created unit) to Neutral Pit Lord - Rain Of Fire Point_WallofFire_Section
          • Unit - Add a 8.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation (udg_Point_WallofFire_Section)
      • Custom script: call RemoveLocation (udg_Point_WallofFire_Target)
 

Moridin

Snow Leopard
Reaction score
144
That's great! :D

I actually made a mistake with my trigger, but you seem to have gotten the idea behind only using 1 loop to do it, so that's cool :).

Also, your trigger doesn't leak, so you don't have to worry about that.
One thing you don't have to do though, is set the triggering player to (Player_WallofFire). Just use (Triggering Player) instead. Less variable calls.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top