Odd bug when casting Death and Decay at a point that's used later in the same trigger

Marsmallos

Member
Reaction score
17
Hello!
I am creating a trigger and I'm getting what seems like a really annoying bug. Could somebody take a look at it and help me figure out what's wrong/how to solve it? (more detailed description below)

Trigger:
  • Freezing Trap freeze
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Freezing Trap
    • Actions
      • Game - Display to (All players) the text: Debug: Mine exploded
      • -------- create the AoE effect and slow --------
      • Set GEN_TEMP_POINT[1] = (Position of (Triggering unit))
      • Unit - Create 1 Dummy Caster for (Owner of (Triggering unit)) at GEN_TEMP_POINT[1] facing Default building facing degrees
      • Unit - Add a 15.00 second Generic expiration timer to (Last created unit)
      • Unit - Add (Hunter) Freezing trap slow to (Last created unit)
      • Unit - Add (Hunter) Freezing trap visual effect to (Last created unit)
      • Unit - Order (Last created unit) to Undead Lich - Death And Decay GEN_TEMP_POINT[1]
      • -------- loop through all nearby units to find the closest one --------
      • Set GEN_TEMP_GROUP_single = (Units within 500.00 of GEN_TEMP_POINT[1] matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))
      • Set HHUNTER_Trap_distance = 500.00
      • Game - Display to (All players) the text: Debug: Does this pa...
      • Game - Display to (All players) the text: (String((Number of units in GEN_TEMP_GROUP_single)))
      • Game - Display to (All players) the text: (String(HHUNTER_Trap_distance))
      • Unit Group - Pick every unit in GEN_TEMP_GROUP_single and do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: Debug: loop
          • Set GEN_TEMP_POINT[2] = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between GEN_TEMP_POINT[1] and GEN_TEMP_POINT[2]) Less than or equal to HHUNTER_Trap_distance
            • Then - Actions
              • Set HHUNTER_Trap_freezetarget = (Picked unit)
              • Set HHUNTER_Trap_distance = (Distance between GEN_TEMP_POINT[1] and GEN_TEMP_POINT[2])
            • Else - Actions
          • Custom script: call RemoveLocation(udg_GEN_TEMP_POINT[2])
      • -------- create another dummy to stun the closest target --------
      • Set GEN_TEMP_POINT_single = (Position of HHUNTER_Trap_freezetarget)
      • Unit - Create 1 Dummy Caster for (Owner of (Triggering unit)) at GEN_TEMP_POINT_single facing Default building facing degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Add (Hunter) Freezing Trap stun to (Last created unit)
      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt HHUNTER_Trap_freezetarget
      • Game - Display to (All players) the text: Debug: Does this pa...
      • Custom script: call DestroyGroup(udg_GEN_TEMP_GROUP_single)
      • Custom script: call RemoveLocation(udg_GEN_TEMP_POINT_single)
      • Custom script: call RemoveLocation(udg_GEN_TEMP_POINT[1])


For some reason its a single spellcasting action that breaks the trigger:

Trigger:
  • Unit - Order (Last created unit) to Undead Lich - Death And Decay GEN_TEMP_POINT[1]


If this action is enabled, the game seems to forget about what/where GEN_TEMP_POINT[1] is and thus it doesn't put any units into GEN_TEMP_GROUP_single (but Death and Decay is successfully cast I might add), and if I disable it, it creates the dummies, runs the loop and does the stun just fine. In other words, if the Death and Decay action is disabled everything else in the trigger runs perfectly, and if its enabled the game doesn't run the unit group loop (nor create the second dummy caster, whose creation is dependant on the loop). Wtf?
 

UndeadDragon

Super Moderator
Reaction score
447
Remove Custom script: call RemoveLocation(udg_GEN_TEMP_POINT[1]).

You destroy the location, which is why it "forgets" it.
 

Marsmallos

Member
Reaction score
17
Remove Custom script: call RemoveLocation(udg_GEN_TEMP_POINT[1]).

You destroy the location, which is why it "forgets" it.

But unless I'm very much mistaken, I only destroy udg_GEN_TEMP_POINT[1] at the end of the trigger when it is no longer needed, not between these:

Trigger:
  • Actions
    • Unit - Order (Last created unit) to Undead Lich - Death And Decay GEN_TEMP_POINT[1]
    • -------- loop through all nearby units to find the closest one --------
    • Set GEN_TEMP_GROUP_single = (Units within 500.00 of GEN_TEMP_POINT[1] matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))


It's between these actions that the game forgets about GEN_TEMP_POINT[1], causing the "Set GEN_TEMP_GROUP_single" action to fail, UNLESS, that is, I disable "Unit - Order (Last created unit) to Undead Lich - Death And Decay GEN_TEMP_POINT[1]"
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
because it is destroyed before the cast is made, it still has not casted on the point if it is out of range or not done casting

just spittballing
 

Marsmallos

Member
Reaction score
17
because it is destroyed before the cast is made, it still has not casted on the point if it is out of range or not done casting

just spittballing

Thanks for your reply!
Could you highlight what actions in the trigger is destroying the point before the trigger is finished? The ability is cast directly below the dummy so range is not an issue (especially as the dummy successfully casts if the action is enabled, however, this breaks the looping through units in range of the point used for the cast) and its cast backswing and cast point are both 0.00 so the ability is cast instantly.
 

keychup

Active Member
Reaction score
34
Before going into all that try this:
Trigger:
  • Unit Group - Pick every unit in GEN_TEMP_GROUP_single and do (Actions)
    • Loop - Actions
    • Game - Display to (All players) the text: Debug: loop
    • Set GEN_TEMP_POINT_single = (Position of Picked Unit)
    • Unit - Create 1 Dummy Caster for (Owner of (Triggering unit)) at GEN_TEMP_POINT_single facing Default building facing degrees
    • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
    • Unit - Add (Hunter) Freezing Trap stun to (Last created unit)
    • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt Picked Unit
    • Custom script: call RemoveLocation(udg_GEN_TEMP_POINT_single)


Your basicly including the remainng actions to the Pick all Units in Unit Group Loop

EDIT: You dont need to store the picked unit in a variable so i replaced it with just picked unit
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
what i was thinking before was wrong, u cant storm bolt a point, only a unit, try basing an ability off a ground targeting ability and add the affects, maybe acid bomb or something of that sort
 

Marsmallos

Member
Reaction score
17
Before going into all that try this:
Trigger:
  • Unit Group - Pick every unit in GEN_TEMP_GROUP_single and do (Actions)
    • Loop - Actions
    • Game - Display to (All players) the text: Debug: loop
    • Set GEN_TEMP_POINT_single = (Position of Picked Unit)
    • Unit - Create 1 Dummy Caster for (Owner of (Triggering unit)) at GEN_TEMP_POINT_single facing Default building facing degrees
    • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
    • Unit - Add (Hunter) Freezing Trap stun to (Last created unit)
    • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt Picked Unit
    • Custom script: call RemoveLocation(udg_GEN_TEMP_POINT_single)


Your basicly including the remainng actions to the Pick all Units in Unit Group Loop

EDIT: You dont need to store the picked unit in a variable so i replaced it with just picked unit

Thanks for your reply!
Won't this stun every unit in GEN_TEMP_GROUP_single? The point of the loop is to find the target closest to the trap. And if it fails to create the unit group it won't fire the loop no matter what actions you put in the loop, right? :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top