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

Leaderboard issue!

Level 10
Joined
Jun 20, 2017
Messages
333
Hello,
I have a weird problem with my leaderboard!
Where if you buy a unit, the purchased unit will then change ownership and move to some locations!
However my problem is that the leaderboard is not counting correctly!
For example, the first round spawns 36 units, and I bought 3 units
The leaderboard should show West mobs to 36 and East mobs to 3! (Since there are no players on the other team, there should be no spawning units except the summoned unit). But instead it adds 3 purchased units to the western mob and counts some for the eastern mob!
  • Setup Leaderboard
    • Events
      • Time - Elapsed game time is 0.02 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled <Empty String>
      • Set VariableSet LastCreatedLeaderboard = (Last created leaderboard)
      • -------- --------
      • Leaderboard - Add Player 13 (Maroon) to LastCreatedLeaderboard with label |cffffffffWest mobs... and value 0
      • Leaderboard - Change the color of the value for Player 13 (Maroon) in LastCreatedLeaderboard to (100.00%, 80.00%, 20.00%) with 0.00% transparency
      • Leaderboard - Add Player 18 (Peach) to LastCreatedLeaderboard with label |cffffffffEast mobs... and value 0
      • Leaderboard - Change the color of the value for Player 18 (Peach) in LastCreatedLeaderboard to (100.00%, 80.00%, 20.00%) with 0.00% transparency
      • -------- --------
      • Leaderboard - Show LastCreatedLeaderboard
  • West Summon
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Selling unit) Equal to Barracks (Summon 1-12) 0216 <gen>
    • Actions
      • Set VariableSet BuyingUnit = (Buying unit)
      • Set VariableSet SoldUnit = (Sold unit)
      • Set VariableSet Integers_SummonCount[1] = (Integers_SummonCount[1] + 1)
      • -------- --------
      • Set VariableSet RandomPointInRegion = (Random point in west summon <gen>)
      • Unit - Move SoldUnit instantly to RandomPointInRegion, facing Default building facing degrees
      • Unit - Change ownership of SoldUnit to Player 13 (Maroon) and Retain color
      • Unit - Set the custom value of SoldUnit to (Player number of (Owner of BuyingUnit))
      • Unit Group - Add SoldUnit to UnitGroup_Summon
      • Unit Group - Add SoldUnit to UnitGroups_TeamSummons[2]
      • Custom script: call RemoveLocation(udg_RandomPointInRegion)
  • East Summon
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Selling unit) Equal to Barracks (Summon 1-12) 0217 <gen>
    • Actions
      • Set VariableSet BuyingUnit = (Buying unit)
      • Set VariableSet SoldUnit = (Sold unit)
      • Set VariableSet Integers_SummonCount[2] = (Integers_SummonCount[2] + 1)
      • -------- --------
      • Set VariableSet RandomPointInRegion = (Random point in east summon <gen>)
      • Unit - Move SoldUnit instantly to RandomPointInRegion, facing Default building facing degrees
      • Unit - Change ownership of SoldUnit to Player 18 (Peach) and Retain color
      • Unit - Set the custom value of SoldUnit to (Player number of (Owner of BuyingUnit))
      • Unit Group - Add SoldUnit to UnitGroup_Summon
      • Unit Group - Add SoldUnit to UnitGroups_TeamSummons[1]
      • Custom script: call RemoveLocation(udg_RandomPointInRegion)
  • Summon Pathing
    • Events
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in east summon big <gen>) and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to Points_CreepSpawn[(Random integer number between 1 and 6)], facing Default building facing degrees
          • Unit Group - Add (Picked unit) to UnitGroup_Creep
          • Unit Group - Add (Picked unit) to UnitGroups_TeamCreeps[1]
          • Unit Group - Add (Picked unit) to UnitGroups_PlayerCreeps[(Player number of (Owner of (Picked unit)))]
      • -------- --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in west summon big <gen>) and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to Points_CreepSpawn[(Random integer number between 7 and 12)], facing Default building facing degrees
          • Unit Group - Add (Picked unit) to UnitGroup_Creep
          • Unit Group - Add (Picked unit) to UnitGroups_TeamCreeps[2]
          • Unit Group - Add (Picked unit) to UnitGroups_PlayerCreeps[(Player number of (Owner of (Picked unit)))]
  • Next Level
    • Events
      • Time - Timer_LevelBegins expires
    • Conditions
    • Actions
      • -------- Run this trigger whenever you want to start the next level. --------
      • -------- --------
      • -------- Update the spawn player groups to prevent leavers from spawning creeps from this point on: --------
      • -------- ( If you Remove them while Creep Spawn is still happening it will break things!!! ) --------
      • Player Group - Pick every player in PlayerGroups_CreepTeam1 and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) slot status) Equal to Has left the game
            • Then - Actions
              • Player Group - Remove (Picked player) from PlayerGroups_CreepTeam1.
            • Else - Actions
      • Player Group - Pick every player in PlayerGroups_CreepTeam2 and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) slot status) Equal to Has left the game
            • Then - Actions
              • Player Group - Remove (Picked player) from PlayerGroups_CreepTeam2.
            • Else - Actions
      • -------- --------
      • Set VariableSet Integer_CurrentLevel = (Integer_CurrentLevel + 1)
      • -------- --------
      • -------- Reset the counter that tracks how many times the Creep Spawn timer has repeated: --------
      • Set VariableSet Integer_CreepCounter = 0
      • -------- --------
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in UnitGroups_TeamCreeps[1].) Equal to True
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Leaderboard - Change the value for Player 18 (Peach) in LastCreatedLeaderboard to (Integers_CreepCount[Integer_CurrentLevel] + Integers_SummonCount[1])
            • Else - Actions
              • Leaderboard - Change the value for Player 13 (Maroon) in LastCreatedLeaderboard to (Integers_CreepCount[Integer_CurrentLevel] + Integers_SummonCount[2])
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in UnitGroups_TeamCreeps[2].) Equal to True
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Leaderboard - Change the value for Player 13 (Maroon) in LastCreatedLeaderboard to ((Number of units in UnitGroups_TeamCreeps[1]) + Integers_SummonCount[2])
            • Else - Actions
              • Leaderboard - Change the value for Player 18 (Peach) in LastCreatedLeaderboard to ((Number of units in UnitGroups_TeamCreeps[2]) + Integers_SummonCount[1])
      • -------- --------
      • Countdown Timer - Start Timer_Spawn as a Repeating timer that will expire in 0.10 seconds
      • -------- --------
      • Trigger - Run Summon Pathing <gen> (ignoring conditions)
  • Creep Dies Level Ends
    • Events
      • Unit - A unit Dies
    • Conditions
      • Boolean_Arena Equal to False
      • Or - Any (Conditions) are true
        • Conditions
          • (Level of Spawn Classification for (Triggering unit)) Greater than 0
          • (Level of Summon Classification for (Triggering unit)) Greater than 0
    • Actions
      • Set VariableSet Integer_CreepRemaining = (Integer_CreepRemaining - 1)
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in UnitGroups_TeamCreeps[1].) Equal to True
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Leaderboard - Change the value for Player 18 (Peach) in LastCreatedLeaderboard to Integer_CreepRemaining
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Integer_CreepRemaining Less than 0
                • Then - Actions
                  • Set VariableSet Integer_CreepRemaining = 0
                • Else - Actions
            • Else - Actions
              • Leaderboard - Change the value for Player 13 (Maroon) in LastCreatedLeaderboard to Integer_CreepRemaining
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Integer_CreepRemaining Less than 0
                • Then - Actions
                  • Set VariableSet Integer_CreepRemaining = 0
                • Else - Actions
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in UnitGroups_TeamCreeps[2].) Equal to True
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Leaderboard - Change the value for Player 13 (Maroon) in LastCreatedLeaderboard to Integer_CreepRemaining
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Integer_CreepRemaining Less than 0
                • Then - Actions
                  • Set VariableSet Integer_CreepRemaining = 0
                • Else - Actions
            • Else - Actions
              • Leaderboard - Change the value for Player 18 (Peach) in LastCreatedLeaderboard to Integer_CreepRemaining
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Integer_CreepRemaining Less than 0
                • Then - Actions
                  • Set VariableSet Integer_CreepRemaining = 0
                • Else - Actions
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_CreepRemaining Equal to 0
        • Then - Actions
          • Set VariableSet Integer_CreepRemaining = 0
          • -------- Run "Next Level" when all of the spawned units have died --------
          • -------- --------
          • -------- Arena start --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • Integer_CurrentLevel Equal to 10
                  • Integer_CurrentLevel Equal to 20
            • Then - Actions
              • Set VariableSet Boolean_Arena = True
              • -------- --------
              • Countdown Timer - Start Timer_LevelBegins as a One-shot timer that will expire in 30.00 seconds
              • Countdown Timer - Change the title of TimerWindow_LevelBegins to Arena Battle in
              • Game - Display to (All players) for 10.00 seconds the text: You have |cffffcc00...
            • Else - Actions
              • Countdown Timer - Hide TimerWindow_GameBegins
              • Countdown Timer - Destroy TimerWindow_GameBegins
              • Countdown Timer - Hide TimerWindow_LevelBegins
              • Countdown Timer - Destroy TimerWindow_LevelBegins
              • Countdown Timer - Start Timer_LevelBegins as a One-shot timer that will expire in Reals_Spawn_Preparation[(Integer_CurrentLevel + 1)] seconds
              • Countdown Timer - Create a timer window for Timer_LevelBegins with title (Level + ((String((Integer_CurrentLevel + 1))) + in))
              • Set VariableSet TimerWindow_LevelBegins = (Last created timer window)
              • Countdown Timer - Show TimerWindow_LevelBegins
              • Game - Display to (All players) for 10.00 seconds the text: (((You have |cffffcc00 + (String(Reals_Spawn_Preparation[(Integer_CurrentLevel + 1)]))) + |r seconds until level |cffffcc00) + ((String((Integer_CurrentLevel + 1))) + |r begins.))
        • Else - Actions

