• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] Group Lives System for a Gladiator Map

Level 6
Joined
Aug 24, 2022
Messages
85
Hi everyone! I would like some help to create a "Group" Lives System for my Gladiator Map Project. I tried to create it by myself, but until now, zero sucess.

How it will work?

- Players will start the game with 3 lives. These lives are not individual, they are for the group.

  • When a new wave starts, all players are teleported from their base, to the arena, and need to battle.
  • Dying players will not respawn until the last hero is killed, or all the enemies are killed.
  • If all players get killed, a life will be lost, all enemies will be removed, and after 90 seconds, the wave will repeat.
  • If all enemies get killed, all alive players will be teleported to the base, and dead players will respawn. 90 seconds later, the next wave will come, and start all this again.

For now, I'm having problem in how I will count properly all heroes inside the arena (storing in a variable). Only players have "heroes" units, so I think this will make my problem easier. There is no "Hero" unit enemies.

Maybe I can set 3 or 4 seconds without heroes inside the arena to check variable... I just don't know how to do it yet.

And a doubt: One specific hero has the "Reincarnation" ability. Do you think this ability can mess with the trigger?

Thank you if you read until here, and I'm still trying to make this trigger.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,204
For now, I'm having problem in how I will count properly all heroes inside the arena (storing in a variable). Only players have "heroes" units, so I think this will make my problem easier. There is no "Hero" unit enemies.
My recommendation would be to have a group variable, alive heroes, that you populate with the player heroes as you teleport them into the arena. Then an any unit dies event trigger checks if the dying unit is in the alive heroes group and if so removes the dying unit from the group. If the group is empty, all player heroes have died so you can run the logic for point 3. A different group variable, alive enemies, could be used to track the spawned enemy units with a similar on death trigger and logic to handle point 4.

To make life easier you should design a system for waves that tracks current wave number as an integer which it uses to look up appropriate spawn data, or run appropriate spawn triggers, from an array. This way mostly the same logic could be used for both points 3 and 4 with the only difference being that point 4 increments the wave number by 1 so advances to the next wave while point 3 does not so replays the current wave. I say this because many people create a spaghetti chain of triggers for each wave which makes changing to or replaying specific waves difficult.
And a doubt: One specific hero has the "Reincarnation" ability. Do you think this ability can mess with the trigger?
I think the unit dying event only fires when units with reincarnation actually die, and not the fake reincarnation death. As such the proposal above should handle this case fine.
 
Level 6
Joined
Aug 24, 2022
Messages
85
My recommendation would be to have a group variable, alive heroes, that you populate with the player heroes as you teleport them into the arena. Then an any unit dies event trigger checks if the dying unit is in the alive heroes group and if so removes the dying unit from the group. If the group is empty, all player heroes have died so you can run the logic for point 3. A different group variable, alive enemies, could be used to track the spawned enemy units with a similar on death trigger and logic to handle point 4.

To make life easier you should design a system for waves that tracks current wave number as an integer which it uses to look up appropriate spawn data, or run appropriate spawn triggers, from an array. This way mostly the same logic could be used for both points 3 and 4 with the only difference being that point 4 increments the wave number by 1 so advances to the next wave while point 3 does not so replays the current wave. I say this because many people create a spaghetti chain of triggers for each wave which makes changing to or replaying specific waves difficult.

I think the unit dying event only fires when units with reincarnation actually die, and not the fake reincarnation death. As such the proposal above should handle this case fine.
Just to update you: I'm out of time to work on this system, but, I tried for the first time, and I did something wrong haha!

If I suceed in this problem, or get any other problem, I will update here. For now, thanks for the direction!
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
Just to update you: I'm out of time to work on this system, but, I tried for the first time, and I did something wrong haha!

If I suceed in this problem, or get any other problem, I will update here. For now, thanks for the direction!
Here you go, hopefully you can open the attached map (requires latest patch). Type -start after picking a hero from the tavern to test it out.

Otherwise, these triggers shouldn't take too long to recreate and should work on any version of Warcraft 3:
1696581773300.png

In this trigger we can use Arrays to store information about each of our waves of enemies. The [index] represents the Wave number:
  • Arena Setup Waves
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Define the number of player lives here: --------
      • Set VariableSet Player_Lives = 3
      • -------- --------
      • -------- Define the different types and amounts of enemies that you will face off against in the arena: --------
      • Set VariableSet Arena_Enemy_Type[1] = Footman
      • Set VariableSet Arena_Enemy_Amount[1] = 5
      • Set VariableSet Arena_Enemy_Info[1] = (Players face off against + ((String(Arena_Enemy_Amount[1])) + puny Footman!))
      • -------- --------
      • Set VariableSet Arena_Enemy_Type[2] = Rifleman
      • Set VariableSet Arena_Enemy_Amount[2] = 4
      • Set VariableSet Arena_Enemy_Info[2] = (Players face off against + ((String(Arena_Enemy_Amount[1])) + bearded Rifleman!))
      • -------- --------
      • Set VariableSet Arena_Enemy_Type[3] = Knight
      • Set VariableSet Arena_Enemy_Amount[3] = 3
      • Set VariableSet Arena_Enemy_Info[3] = (Players face off against + ((String(Arena_Enemy_Amount[1])) + dashing Knights!))
This trigger should be customized to your liking. This is how you can begin the very first Wave of the game:
  • Arena Start First Wave
    • Events
      • Player - Player 1 (Red) types a chat message containing -start as An exact match
    • Conditions
    • Actions
      • Trigger - Run Arena Start Next Wave <gen> (ignoring conditions)
      • Trigger - Turn off (This trigger)
This trigger runs when a Wave is starting and prepares everything related to it:
  • Arena Start Next Wave
    • Events
    • Conditions
    • Actions
      • Set VariableSet Arena_Current_Wave = (Arena_Current_Wave + 1)
      • -------- --------
      • Set VariableSet Player_Hero_Alive = (Number of units in Player_Hero_Group)
      • -------- --------
      • Game - Display to (All players) for 10.00 seconds the text: ((|cff00ff00Wave + ((String(Arena_Current_Wave)) + |r: )) + Arena_Enemy_Info[Arena_Current_Wave])
      • -------- --------
      • Wait 3.00 game-time seconds
      • -------- --------
      • Unit Group - Pick every unit in Player_Hero_Group and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Arena <gen>) over 0.00 seconds
          • Unit - Move (Picked unit) instantly to (Center of Arena <gen>)
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
      • -------- --------
      • Wait 3.00 game-time seconds
      • -------- --------
      • For each (Integer Arena_Loop) from 1 to Arena_Enemy_Amount[Arena_Current_Wave], do (Actions)
        • Loop - Actions
          • Unit - Create 1 Arena_Enemy_Type[Arena_Current_Wave] for Player 2 (Blue) at (Center of Arena <gen>) facing Default building facing degrees
          • Unit Group - Add (Last created unit) to Arena_Enemy_Group
          • Set VariableSet Arena_Enemy_Alive = (Arena_Enemy_Alive + 1)
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
This trigger runs when a wave is over and the players have defeated all of the enemies:
  • Arena Players Win Wave
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) for 10.00 seconds the text: (You've completed |cff00ff00Wave + ((String(Arena_Current_Wave)) + |r!))
      • -------- --------
      • Wait 1.00 game-time seconds
      • -------- --------
      • -------- Move/revive heroes back at the tavern: --------
      • Unit Group - Pick every unit in Player_Hero_Group and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Tavern <gen>) over 0.00 seconds
          • Unit - Move (Picked unit) instantly to (Center of Tavern <gen>)
          • Hero - Instantly revive (Picked unit) at (Center of Tavern <gen>), Show revival graphics
      • -------- --------
      • -------- Remove leftover units in the arena: --------
      • Unit Group - Pick every unit in (Units in Arena <gen>) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • -------- --------
      • -------- Check if the players have finished the final wave! --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Arena_Enemy_Amount[(Arena_Current_Wave + 1)] Equal to 0
        • Then - Actions
          • Trigger - Run Game Over Victory <gen> (ignoring conditions)
          • Skip remaining actions
        • Else - Actions
      • -------- --------
      • Wait 5.00 game-time seconds
      • -------- --------
      • -------- Start the next wave: --------
      • Trigger - Run Arena Start Next Wave <gen> (ignoring conditions)
This trigger runs when a wave is over and the players have all died:
  • Arena Players Lose Wave
    • Events
    • Conditions
    • Actions
      • Set VariableSet Player_Lives = (Player_Lives - 1)
      • -------- --------
      • Game - Display to (All players) for 10.00 seconds the text: (You've failed |cffff0000Wave + ((String(Arena_Current_Wave)) + (|r + (- Player lives remaining: |cff00ff00 + ((String(Player_Lives)) + |r)))))
      • -------- --------
      • -------- Check if the players have run out of lives! --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Player_Lives Equal to 0
        • Then - Actions
          • Trigger - Run Game Over Defeat <gen> (ignoring conditions)
          • Skip remaining actions
        • Else - Actions
      • -------- --------
      • Wait 1.00 game-time seconds
      • -------- --------
      • -------- Move/revive heroes back at the tavern: --------
      • Unit Group - Pick every unit in Player_Hero_Group and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Tavern <gen>) over 0.00 seconds
          • Unit - Move (Picked unit) instantly to (Center of Tavern <gen>)
          • Hero - Instantly revive (Picked unit) at (Center of Tavern <gen>), Show revival graphics
      • -------- --------
      • -------- Remove leftover units in the arena: --------
      • Unit Group - Pick every unit in (Units in Arena <gen>) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Set VariableSet Arena_Enemy_Alive = 0
      • -------- --------
      • Wait 5.00 game-time seconds
      • -------- --------
      • -------- Repeat the last wave: --------
      • Set VariableSet Arena_Current_Wave = (Arena_Current_Wave - 1)
      • Trigger - Run Arena Start Next Wave <gen> (ignoring conditions)
