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

Do these triggers leak?

Status
Not open for further replies.
Level 4
Joined
Mar 21, 2014
Messages
79
do these triggers leak?


  • Boss Event Announce and Countdown
    • Events
      • Time - Boss_Event_Loop expires
    • Conditions
      • Boss_Events Equal to True
      • Boss_Status Equal to <Dead>
    • Actions
      • For each (Integer A) from 1 to 20, do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect at ((Center of Boss Fight Area <gen>) offset by 512.00 towards (18.00 x (Real((Integer A)))) degrees) using Doodads\Cityscape\Props\MagicRunes\MagicRunes0.mdl
          • Set Boss_Animation[(Integer A)] = (Last created special effect)
      • Set Boss_Status = coming
      • Game - Display to (All players) for 30.00 seconds the text: |cffffcc00BOSS EVEN...
      • Trigger - Turn on Boss Event Ping Loop <gen>
      • Wait 60.00 game-time seconds
      • Game - Display to (All players) for 10.00 seconds the text: |cffffcc00BOSS EVEN...
      • Wait 20.00 game-time seconds
      • Game - Display to (All players) for 5.00 seconds the text: |cffffcc00BOSS EVEN...
      • Wait 5.00 game-time seconds
      • Game - Display to (All players) for 2.00 seconds the text: |cffffcc00BOSS EVEN...
      • Wait 1.00 game-time seconds
      • Game - Display to (All players) for 2.00 seconds the text: |cffffcc00BOSS EVEN...
      • Wait 1.00 game-time seconds
      • Game - Display to (All players) for 2.00 seconds the text: |cffffcc00BOSS EVEN...
      • Wait 1.00 game-time seconds
      • Game - Display to (All players) for 2.00 seconds the text: |cffffcc00BOSS EVEN...
      • Wait 1.00 game-time seconds
      • Game - Display to (All players) for 2.00 seconds the text: |cffffcc00BOSS EVEN...
      • Wait 1.00 game-time seconds
      • Game - Display to (All players) for 2.00 seconds the text: |cffffcc00BOSS EVEN...
      • Set Boss_Event_Fight_Side = 0
      • Set Boss_Event_Fight_Value = 0
      • Set Boss_Status = Fight!
      • Trigger - Turn on Boss Fight Points <gen>



  • Boss Event Ping Loop
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • Boss_Status Equal to coming
          • Boss_Status Equal to Fight!
    • Actions
      • Cinematic - Ping minimap for (All players) at (Center of Boss Fight Area <gen>) for 3.00 seconds, using a Simple ping of color (70.00%, 50.00%, 10.00%)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boss_Status Equal to <Dead>
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Do nothing



  • Boss Fight Points
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • Boss_Status Equal to Fight!
    • Actions
      • Set Boss_Event_Fight_Side = 0
      • Set Local_Side1_Counter = 0
      • Set Local_Side2_Counter = 0
      • Unit Group - Pick every unit in (Units within 512.00 of (Center of Boss Fight Area <gen>)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an ally of Player 9 (Gray)) Equal to True
              • ((Unit-type of (Picked unit)) is A Hero) Equal to True
            • Then - Actions
              • Set Local_Side1_Counter = -1
            • Else - Actions
      • Unit Group - Pick every unit in (Units within 512.00 of (Center of Boss Fight Area <gen>)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an ally of Player 10 (Light Blue)) Equal to True
              • ((Unit-type of (Picked unit)) is A Hero) Equal to True
            • Then - Actions
              • Set Local_Side2_Counter = 1
            • Else - Actions
              • Do nothing
      • Set Boss_Event_Fight_Side = (Local_Side1_Counter + Local_Side2_Counter)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boss_Event_Fight_Side Less than 0
        • Then - Actions
          • Set Boss_Event_Fight_Value = (Boss_Event_Fight_Value - 1)
          • Floating Text - Create floating text that reads (|cffcc0000 + ((String((0 - Boss_Event_Fight_Value))) + |r!)) at (Center of Boss Fight Area <gen>) with Z offset 0.00, using font size 30.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 75.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 0.50 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.40 seconds
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boss_Event_Fight_Side Greater than 0
        • Then - Actions
          • Set Boss_Event_Fight_Value = (Boss_Event_Fight_Value + 1)
          • Floating Text - Create floating text that reads (|cff7EBFF1 + ((String(Boss_Event_Fight_Value)) + |r!)) at (Center of Boss Fight Area <gen>) with Z offset 0.00, using font size 30.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 75.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 0.50 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.40 seconds
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boss_Event_Fight_Side Less than 0
          • Boss_Event_Fight_Value Less than or equal to -10
        • Then - Actions
          • Set Boss_Event_Fight_Value = 0
          • Set Boss_Event_Fight_Side = 0
          • Set Boss_Status = <Dead>
          • Unit - Create 1 Unit_Ogre_Boss for Player 9 (Gray) at (Center of Boss Fight Area <gen>) facing (Position of Fortress[3])
          • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
            • Loop - Actions
              • Unit - Add Ogre_Boss_Abilities[0] to (Picked unit)
              • Unit - Add Ogre_Boss_Abilities[1] to (Picked unit)
              • Unit - Add Ogre_Boss_Abilities[2] to (Picked unit)
              • Unit Group - Add (Picked unit) to Units_BlackrockClan
              • AI - Ignore (Picked unit)'s guard position
              • Unit - Order (Picked unit) to Attack-Move To (Center of Horde Fortress 2 <gen>)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Creeps_Group_Fight_Side[(Integer A)] Greater than 0
              • Creeps_Region_Fight_Value[(Integer A)] Greater than or equal to 10
            • Then - Actions
              • Set Boss_Event_Fight_Value = 0
              • Set Boss_Event_Fight_Side = 0
              • Set Boss_Status = <Dead>
              • Unit - Create 1 Unit_Ogre_Boss for Player 10 (Light Blue) at (Center of Boss Fight Area <gen>) facing (Position of Fortress[0])
              • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
                • Loop - Actions
                  • Unit - Add Ogre_Boss_Abilities[0] to (Picked unit)
                  • Unit - Add Ogre_Boss_Abilities[1] to (Picked unit)
                  • Unit - Add Ogre_Boss_Abilities[2] to (Picked unit)
                  • Unit Group - Add (Picked unit) to Units_BlackToothGrinClan
                  • AI - Ignore (Picked unit)'s guard position
                  • Unit - Order (Picked unit) to Attack-Move To (Center of Horde Fortress 1 <gen>)
            • Else - Actions
              • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boss_Status Equal to <Dead>
        • Then - Actions
          • For each (Integer A) from 1 to 20, do (Actions)
            • Loop - Actions
              • Special Effect - Destroy Boss_Animation[(Integer A)]
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Do nothing
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
yes your triggers are full of location leaks and unitgroup leaks