Edit,
I know I could simply use this, but I don't like this method because if a unit returns to its spawn location, it counts again!
  • west
    • Events
      • Unit - A unit enters p1 <gen>
      • Unit - A unit enters p2 <gen>
      • Unit - A unit enters p3 <gen>
      • Unit - A unit enters p4 <gen>
      • Unit - A unit enters p5 <gen>
      • Unit - A unit enters p6 <gen>
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Level of Spawn Classification for (Triggering unit)) Greater than 0
          • (Level of Summon Classification for (Triggering unit)) Greater than 0
    • Actions
      • Set VariableSet Integer_CreepRemaining = (Integer_CreepRemaining + 1)
      • -------- --------
      • Leaderboard - Change the value for Player 13 (Maroon) in LastCreatedLeaderboard to Integer_CreepRemaining
  • east
    • Events
      • Unit - A unit enters p7 <gen>
      • Unit - A unit enters p8 <gen>
      • Unit - A unit enters p9 <gen>
      • Unit - A unit enters p10 <gen>
      • Unit - A unit enters p11 <gen>
      • Unit - A unit enters p12 <gen>
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Level of Spawn Classification for (Triggering unit)) Greater than 0
          • (Level of Summon Classification for (Triggering unit)) Greater than 0
    • Actions
      • Set VariableSet Integer_CreepRemaining = (Integer_CreepRemaining + 1)
      • -------- --------
      • Leaderboard - Change the value for Player 18 (Peach) in LastCreatedLeaderboard to Integer_CreepRemaining

