[Trigger] Would these leak?

Level 13
Joined
Oct 27, 2008
Messages
1,176
  • Die 1 1to8
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Barracks
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (1 1 <gen> contains (Position of (Triggering unit))) Equal to True
        • Then - Actions
          • Set Barracks64[1] = False
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (1 2 <gen> contains (Position of (Triggering unit))) Equal to True
            • Then - Actions
              • Set Barracks64[2] = False
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (1 3 <gen> contains (Position of (Triggering unit))) Equal to True
                • Then - Actions
                  • Set Barracks64[3] = False
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (1 4 <gen> contains (Position of (Triggering unit))) Equal to True
                    • Then - Actions
                      • Set Barracks64[4] = False
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (1 5 <gen> contains (Position of (Triggering unit))) Equal to True
                        • Then - Actions
                          • Set Barracks64[5] = False
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (1 6 <gen> contains (Position of (Triggering unit))) Equal to True
                            • Then - Actions
                              • Set Barracks64[6] = False
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (1 7 <gen> contains (Position of (Triggering unit))) Equal to True
                                • Then - Actions
                                  • Set Barracks64[7] = False
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (1 8 <gen> contains (Position of (Triggering unit))) Equal to True
                                    • Then - Actions
                                      • Set Barracks64[8] = False
                                    • Else - Actions
  • R Units
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
      • (Barracks 0016 <gen> is alive) Equal to True
    • Actions
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type Barracks) and do (Unit - Order (Picked unit) to train/upgrade to a Footman)
Do any of those leak?
This map alone may cause a good chunk of lag so any leaks i can fix would make this map run a bit better
 
Last edited:
Level 6
Joined
Aug 19, 2006
Messages
187
create a variable of type point called "temppoint" or what you want

then add to the trigger at the beginning

set temppoint = Position of TriggeringUnit
or
set temppoint = Center of Region xy
and at the end
custom script: call RemoveLocation(udg_temppoint)



and to remove the group leak use before you group the units
custom script: set bj_wantDestroyGroup = true
 
Level 13
Joined
Oct 27, 2008
Messages
1,176
  • R Builder
    • Events
      • Player - Player 1 (Red)'s Current lumber becomes Equal to 100.00
    • Conditions
    • Actions
      • Player - Set Player 1 (Red) Current lumber to 0
      • Unit - Create 1 Builder for Player 1 (Red) at (Center of 1 1 <gen>) facing Default building facing degrees
      • Set TempPoint = (Position of (Last created unit))
      • Custom script: call RemoveLocation(udg_TempPoint)
I Downloaded the leak check tool
The variable is removed but it says it still leaks
 
Level 13
Joined
Oct 27, 2008
Messages
1,176
Ok well all the builder triggers are done now
thank you
just need to figure out the other 2 now

  • R Units
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
      • (Barracks 0016 <gen> is alive) Equal to ((Triggering unit) is selected by Player 1 (Red))
    • Actions
      • Set UnitGroup[1] = (Units in (Playable map area))
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type Barracks) and do (Unit - Order (Picked unit) to train/upgrade to a Footman)
      • Custom script: call DestroyGroup (udg_UnitGroup[1])
Where did i mess up?
Variable is removed but not the leak again
 
Level 15
Joined
Mar 31, 2009
Messages
1,397
(Barracks 0016 <gen> is alive) Equal to ((Triggering unit) is selected by Player 1 (Red))

That condition is messed up and the trigger won't go go go, and the unit group isn't doing anything.....

Here's what might work:
  • R units
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
      • ((Barracks 0016 <gen>) is alive) Equal to True
      • ((Barracks 0016 <gen>) is selected by Player 1 (Red)) Equal to True
    • Actions
      • Set UnitGroup[1] = (Units owned by Player 1 (Red) of type Barracks)
      • Unit Group - Pick every unit in TUnitGroup[1] and do (Unit - Order (Picked unit) to train/upgrade to a Footman)
      • Custom script: call DestroyGroup (udg_UnitGroup[1])
 
Level 13
Joined
Oct 27, 2008
Messages
1,176
  • B Units
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
      • (Barracks 0017 <gen> is alive) Equal to True
    • Actions
      • Unit Group - Pick every unit in (Units owned by Player 2 (Blue) of type Barracks) and do (Unit - Order (Picked unit) to train/upgrade to a Footman)
How would i make this not leak?
 
Level 13
Joined
Oct 27, 2008
Messages
1,176
so no arrays?
cuz there is 4 players in the map
Whenever that trigger goes off it causes lag big time
it causes all the units to stop moveing for a second
and that is going to cause problems with the trigger i still have to make that sends all of the players units to one of the corners to attack all units
 
Last edited:
Level 15
Joined
Mar 31, 2009
Messages
1,397
Did no one read my post.......

Mine is an Array

  • R units
  • Events
  • Time - Every 5.00 seconds of game time
  • Conditions
  • ((Barracks 0016 <gen>) is alive) Equal to True
  • Actions
  • Set UnitGroup[1] = (Units owned by Player 1 (Red) of type Barracks)
  • Unit Group - Pick every unit in TUnitGroup[1] and do (Unit - Order (Picked unit) to train/upgrade to a Footman)
  • Custom script: call DestroyGroup (udg_UnitGroup[1])
And For Blue:

  • B units
  • Events
  • Time - Every 5.00 seconds of game time
  • Conditions
  • ((Barracks 0017 <gen>) is alive) Equal to True
  • Actions
  • Set UnitGroup[2] = (Units owned by Player 2 (Blue) of type Barracks)
  • Unit Group - Pick every unit in UnitGroup[2] and do (Unit - Order (Picked unit) to train/upgrade to a Footman)
  • Custom script: call DestroyGroup (udg_UnitGroup[2])
Just set the Color and Array# for each player

In other words, Red=UnitGroup[1], Blue=UnitGroup[2], Teal==UnitGroup[3], etc etc

And for my next trick, I'll pull a Grunt out of a hat!

{EDIT}
Greasontim, did you mean mine or Illidan(Evil)X

Make new posts instead of editing old ones, it confuzzulating
 
Last edited by a moderator:
Level 16
Joined
Oct 12, 2008
Messages
1,570
No do not make new posts instead of editing old ones!
Making new posts while the last one was yours is against the rules!
What is with that array? Why do you need a trigger for every player?
  • Events
    • Time - Every 5 seconds of the game
  • Conditions
  • Actions
    • If (All Conditions are True) Then
      • If (Conditions)
        • Barracks 0016 <gen> is alive equal to true
      • Then (actions)
        • Custom Script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units owned by Player 1 of type Barracks) and do(Unit - Order (Picked Unit) to train footman)
      • Else (Actions)
    • If (All Conditions are True) Then
      • If (Conditions)
        • Barracks 0017 <gen> is alive equal to true
      • Then (actions)
        • Custom Script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units owned by Player 2 of type Barracks) and do(Unit - Order (Picked Unit) to train footman)
      • Else (Actions)
    • If (All Conditions are True) Then
      • If (Conditions)
        • Barracks 0018 <gen> is alive equal to true
      • Then (actions)
        • Custom Script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units owned by Player 3 of type Barracks) and do(Unit - Order (Picked Unit) to train footman)
      • Else (Actions)
    • If (All Conditions are True) Then
      • If (Conditions)
        • Barracks 0019 <gen> is alive equal to true
      • Then (actions)
        • Custom Script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units owned by Player 4 of type Barracks) and do(Unit - Order (Picked Unit) to train footman)
      • Else (Actions)
that should work
 
Top