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

[Trigger] Region Claiming (Please review)

Status
Not open for further replies.
Level 7
Joined
Jun 23, 2009
Messages
297
So, I just finished this region claiming, it's quite basic, but sure took a long time, and I'd appreciate your opinion. That is, what is wrong, what could be improved, etc.


Overview: What's it's job? Well, we have a certain amount of allies (group A), say, 10, and a certain amount of enemies, say, 2 (group B). Only group A can claim regions. That is, enter a region, maybe a base, or something, say -claim, or something like that, and that player owns the base, so nobody comes in and starts messing with this base.
The system has five functions:
1- Detecting when a player enters a base (one trigger per base)
2- Detecting when a player leaves a base (one trigger per base)
3- Giving each player the ownership of the base (one trigger per player)
4- Kicking all undesired players (one trigger per player)
5- Clearing the ownership of the base (one trigger per player)


Entering a base:
  • Base1
    • Events
      • Unit - A unit enters Base1 <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Human
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Set BaseDE[1] = 1
  • //BaseDE is a variable which sets where each player is. In this case, player //one is in base one, thus, BaseDE[1] is equal to 1. The first one is the //number of the base, the second one is the number of the player
    • Else - 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)
        • Then - Actions
          • Set BaseDE[1] = 2
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
            • Then - Actions
              • Set BaseDE[1] = 3
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
                • Then - Actions
                  • Set BaseDE[1] = 4
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
                    • Then - Actions
                      • Set BaseDE[1] = 5
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Triggering unit)) Equal to Player 6 (Orange)
                        • Then - Actions
                          • Set BaseDE[1] = 6
                        • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Triggering unit)) Equal to Player 7 (Green)
                        • Then - Actions
                          • Set BaseDE[1] = 7
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Owner of (Triggering unit)) Equal to Player 8 (Pink)
                            • Then - Actions
                              • Set BaseDE[1] = 8
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Owner of (Triggering unit)) Equal to Player 9 (Gray)
                                • Then - Actions
                                  • Set BaseDE[1] = 9
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Owner of (Triggering unit)) Equal to Player 10 (Light Blue)
                                    • Then - Actions
                                      • Set BaseDE[1] = 10
                                    • Else - Actions


Now, when a player leaves a base:
  • Base 1
    • Events
      • Unit - A unit leaves Base1 <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Human
    • Actions
      • Set BaseDE[1] = 0
Simple enough, but this is where it fails up to where I know, say there are two players: A and B, both go into base C, but player B leaves, so BaseDE[C] is set to zero, and if player A wants to claim the base, the system will detect that player A is located in no base... If you can think of any solution, please post it.