Edit,
What did I do wrong here?! I think it should work fine but it doesn't!?
It counts the number of units purchased (which is 12), but not the number of creeps that spawned (which is 36).
  • Setup Leaderboard
    • Events
      • Time - Elapsed game time is 0.02 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled <Empty String>
      • Set VariableSet LastCreatedLeaderboard = (Last created leaderboard)
      • -------- --------
      • Leaderboard - Add Player 13 (Maroon) to LastCreatedLeaderboard with label |cffffffffWest mobs... and value 0
      • Leaderboard - Change the color of the value for Player 13 (Maroon) in LastCreatedLeaderboard to (100.00%, 80.00%, 20.00%) with 0.00% transparency
      • Leaderboard - Add Player 18 (Peach) to LastCreatedLeaderboard with label |cffffffffEast mobs... and value 0
      • Leaderboard - Change the color of the value for Player 18 (Peach) in LastCreatedLeaderboard to (100.00%, 80.00%, 20.00%) with 0.00% transparency
      • -------- --------
      • Leaderboard - Show LastCreatedLeaderboard
  • Creep Spawn
    • Events
      • Time - Timer_Spawn expires
    • Conditions
    • Actions
      • -------- Get the computer players that the units should spawn for: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_CreepComputerIndex Greater than or equal to Integer_TotalCreepComputer
        • Then - Actions
          • Set VariableSet Integer_CreepComputerIndex = 0
        • Else - Actions
      • Set VariableSet Integer_CreepComputerIndex = (Integer_CreepComputerIndex + 1)
      • -------- --------
      • -------- Create units for Team 1 --------
      • Set VariableSet Player_CreepComputer = Players_CreepComputerTeam2[Integer_CreepComputerIndex]
      • Player Group - Pick every player in PlayerGroups_CreepTeam1 and do (Actions)
        • Loop - Actions
          • Set VariableSet Integer_CreepLoop = (Player number of (Picked player))
          • -------- --------
          • Unit - Create 1 UnitTypes_Creep[Integer_CurrentLevel] for Player_CreepComputer at Points_CreepSpawn[Integer_CreepLoop] facing Default building facing degrees
          • Set VariableSet Unit_CreepA = (Last created unit)
          • Set VariableSet Integer_CreepCustomValueA = (Custom value of Unit_CreepA)
          • Unit Group - Add Unit_CreepA to UnitGroup_A
          • Unit Group - Add Unit_CreepA to UnitGroup_Creep
          • Unit Group - Add Unit_CreepA to UnitGroups_TeamCreeps[1]
          • Unit - Order Unit_CreepA to Attack-Move To Points_CreepMoveTo[Integer_CreepLoop]
          • -------- --------
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in UnitGroup_A and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                • Then - Actions
                  • Set VariableSet Integer_CreepRemainingA = (Integer_CreepRemainingA + 1)
                  • Leaderboard - Change the value for Player 13 (Maroon) in LastCreatedLeaderboard to Integer_CreepRemainingA
                • Else - Actions
      • -------- --------
      • -------- Create units for Team 2 --------
      • Set VariableSet Player_CreepComputer = Players_CreepComputerTeam1[Integer_CreepComputerIndex]
      • Player Group - Pick every player in PlayerGroups_CreepTeam2 and do (Actions)
        • Loop - Actions
          • Set VariableSet Integer_CreepLoop = (Player number of (Picked player))
          • -------- --------
          • Unit - Create 1 UnitTypes_Creep[Integer_CurrentLevel] for Player_CreepComputer at Points_CreepSpawn[Integer_CreepLoop] facing Default building facing degrees
          • Set VariableSet Unit_CreepB = (Last created unit)
          • Set VariableSet Integer_CreepCustomValueB = (Custom value of Unit_CreepB)
          • Unit Group - Add Unit_CreepB to UnitGroup_B
          • Unit Group - Add Unit_CreepB to UnitGroup_Creep
          • Unit Group - Add Unit_CreepB to UnitGroups_TeamCreeps[2]
          • Unit - Order Unit_CreepB to Attack-Move To Points_CreepMoveTo[Integer_CreepLoop]
          • -------- --------
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in UnitGroup_B and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                • Then - Actions
                  • Set VariableSet Integer_CreepRemainingB = (Integer_CreepRemainingB + 1)
                  • Leaderboard - Change the value for Player 18 (Peach) in LastCreatedLeaderboard to Integer_CreepRemainingB
                • Else - Actions
      • -------- --------
      • -------- Check if all of the units have spawned --------
      • Set VariableSet Integer_CreepCounter = (Integer_CreepCounter + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_CreepCounter Equal to Integers_CreepCount[Integer_CurrentLevel]
        • Then - Actions
          • Countdown Timer - Pause Timer_Spawn
        • Else - Actions
  • West Summon
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Selling unit) Equal to Barracks (Summon 1-12) 0216 <gen>
    • Actions
      • Set VariableSet SoldUnitA = (Sold unit)
      • Unit Group - Add SoldUnitA to UnitGroup_B
      • -------- --------
      • Set VariableSet RandomPointInRegion = (Random point in west summon <gen>)
      • Unit - Move SoldUnitA instantly to RandomPointInRegion, facing Default building facing degrees
      • Unit - Change ownership of SoldUnitA to Player 13 (Maroon) and Retain color
      • Custom script: call RemoveLocation(udg_RandomPointInRegion)
  • East Summon
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Selling unit) Equal to Barracks (Summon 1-12) 0217 <gen>
    • Actions
      • Set VariableSet SoldUnitB = (Sold unit)
      • Unit Group - Add SoldUnitB to UnitGroup_A
      • -------- --------
      • Set VariableSet RandomPointInRegion = (Random point in east summon <gen>)
      • Unit - Move SoldUnitB instantly to RandomPointInRegion, facing Default building facing degrees
      • Unit - Change ownership of SoldUnitB to Player 18 (Peach) and Retain color
      • Custom script: call RemoveLocation(udg_RandomPointInRegion)
 