This trigger is meant to track when a unit in the arena dies. You will most likely need to customize it to fit your map:
  • Arena Unit Dies
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
          • ((Triggering unit) is Summoned) Equal to False
        • Then - Actions
          • -------- ARENA ENEMY DIED (Non-Summoned): --------
          • Unit Group - Remove (Triggering unit) from Arena_Enemy_Group.
          • -------- --------
          • Set VariableSet Arena_Enemy_Alive = (Arena_Enemy_Alive - 1)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Arena_Enemy_Alive Equal to 0
            • Then - Actions
              • Trigger - Run Arena Players Win Wave <gen> (ignoring conditions)
            • Else - Actions
        • Else - Actions
          • -------- PLAYER HERO DIED: --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is A Hero) Equal to True
              • ((Triggering unit) is an illusion) Equal to False
            • Then - Actions
              • Set VariableSet Player_Hero_Alive = (Player_Hero_Alive - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Player_Hero_Alive Equal to 0
                • Then - Actions
                  • Trigger - Run Arena Players Lose Wave <gen> (ignoring conditions)
                • Else - Actions
            • Else - Actions
This trigger helps track our player's heroes, you will most likely need to customize it to fit your map:
  • Pick Hero
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • -------- This assumes that your map uses a Tavern to purchase your Hero. If not, you must modify the Event/Event Responses to work for your hero selection system! --------
      • Unit Group - Add (Sold unit) to Player_Hero_Group
      • Set VariableSet Player_Hero_Alive = (Player_Hero_Alive + 1)
This trigger runs when you've completed the final wave:
  • Game Over Victory
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Shake the camera for (Picked player) with magnitude 3.00
      • Cinematic - Turn cinematic mode On for (All players)
      • Game - Display to (All players) for 30.00 seconds the text: |cff00ff00VICTORY!!...
      • Wait 5.00 game-time seconds
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Game - Victory (Picked player) (Show dialogs, Show scores)
This trigger runs when you've reached 0 lives:
  • Game Over Defeat
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Shake the camera for (Picked player) with magnitude 3.00
      • Cinematic - Turn cinematic mode On for (All players)
      • Game - Display to (All players) for 30.00 seconds the text: |cffff0000DEFEAT.|r
      • Wait 5.00 game-time seconds
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Game - Defeat (Picked player) with the message: Defeat!
Notes:
  • I didn't address the Memory Leaks since I was in a rush. These leaks occur whenever I reference the Position of a unit or the Center of a region as well as my Unit removal (Pick every unit in Arena).
  • This doesn't handle what happens when a Player leaves the game, I leave that up to you.
  • The "Unit Dies" trigger can be a source of a lot of bugs/problems if you don't set it up correctly!
^ There's some useful information in there that you most likely want to read.
 

Attachments

  • Arena Example 1.w3m
    26.5 KB · Views: 6
Last edited:
Level 6
Joined
Aug 24, 2022
Messages
85
Here you go, hopefully you can open the attached map (requires latest patch). Type -start after picking a hero from the tavern to test it out.

Otherwise, these triggers shouldn't take too long to recreate and should work on any version of Warcraft 3:
View attachment 449922
In this trigger we can use Arrays to store information about each of our waves of enemies. The [index] represents the Wave number:
  • Arena Setup Waves
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Define the number of player lives here: --------
      • Set VariableSet Player_Lives = 3
      • -------- --------
      • -------- Define the different types and amounts of enemies that you will face off against in the arena: --------
      • Set VariableSet Arena_Enemy_Type[1] = Footman
      • Set VariableSet Arena_Enemy_Amount[1] = 5
      • Set VariableSet Arena_Enemy_Info[1] = (Players face off against + ((String(Arena_Enemy_Amount[1])) + puny Footman!))
      • -------- --------
      • Set VariableSet Arena_Enemy_Type[2] = Rifleman
      • Set VariableSet Arena_Enemy_Amount[2] = 4
      • Set VariableSet Arena_Enemy_Info[2] = (Players face off against + ((String(Arena_Enemy_Amount[1])) + bearded Rifleman!))
      • -------- --------
      • Set VariableSet Arena_Enemy_Type[3] = Knight
      • Set VariableSet Arena_Enemy_Amount[3] = 3
      • Set VariableSet Arena_Enemy_Info[3] = (Players face off against + ((String(Arena_Enemy_Amount[1])) + dashing Knights!))
This trigger should be customized to your liking. This is how you can begin the very first Wave of the game:
  • Arena Start First Wave
    • Events
      • Player - Player 1 (Red) types a chat message containing -start as An exact match
    • Conditions
    • Actions
      • Trigger - Run Arena Start Next Wave <gen> (ignoring conditions)
      • Trigger - Turn off (This trigger)
This trigger runs when a Wave is starting and prepares everything related to it:
  • Arena Start Next Wave
    • Events
    • Conditions
    • Actions
      • Set VariableSet Arena_Current_Wave = (Arena_Current_Wave + 1)
      • -------- --------
      • Set VariableSet Player_Hero_Alive = (Number of units in Player_Hero_Group)
      • -------- --------
      • Game - Display to (All players) for 10.00 seconds the text: ((|cff00ff00Wave + ((String(Arena_Current_Wave)) + |r: )) + Arena_Enemy_Info[Arena_Current_Wave])
      • -------- --------
      • Wait 3.00 game-time seconds
      • -------- --------
      • Unit Group - Pick every unit in Player_Hero_Group and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Arena <gen>) over 0.00 seconds
          • Unit - Move (Picked unit) instantly to (Center of Arena <gen>)
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
      • -------- --------
      • Wait 3.00 game-time seconds
      • -------- --------
      • For each (Integer Arena_Loop) from 1 to Arena_Enemy_Amount[Arena_Current_Wave], do (Actions)
        • Loop - Actions
          • Unit - Create 1 Arena_Enemy_Type[Arena_Current_Wave] for Player 2 (Blue) at (Center of Arena <gen>) facing Default building facing degrees
          • Unit Group - Add (Last created unit) to Arena_Enemy_Group
          • Set VariableSet Arena_Enemy_Alive = (Arena_Enemy_Alive + 1)
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
This trigger runs when a wave is over and the players have defeated all of the enemies:
  • Arena Players Win Wave
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) for 10.00 seconds the text: (You've completed |cff00ff00Wave + ((String(Arena_Current_Wave)) + |r!))
      • -------- --------
      • Wait 1.00 game-time seconds
      • -------- --------
      • -------- Move/revive heroes back at the tavern: --------
      • Unit Group - Pick every unit in Player_Hero_Group and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Tavern <gen>) over 0.00 seconds
          • Unit - Move (Picked unit) instantly to (Center of Tavern <gen>)
          • Hero - Instantly revive (Picked unit) at (Center of Tavern <gen>), Show revival graphics
      • -------- --------
      • -------- Remove leftover units in the arena: --------
      • Unit Group - Pick every unit in (Units in Arena <gen>) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • -------- --------
      • -------- Check if the players have finished the final wave! --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Arena_Enemy_Amount[(Arena_Current_Wave + 1)] Equal to 0
        • Then - Actions
          • Trigger - Run Game Over Victory <gen> (ignoring conditions)
          • Skip remaining actions
        • Else - Actions
      • -------- --------
      • Wait 5.00 game-time seconds
      • -------- --------
      • -------- Start the next wave: --------
      • Trigger - Run Arena Start Next Wave <gen> (ignoring conditions)
This trigger runs when a wave is over and the players have all died:
  • Arena Players Lose Wave
    • Events
    • Conditions
    • Actions
      • Set VariableSet Player_Lives = (Player_Lives - 1)
      • -------- --------
      • Game - Display to (All players) for 10.00 seconds the text: (You've failed |cffff0000Wave + ((String(Arena_Current_Wave)) + (|r + (- Player lives remaining: |cff00ff00 + ((String(Player_Lives)) + |r)))))
      • -------- --------
      • -------- Check if the players have run out of lives! --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Player_Lives Equal to 0
        • Then - Actions
          • Trigger - Run Game Over Defeat <gen> (ignoring conditions)
          • Skip remaining actions
        • Else - Actions
      • -------- --------
      • Wait 1.00 game-time seconds
      • -------- --------
      • -------- Move/revive heroes back at the tavern: --------
      • Unit Group - Pick every unit in Player_Hero_Group and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Tavern <gen>) over 0.00 seconds
          • Unit - Move (Picked unit) instantly to (Center of Tavern <gen>)
          • Hero - Instantly revive (Picked unit) at (Center of Tavern <gen>), Show revival graphics
      • -------- --------
      • -------- Remove leftover units in the arena: --------
      • Unit Group - Pick every unit in (Units in Arena <gen>) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Set VariableSet Arena_Enemy_Alive = 0
      • -------- --------
      • Wait 5.00 game-time seconds
      • -------- --------
      • -------- Repeat the last wave: --------
      • Set VariableSet Arena_Current_Wave = (Arena_Current_Wave - 1)
      • Trigger - Run Arena Start Next Wave <gen> (ignoring conditions)