Now, claiming:
  • Rojo Claims
    • Events
      • Player - Player 1 (Red) types a chat message containing -claim as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BasesReclamadasYa[1] Equal to True
  • //BasesReclamadasYa is a variable which states whether the player has or //not previously claimed a base. This way, it prevents players from claiming //two or more bases.
    • Then - Actions
      • Game - Display to Player Group - Player 1 (Red) the text: |cFFFF0000The system has detected you already have a base under your ownership..
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BaseDE[1] Equal to 1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BaseR[1] Equal to 0
            • Then - Actions
              • Set BaseR[1] = 1
              • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at ((Center of Base1 <gen>) offset by (500.00, 0.00)) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
              • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at ((Center of Base1 <gen>) offset by (-500.00, 0.00)) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
              • Game - Display to (All allies of Player 1 (Red)) the text: ((Name of (Triggering player)) + claimed base number 1.)
              • Set BasesReclamadasYa[1] = True
            • Else - Actions
              • Game - Display to Player Group - Player 1 (Red) the text: This base already belongs to another player
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BaseDE[2] Equal to 1
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BaseR[2] Equal to 0
                • Then - Actions
                  • Set BaseR[2] = 1
                  • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at ((Center of Base2 <gen>) offset by (500.00, 0.00)) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                  • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at ((Center of Base2 <gen>) offset by (-500.00, 0.00)) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                  • Game - Display to (All allies of Player 1 (Red)) the text: ((Name of (Triggering player)) + reclamó la base 2.)
                  • Set BasesReclamadasYa[1] = True
                • Else - Actions
                  • Game - Display to Player Group - Player 1 (Red) the text: Esta base ya está ...
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BaseDE[3] Equal to 1
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BaseR[3] Equal to 0
                    • Then - Actions
                      • Set BaseR[3] = 1
                      • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at ((Center of Base3 <gen>) offset by (500.00, 0.00)) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                      • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at ((Center of Base3 <gen>) offset by (-500.00, 0.00)) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                      • Game - Display to (All allies of Player 1 (Red)) the text: ((Name of (Triggering player)) + reclamó la base 3.)
                      • Set BasesReclamadasYa[1] = True
                    • Else - Actions
                      • Game - Display to Player Group - Player 1 (Red) the text: Esta base ya está ...
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BaseDE[4] Equal to 1
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • BaseR[4] Equal to 0
                        • Then - Actions
                          • Set BaseR[4] = 1
                          • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at ((Center of Base4 <gen>) offset by (500.00, 0.00)) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                          • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at ((Center of Base4 <gen>) offset by (-500.00, 0.00)) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                          • Game - Display to (All allies of Player 1 (Red)) the text: ((Name of (Triggering player)) + reclamó la base 4.)
                          • Set BasesReclamadasYa[1] = True
                        • Else - Actions
                          • Game - Display to Player Group - Player 1 (Red) the text: Esta base ya está ...
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • BaseDE[5] Equal to 1
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • BaseR[5] Equal to 0
                            • Then - Actions
                              • Set BaseR[5] = 1
                              • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at (Center of Base5 <gen>) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                              • Game - Display to (All allies of Player 1 (Red)) the text: ((Name of (Triggering player)) + ha reclamado la base 5.)
                              • Set BasesReclamadasYa[1] = True
                            • Else - Actions
                              • Game - Display to Player Group - Player 1 (Red) the text: Esta base ya está ...
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • BaseDE[6] Equal to 1
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • BaseR[6] Equal to 0
                                • Then - Actions
                                  • Set BaseR[6] = 1
                                  • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at (Center of Base6 <gen>) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                  • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at (Center of Base06 <gen>) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                  • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at (Center of Base006 <gen>) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                  • Game - Display to (All allies of Player 1 (Red)) the text: ((Name of (Triggering player)) + reclamó la base 6.)
                                  • Set BasesReclamadasYa[1] = True
                                • Else - Actions
                                  • Game - Display to Player Group - Player 1 (Red) the text: Esta base ya está ...
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • BaseDE[7] Equal to 1
                                • Then - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • BaseR[7] Equal to 0
                                    • Then - Actions
                                      • Set BaseR[7] = 1
                                      • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at (Center of Base7 <gen>) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                      • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at (Center of Base07 <gen>) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                      • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at (Center of Base007 <gen>) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                      • Game - Display to (All allies of Player 1 (Red)) the text: ((Name of (Triggering player)) + reclamó la base 7.)
                                      • Set BasesReclamadasYa[1] = True
                                    • Else - Actions
                                      • Game - Display to Player Group - Player 1 (Red) the text: Esta base ya está ...
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • BaseDE[8] Equal to 1
                                    • Then - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • BaseR[8] Equal to 0
                                        • Then - Actions
                                          • Set BaseR[8] = 1
                                          • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at (Center of Base8 <gen>) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                          • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at (Center of Base08 <gen>) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                          • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at (Center of Base008 <gen>) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                          • Game - Display to (All allies of Player 1 (Red)) the text: ((Name of (Triggering player)) + reclamó la base 8.)
                                          • Set BasesReclamadasYa[1] = True
                                        • Else - Actions
                                          • Game - Display to Player Group - Player 1 (Red) the text: Esta base ya está ...
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • BaseDE[9] Equal to 1
                                        • Then - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • BaseR[9] Equal to 0
                                            • Then - Actions
                                              • Set BaseR[9] = 1
                                              • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at ((Center of Base9 <gen>) offset by (500.00, 0.00)) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                              • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at ((Center of Base9 <gen>) offset by (-500.00, 0.00)) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                              • Game - Display to (All allies of Player 1 (Red)) the text: ((Name of (Triggering player)) + reclamó la base 9.)
                                              • Set BasesReclamadasYa[1] = True
                                            • Else - Actions
                                              • Game - Display to Player Group - Player 1 (Red) the text: Esta base ya está ...
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • BaseDE[10] Equal to 1
                                            • Then - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • BaseR[10] Equal to 0
                                                • Then - Actions
                                                  • Set BaseR[10] = 1
                                                  • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at (Center of Base10 <gen>) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                                  • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at (Center of Base010 <gen>) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                                  • Game - Display to (All allies of Player 1 (Red)) the text: ((Name of (Triggering player)) + reclamó la base 10.)
                                                  • Set BasesReclamadasYa[1] = True
                                                • Else - Actions
                                                  • Game - Display to Player Group - Player 1 (Red) the text: Esta base ya está ...
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • BaseDE[11] Equal to 1
                                                • Then - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • BaseR[11] Equal to 0
                                                    • Then - Actions
                                                      • Set BaseR[11] = 1
                                                      • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at (Random point in Base11 <gen>) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                                      • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at (Random point in Base11 <gen>) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                                      • Game - Display to (All allies of Player 1 (Red)) the text: ((Name of (Triggering player)) + reclamó la base 11.)
                                                      • Set BasesReclamadasYa[1] = True
                                                    • Else - Actions
                                                      • Game - Display to Player Group - Player 1 (Red) the text: Esta base ya está ...
                                                • Else - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • BaseDE[12] Equal to 1
                                                    • Then - Actions
                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        • If - Conditions
                                                          • BaseR[12] Equal to 0
                                                        • Then - Actions
                                                          • Set BaseR[12] = 1
                                                          • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at (Random point in Base11 <gen>) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                                          • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at (Random point in Base11 <gen>) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
                                                          • Game - Display to (All allies of Player 1 (Red)) the text: ((Name of (Triggering player)) + reclamó la base 12.)
                                                          • Set BasesReclamadasYa[1] = True
                                                        • Else - Actions
                                                          • Game - Display to Player Group - Player 1 (Red) the text: Esta base ya está ...
                                                    • Else - Actions
                                                      • Game - Display to Player Group - Player 1 (Red) the text: |c00FF0000Error: the system detects your human is not in any base.