Attachments

  • Always Spawn System 4.w3m
    48.2 KB · Views: 3
  • Screenshot_1.png
    Screenshot_1.png
    1.7 MB · Views: 6
Last edited:
Level 19
Joined
Aug 16, 2007
Messages
881
I assume the Unit Groups are the issue.

Unit Group array in GUI is a trap as no index other than 0 and 1 will actually work by default.
In order to use any other index you'll have to create and assign the group yourself with custom script.

  • Actions
    • Custom script: set udg_UnitGroups_TeamCreeps[2] = CreateGroup()
    • Custom script: set udg_UnitGroups_PlayerCreeps[2] = CreateGroup()
    • Custom script: set udg_UnitGroups_TeamSummons[2] = CreateGroup()
If the group isn't created you'll add units to a non-existent group and any
  • ((Picked unit) is in UnitGroups_TeamCreeps[2].) Equal to True
returns false.

For info this is how the map initializes one of the above variables during map loading:
JASS:
    set i=0
    loop
        exitwhen ( i > 1 )
        set udg_UnitGroups_TeamSummons[i]=CreateGroup()
        set i=i + 1
    endloop
as you can see it will only assign indexes 0 and 1 to a group.
 
Level 10
Joined
Jun 20, 2017
Messages
333
Thanks, now it counts correctly.
Well, I have a problem with subtract from it! it doesn't work at all!
  • West Summon
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Selling unit) Equal to Barracks (Summon 1-12) 0216 <gen>
    • Actions
      • Set VariableSet SoldUnits[1] = (Sold unit)
      • Unit Group - Add SoldUnits[1] to UnitGroups[2]
      • -------- --------
      • Set VariableSet RandomPointInRegion = (Random point in west summon <gen>)
      • Unit - Move SoldUnits[1] instantly to RandomPointInRegion, facing Default building facing degrees
      • Unit - Change ownership of SoldUnits[1] to Player 13 (Maroon) and Retain color
      • Custom script: call RemoveLocation(udg_RandomPointInRegion)
  • East Summon
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Selling unit) Equal to Barracks (Summon 1-12) 0217 <gen>
    • Actions
      • Set VariableSet SoldUnits[2] = (Sold unit)
      • Unit Group - Add SoldUnits[2] to UnitGroups[1]
      • -------- --------
      • Set VariableSet RandomPointInRegion = (Random point in east summon <gen>)
      • Unit - Move SoldUnits[2] instantly to RandomPointInRegion, facing Default building facing degrees
      • Unit - Change ownership of SoldUnits[2] to Player 18 (Peach) and Retain color
      • Custom script: call RemoveLocation(udg_RandomPointInRegion)
  • Creep Spawn
    • Events
      • Time - Timer_Spawn expires
    • Conditions
    • Actions
      • Custom script: set udg_UnitGroups_TeamCreeps[1] = CreateGroup()
      • Custom script: set udg_UnitGroups_TeamCreeps[2] = CreateGroup()
      • -------- --------
      • -------- Get the computer players that the units should spawn for: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_CreepComputerIndex Greater than or equal to Integer_TotalCreepComputer
        • Then - Actions
          • Set VariableSet Integer_CreepComputerIndex = 0
        • Else - Actions
      • Set VariableSet Integer_CreepComputerIndex = (Integer_CreepComputerIndex + 1)
      • -------- --------
      • -------- Create units for Team 1 --------
      • Set VariableSet Player_CreepComputer = Players_CreepComputerTeam2[Integer_CreepComputerIndex]
      • Player Group - Pick every player in PlayerGroups_CreepTeam1 and do (Actions)
        • Loop - Actions
          • Set VariableSet Integer_CreepLoop = (Player number of (Picked player))
          • -------- --------
          • Unit - Create 1 UnitTypes_Creep[Integer_CurrentLevel] for Player_CreepComputer at Points_CreepSpawn[Integer_CreepLoop] facing Default building facing degrees
          • Set VariableSet Units_Creep[1] = (Last created unit)
          • Unit Group - Add Units_Creep[1] to UnitGroup_Creep
          • Unit Group - Add Units_Creep[1] to UnitGroups_TeamCreeps[1]
          • Unit - Order Units_Creep[1] to Attack-Move To Points_CreepMoveTo[Integer_CreepLoop]
      • -------- --------
      • -------- Create units for Team 2 --------
      • Set VariableSet Player_CreepComputer = Players_CreepComputerTeam1[Integer_CreepComputerIndex]
      • Player Group - Pick every player in PlayerGroups_CreepTeam2 and do (Actions)
        • Loop - Actions
          • Set VariableSet Integer_CreepLoop = (Player number of (Picked player))
          • -------- --------
          • Unit - Create 1 UnitTypes_Creep[Integer_CurrentLevel] for Player_CreepComputer at Points_CreepSpawn[Integer_CreepLoop] facing Default building facing degrees
          • Set VariableSet Units_Creep[2] = (Last created unit)
          • Unit Group - Add Units_Creep[2] to UnitGroup_Creep
          • Unit Group - Add Units_Creep[2] to UnitGroups_TeamCreeps[2]
          • Unit - Order Units_Creep[2] to Attack-Move To Points_CreepMoveTo[Integer_CreepLoop]
      • -------- --------
      • -------- --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in UnitGroups[1] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Set VariableSet Integers_CreepRemaining[1] = (Integers_CreepRemaining[1] + 1)
              • Leaderboard - Change the value for Player 13 (Maroon) in LastCreatedLeaderboard to Integers_CreepRemaining[1]
            • Else - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in UnitGroups_TeamCreeps[1] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Set VariableSet Integers_CreepRemaining[1] = (Integers_CreepRemaining[1] + 1)
              • Leaderboard - Change the value for Player 13 (Maroon) in LastCreatedLeaderboard to Integers_CreepRemaining[1]
            • Else - Actions
      • -------- --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in UnitGroups[2] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Set VariableSet Integers_CreepRemaining[2] = (Integers_CreepRemaining[2] + 1)
              • Leaderboard - Change the value for Player 18 (Peach) in LastCreatedLeaderboard to Integers_CreepRemaining[2]
            • Else - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in UnitGroups_TeamCreeps[2] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Set VariableSet Integers_CreepRemaining[2] = (Integers_CreepRemaining[2] + 1)
              • Leaderboard - Change the value for Player 18 (Peach) in LastCreatedLeaderboard to Integers_CreepRemaining[2]
            • Else - Actions
      • -------- --------
      • -------- --------
      • -------- Check if all of the units have spawned --------
      • Set VariableSet Integer_CreepCounter = (Integer_CreepCounter + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_CreepCounter Equal to Integers_CreepCount[Integer_CurrentLevel]
        • Then - Actions
          • Countdown Timer - Pause Timer_Spawn
        • Else - Actions
  • Creep Dies Level Ends
    • Events
      • Unit - A unit Dies
    • Conditions
      • Boolean_Arena Equal to False
      • Or - Any (Conditions) are true
        • Conditions
          • (Level of Spawn Classification for (Triggering unit)) Greater than 0
          • (Level of Summon Classification for (Triggering unit)) Greater than 0
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in UnitGroups[1] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to False
            • Then - Actions
              • Set VariableSet Integers_CreepRemaining[1] = (Integers_CreepRemaining[1] - 1)
              • Leaderboard - Change the value for Player 13 (Maroon) in LastCreatedLeaderboard to Integers_CreepRemaining[1]
            • Else - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in UnitGroups_TeamCreeps[1] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to False
            • Then - Actions
              • Set VariableSet Integers_CreepRemaining[1] = (Integers_CreepRemaining[1] - 1)
              • Leaderboard - Change the value for Player 13 (Maroon) in LastCreatedLeaderboard to Integers_CreepRemaining[1]
            • Else - Actions
      • -------- --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in UnitGroups[2] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to False
            • Then - Actions
              • Set VariableSet Integers_CreepRemaining[2] = (Integers_CreepRemaining[2] - 1)
              • Leaderboard - Change the value for Player 18 (Peach) in LastCreatedLeaderboard to Integers_CreepRemaining[2]
            • Else - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in UnitGroups_TeamCreeps[2] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to False
            • Then - Actions
              • Set VariableSet Integers_CreepRemaining[2] = (Integers_CreepRemaining[2] - 1)
              • Leaderboard - Change the value for Player 18 (Peach) in LastCreatedLeaderboard to Integers_CreepRemaining[2]
            • Else - Actions
      • -------- --------
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integers_CreepRemaining[1] Equal to 0
          • Integers_CreepRemaining[2] Equal to 0
        • Then - Actions
          • Set VariableSet Integer_CreepRemainingA = 0
          • Set VariableSet Integer_CreepRemainingB = 0
          • -------- --------
          • -------- Run "Next Level" when all of the spawned units have died --------
          • -------- --------
          • -------- Arena start --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • Integer_CurrentLevel Equal to 10
                  • Integer_CurrentLevel Equal to 20
            • Then - Actions
              • Set VariableSet Boolean_Arena = True
              • -------- --------
              • Countdown Timer - Start Timer_LevelBegins as a One-shot timer that will expire in 30.00 seconds
              • Countdown Timer - Change the title of TimerWindow_LevelBegins to Arena Battle in
              • Game - Display to (All players) for 10.00 seconds the text: You have |cffffcc00...
            • Else - Actions
              • Countdown Timer - Hide TimerWindow_GameBegins
              • Countdown Timer - Destroy TimerWindow_GameBegins
              • Countdown Timer - Hide TimerWindow_LevelBegins
              • Countdown Timer - Destroy TimerWindow_LevelBegins
              • Countdown Timer - Start Timer_LevelBegins as a One-shot timer that will expire in Reals_Spawn_Preparation[(Integer_CurrentLevel + 1)] seconds
              • Countdown Timer - Create a timer window for Timer_LevelBegins with title (Level + ((String((Integer_CurrentLevel + 1))) + in))
              • Set VariableSet TimerWindow_LevelBegins = (Last created timer window)
              • Countdown Timer - Show TimerWindow_LevelBegins
              • Game - Display to (All players) for 10.00 seconds the text: (((You have |cffffcc00 + (String(Reals_Spawn_Preparation[(Integer_CurrentLevel + 1)]))) + |r seconds until level |cffffcc00) + ((String((Integer_CurrentLevel + 1))) + |r begins.))
        • Else - Actions
 
Top