This trigger is meant to track when a unit in the arena dies. You will most likely need to customize it to fit your map:
  • Arena Unit Dies
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
          • ((Triggering unit) is Summoned) Equal to False
        • Then - Actions
          • -------- ARENA ENEMY DIED (Non-Summoned): --------
          • Unit Group - Remove (Triggering unit) from Arena_Enemy_Group.
          • -------- --------
          • Set VariableSet Arena_Enemy_Alive = (Arena_Enemy_Alive - 1)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Arena_Enemy_Alive Equal to 0
            • Then - Actions
              • Trigger - Run Arena Players Win Wave <gen> (ignoring conditions)
            • Else - Actions
        • Else - Actions
          • -------- PLAYER HERO DIED: --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is A Hero) Equal to True
              • ((Triggering unit) is an illusion) Equal to False
            • Then - Actions
              • Set VariableSet Player_Hero_Alive = (Player_Hero_Alive - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Player_Hero_Alive Equal to 0
                • Then - Actions
                  • Trigger - Run Arena Players Lose Wave <gen> (ignoring conditions)
                • Else - Actions
            • Else - Actions
This trigger helps track our player's heroes, you will most likely need to customize it to fit your map:
  • Pick Hero
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • -------- This assumes that your map uses a Tavern to purchase your Hero. If not, you must modify the Event/Event Responses to work for your hero selection system! --------
      • Unit Group - Add (Sold unit) to Player_Hero_Group
      • Set VariableSet Player_Hero_Alive = (Player_Hero_Alive + 1)
This trigger runs when you've completed the final wave:
  • Game Over Victory
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Shake the camera for (Picked player) with magnitude 3.00
      • Cinematic - Turn cinematic mode On for (All players)
      • Game - Display to (All players) for 30.00 seconds the text: |cff00ff00VICTORY!!...
      • Wait 5.00 game-time seconds
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Game - Victory (Picked player) (Show dialogs, Show scores)
This trigger runs when you've reached 0 lives:
  • Game Over Defeat
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Shake the camera for (Picked player) with magnitude 3.00
      • Cinematic - Turn cinematic mode On for (All players)
      • Game - Display to (All players) for 30.00 seconds the text: |cffff0000DEFEAT.|r
      • Wait 5.00 game-time seconds
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Game - Defeat (Picked player) with the message: Defeat!
Notes:
  • I didn't address the Memory Leaks since I was in a rush. These leaks occur whenever I reference the Position of a unit or the Center of a region as well as my Unit removal (Pick every unit in Arena).
  • This doesn't handle what happens when a Player leaves the game, I leave that up to you.
  • The "Unit Dies" trigger can be a source of a lot of bugs/problems if you don't set it up correctly!
^ There's some useful information in there that you most likely want to read.
Today I've got some time, so I'm working right now on the map.

Uncle, your system is amazing. I'm trying things in my map using it, and everything works perfectly! I didn't expect to get the entire system ready to use like this... I was up to study how to make it, and I just asked for direction... I'm really surprised haha!

I think this is the hardest, toughest thing to create in my project, and you just gave it ready to use. I'd like to put you as a NPC inside the map, with the model you want, and name you want. Maybe a Legendary Gladiator at the top ranking, or an observer at the Arena's bench... I don't know.

EDIT: About the event "Player leaves the game", I've already made a "Left Game" message for all players, so, I'll test if I just need to put a "-1" at the variable of the picked heroes (because yes, I use a tavern hero pick), or remove it from the player group you created for the waves. It's just a matter of time to solve this, thanks.

EDIT2: Wondering how to insert diferent types of enemies. I'm using a bunch of diferent enemies per wave, and I expect that I'll use about 12 types of enemies at a same wave (1 to just give gold, 4 basic enemies, 4 elite enemies, 3 bosses [Every wave has a % of each type of enemy, totallyzing 100 enemies {An Army}, and only later waves has bosses]).

EDIT3: I think I can use individual trigger to define which units and number of unit will spawn on each wave, but I don't know what this kind of triggering can cause. Using "initially off" triggers, that we keep turning on as the game proceeds. I'm just writing what I'm thinking about this problem, and trying to find a solution. I prefer this way that Uncle shown me. I think that, If I can use a VAR that set others VARS (like enemy type and quantity), I can track waves with the system.

For example, the VAR "Wave 1" sets enemies types and quantities, and then execute the trigger using these information. The VAR "Wave 2" changes values of enemies and quantities, and then, execute the trigger. I'm still trying here. Any news, I'll come back here. Until now, thanks for everything and every help or direction.
 
Last edited:
Level 6
Joined
Aug 24, 2022
Messages
85
Hi for everyone! Coming back after some weeks to tell that I've made progress.

I figured out how I could use Uncle's system in my project, and it works.

When the "mode" is selected, this trigger setup types of enemies. I can't put it on the start of the map, because every mode has diferent types of "armies" (name for a group of enemies), so they'll never be the same.
  • Normal Mode Inicialization
    • Events
    • Conditions
    • Actions
      • -------- Tier 1 Enemies Setup --------
      • Set VariableSet Arena_Enemy_Type[1] = Human Slave (Tier 1)
      • Set VariableSet Arena_Enemy_Type[2] = Human Soldier (Tier 1)
      • Set VariableSet Arena_Enemy_Type[3] = Dwarf Shooter (Tier 1)
      • Set VariableSet Arena_Enemy_Type[4] = Mounted Mage (Tier 1)
      • Set VariableSet Arena_Enemy_Type[5] = Human Shepherd (Tier 1)
      • -------- Tier 1 Elites --------
      • Set VariableSet Arena_Enemy_Type[6] = Human Captain - |cffffff00Elite|r (Elite - Tier 1)
      • Set VariableSet Arena_Enemy_Type[7] = Dwarf Mortar - |cffffff00Elite|r (Elite - Tier 1)
      • Set VariableSet Arena_Enemy_Type[8] = Wise Wizard - |cffffff00Elite|r (Elite - Tier 1)
      • Set VariableSet Arena_Enemy_Type[9] = Secret Cultist - |cffffff00Elite|r (Elite - Tier 1)
      • -------- Tier 1 Bosses --------
      • Set VariableSet Arena_Enemy_Type[10] = Royal Guard - |cffff0000Boss|r (Boss - Tier 1)
      • Set VariableSet Arena_Enemy_Type[11] = Pirate Captain - |cffff0000Boss|r (Boss - Tier 1)
      • Set VariableSet Arena_Enemy_Type[12] = Mounted Ghost - |cffff0000Boss|r (Boss - Tier 1)
      • Set VariableSet Arena_Enemy_Type[13] = Petrified Hero - |cffff8080Outerworld|r (Unique - Tier 1)
      • -------- Tier 2 Enemies Setup --------
      • Set VariableSet Arena_Enemy_Type[14] = Lumberjack Slave (Tier 2)
      • Set VariableSet Arena_Enemy_Type[15] = Protector (Tier 2)
      • Set VariableSet Arena_Enemy_Type[16] = Winged Treant (Tier 2)
      • Set VariableSet Arena_Enemy_Type[17] = Enchanted Sappling (Tier 2)
      • Set VariableSet Arena_Enemy_Type[18] = Stone Launcher (Tier 2)
      • -------- Tier 2 Elites --------
      • Set VariableSet Arena_Enemy_Type[19] = Night Protector - |cffffff00Elite|r (|cffffff00Elite|r - Tier 2)
      • Set VariableSet Arena_Enemy_Type[20] = Elder Treant - |cffffff00Elite|r (|cffffff00Elite|r - Tier 2)
      • Set VariableSet Arena_Enemy_Type[21] = Corrupted Sappling - |cffffff00Elite|r (|cffffff00Elite|r - Tier 2)
      • Set VariableSet Arena_Enemy_Type[22] = Elite Launcher - |cffffff00Elite|r (|cffffff00Elite|r - Tier 2)
      • -------- Tier 2 Bosses --------
      • Set VariableSet Arena_Enemy_Type[23] = Stone Guardian - |cffff0000Boss|r (Boss - Tier 2)
      • Set VariableSet Arena_Enemy_Type[24] = Harvester - |cffff0000Boss|r (Boss - Tier 2)
      • Set VariableSet Arena_Enemy_Type[25] = Nature Centaur - |cffff0000Boss|r (Boss - Tier 2)
      • Set VariableSet Arena_Enemy_Type[26] = Corrupted Guardian - |cffff8080Outerworld|r (Unique - Tier 2)
      • -------- Tier 3 Enemies Setup --------
      • Set VariableSet Arena_Enemy_Type[27] = Blood Boar (Tier 3)
      • Set VariableSet Arena_Enemy_Type[28] = Draenei Fighter (Tier 3)
      • Set VariableSet Arena_Enemy_Type[29] = Mysterious Larva (Tier 3)
      • Set VariableSet Arena_Enemy_Type[30] = Demonic Aparition (Tier 3)
      • Set VariableSet Arena_Enemy_Type[31] = Mysterious Ghost (Tier 3)
      • -------- Tier 3 Elites --------
      • Set VariableSet Arena_Enemy_Type[32] = Draenei Champion - |cffffff00Elite|r (Tier 3)
      • Set VariableSet Arena_Enemy_Type[33] = Giant Zergling - |cffffff00Elite|r (Tier 3)
      • Set VariableSet Arena_Enemy_Type[34] = Demonic Ghost - |cffffff00Elite|r (Tier 3)
      • Set VariableSet Arena_Enemy_Type[35] = Frozen Ghost - |cffffff00Elite|r (Tier 3)
      • -------- Tier 3 Bosses --------
      • Set VariableSet Arena_Enemy_Type[36] = Draenei Assassin - |cffff0000Boss|r (Tier 3)
      • Set VariableSet Arena_Enemy_Type[37] = Hydralisk - |cffff0000Boss|r (Tier 3)
      • Set VariableSet Arena_Enemy_Type[38] = Draenei Witcher - |cffff0000Boss|r (Tier 3)
      • Set VariableSet Arena_Enemy_Type[39] = Mastermind - |cffff8080Outerworld|r (Unique - Tier 3)
      • -------- Last Wave Setup --------
      • Set VariableSet Arena_Enemy_Type[40] = Shadow Hero - |cffff8080Outerworld|r (Unique - Tier 3)
      • Set VariableSet Arena_Enemy_Type[41] = Shadow Guardian - |cffff8080Outerworld|r (Unique - Tier 3)
      • Set VariableSet Arena_Enemy_Type[42] = Shadow Mastermind - |cffff8080Outerworld|r (Unique - Tier 3)

Here, we have a trigger that is called everytime a new wave starts (using the trigger you've made). It sets enemies quantity and the reward for the wave. If on Wave 1, set quantities. If on Wave 2, set other quantities, and so on.
  • Enemy Quantity Check
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Arena_Current_Wave Equal to 1
        • Then - Actions
          • -------- Normal Enemies --------
          • Set VariableSet Arena_Enemy_Amount[1] = 100
          • Set VariableSet Arena_Enemy_Amount[2] = 0
          • Set VariableSet Arena_Enemy_Amount[3] = 0
          • Set VariableSet Arena_Enemy_Amount[4] = 0
          • Set VariableSet Arena_Enemy_Amount[5] = 0
          • -------- Elite Enemies --------
          • Set VariableSet Arena_Enemy_Amount[6] = 0
          • Set VariableSet Arena_Enemy_Amount[7] = 0
          • Set VariableSet Arena_Enemy_Amount[8] = 0
          • Set VariableSet Arena_Enemy_Amount[9] = 0
          • -------- Bosses --------
          • Set VariableSet Arena_Enemy_Amount[10] = 0
          • Set VariableSet Arena_Enemy_Amount[11] = 0
          • Set VariableSet Arena_Enemy_Amount[12] = 0
          • -------- Outerworld --------
          • Set VariableSet Arena_Enemy_Amount[13] = 0
          • -------- Wave Reward --------
          • Set VariableSet Reward[1] = 300
          • Trigger - Run Next Wave 2 <gen> (ignoring conditions)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Arena_Current_Wave Equal to 2
            • Then - Actions
              • -------- Normal Enemies --------
              • Set VariableSet Arena_Enemy_Amount[1] = 60
              • Set VariableSet Arena_Enemy_Amount[2] = 10
              • Set VariableSet Arena_Enemy_Amount[3] = 10
              • Set VariableSet Arena_Enemy_Amount[4] = 10
              • Set VariableSet Arena_Enemy_Amount[5] = 10
              • -------- Elite Enemies --------
              • Set VariableSet Arena_Enemy_Amount[6] = 0
              • Set VariableSet Arena_Enemy_Amount[7] = 0
              • Set VariableSet Arena_Enemy_Amount[8] = 0
              • Set VariableSet Arena_Enemy_Amount[9] = 0
              • -------- Bosses --------
              • Set VariableSet Arena_Enemy_Amount[10] = 0
              • Set VariableSet Arena_Enemy_Amount[11] = 0
              • Set VariableSet Arena_Enemy_Amount[12] = 0
              • -------- Outerworld --------
              • Set VariableSet Arena_Enemy_Amount[13] = 0
              • -------- Wave Reward --------
              • Set VariableSet Reward[2] = 380
              • Trigger - Run Next Wave 2 <gen> (ignoring conditions)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Arena_Current_Wave Equal to 3
                • Then - Actions
                  • -------- Normal Enemies --------
                  • Set VariableSet Arena_Enemy_Amount[1] = 47
                  • Set VariableSet Arena_Enemy_Amount[2] = 10
                  • Set VariableSet Arena_Enemy_Amount[3] = 10
                  • Set VariableSet Arena_Enemy_Amount[4] = 10
                  • Set VariableSet Arena_Enemy_Amount[5] = 10
                  • -------- Elite Enemies --------
                  • Set VariableSet Arena_Enemy_Amount[6] = 3
                  • Set VariableSet Arena_Enemy_Amount[7] = 3
                  • Set VariableSet Arena_Enemy_Amount[8] = 3
                  • Set VariableSet Arena_Enemy_Amount[9] = 3
                  • -------- Bosses --------
                  • Set VariableSet Arena_Enemy_Amount[10] = 1
                  • Set VariableSet Arena_Enemy_Amount[11] = 0
                  • Set VariableSet Arena_Enemy_Amount[12] = 0
                  • -------- Outerworld --------
                  • Set VariableSet Arena_Enemy_Amount[13] = 0
                  • -------- Wave Reward --------
                  • Set VariableSet Reward[3] = 571
                  • Trigger - Run Next Wave 2 <gen> (ignoring conditions)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Arena_Current_Wave Equal to 4
                    • Then - Actions
                      • -------- Normal Enemies --------
                      • Set VariableSet Arena_Enemy_Amount[1] = 41
                      • Set VariableSet Arena_Enemy_Amount[2] = 9
                      • Set VariableSet Arena_Enemy_Amount[3] = 9
                      • Set VariableSet Arena_Enemy_Amount[4] = 9
                      • Set VariableSet Arena_Enemy_Amount[5] = 9
                      • -------- Elite Enemies --------
                      • Set VariableSet Arena_Enemy_Amount[6] = 5
                      • Set VariableSet Arena_Enemy_Amount[7] = 5
                      • Set VariableSet Arena_Enemy_Amount[8] = 5
                      • Set VariableSet Arena_Enemy_Amount[9] = 5
                      • -------- Bosses --------
                      • Set VariableSet Arena_Enemy_Amount[10] = 1
                      • Set VariableSet Arena_Enemy_Amount[11] = 1
                      • Set VariableSet Arena_Enemy_Amount[12] = 1
                      • -------- Outerworld --------
                      • Set VariableSet Arena_Enemy_Amount[13] = 0
                      • -------- Wave Reward --------
                      • Set VariableSet Reward[4] = 753
                      • Trigger - Run Next Wave 2 <gen> (ignoring conditions)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Arena_Current_Wave Equal to 5
                        • Then - Actions
                          • -------- Normal Enemies --------
                          • Set VariableSet Arena_Enemy_Amount[1] = 20
                          • Set VariableSet Arena_Enemy_Amount[2] = 12
                          • Set VariableSet Arena_Enemy_Amount[3] = 12
                          • Set VariableSet Arena_Enemy_Amount[4] = 12
                          • Set VariableSet Arena_Enemy_Amount[5] = 12
                          • -------- Elite Enemies --------
                          • Set VariableSet Arena_Enemy_Amount[6] = 7
                          • Set VariableSet Arena_Enemy_Amount[7] = 7
                          • Set VariableSet Arena_Enemy_Amount[8] = 7
                          • Set VariableSet Arena_Enemy_Amount[9] = 7
                          • -------- Bosses --------
                          • Set VariableSet Arena_Enemy_Amount[10] = 2
                          • Set VariableSet Arena_Enemy_Amount[11] = 1
                          • Set VariableSet Arena_Enemy_Amount[12] = 1
                          • -------- Outerworld --------
                          • Set VariableSet Arena_Enemy_Amount[13] = 0
                          • -------- Wave Reward --------
                          • Set VariableSet Reward[5] = 920
                          • Trigger - Run Next Wave 2 <gen> (ignoring conditions)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Arena_Current_Wave Equal to 6
                            • Then - Actions
                              • -------- Normal Enemies --------
                              • Set VariableSet Arena_Enemy_Amount[1] = 2
                              • Set VariableSet Arena_Enemy_Amount[2] = 13
                              • Set VariableSet Arena_Enemy_Amount[3] = 13
                              • Set VariableSet Arena_Enemy_Amount[4] = 13
                              • Set VariableSet Arena_Enemy_Amount[5] = 13
                              • -------- Elite Enemies --------
                              • Set VariableSet Arena_Enemy_Amount[6] = 10
                              • Set VariableSet Arena_Enemy_Amount[7] = 10
                              • Set VariableSet Arena_Enemy_Amount[8] = 10
                              • Set VariableSet Arena_Enemy_Amount[9] = 10
                              • -------- Bosses --------
                              • Set VariableSet Arena_Enemy_Amount[10] = 2
                              • Set VariableSet Arena_Enemy_Amount[11] = 2
                              • Set VariableSet Arena_Enemy_Amount[12] = 2
                              • -------- Outerworld --------
                              • Set VariableSet Arena_Enemy_Amount[13] = 0
                              • -------- Wave Reward --------
                              • Set VariableSet Reward[6] = 1116
                              • Trigger - Run Next Wave 2 <gen> (ignoring conditions)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • Arena_Current_Wave Equal to 7
                                • Then - Actions
                                  • -------- Normal Enemies --------
                                  • Set VariableSet Arena_Enemy_Amount[1] = 0
                                  • Set VariableSet Arena_Enemy_Amount[2] = 0
                                  • Set VariableSet Arena_Enemy_Amount[3] = 0
                                  • Set VariableSet Arena_Enemy_Amount[4] = 0
                                  • Set VariableSet Arena_Enemy_Amount[5] = 0
                                  • -------- Elite Enemies --------
                                  • Set VariableSet Arena_Enemy_Amount[6] = 0
                                  • Set VariableSet Arena_Enemy_Amount[7] = 0
                                  • Set VariableSet Arena_Enemy_Amount[8] = 0
                                  • Set VariableSet Arena_Enemy_Amount[9] = 0
                                  • -------- Bosses --------
                                  • Set VariableSet Arena_Enemy_Amount[10] = 0
                                  • Set VariableSet Arena_Enemy_Amount[11] = 0
                                  • Set VariableSet Arena_Enemy_Amount[12] = 0
                                  • -------- Outerworld --------
                                  • Set VariableSet Arena_Enemy_Amount[13] = 1
                                  • -------- Wave Reward --------
                                  • Set VariableSet Reward[7] = 2250
                                  • Trigger - Run Next Wave 2 <gen> (ignoring conditions)
                                • Else - Actions
                                  • Do nothing

And here we have the trigger that spawns enemies. It spawns all the 13 types of enemies, based on the quantity set on the previous trigger. If VAR is 0, so the enemy won't spawn.

I'm still trying things here, as this system doesn't work on the boss wave, where there is only 1 enemy. When his horde comes out, you kill a creep and the wave ends haha!

  • Next Wave 2
    • Events
    • Conditions
    • Actions
      • Destructible - Open Demonic Gate (Horizontal) 0025 <gen>
      • Destructible - Open Demonic Gate (Horizontal) 0030 <gen>
      • Unit - Create Arena_Enemy_Amount[1] Arena_Enemy_Type[1] for Neutral Hostile at (Center of Creep Spawn <gen>) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to Arena_Enemy_Group
      • Unit - Create Arena_Enemy_Amount[2] Arena_Enemy_Type[2] for Neutral Hostile at (Center of Creep Spawn <gen>) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to Arena_Enemy_Group
      • Unit - Create Arena_Enemy_Amount[3] Arena_Enemy_Type[3] for Neutral Hostile at (Center of Creep Spawn <gen>) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to Arena_Enemy_Group
      • Unit - Create Arena_Enemy_Amount[4] Arena_Enemy_Type[4] for Neutral Hostile at (Center of Creep Spawn <gen>) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to Arena_Enemy_Group
      • Unit - Create Arena_Enemy_Amount[5] Arena_Enemy_Type[5] for Neutral Hostile at (Center of Creep Spawn <gen>) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to Arena_Enemy_Group
      • Unit - Create Arena_Enemy_Amount[6] Arena_Enemy_Type[6] for Neutral Hostile at (Center of Creep Spawn <gen>) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to Arena_Enemy_Group
      • Unit - Create Arena_Enemy_Amount[7] Arena_Enemy_Type[7] for Neutral Hostile at (Center of Creep Spawn <gen>) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to Arena_Enemy_Group
      • Unit - Create Arena_Enemy_Amount[8] Arena_Enemy_Type[8] for Neutral Hostile at (Center of Creep Spawn <gen>) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to Arena_Enemy_Group
      • Unit - Create Arena_Enemy_Amount[9] Arena_Enemy_Type[9] for Neutral Hostile at (Center of Creep Spawn <gen>) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to Arena_Enemy_Group
      • Unit - Create Arena_Enemy_Amount[10] Arena_Enemy_Type[10] for Neutral Hostile at (Center of Creep Spawn <gen>) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to Arena_Enemy_Group
      • Unit - Create Arena_Enemy_Amount[11] Arena_Enemy_Type[11] for Neutral Hostile at (Center of Creep Spawn <gen>) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to Arena_Enemy_Group
      • Unit - Create Arena_Enemy_Amount[12] Arena_Enemy_Type[12] for Neutral Hostile at (Center of Creep Spawn <gen>) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to Arena_Enemy_Group
      • Unit - Create Arena_Enemy_Amount[13] Arena_Enemy_Type[13] for Neutral Hostile at (Center of Creep Spawn <gen>) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to Arena_Enemy_Group
      • Set VariableSet Arena_Enemy_Alive = 100
      • Unit Group - Pick every unit in (Units in Creep Spawn <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Random point in Arena 1 <gen>))

After all that explication above, every time the wave ends with victorious players, the "Reward" VAR is called with all that setup, and gives bounty for players. For now, that's it guys.

Another time, thank you very much for all help and direction all of you gave to me.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
Sorry, I didn't notice your updates to the post. Edits don't ping a notification.

Using an Array of triggers is a fine alternative as well:
  • Set VariableSet Arena_Enemy_Trigger[1] = CreateArenaEnemies1 <gen>
  • Set VariableSet Arena_Enemy_Trigger[2] = CreateArenaEnemies2 <gen>
  • Set VariableSet Arena_Enemy_Trigger[3] = CreateArenaEnemies3 <gen>
Now you just run this trigger after increasing the Current Wave integer:
  • Set Variable Arena_Current_Wave = Arena_Current_Wave + 1
  • Trigger - Run Arena_Enemy_Trigger[Arena_Current_Wave] (ignoring conditions)
Each trigger can be unique and do whatever you want.

What you have in your latest post looks a bit messy and I think you may be missing the point, but if it works and you understand it then that's good. I'd have to see the full triggers to get a better understanding but it looks like you're setting a lot of unnecessary variables.

Here's how you can post your triggers, this is much better than taking pictures:
 
Level 6
Joined
Aug 24, 2022
Messages
85
Here's how you can post your triggers, this is much better than taking pictures:
I've edited my previous post using this tutorial. Thanks for the advice. I agree with you, it is much better haha!

What you have in your latest post looks a bit messy and I think you may be missing the point, but if it works and you understand it then that's good. I'd have to see the full triggers to get a better understanding but it looks like you're setting a lot of unnecessary variables.
If you want to take a look, feel free to download and look by yourself. As my first time programming something, I wasn't worried about organization as a first step, so things aren't as clean as I would like.

If you want to see by yourself how the game will work, I've made every wave to be called manually (See quests for some commands). The entire normal mode is playable using them. Things are not balanced yet.
Using an Array of triggers is a fine alternative as well:
  • set.gif
    Set VariableSet Arena_Enemy_Trigger[1] = CreateArenaEnemies1 <gen>
  • set.gif
    Set VariableSet Arena_Enemy_Trigger[2] = CreateArenaEnemies2 <gen>
  • set.gif
    Set VariableSet Arena_Enemy_Trigger[3] = CreateArenaEnemies3 <gen>
Now you just run this trigger after increasing the Current Wave integer:
  • set.gif
    Set Variable Arena_Current_Wave = Arena_Current_Wave + 1
  • page.gif
    Trigger - Run Arena_Enemy_Trigger[Arena_Current_Wave] (ignoring conditions)
I think I used as this. I'm using the VAR enemy_type as an Integer Array.
 

Attachments

  • Outerworld Arena ALPHA v.0.3.w3x
    1.9 MB · Views: 0

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
So when you create multiple units like this:
  • Unit - Create Arena_Enemy_Amount[1] Arena_Enemy_Type[1] for Neutral Hostile at (Center of Creep Spawn <gen>) facing Default building facing degrees
  • Unit Group - Add (Last created unit) to Arena_Enemy_Group
It doesn't make sense to reference the (Last created unit) like that. That Event Response is always equal to the LAST of those units that was created, so if you created 10 of them, it'd be the 10th one. That means that you aren't adding the first 9 units to Arena_Enemy_Group.

Instead, you should use the Add Unit Group action and reference (Last created unit group):
  • Unit Group - Add all units of (Last created unit group) to Arena_Enemy_Group

Also, a nice method for making better and more dynamic triggers is to use a For Loop. Here I am resetting Arena_Enemy_Amount[1] to [13] back to 0:
  • Actions
    • For each (Integer Arena_Loop) from 1 to 13, do (Actions)
      • Loop - Actions
        • Set VariableSet Arena_Enemy_Amount[Arena_Loop] = 0
You could do this at the very start of your Enemy Quantity Check trigger so that the Amount for each Unit-Type is reset back to 0.

With this design you avoid the need to Set unused Arena_Enemy_Amount variables to 0 since they'll be set to that already. This will clean up your triggers a lot.

Now let's look at using this same For Loop method in the Next Wave 2 trigger to simplify things and avoid bugs:
  • Next Wave 2
    • Events
    • Conditions
    • Actions
      • Destructible - Open Demonic Gate (Horizontal) 0025 <gen>
      • Destructible - Open Demonic Gate (Horizontal) 0030 <gen>
      • Set VariableSet Arena_Enemy_Alive = 0
      • For each (Integer Arena_Loop) from 1 to 13, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Arena_Enemy_Amount[Arena_Loop] Greater than 0
            • Then - Actions
              • Unit - Create Arena_Enemy_Amount[Arena_Loop] Arena_Enemy_Type[Arena_Loop] for Neutral Hostile at Creep_Spawn_Point facing Default building facing degrees
              • Unit Group - Add all units of (Last created unit group) to Arena_Enemy_Group
              • Set VariableSet Arena_Enemy_Alive = (Arena_Enemy_Alive + Arena_Enemy_Amount[Arena_Loop])
            • Else - Actions
      • Set VariableSet Creep_Random_Point = (Random point in Arena 1 <gen>)
      • Unit Group - Pick every unit in Arena_Enemy_Group and do (Unit - Order (Picked unit) to Attack-Move To Creep_Random_Point
      • Custom script: call RemoveLocation( udg_Creep_Random_Point )
So here I have simplified the trigger to use a For Loop. It's now only creating units that have an Amount > 0 and is now properly tracking the units in your Arena_Enemy_Group. Arena_Enemy_Alive is now set automatically so you don't have to bother doing the math yourself. I also addressed all of the memory leaks.

Creep_Spawn_Point would be setup at the start of the game before any creeps have spawned:
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set VariableSet Creep_Spawn_Point = (Center of Creep Spawn <gen>)
By doing this at the start you can safely reference it throughout all of your other triggers. It's smart to have a "setup" trigger like this that will define variables which remain constant throughout the game. A constant variable is one that's never meant to change or get set again.


Regarding the memory leaks, which you probably want to fix but it's not necessary:

This leaks a Unit Group and a Point:
  • Unit Group - Pick every unit in (Units in Creep Spawn <gen>) and do (Unit - Order (Picked unit) to Attack-Move To (Random point in Arena 1 <gen>))
Anywhere you see this you're leaking a Point:
  • (Center of Creep Spawn <gen>)
 
Last edited:
Level 6
Joined
Aug 24, 2022
Messages
85
Done everything you showed me Uncle. When I was testing the game before those corrections, I felt like the game was getting "heavier" as it was going. I read the "Memory Leak" thread, and I feel like it was these leaks you showed me, and leaks about the merging items system I'm currently using. For the items system, I'll read more at that thread, but for now, It looks like everything is fine.

Didn't test the entire system yet, but certainly it is working. Thanks one more time, for all the help and all the directions you gave me.

I'd like to put you as a NPC inside the map, with the model you want, and name you want. Maybe a Legendary Gladiator at the top ranking, or an observer at the Arena's bench...
And you didn't say anything about this... :goblin_cry:
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
Done everything you showed me Uncle. When I was testing the game before those corrections, I felt like the game was getting "heavier" as it was going. I read the "Memory Leak" thread, and I feel like it was these leaks you showed me, and leaks about the merging items system I'm currently using. For the items system, I'll read more at that thread, but for now, It looks like everything is fine.
Didn't test the entire system yet, but certainly it is working. Thanks one more time, for all the help and all the directions you gave me.
Glad to hear it.

And idk, are you using HD or SD mode - gotta know what I'm working with here ;)
 
Level 6
Joined
Aug 24, 2022
Messages
85
Glad to hear it.

And idk, are you using HD or SD mode - gotta know what I'm working with here ;)
I'm using SD mode at the editor, and I'm using 2 or 3 custom SD models. Also, some custom SD icons. All other things are standard models. I think it'll work on both.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
I'm using SD mode at the editor, and I'm using 2 or 3 custom SD models. Also, some custom SD icons. All other things are standard models. I think it'll work on both.
I want to be the goblin emperor, giving the thumbs up or down to signal the loser's death. (You brought this upon yourself)

That or a happy little chicken roaming the map.
 
Level 6
Joined
Aug 24, 2022
Messages
85
I want to be the goblin emperor, giving the thumbs up or down to signal the loser's death. (You brought this upon yourself)

That or a happy little chicken roaming the map.
What a wonderful model haha! As promised, It'll be inside the arena.
 
Level 6
Joined
Aug 24, 2022
Messages
85
Hello one more time. I don't know if I need to create another post for my doubt, because my target is this system, again.

For some reason, the system broke, and I didn't make any change. I've made tests to check which waves aren't coming, and just the 4 and 5 wave simply doesn't spawn enemies. All the other ones are ok.

As I didn't make any kind of change, because the system was already working fine, my doubt is: Maybe the WE just saved something wrong on its code... I just don't know why this is happening, because other versions has exactly the same working system. Do I need to recreate the "broken" part of the trigger from scratch to ensure its function?

EDIT: I didn't put the Uncle Goblin yet. I'm going to put him when I reach the "Aesthetic" phase of my project.
 
Level 6
Joined
Aug 24, 2022
Messages
85
You probably forgot to Set variables for those waves.
Well, I went there to check again, and is all ok:
  • Enemy Quantity Check
    • Events
    • Conditions
    • Actions
      • For each (Integer Arena_Loop) from 1 to 42, do (Actions)
        • Loop - Actions
          • Set VariableSet Arena_Enemy_Amount[Arena_Loop] = 0
          • Set VariableSet ConsolationReward[Arena_Loop] = 0
          • Set VariableSet Reward[Arena_Loop] = 0
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Arena_Current_Wave Equal to 1
        • Then - Actions
          • Game - Display to (All players) the text: <Empty String>
          • Game - Display to (All players) the text: "|cff00ffffHuman Ar...
          • -------- Normal Enemies --------
          • Set VariableSet Arena_Enemy_Amount[1] = 100
          • Set VariableSet Arena_Enemy_Amount[2] = 0
          • Set VariableSet Arena_Enemy_Amount[3] = 0
          • Set VariableSet Arena_Enemy_Amount[4] = 0
          • Set VariableSet Arena_Enemy_Amount[5] = 0
          • -------- Elite Enemies --------
          • Set VariableSet Arena_Enemy_Amount[6] = 0
          • Set VariableSet Arena_Enemy_Amount[7] = 0
          • Set VariableSet Arena_Enemy_Amount[8] = 0
          • Set VariableSet Arena_Enemy_Amount[9] = 0
          • -------- Bosses --------
          • Set VariableSet Arena_Enemy_Amount[10] = 0
          • Set VariableSet Arena_Enemy_Amount[11] = 0
          • Set VariableSet Arena_Enemy_Amount[12] = 0
          • -------- Outerworld --------
          • Set VariableSet Arena_Enemy_Amount[13] = 0
          • -------- Wave Reward --------
          • Set VariableSet Reward[1] = 300
          • Set VariableSet ConsolationReward[1] = 50
          • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Arena_Current_Wave Equal to 2
            • Then - Actions
              • -------- Normal Enemies --------
              • Set VariableSet Arena_Enemy_Amount[1] = 60
              • Set VariableSet Arena_Enemy_Amount[2] = 10
              • Set VariableSet Arena_Enemy_Amount[3] = 10
              • Set VariableSet Arena_Enemy_Amount[4] = 10
              • Set VariableSet Arena_Enemy_Amount[5] = 10
              • -------- Elite Enemies --------
              • Set VariableSet Arena_Enemy_Amount[6] = 0
              • Set VariableSet Arena_Enemy_Amount[7] = 0
              • Set VariableSet Arena_Enemy_Amount[8] = 0
              • Set VariableSet Arena_Enemy_Amount[9] = 0
              • -------- Bosses --------
              • Set VariableSet Arena_Enemy_Amount[10] = 0
              • Set VariableSet Arena_Enemy_Amount[11] = 0
              • Set VariableSet Arena_Enemy_Amount[12] = 0
              • -------- Outerworld --------
              • Set VariableSet Arena_Enemy_Amount[13] = 0
              • -------- Wave Reward --------
              • Set VariableSet Reward[2] = 380
              • Set VariableSet ConsolationReward[2] = 63
              • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Arena_Current_Wave Equal to 3
                • Then - Actions
                  • -------- Normal Enemies --------
                  • Set VariableSet Arena_Enemy_Amount[1] = 47
                  • Set VariableSet Arena_Enemy_Amount[2] = 10
                  • Set VariableSet Arena_Enemy_Amount[3] = 10
                  • Set VariableSet Arena_Enemy_Amount[4] = 10
                  • Set VariableSet Arena_Enemy_Amount[5] = 10
                  • -------- Elite Enemies --------
                  • Set VariableSet Arena_Enemy_Amount[6] = 3
                  • Set VariableSet Arena_Enemy_Amount[7] = 3
                  • Set VariableSet Arena_Enemy_Amount[8] = 3
                  • Set VariableSet Arena_Enemy_Amount[9] = 3
                  • -------- Bosses --------
                  • Set VariableSet Arena_Enemy_Amount[10] = 1
                  • Set VariableSet Arena_Enemy_Amount[11] = 0
                  • Set VariableSet Arena_Enemy_Amount[12] = 0
                  • -------- Outerworld --------
                  • Set VariableSet Arena_Enemy_Amount[13] = 0
                  • -------- Wave Reward --------
                  • Set VariableSet Reward[3] = 571
                  • Set VariableSet ConsolationReward[3] = 95
                  • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Arena_Current_Wave Equal to 4
                    • Then - Actions
                      • -------- Normal Enemies --------
                      • Set VariableSet Arena_Enemy_Amount[1] = 41
                      • Set VariableSet Arena_Enemy_Amount[2] = 9
                      • Set VariableSet Arena_Enemy_Amount[3] = 9
                      • Set VariableSet Arena_Enemy_Amount[4] = 9
                      • Set VariableSet Arena_Enemy_Amount[5] = 9
                      • -------- Elite Enemies --------
                      • Set VariableSet Arena_Enemy_Amount[6] = 5
                      • Set VariableSet Arena_Enemy_Amount[7] = 5
                      • Set VariableSet Arena_Enemy_Amount[8] = 5
                      • Set VariableSet Arena_Enemy_Amount[9] = 5
                      • -------- Bosses --------
                      • Set VariableSet Arena_Enemy_Amount[10] = 1
                      • Set VariableSet Arena_Enemy_Amount[11] = 1
                      • Set VariableSet Arena_Enemy_Amount[12] = 1
                      • -------- Outerworld --------
                      • Set VariableSet Arena_Enemy_Amount[13] = 0
                      • -------- Wave Reward --------
                      • Set VariableSet Reward[4] = 753
                      • Set VariableSet ConsolationReward[4] = 125
                      • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Arena_Current_Wave Equal to 5
                        • Then - Actions
                          • -------- Normal Enemies --------
                          • Set VariableSet Arena_Enemy_Amount[1] = 20
                          • Set VariableSet Arena_Enemy_Amount[2] = 12
                          • Set VariableSet Arena_Enemy_Amount[3] = 12
                          • Set VariableSet Arena_Enemy_Amount[4] = 12
                          • Set VariableSet Arena_Enemy_Amount[5] = 12
                          • -------- Elite Enemies --------
                          • Set VariableSet Arena_Enemy_Amount[6] = 7
                          • Set VariableSet Arena_Enemy_Amount[7] = 7
                          • Set VariableSet Arena_Enemy_Amount[8] = 7
                          • Set VariableSet Arena_Enemy_Amount[9] = 7
                          • -------- Bosses --------
                          • Set VariableSet Arena_Enemy_Amount[10] = 2
                          • Set VariableSet Arena_Enemy_Amount[11] = 1
                          • Set VariableSet Arena_Enemy_Amount[12] = 1
                          • -------- Outerworld --------
                          • Set VariableSet Arena_Enemy_Amount[13] = 0
                          • -------- Wave Reward --------
                          • Set VariableSet Reward[5] = 920
                          • Set VariableSet ConsolationReward[5] = 153
                          • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Arena_Current_Wave Equal to 6
                            • Then - Actions
                              • -------- Normal Enemies --------
                              • Set VariableSet Arena_Enemy_Amount[1] = 2
                              • Set VariableSet Arena_Enemy_Amount[2] = 13
                              • Set VariableSet Arena_Enemy_Amount[3] = 13
                              • Set VariableSet Arena_Enemy_Amount[4] = 13
                              • Set VariableSet Arena_Enemy_Amount[5] = 13
                              • -------- Elite Enemies --------
                              • Set VariableSet Arena_Enemy_Amount[6] = 10
                              • Set VariableSet Arena_Enemy_Amount[7] = 10
                              • Set VariableSet Arena_Enemy_Amount[8] = 10
                              • Set VariableSet Arena_Enemy_Amount[9] = 10
                              • -------- Bosses --------
                              • Set VariableSet Arena_Enemy_Amount[10] = 2
                              • Set VariableSet Arena_Enemy_Amount[11] = 2
                              • Set VariableSet Arena_Enemy_Amount[12] = 2
                              • -------- Outerworld --------
                              • Set VariableSet Arena_Enemy_Amount[13] = 0
                              • -------- Wave Reward --------
                              • Set VariableSet Reward[6] = 1116
                              • Set VariableSet ConsolationReward[6] = 194
                              • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • Arena_Current_Wave Equal to 7
                                • Then - Actions
                                  • -------- Normal Enemies --------
                                  • Set VariableSet Arena_Enemy_Amount[1] = 0
                                  • Set VariableSet Arena_Enemy_Amount[2] = 0
                                  • Set VariableSet Arena_Enemy_Amount[3] = 0
                                  • Set VariableSet Arena_Enemy_Amount[4] = 0
                                  • Set VariableSet Arena_Enemy_Amount[5] = 0
                                  • -------- Elite Enemies --------
                                  • Set VariableSet Arena_Enemy_Amount[6] = 0
                                  • Set VariableSet Arena_Enemy_Amount[7] = 0
                                  • Set VariableSet Arena_Enemy_Amount[8] = 0
                                  • Set VariableSet Arena_Enemy_Amount[9] = 0
                                  • -------- Bosses --------
                                  • Set VariableSet Arena_Enemy_Amount[10] = 0
                                  • Set VariableSet Arena_Enemy_Amount[11] = 0
                                  • Set VariableSet Arena_Enemy_Amount[12] = 0
                                  • -------- Outerworld --------
                                  • Set VariableSet Arena_Enemy_Amount[13] = 1
                                  • -------- Wave Reward --------
                                  • Set VariableSet Reward[7] = 2250
                                  • Set VariableSet ConsolationReward[7] = 375
                                  • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • Arena_Current_Wave Equal to 8
                                    • Then - Actions
                                      • Game - Display to (All players) the text: <Empty String>
                                      • Game - Display to (All players) the text: "|cff00ffffTreant A...
                                      • -------- Normal Enemies --------
                                      • Set VariableSet Arena_Enemy_Amount[14] = 100
                                      • Set VariableSet Arena_Enemy_Amount[15] = 0
                                      • Set VariableSet Arena_Enemy_Amount[16] = 0
                                      • Set VariableSet Arena_Enemy_Amount[17] = 0
                                      • Set VariableSet Arena_Enemy_Amount[18] = 0
                                      • -------- Elite Enemies --------
                                      • Set VariableSet Arena_Enemy_Amount[19] = 0
                                      • Set VariableSet Arena_Enemy_Amount[20] = 0
                                      • Set VariableSet Arena_Enemy_Amount[21] = 0
                                      • Set VariableSet Arena_Enemy_Amount[22] = 0
                                      • -------- Bosses --------
                                      • Set VariableSet Arena_Enemy_Amount[23] = 0
                                      • Set VariableSet Arena_Enemy_Amount[24] = 0
                                      • Set VariableSet Arena_Enemy_Amount[25] = 0
                                      • -------- Outerworld --------
                                      • Set VariableSet Arena_Enemy_Amount[26] = 0
                                      • -------- Wave Reward --------
                                      • Set VariableSet Reward[8] = 600
                                      • Set VariableSet ConsolationReward[8] = 100
                                      • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • Arena_Current_Wave Equal to 9
                                        • Then - Actions
                                          • -------- Normal Enemies --------
                                          • Set VariableSet Arena_Enemy_Amount[14] = 60
                                          • Set VariableSet Arena_Enemy_Amount[15] = 10
                                          • Set VariableSet Arena_Enemy_Amount[16] = 10
                                          • Set VariableSet Arena_Enemy_Amount[17] = 10
                                          • Set VariableSet Arena_Enemy_Amount[18] = 10
                                          • -------- Elite Enemies --------
                                          • Set VariableSet Arena_Enemy_Amount[19] = 0
                                          • Set VariableSet Arena_Enemy_Amount[20] = 0
                                          • Set VariableSet Arena_Enemy_Amount[21] = 0
                                          • Set VariableSet Arena_Enemy_Amount[22] = 0
                                          • -------- Bosses --------
                                          • Set VariableSet Arena_Enemy_Amount[23] = 0
                                          • Set VariableSet Arena_Enemy_Amount[24] = 0
                                          • Set VariableSet Arena_Enemy_Amount[25] = 0
                                          • -------- Outerworld --------
                                          • Set VariableSet Arena_Enemy_Amount[26] = 0
                                          • -------- Wave Reward --------
                                          • Set VariableSet Reward[9] = 960
                                          • Set VariableSet ConsolationReward[9] = 160
                                          • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • Arena_Current_Wave Equal to 10
                                            • Then - Actions
                                              • -------- Normal Enemies --------
                                              • Set VariableSet Arena_Enemy_Amount[14] = 47
                                              • Set VariableSet Arena_Enemy_Amount[15] = 10
                                              • Set VariableSet Arena_Enemy_Amount[16] = 10
                                              • Set VariableSet Arena_Enemy_Amount[17] = 10
                                              • Set VariableSet Arena_Enemy_Amount[18] = 10
                                              • -------- Elite Enemies --------
                                              • Set VariableSet Arena_Enemy_Amount[19] = 3
                                              • Set VariableSet Arena_Enemy_Amount[20] = 3
                                              • Set VariableSet Arena_Enemy_Amount[21] = 3
                                              • Set VariableSet Arena_Enemy_Amount[22] = 3
                                              • -------- Bosses --------
                                              • Set VariableSet Arena_Enemy_Amount[23] = 1
                                              • Set VariableSet Arena_Enemy_Amount[24] = 0
                                              • Set VariableSet Arena_Enemy_Amount[25] = 0
                                              • -------- Outerworld --------
                                              • Set VariableSet Arena_Enemy_Amount[26] = 0
                                              • -------- Wave Reward --------
                                              • Set VariableSet Reward[10] = 1572
                                              • Set VariableSet ConsolationReward[10] = 262
                                              • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • Arena_Current_Wave Equal to 11
                                                • Then - Actions
                                                  • -------- Normal Enemies --------
                                                  • Set VariableSet Arena_Enemy_Amount[14] = 41
                                                  • Set VariableSet Arena_Enemy_Amount[15] = 9
                                                  • Set VariableSet Arena_Enemy_Amount[16] = 9
                                                  • Set VariableSet Arena_Enemy_Amount[17] = 9
                                                  • Set VariableSet Arena_Enemy_Amount[18] = 9
                                                  • -------- Elite Enemies --------
                                                  • Set VariableSet Arena_Enemy_Amount[19] = 5
                                                  • Set VariableSet Arena_Enemy_Amount[20] = 5
                                                  • Set VariableSet Arena_Enemy_Amount[21] = 5
                                                  • Set VariableSet Arena_Enemy_Amount[22] = 5
                                                  • -------- Bosses --------
                                                  • Set VariableSet Arena_Enemy_Amount[23] = 1
                                                  • Set VariableSet Arena_Enemy_Amount[24] = 1
                                                  • Set VariableSet Arena_Enemy_Amount[25] = 1
                                                  • -------- Outerworld --------
                                                  • Set VariableSet Arena_Enemy_Amount[26] = 0
                                                  • -------- Wave Reward --------
                                                  • Set VariableSet Reward[11] = 2136
                                                  • Set VariableSet ConsolationReward[11] = 356
                                                  • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                                                • Else - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • Arena_Current_Wave Equal to 12
                                                    • Then - Actions
                                                      • -------- Normal Enemies --------
                                                      • Set VariableSet Arena_Enemy_Amount[14] = 20
                                                      • Set VariableSet Arena_Enemy_Amount[15] = 12
                                                      • Set VariableSet Arena_Enemy_Amount[16] = 12
                                                      • Set VariableSet Arena_Enemy_Amount[17] = 12
                                                      • Set VariableSet Arena_Enemy_Amount[18] = 12
                                                      • -------- Elite Enemies --------
                                                      • Set VariableSet Arena_Enemy_Amount[19] = 7
                                                      • Set VariableSet Arena_Enemy_Amount[20] = 7
                                                      • Set VariableSet Arena_Enemy_Amount[21] = 7
                                                      • Set VariableSet Arena_Enemy_Amount[22] = 7
                                                      • -------- Bosses --------
                                                      • Set VariableSet Arena_Enemy_Amount[23] = 2
                                                      • Set VariableSet Arena_Enemy_Amount[24] = 1
                                                      • Set VariableSet Arena_Enemy_Amount[25] = 1
                                                      • -------- Outerworld --------
                                                      • Set VariableSet Arena_Enemy_Amount[26] = 0
                                                      • -------- Wave Reward --------
                                                      • Set VariableSet Reward[12] = 2700
                                                      • Set VariableSet ConsolationReward[12] = 450
                                                      • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                                                    • Else - Actions
                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        • If - Conditions
                                                          • Arena_Current_Wave Equal to 13
                                                        • Then - Actions
                                                          • -------- Normal Enemies --------
                                                          • Set VariableSet Arena_Enemy_Amount[14] = 2
                                                          • Set VariableSet Arena_Enemy_Amount[15] = 13
                                                          • Set VariableSet Arena_Enemy_Amount[16] = 13
                                                          • Set VariableSet Arena_Enemy_Amount[17] = 13
                                                          • Set VariableSet Arena_Enemy_Amount[18] = 13
                                                          • -------- Elite Enemies --------
                                                          • Set VariableSet Arena_Enemy_Amount[19] = 10
                                                          • Set VariableSet Arena_Enemy_Amount[20] = 10
                                                          • Set VariableSet Arena_Enemy_Amount[21] = 10
                                                          • Set VariableSet Arena_Enemy_Amount[22] = 10
                                                          • -------- Bosses --------
                                                          • Set VariableSet Arena_Enemy_Amount[23] = 2
                                                          • Set VariableSet Arena_Enemy_Amount[24] = 2
                                                          • Set VariableSet Arena_Enemy_Amount[25] = 2
                                                          • -------- Outerworld --------
                                                          • Set VariableSet Arena_Enemy_Amount[26] = 0
                                                          • -------- Wave Reward --------
                                                          • Set VariableSet Reward[13] = 3492
                                                          • Set VariableSet ConsolationReward[13] = 582
                                                          • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                                                        • Else - Actions
                                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            • If - Conditions
                                                              • Arena_Current_Wave Equal to 14
                                                            • Then - Actions
                                                              • -------- Normal Enemies --------
                                                              • Set VariableSet Arena_Enemy_Amount[14] = 0
                                                              • Set VariableSet Arena_Enemy_Amount[15] = 0
                                                              • Set VariableSet Arena_Enemy_Amount[16] = 0
                                                              • Set VariableSet Arena_Enemy_Amount[17] = 0
                                                              • Set VariableSet Arena_Enemy_Amount[18] = 0
                                                              • -------- Elite Enemies --------
                                                              • Set VariableSet Arena_Enemy_Amount[19] = 0
                                                              • Set VariableSet Arena_Enemy_Amount[20] = 0
                                                              • Set VariableSet Arena_Enemy_Amount[21] = 0
                                                              • Set VariableSet Arena_Enemy_Amount[22] = 0
                                                              • -------- Bosses --------
                                                              • Set VariableSet Arena_Enemy_Amount[23] = 0
                                                              • Set VariableSet Arena_Enemy_Amount[24] = 0
                                                              • Set VariableSet Arena_Enemy_Amount[25] = 0
                                                              • -------- Outerworld --------
                                                              • Set VariableSet Arena_Enemy_Amount[26] = 1
                                                              • -------- Wave Reward --------
                                                              • Set VariableSet Reward[14] = 6000
                                                              • Set VariableSet ConsolationReward[14] = 1000
                                                              • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                                                            • Else - Actions
                                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                • If - Conditions
                                                                  • Arena_Current_Wave Equal to 15
                                                                • Then - Actions
                                                                  • -------- Normal Enemies --------
                                                                  • Set VariableSet Arena_Enemy_Amount[27] = 100
                                                                  • Set VariableSet Arena_Enemy_Amount[28] = 0
                                                                  • Set VariableSet Arena_Enemy_Amount[29] = 0
                                                                  • Set VariableSet Arena_Enemy_Amount[30] = 0
                                                                  • Set VariableSet Arena_Enemy_Amount[31] = 0
                                                                  • -------- Elite Enemies --------
                                                                  • Set VariableSet Arena_Enemy_Amount[32] = 0
                                                                  • Set VariableSet Arena_Enemy_Amount[33] = 0
                                                                  • Set VariableSet Arena_Enemy_Amount[34] = 0
                                                                  • Set VariableSet Arena_Enemy_Amount[35] = 0
                                                                  • -------- Bosses --------
                                                                  • Set VariableSet Arena_Enemy_Amount[36] = 0
                                                                  • Set VariableSet Arena_Enemy_Amount[37] = 0
                                                                  • Set VariableSet Arena_Enemy_Amount[38] = 0
                                                                  • -------- Outerworld --------
                                                                  • Set VariableSet Arena_Enemy_Amount[39] = 0
                                                                  • -------- Wave Reward --------
                                                                  • Set VariableSet Reward[15] = 1800
                                                                  • Set VariableSet ConsolationReward[15] = 300
                                                                  • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                                                                • Else - Actions
                                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                    • If - Conditions
                                                                      • Arena_Current_Wave Equal to 16
                                                                    • Then - Actions
                                                                      • -------- Normal Enemies --------
                                                                      • Set VariableSet Arena_Enemy_Amount[27] = 60
                                                                      • Set VariableSet Arena_Enemy_Amount[28] = 10
                                                                      • Set VariableSet Arena_Enemy_Amount[29] = 10
                                                                      • Set VariableSet Arena_Enemy_Amount[30] = 10
                                                                      • Set VariableSet Arena_Enemy_Amount[31] = 10
                                                                      • -------- Elite Enemies --------
                                                                      • Set VariableSet Arena_Enemy_Amount[32] = 0
                                                                      • Set VariableSet Arena_Enemy_Amount[33] = 0
                                                                      • Set VariableSet Arena_Enemy_Amount[34] = 0
                                                                      • Set VariableSet Arena_Enemy_Amount[35] = 0
                                                                      • -------- Bosses --------
                                                                      • Set VariableSet Arena_Enemy_Amount[36] = 0
                                                                      • Set VariableSet Arena_Enemy_Amount[37] = 0
                                                                      • Set VariableSet Arena_Enemy_Amount[38] = 0
                                                                      • -------- Outerworld --------
                                                                      • Set VariableSet Arena_Enemy_Amount[39] = 0
                                                                      • -------- Wave Reward --------
                                                                      • Set VariableSet Reward[16] = 3240
                                                                      • Set VariableSet ConsolationReward[16] = 540
                                                                      • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                                                                    • Else - Actions
                                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                        • If - Conditions
                                                                          • Arena_Current_Wave Equal to 17
                                                                        • Then - Actions
                                                                          • -------- Normal Enemies --------
                                                                          • Set VariableSet Arena_Enemy_Amount[27] = 47
                                                                          • Set VariableSet Arena_Enemy_Amount[28] = 10
                                                                          • Set VariableSet Arena_Enemy_Amount[29] = 10
                                                                          • Set VariableSet Arena_Enemy_Amount[30] = 10
                                                                          • Set VariableSet Arena_Enemy_Amount[31] = 10
                                                                          • -------- Elite Enemies --------
                                                                          • Set VariableSet Arena_Enemy_Amount[32] = 3
                                                                          • Set VariableSet Arena_Enemy_Amount[33] = 3
                                                                          • Set VariableSet Arena_Enemy_Amount[34] = 3
                                                                          • Set VariableSet Arena_Enemy_Amount[35] = 3
                                                                          • -------- Bosses --------
                                                                          • Set VariableSet Arena_Enemy_Amount[36] = 1
                                                                          • Set VariableSet Arena_Enemy_Amount[37] = 0
                                                                          • Set VariableSet Arena_Enemy_Amount[38] = 0
                                                                          • -------- Outerworld --------
                                                                          • Set VariableSet Arena_Enemy_Amount[39] = 0
                                                                          • -------- Wave Reward --------
                                                                          • Set VariableSet Reward[17] = 5490
                                                                          • Set VariableSet ConsolationReward[17] = 915
                                                                          • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                                                                        • Else - Actions
                                                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                            • If - Conditions
                                                                              • Arena_Current_Wave Equal to 18
                                                                            • Then - Actions
                                                                              • -------- Normal Enemies --------
                                                                              • Set VariableSet Arena_Enemy_Amount[27] = 41
                                                                              • Set VariableSet Arena_Enemy_Amount[28] = 9
                                                                              • Set VariableSet Arena_Enemy_Amount[29] = 9
                                                                              • Set VariableSet Arena_Enemy_Amount[30] = 9
                                                                              • Set VariableSet Arena_Enemy_Amount[31] = 9
                                                                              • -------- Elite Enemies --------
                                                                              • Set VariableSet Arena_Enemy_Amount[32] = 5
                                                                              • Set VariableSet Arena_Enemy_Amount[33] = 5
                                                                              • Set VariableSet Arena_Enemy_Amount[34] = 5
                                                                              • Set VariableSet Arena_Enemy_Amount[35] = 5
                                                                              • -------- Bosses --------
                                                                              • Set VariableSet Arena_Enemy_Amount[36] = 1
                                                                              • Set VariableSet Arena_Enemy_Amount[37] = 1
                                                                              • Set VariableSet Arena_Enemy_Amount[38] = 1
                                                                              • -------- Outerworld --------
                                                                              • Set VariableSet Arena_Enemy_Amount[39] = 0
                                                                              • -------- Wave Reward --------
                                                                              • Set VariableSet Reward[18] = 7542
                                                                              • Set VariableSet ConsolationReward[18] = 1257
                                                                              • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                                                                            • Else - Actions
                                                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                • If - Conditions
                                                                                  • Arena_Current_Wave Equal to 19
                                                                                • Then - Actions
                                                                                  • -------- Normal Enemies --------
                                                                                  • Set VariableSet Arena_Enemy_Amount[27] = 20
                                                                                  • Set VariableSet Arena_Enemy_Amount[28] = 12
                                                                                  • Set VariableSet Arena_Enemy_Amount[29] = 12
                                                                                  • Set VariableSet Arena_Enemy_Amount[30] = 12
                                                                                  • Set VariableSet Arena_Enemy_Amount[31] = 12
                                                                                  • -------- Elite Enemies --------
                                                                                  • Set VariableSet Arena_Enemy_Amount[32] = 7
                                                                                  • Set VariableSet Arena_Enemy_Amount[33] = 7
                                                                                  • Set VariableSet Arena_Enemy_Amount[34] = 7
                                                                                  • Set VariableSet Arena_Enemy_Amount[35] = 7
                                                                                  • -------- Bosses --------
                                                                                  • Set VariableSet Arena_Enemy_Amount[36] = 2
                                                                                  • Set VariableSet Arena_Enemy_Amount[37] = 1
                                                                                  • Set VariableSet Arena_Enemy_Amount[38] = 1
                                                                                  • -------- Outerworld --------
                                                                                  • Set VariableSet Arena_Enemy_Amount[39] = 0
                                                                                  • -------- Wave Reward --------
                                                                                  • Set VariableSet Reward[19] = 9648
                                                                                  • Set VariableSet ConsolationReward[19] = 1608
                                                                                  • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                                                                                • Else - Actions
                                                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                    • If - Conditions
                                                                                      • Arena_Current_Wave Equal to 20
                                                                                    • Then - Actions
                                                                                      • -------- Normal Enemies --------
                                                                                      • Set VariableSet Arena_Enemy_Amount[27] = 2
                                                                                      • Set VariableSet Arena_Enemy_Amount[28] = 13
                                                                                      • Set VariableSet Arena_Enemy_Amount[29] = 13
                                                                                      • Set VariableSet Arena_Enemy_Amount[30] = 13
                                                                                      • Set VariableSet Arena_Enemy_Amount[31] = 13
                                                                                      • -------- Elite Enemies --------
                                                                                      • Set VariableSet Arena_Enemy_Amount[32] = 10
                                                                                      • Set VariableSet Arena_Enemy_Amount[33] = 10
                                                                                      • Set VariableSet Arena_Enemy_Amount[34] = 10
                                                                                      • Set VariableSet Arena_Enemy_Amount[35] = 10
                                                                                      • -------- Bosses --------
                                                                                      • Set VariableSet Arena_Enemy_Amount[36] = 2
                                                                                      • Set VariableSet Arena_Enemy_Amount[37] = 2
                                                                                      • Set VariableSet Arena_Enemy_Amount[38] = 2
                                                                                      • -------- Outerworld --------
                                                                                      • Set VariableSet Arena_Enemy_Amount[39] = 0
                                                                                      • -------- Wave Reward --------
                                                                                      • Set VariableSet Reward[20] = 12564
                                                                                      • Set VariableSet ConsolationReward[20] = 2094
                                                                                      • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                                                                                    • Else - Actions
                                                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                        • If - Conditions
                                                                                          • Arena_Current_Wave Equal to 21
                                                                                        • Then - Actions
                                                                                          • -------- Normal Enemies --------
                                                                                          • Set VariableSet Arena_Enemy_Amount[27] = 0
                                                                                          • Set VariableSet Arena_Enemy_Amount[28] = 0
                                                                                          • Set VariableSet Arena_Enemy_Amount[29] = 0
                                                                                          • Set VariableSet Arena_Enemy_Amount[30] = 0
                                                                                          • Set VariableSet Arena_Enemy_Amount[31] = 0
                                                                                          • -------- Elite Enemies --------
                                                                                          • Set VariableSet Arena_Enemy_Amount[32] = 0
                                                                                          • Set VariableSet Arena_Enemy_Amount[33] = 0
                                                                                          • Set VariableSet Arena_Enemy_Amount[34] = 0
                                                                                          • Set VariableSet Arena_Enemy_Amount[35] = 0
                                                                                          • -------- Bosses --------
                                                                                          • Set VariableSet Arena_Enemy_Amount[36] = 0
                                                                                          • Set VariableSet Arena_Enemy_Amount[37] = 0
                                                                                          • Set VariableSet Arena_Enemy_Amount[38] = 0
                                                                                          • -------- Outerworld --------
                                                                                          • Set VariableSet Arena_Enemy_Amount[39] = 1
                                                                                          • -------- Wave Reward --------
                                                                                          • Set VariableSet Reward[21] = 20200
                                                                                          • Set VariableSet ConsolationReward[21] = 3367
                                                                                          • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                                                                                        • Else - Actions
                                                                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                            • If - Conditions
                                                                                              • Arena_Current_Wave Equal to 22
                                                                                            • Then - Actions
                                                                                              • Game - Display to (All players) the text: <Empty String>
                                                                                              • Game - Display to (All players) the text: |cffd45e19Cinematic...
                                                                                              • Set VariableSet Arena_Enemy_Amount[40] = 1
                                                                                              • Set VariableSet Arena_Enemy_Amount[41] = 1
                                                                                              • Set VariableSet Arena_Enemy_Amount[42] = 1
                                                                                              • Set VariableSet ConsolationReward[22] = 3367
                                                                                              • Trigger - Run Next Wave Part 2 <gen> (ignoring conditions)
                                                                                            • Else - Actions
                                                                                              • Do nothing

How something that was running perfectly just break in two parts, even when nothing was changed? Haha!
 
Level 39
Joined
Feb 27, 2007
Messages
5,034
ConsolationReward and Reward don't need to be arrays.

There is more nuance than "doesn't work" you can check. Does Wave 3 actually end? Waves 4 and 5 instantly progress? Wave 6 is generated just fine? Is the reward gold given? Have you tried printing the current value of some of the relevant variables during waves 4 and 5 (how many of which units it thinks its making, for example).

As some triggers have changed throughout this process, it's always helpful to show everything up-to-date at once rather than just one part of the trigger. It's hard to accurately troubleshoot without being able to see most of what the current code is.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
If you send me an updated version of the map I can adjust the triggers for you. It'll be a lot easier to show you how to do this properly that way, because it looks like you've misunderstood the Arrays and probably aren't creating the Units properly.

For example, your Array index shouldn't be going above [13] for Arena_Enemy_Amount. It goes from [1] to [13] because that's the range of our For Loop. The For Loop cycles through those numbers when creating Units and references each of those indexes to do so.

Also, what Pyro said.
 
Level 6
Joined
Aug 24, 2022
Messages
85
Well guys, as I didn't find any other problem with the system done, I'm marking this thread as solved. Should I post the finished system to help other people, or not?
 
Top