what u want to do is
when ever you are using at position of unit/ at center of region ect (a location to do somthing)

instead set a location variable then for eg create ur effect at the location variable then destroy it
  • Set Location = (Center of (Playable map area))
  • Cinematic - Ping minimap for (All players) at Location for 1.00 seconds
  • Custom script: call RemoveLocation(udg_Location)
and for units groups if you arnt using the unit group latter on u can use this line before creating it
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Playable Map Area) and do (Unit - kill (Picked unit))
then if u want to be using that same unit group later on ull need to set it in a variable then destroy it later when ur done with it
  • Set Group = Pick every unit in (Playable Map Area)
  • ... Usage of Group ...
  • Custom script: call DestroyGroup(udg_Group)

more details about leaks can be found here suggest u have a look
Memory Leaks
 
Level 4
Joined
Mar 21, 2014
Messages
79
Ok i already thought so that they do leak. Thanks a lot!
I wasn't sure if Position Center of Map does also leak, now i know :)

So then what would you say about these two triggers?
My assumption is that there are never more than 100 runes active on the map.



  • Regen Globe Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Equal to Unit_Demolisher
          • (Unit-type of (Dying unit)) Equal to Unit_Grunt
          • (Unit-type of (Dying unit)) Equal to Unit_Troll
          • ((Dying unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random real number between 1.00 and 100.00) Less than or equal to 3.00
        • Then - Actions
          • Set Regen_Globe_Max = (Regen_Globe_Max + 1)
          • Set Regen_Globe = Regen_Globe_Max
          • Set Regen_Globe_Point = (Position of (Dying unit))
          • Countdown Timer - Start Regen_Globe_Timer[Regen_Globe] as a One-shot timer that will expire in 10.00 seconds
          • Item - Create Rune_Healing at Regen_Globe_Point
          • Set Regen_Globe_Item[Regen_Globe] = (Last created item)
          • Custom script: call RemoveLocation(udg_Regen_Globe_Point)
          • Trigger - Add to Regen Globe Timer <gen> the event (Time - Regen_Globe_Timer[Regen_Globe] expires)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Regen_Globe_Max Greater than or equal to 100
        • Then - Actions
          • Set Regen_Globe_Max = 0
        • Else - Actions
          • Do nothing


I think the line "Add to <Regen Globe Timer <gen>> the event <Timer...> expires" could be optimized by creating all the events at map init, right?


  • Regen Globe Timer
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to Regen_Globe_Max, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Remaining time for Regen_Globe_Timer[(Integer A)]) Less than or equal to 0.00
            • Then - Actions
              • Item - Remove Regen_Globe_Item[(Integer A)]
            • Else - Actions
 