Now, with the ousting:
  • Oust Red
    • Events
      • Player - Player 1 (Red) types a chat message containing -kick as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BaseR[1] Equal to 1
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in Base1 <gen>) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Triggering unit)) Not equal to (Triggering player)
                  • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
  • //players 11 and 12 are the enemies, thus, they shouldn't be ousted
    • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
    • Then - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Picked unit)) Not equal to Human
        • Then - Actions
          • Unit - Kill (Picked unit)
        • Else - Actions
          • Unit - Move (Picked unit) instantly to (Center of Oust1 <gen>)
    • Else - Actions
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BaseR[2] Equal to 1
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in Base2 <gen>) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Triggering unit)) Not equal to (Triggering player)
                  • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                  • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Picked unit)) Not equal to Humano
                    • Then - Actions
                      • Unit - Kill (Picked unit)
                    • Else - Actions
                      • Unit - Move (Picked unit) instantly to (Center of Oust2 <gen>)
                • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BaseR[3] Equal to 1
            • Then - Actions
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units in Base3 <gen>) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Triggering unit)) Not equal to (Triggering player)
                      • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                      • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Not equal to Humano
                        • Then - Actions
                          • Unit - Kill (Picked unit)
                        • Else - Actions
                          • Unit - Move (Picked unit) instantly to (Center of Oust3 <gen>)
                    • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BaseR[4] Equal to 1
                • Then - Actions
                  • Custom script: set bj_wantDestroyGroup = true
                  • Unit Group - Pick every unit in (Units in Base4 <gen>) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Triggering unit)) Not equal to (Triggering player)
                          • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                          • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Unit-type of (Picked unit)) Not equal to Humano
                            • Then - Actions
                              • Unit - Kill (Picked unit)
                            • Else - Actions
                              • Unit - Move (Picked unit) instantly to (Center of Oust4 <gen>)
                        • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BaseR[5] Equal to 1
                    • Then - Actions
                      • Custom script: set bj_wantDestroyGroup = true
                      • Unit Group - Pick every unit in (Units in Base5 <gen>) and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Owner of (Triggering unit)) Not equal to (Triggering player)
                              • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                              • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Unit-type of (Picked unit)) Not equal to Humano
                                • Then - Actions
                                  • Unit - Kill (Picked unit)
                                • Else - Actions
                                  • Unit - Move (Picked unit) instantly to (Center of Oust5 <gen>)
                            • Else - Actions
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • BaseR[6] Equal to 1
                        • Then - Actions
                          • Custom script: set bj_wantDestroyGroup = true
                          • Unit Group - Pick every unit in (Units in Base6 <gen>) and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Owner of (Triggering unit)) Not equal to (Triggering player)
                                  • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                                  • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                                • Then - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Unit-type of (Picked unit)) Not equal to Humano
                                    • Then - Actions
                                      • Unit - Kill (Picked unit)
                                    • Else - Actions
                                      • Unit - Move (Picked unit) instantly to (Center of Oust6 <gen>)
                                • Else - Actions
                          • Custom script: set bj_wantDestroyGroup = true
                          • Unit Group - Pick every unit in (Units in Base06 <gen>) and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Owner of (Triggering unit)) Not equal to (Triggering player)
                                  • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                                  • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                                • Then - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Unit-type of (Picked unit)) Not equal to Humano
                                    • Then - Actions
                                      • Unit - Kill (Picked unit)
                                    • Else - Actions
                                      • Unit - Move (Picked unit) instantly to (Center of Oust6 <gen>)
                                • Else - Actions
                          • Custom script: set bj_wantDestroyGroup = true
                          • Unit Group - Pick every unit in (Units in Base006 <gen>) and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Owner of (Triggering unit)) Not equal to (Triggering player)
                                  • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                                  • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                                • Then - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Unit-type of (Picked unit)) Not equal to Humano
                                    • Then - Actions
                                      • Unit - Kill (Picked unit)
                                    • Else - Actions
                                      • Unit - Move (Picked unit) instantly to (Center of Oust6 <gen>)
                                • Else - Actions
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • BaseR[7] Equal to 1
                            • Then - Actions
                              • Custom script: set bj_wantDestroyGroup = true
                              • Unit Group - Pick every unit in (Units in Base7 <gen>) and do (Actions)
                                • Loop - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Owner of (Triggering unit)) Not equal to (Triggering player)
                                      • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                                      • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                                    • Then - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Unit-type of (Picked unit)) Not equal to Humano
                                        • Then - Actions
                                          • Unit - Kill (Picked unit)
                                        • Else - Actions
                                          • Unit - Move (Picked unit) instantly to (Center of Oust712 <gen>)
                                    • Else - Actions
                              • Custom script: set bj_wantDestroyGroup = true
                              • Unit Group - Pick every unit in (Units in Base07 <gen>) and do (Actions)
                                • Loop - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Owner of (Triggering unit)) Not equal to (Triggering player)
                                      • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                                      • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                                    • Then - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Unit-type of (Picked unit)) Not equal to Humano
                                        • Then - Actions
                                          • Unit - Kill (Picked unit)
                                        • Else - Actions
                                          • Unit - Move (Picked unit) instantly to (Center of Oust712 <gen>)
                                    • Else - Actions
                              • Custom script: set bj_wantDestroyGroup = true
                              • Unit Group - Pick every unit in (Units in Base007 <gen>) and do (Actions)
                                • Loop - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Owner of (Triggering unit)) Not equal to (Triggering player)
                                      • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                                      • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                                    • Then - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Unit-type of (Picked unit)) Not equal to Humano
                                        • Then - Actions
                                          • Unit - Kill (Picked unit)
                                        • Else - Actions
                                          • Unit - Move (Picked unit) instantly to (Center of Oust712 <gen>)
                                    • Else - Actions
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • BaseR[8] Equal to 1
                                • Then - Actions
                                  • Custom script: set bj_wantDestroyGroup = true
                                  • Unit Group - Pick every unit in (Units in Base8 <gen>) and do (Actions)
                                    • Loop - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Owner of (Triggering unit)) Not equal to (Triggering player)
                                          • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                                          • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                                        • Then - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • (Unit-type of (Picked unit)) Not equal to Humano
                                            • Then - Actions
                                              • Unit - Kill (Picked unit)
                                            • Else - Actions
                                              • Unit - Move (Picked unit) instantly to (Center of Oust810 <gen>)
                                        • Else - Actions
                                  • Custom script: set bj_wantDestroyGroup = true
                                  • Unit Group - Pick every unit in (Units in Base08 <gen>) and do (Actions)
                                    • Loop - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Owner of (Triggering unit)) Not equal to (Triggering player)
                                          • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                                          • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                                        • Then - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • (Unit-type of (Picked unit)) Not equal to Humano
                                            • Then - Actions
                                              • Unit - Kill (Picked unit)
                                            • Else - Actions
                                              • Unit - Move (Picked unit) instantly to (Center of Oust810 <gen>)
                                        • Else - Actions
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • BaseR[9] Equal to 1
                                    • Then - Actions
                                      • Custom script: set bj_wantDestroyGroup = true
                                      • Unit Group - Pick every unit in (Units in Base9 <gen>) and do (Actions)
                                        • Loop - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • (Owner of (Triggering unit)) Not equal to (Triggering player)
                                              • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                                              • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                                            • Then - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • (Unit-type of (Picked unit)) Not equal to Humano
                                                • Then - Actions
                                                  • Unit - Kill (Picked unit)
                                                • Else - Actions
                                                  • Unit - Move (Picked unit) instantly to (Center of Oust9 <gen>)
                                            • Else - Actions
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • BaseR[10] Equal to 1
                                        • Then - Actions
                                          • Custom script: set bj_wantDestroyGroup = true
                                          • Unit Group - Pick every unit in (Units in Base10 <gen>) and do (Actions)
                                            • Loop - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • (Owner of (Triggering unit)) Not equal to (Triggering player)
                                                  • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                                                  • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                                                • Then - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • (Unit-type of (Picked unit)) Not equal to Humano
                                                    • Then - Actions
                                                      • Unit - Kill (Picked unit)
                                                    • Else - Actions
                                                      • Unit - Move (Picked unit) instantly to (Center of Oust810 <gen>)
                                                • Else - Actions
                                          • Custom script: set bj_wantDestroyGroup = true
                                          • Unit Group - Pick every unit in (Units in Base010 <gen>) and do (Actions)
                                            • Loop - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • (Owner of (Triggering unit)) Not equal to (Triggering player)
                                                  • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                                                  • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                                                • Then - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • (Unit-type of (Picked unit)) Not equal to Humano
                                                    • Then - Actions
                                                      • Unit - Kill (Picked unit)
                                                    • Else - Actions
                                                      • Unit - Move (Picked unit) instantly to (Center of Oust810 <gen>)
                                                • Else - Actions
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • BaseR[11] Equal to 1
                                            • Then - Actions
                                              • Custom script: set bj_wantDestroyGroup = true
                                              • Unit Group - Pick every unit in (Units in Base11 <gen>) and do (Actions)
                                                • Loop - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • (Owner of (Triggering unit)) Not equal to (Triggering player)
                                                      • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                                                      • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                                                    • Then - Actions
                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        • If - Conditions
                                                          • (Unit-type of (Picked unit)) Not equal to Humano
                                                        • Then - Actions
                                                          • Unit - Kill (Picked unit)
                                                        • Else - Actions
                                                          • Unit - Move (Picked unit) instantly to (Center of Oust11 <gen>)
                                                    • Else - Actions
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • BaseR[12] Equal to 1
                                                • Then - Actions
                                                  • Custom script: set bj_wantDestroyGroup = true
                                                  • Unit Group - Pick every unit in (Units in Base12 <gen>) and do (Actions)
                                                    • Loop - Actions
                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        • If - Conditions
                                                          • (Owner of (Triggering unit)) Not equal to (Triggering player)
                                                          • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                                                          • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                                                        • Then - Actions
                                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            • If - Conditions
                                                              • (Unit-type of (Picked unit)) Not equal to Humano
                                                            • Then - Actions
                                                              • Unit - Kill (Picked unit)
                                                            • Else - Actions
                                                              • Unit - Move (Picked unit) instantly to (Center of Oust712 <gen>)
                                                        • Else - Actions
                                                  • Custom script: set bj_wantDestroyGroup = true
                                                  • Unit Group - Pick every unit in (Units in Base012 <gen>) and do (Actions)
                                                    • Loop - Actions
                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        • If - Conditions
                                                          • (Owner of (Triggering unit)) Not equal to (Triggering player)
                                                          • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                                                          • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                                                        • Then - Actions
                                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            • If - Conditions
                                                              • (Unit-type of (Picked unit)) Not equal to Humano
                                                            • Then - Actions
                                                              • Unit - Kill (Picked unit)
                                                            • Else - Actions
                                                              • Unit - Move (Picked unit) instantly to (Center of Oust712 <gen>)
                                                        • Else - Actions
                                                  • Custom script: set bj_wantDestroyGroup = true
                                                  • Unit Group - Pick every unit in (Units in Base0012 <gen>) and do (Actions)
                                                    • Loop - Actions
                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        • If - Conditions
                                                          • (Owner of (Triggering unit)) Not equal to (Triggering player)
                                                          • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
                                                          • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
                                                        • Then - Actions
                                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            • If - Conditions
                                                              • (Unit-type of (Picked unit)) Not equal to Humano
                                                            • Then - Actions
                                                              • Unit - Kill (Picked unit)
                                                            • Else - Actions
                                                              • Unit - Move (Picked unit) instantly to (Center of Oust712 <gen>)
                                                        • Else - Actions
                                                • Else - Actions
                                                  • Game - Display to Player Group - Player 1 (Red) the text: |c00FF0000Error: the system detects you don't own any bases.






