• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Does this Trigger LEAK?

Status
Not open for further replies.
Level 8
Joined
Jul 17, 2004
Messages
283
Is my trigger leak free? Does that 'Game - Display to Player Group' function leak? If so, how do I fix the leak?

  • Hire Squire Red
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Hire Squire
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 (Red) Food used) Equal to 4
        • Then - Actions
          • Game - Display to Player Group - Player 1 (Red) for 0.50 seconds the text: |cffffcc00You can o...
          • Game - Display to Player Group - Player 1 (Red) for 0.50 seconds the text:
        • Else - Actions
          • Set TempPoint = (Position of Recruiter)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SoldierRED[1] Equal to No unit
            • Then - Actions
              • Set TempUnitGroup = (Units in JOBS RED GROUP1 <gen> matching ((Unit-type of (Matching unit)) Equal to Squire))
              • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
                • Loop - Actions
                  • Player - Set Player 1 (Red) Food used to ((Player 1 (Red) Food used) + 1)
                  • Set SoldierRED[1] = (Picked unit)
                  • Unit - Move SoldierRED[1] instantly to TempPoint, facing 270.00 degrees
                  • Special Effect - Create a special effect attached to the origin of SoldierRED[1] using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
                  • Special Effect - Destroy (Last created special effect)
              • Custom script: call DestroyGroup(udg_TempUnitGroup)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SoldierRED[2] Equal to No unit
                • Then - Actions
                  • Set TempUnitGroup = (Units in JOBS RED GROUP2 <gen> matching ((Unit-type of (Matching unit)) Equal to Squire))
                  • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
                    • Loop - Actions
                      • Player - Set Player 1 (Red) Food used to ((Player 1 (Red) Food used) + 1)
                      • Set SoldierRED[2] = (Picked unit)
                      • Unit - Move SoldierRED[2] instantly to TempPoint, facing 270.00 degrees
                      • Special Effect - Create a special effect attached to the origin of SoldierRED[2] using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
                      • Special Effect - Destroy (Last created special effect)
                  • Custom script: call DestroyGroup(udg_TempUnitGroup)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SoldierRED[3] Equal to No unit
                    • Then - Actions
                      • Set TempUnitGroup = (Units in JOBS RED GROUP3 <gen> matching ((Unit-type of (Matching unit)) Equal to Squire))
                      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
                        • Loop - Actions
                          • Player - Set Player 1 (Red) Food used to ((Player 1 (Red) Food used) + 1)
                          • Set SoldierRED[3] = (Picked unit)
                          • Unit - Move SoldierRED[3] instantly to TempPoint, facing 270.00 degrees
                          • Special Effect - Create a special effect attached to the origin of SoldierRED[3] using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
                          • Special Effect - Destroy (Last created special effect)
                      • Custom script: call DestroyGroup(udg_TempUnitGroup)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • SoldierRED[4] Equal to No unit
                        • Then - Actions
                          • Set TempUnitGroup = (Units in JOBS RED GROUP4 <gen> matching ((Unit-type of (Matching unit)) Equal to Squire))
                          • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
                            • Loop - Actions
                              • Player - Set Player 1 (Red) Food used to ((Player 1 (Red) Food used) + 1)
                              • Set SoldierRED[4] = (Picked unit)
                              • Unit - Move SoldierRED[4] instantly to TempPoint, facing 270.00 degrees
                              • Special Effect - Create a special effect attached to the origin of SoldierRED[4] using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
                              • Special Effect - Destroy (Last created special effect)
                          • Custom script: call DestroyGroup(udg_TempUnitGroup)
                        • Else - Actions
      • Custom script: call RemoveLocation( udg_TempPoint)
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
Your trigger is fine, Game - display text is fine if you use it directly with Player 1/2/3 etc and All Players.
 
Level 8
Joined
Jul 17, 2004
Messages
283
no it doesnt leak. u should learn how to combine things a little more. it would make coding so much nicer.

I don't know what you mean. I thought this was the most efficient way to do this trigger.







Thanks for the help guys! Glad to know my trigger is leakless.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
It doesn't leak, but it's a resource-wasting way of coding.

There are ways to achieve a better, faster, smoother result, like what deathismyfriend suggested.
 
Status
Not open for further replies.
Top