Level 39
Joined
Feb 27, 2007
Messages
5,010
Literally every point object ever is a 'leak' if you don't clean it up or reuse it. Every group is a leak. Every player group is a leak. Things That Leak

Using a timer array like that is not good. GUI requires you to choose an array size which initializes ONLY those indices of the array. Others will not have a timer associated with them and won't properly do anything when you tell them to run if the current instance count exceeds the array size you chose. Setting the array size very high is inefficient and is its own form of a memory leak. Instead of starting multiple timers, just a periodic event and give a counter variable to each instance. This counter should be an integer. Every time the trigger runs (say every 0.25 seconds) reduce the counter of each instance by 1. If you start the counter at 40 and reduce by 1 every 0.25 seconds that's 10 seconds per instance. When the counter is 0 for a given instance, 'end' it however you have to.

This method means that at most any given instance lasts for 1 timer period shorter than it should, which is why I didn't suggest using a period of 1 second. Pick something small-ish if that 1 second variability matters to you.
 
Level 4
Joined
Mar 21, 2014
Messages
79
Ok i improved it with a more sophisticated indexing system:


  • Regen Globe Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Equal to Unit_Demolisher
          • (Unit-type of (Dying unit)) Equal to Unit_Grunt
          • (Unit-type of (Dying unit)) Equal to Unit_Troll
          • ((Dying unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random real number between 1.00 and 100.00) Less than or equal to 90.00
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Regen_Globe_Index_Size Equal to 0
            • Then - Actions
              • Trigger - Turn on Regen Globe Loop <gen>
            • Else - Actions
          • Set Regen_Globe_Index_Size = (Regen_Globe_Index_Size + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Regen_Globe_Index_Size Greater than Regen_Globe_Max_Size
            • Then - Actions
              • Set Regen_Globe_Index[Regen_Globe_Index_Size] = Regen_Globe_Index_Size
              • Set Regen_Globe_Max_Size = Regen_Globe_Index_Size
            • Else - Actions
          • Set Regen_Globe_TempInt = Regen_Globe_Index[Regen_Globe_Index_Size]
          • Set Regen_Globe_Point = (Position of (Dying unit))
          • Set Regen_Globe_Integer_Timer[Regen_Globe_TempInt] = 50
          • Item - Create Rune_Healing at Regen_Globe_Point
          • Set Regen_Globe_Item[Regen_Globe_TempInt] = (Last created item)
          • Custom script: call RemoveLocation(udg_Regen_Globe_Point)
        • Else - Actions
          • Do nothing



  • Regen Globe Loop
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Regen_Loop) from 1 to Regen_Globe_Index_Size, do (Actions)
        • Loop - Actions
          • Set Regen_Globe_TempInt = Regen_Globe_Index[Regen_Loop]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Regen_Globe_Integer_Timer[Regen_Globe_TempInt] Greater than 0
            • Then - Actions
              • Set Regen_Globe_Integer_Timer[Regen_Globe_TempInt] = (Regen_Globe_Integer_Timer[Regen_Globe_TempInt] - 1)
            • Else - Actions
              • Item - Remove Regen_Globe_Item[Regen_Globe_TempInt]
              • Set Regen_Globe_Index[Regen_Loop] = Regen_Globe_Index[Regen_Globe_Index_Size]
              • Set Regen_Globe_Index[Regen_Globe_Index_Size] = Regen_Globe_TempInt
              • Set Regen_Globe_Index_Size = (Regen_Globe_Index_Size - 1)
              • Set Regen_Loop = (Regen_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Regen_Globe_Index_Size Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions



Question: Can I mix one global Point Variable "udg_TempPoint" in different scripts/Triggers?


Fore example i use in one trigger TempPoint like this:

  • Boss Event Announce and Countdown
    • Events
      • Time - Boss_Event_Loop expires
    • Conditions
      • Boss_Events Equal to True
    • Actions
      • Set TempPoint = (Center of Boss Fight Area <gen>)
      • For each (Integer A) from 1 to 20, do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect at (TempPoint offset by 512.00 towards (18.00 x (Real((Integer A)))) degrees) using Doodads\Cityscape\Props\MagicRunes\MagicRunes0.mdl
          • Set Boss_Animation[(Integer A)] = (Last created special effect)
      • Custom script: call RemoveLocation(udg_TempPoint)


and in another trigger also:


  • Creep Event Announce and Countdown
    • Events
      • Time - Creep_Event_Loop expires
    • Conditions
      • Creep_Events Equal to True
    • Actions
      • Set TempPoint = (Center of Creep Fight Area <gen>)
      • For each (Integer A) from 1 to 20, do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect at (TempPoint offset by 512.00 towards (18.00 x (Real((Integer A)))) degrees) using Doodads\Cityscape\Props\MagicRunes\MagicRunes0.mdl
          • Set Creep_Animation[(Integer A)] = (Last created special effect)
      • Custom script: call RemoveLocation(udg_TempPoint)



And also i improved the triggers from my first post - what do you think about it now?



  • Boss Events Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Event_Timers[0] = 60.00
      • Set Event_Timers[1] = 20.00
      • Set Event_Timers[2] = 5.00
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set Event_Timers[(2 + (Integer A))] = 1.00




  • Boss Event Announce and Countdown
    • Events
      • Time - Boss_Event_Loop expires
    • Conditions
      • Boss_Events Equal to True
      • Boss_Status Equal to <Dead>
    • Actions
      • Set TempPoint = (Center of Boss Fight Area <gen>)
      • For each (Integer A) from 1 to 20, do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect at (TempPoint offset by 512.00 towards (18.00 x (Real((Integer A)))) degrees) using Doodads\Cityscape\Props\MagicRunes\MagicRunes0.mdl
          • Set Boss_Animation[(Integer A)] = (Last created special effect)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Set Boss_Status = coming
      • Game - Display to (All players) for 30.00 seconds the text: |cffffcc00BOSS EVEN...
      • Trigger - Turn on Boss Event Ping Loop <gen>
      • Trigger - Turn on Boss Event Timers <gen>
      • Set Event_Counter = 0
      • Countdown Timer - Start Boss_Announce_Timer as a One-shot timer that will expire in Event_Timers[Event_Counter] seconds




  • Boss Event Timers
    • Events
      • Time - Boss_Announce_Timer expires
    • Conditions
    • Actions
      • Set TempSum = 0.00
      • For each (Integer A) from 0 to Event_Counter, do (Actions)
        • Loop - Actions
          • Set TempSum = (TempSum + Event_Timers[(Integer A)])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Event_Counter Less than 2
        • Then - Actions
          • Game - Display to (All players) for 5.00 seconds the text: (|cffffcc00BOSS EVENT|r - Fight in + ((String((90.00 - TempSum))) + sec at the center of the map!))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Event_Counter Less than 7
            • Then - Actions
              • Game - Display to (All players) for 2.00 seconds the text: (|cffffcc00BOSS EVENT|r - + ((String((90.00 - TempSum))) + !))
            • Else - Actions
              • Game - Display to (All players) for 2.00 seconds the text: |cffffcc00BOSS EVEN...
              • Set Boss_Event_Fight_Side = 0
              • Set Boss_Event_Fight_Value = 0
              • Set Boss_Status = Fight!
              • Trigger - Turn on Boss Fight Points <gen>
      • Set Event_Counter = (Event_Counter + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Event_Counter Less than or equal to 7
        • Then - Actions
          • Countdown Timer - Start Boss_Announce_Timer as a One-shot timer that will expire in Event_Timers[Event_Counter] seconds
        • Else - Actions
          • Trigger - Turn off (This trigger)




  • Boss Event Ping Loop
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • Boss_Status Equal to coming
          • Boss_Status Equal to Fight!
    • Actions
      • Set TempPoint = (Center of Boss Fight Area <gen>)
      • Cinematic - Ping minimap for (All players) at TempPoint for 3.00 seconds, using a Simple ping of color (70.00%, 50.00%, 10.00%)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boss_Status Equal to <Dead>
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Do nothing



  • Boss Fight Points
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • Boss_Status Equal to Fight!
    • Actions
      • Set Boss_Event_Fight_Side = 0
      • Set Local_Side1_Counter = 0
      • Set Local_Side2_Counter = 0
      • Set TempPoint = (Center of Boss Fight Area <gen>)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 512.00 of TempPoint) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an ally of Player 9 (Gray)) Equal to True
              • ((Unit-type of (Picked unit)) is A Hero) Equal to True
            • Then - Actions
              • Set Local_Side1_Counter = -1
            • Else - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 512.00 of TempPoint) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an ally of Player 10 (Light Blue)) Equal to True
              • ((Unit-type of (Picked unit)) is A Hero) Equal to True
            • Then - Actions
              • Set Local_Side2_Counter = 1
            • Else - Actions
              • Do nothing
      • Set Boss_Event_Fight_Side = (Local_Side1_Counter + Local_Side2_Counter)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boss_Event_Fight_Side Less than 0
        • Then - Actions
          • Set Boss_Event_Fight_Value = (Boss_Event_Fight_Value - 1)
          • Floating Text - Create floating text that reads (|cffcc0000 + ((String((0 - Boss_Event_Fight_Value))) + |r!)) at (Center of Boss Fight Area <gen>) with Z offset 0.00, using font size 30.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 75.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 0.50 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.40 seconds
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boss_Event_Fight_Side Greater than 0
        • Then - Actions
          • Set Boss_Event_Fight_Value = (Boss_Event_Fight_Value + 1)
          • Floating Text - Create floating text that reads (|cff7EBFF1 + ((String(Boss_Event_Fight_Value)) + |r!)) at (Center of Boss Fight Area <gen>) with Z offset 0.00, using font size 30.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 75.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 0.50 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.40 seconds
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boss_Event_Fight_Side Less than 0
          • Boss_Event_Fight_Value Less than or equal to -10
        • Then - Actions
          • Set Boss_Event_Fight_Value = 0
          • Set Boss_Event_Fight_Side = 0
          • Set Boss_Status = <Dead>
          • Set TempPoint2 = (Position of Fortress[3])
          • Set TempPoint3 = (Center of Horde Fortress 2 <gen>)
          • Unit - Create 1 Unit_Ogre_Boss for Player 9 (Gray) at TempPoint facing TempPoint2
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
            • Loop - Actions
              • Unit - Add Ogre_Boss_Abilities[0] to (Picked unit)
              • Unit - Add Ogre_Boss_Abilities[1] to (Picked unit)
              • Unit - Add Ogre_Boss_Abilities[2] to (Picked unit)
              • Unit Group - Add (Picked unit) to Units_BlackrockClan
              • AI - Ignore (Picked unit)'s guard position
              • Unit - Order (Picked unit) to Attack-Move To TempPoint3
          • Custom script: call RemoveLocation(udg_TempPoint2)
          • Custom script: call RemoveLocation(udg_TempPoint3)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Creeps_Group_Fight_Side[(Integer A)] Greater than 0
              • Creeps_Region_Fight_Value[(Integer A)] Greater than or equal to 10
            • Then - Actions
              • Set Boss_Event_Fight_Value = 0
              • Set Boss_Event_Fight_Side = 0
              • Set Boss_Status = <Dead>
              • Set TempPoint2 = (Position of Fortress[0])
              • Set TempPoint3 = (Center of Horde Fortress 1 <gen>)
              • Unit - Create 1 Unit_Ogre_Boss for Player 10 (Light Blue) at TempPoint facing TempPoint2
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
                • Loop - Actions
                  • Unit - Add Ogre_Boss_Abilities[0] to (Picked unit)
                  • Unit - Add Ogre_Boss_Abilities[1] to (Picked unit)
                  • Unit - Add Ogre_Boss_Abilities[2] to (Picked unit)
                  • Unit Group - Add (Picked unit) to Units_BlackToothGrinClan
                  • AI - Ignore (Picked unit)'s guard position
                  • Unit - Order (Picked unit) to Attack-Move To TempPoint3
              • Custom script: call RemoveLocation(udg_TempPoint2)
              • Custom script: call RemoveLocation(udg_TempPoint3)
            • Else - Actions
              • Do nothing
      • Custom script: call RemoveLocation(udg_TempPoint)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boss_Status Equal to <Dead>
        • Then - Actions
          • For each (Integer A) from 1 to 20, do (Actions)
            • Loop - Actions
              • Special Effect - Destroy Boss_Animation[(Integer A)]
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Do nothing




Edit:
Next Question - Does this also leak?
And does it make sense here to use bj_wantDestroyGroup?

I will have to repeat these lines for 12 groups. each group will have another offset and other points (targets). maybe i could also just make it with a "For loop" and restructure the whole trigger?


  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set TempPoint = (Center of Horde 1 N <gen>)
      • Set TempPoint2 = (Center of Fortress 1 <gen>)
      • Unit - Create N_Grunts[0] Unit_Grunt for Player 9 (Gray) at (TempPoint offset by 200.00 towards 90.00 degrees) facing 90.00 degrees
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
        • Loop - Actions
          • AI - Ignore (Picked unit)'s guard position
          • Unit - Order (Picked unit) to Attack-Move To TempPoint2
          • Unit Group - Add (Picked unit) to Units_BC_Dir[0]
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
 
Last edited:
Status
Not open for further replies.
Top