Continues in the next post:
 
Level 7
Joined
Jun 23, 2009
Messages
297
And last, but not least, the clearing function:

  • R1
    • Events
      • Player - Player 1 (Red) types a chat message containing -clear as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BaseR[1] Equal to 1
        • Then - Actions
          • Set BaseR[1] = 0
          • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at ((Center of Base1 <gen>) offset by (500.00, 0.00)) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
          • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at ((Center of Base1 <gen>) offset by (-500.00, 0.00)) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
          • Game - Display to (All allies of Player 1 (Red)) the text: ((Name of (Triggering player)) + cleared base 1.)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BaseR[2] Equal to 1
            • Then - Actions
              • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at ((Center of Base2 <gen>) offset by (500.00, 0.00)) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
              • Cinematic - Ping minimap for (All allies of Player 1 (Red)) at ((Center of Base2 <gen>) offset by (-500.00, 0.00)) for 2.00 seconds, using a Flashy ping of color (100.00%, 0.00%, 0.00%)
              • Game - Display to (All allies of Player 1 (Red)) the text: ((Name of (Triggering player)) + liberó la base 2.)
              • Set BaseR[2] = 0
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BaseR[3] Equal to 1
                • Then - Actions
                  • Set BaseR[3] = 0
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BaseR[4] Equal to 1
                    • Then - Actions
                      • Set BaseR[4] = 0
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • BaseR[5] Equal to 1
                        • Then - Actions
                          • Set BaseR[5] = 0
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • BaseR[6] Equal to 1
                            • Then - Actions
                              • Set BaseR[6] = 0
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • BaseR[7] Equal to 1
                                • Then - Actions
                                  • Set BaseR[7] = 0
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • BaseR[8] Equal to 1
                                    • Then - Actions
                                      • Set BaseR[8] = 0
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • BaseR[9] Equal to 1
                                        • Then - Actions
                                          • Set BaseR[9] = 0
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • BaseR[10] Equal to 1
                                            • Then - Actions
                                              • Set BaseR[10] = 0
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • BaseR[11] Equal to 1
                                                • Then - Actions
                                                  • Set BaseR[11] = 0
                                                • Else - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • BaseR[12] Equal to 1
                                                    • Then - Actions
                                                      • Set BaseR[12] = 0
                                                    • Else - Actions
                                                      • Game - Display to Player Group - Player 1 (Red) the text: |c00FF0000Error: the system detects you don't own any bases.




I really hope somebody helps me here, It's shorter than it seems. If you do not understand any part, just point it out and I'll gladly explain.

NOTE: some bases have multiple regions, therefore, they might be <base7>, <base07>, <base007>.
Other bases might share some ousting regions, therefore the <oust712>, that means that both, bases 7 and 12, share the ousting region.[/TRIGGER]
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Use loops to greatly shorten the triggers.

  • Untitled Trigger 051
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Array[(Integer A)] Equal to 1
            • Then - Actions
              • -------- do something --------
              • -------- -------------------- --------
              • -------- This breaks out of the loop --------
              • Skip remaining actions
            • Else - Actions
 
Status
Not open for further replies.
Top