• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Tiered Construction Mulitple Triggers Help

Status
Not open for further replies.
Level 4
Joined
Jul 14, 2012
Messages
100
Ok I apologize in advance for the length of the my post because I need help with a problem that I think involves up to three triggers so I've included them all just to be sure the problem can be found.

Ok so first of all in this map the player can build towers in a lane to advance how much of the lane they control, and therefore, make more income every x seconds. However, they have a base with other buildings that can be built and to keep the player from building towers in their base to cheat the system, I used a different buildable terrain type in the base, so this trigger checks to make sure the tower is not in the base:

  • An Obsidian Statue is Misplaced
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • (Unit-type of (Constructing structure)) Equal to Territorial Banner (forgotten worker)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain type at (Position of (Constructing structure))) Equal to Cityscape - Grass Trim
        • Then - Actions
          • Unit - Remove (Constructing structure) from the game
          • Player - Add 100 to (Owner of (Triggering unit)) Current gold
          • Player - Add 15 to (Owner of (Triggering unit)) Current lumber
          • Quest - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the Hint message: |cff32cd32HINT|r: Y...
        • Else - Actions
Ok so if the tower is not on grass trim, it's in the clear to construct. No problem there. But here's another catch: there are columns in the lane, 4 columns. There are 2 spots to build towers in each column so you can have 8 towers in the lane. Additionally, each base starts with a tower in front of their base, making 10 towers by the time are the spots are taken.

But: you can't build towers on the next column until you've taken up both slots of the previous column, this prevents players from rushing each other's column spaces so it's fair game. That means this trigger involves checking if the tower is in a column, then the previous column must have 2 towers by that player built, as well as each column before it, if any.

  • An Obsidian Statue is Placed
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Territorial Banner (forgotten worker)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Constructed structure)) Equal to Player 8 (Pink)
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Column 1 <gen> contains (Constructed structure)) Equal to True
            • Then - Actions
              • Set column1 = (column1 + 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Column 2 <gen> contains (Constructed structure)) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • column1 Equal to 2
                    • Then - Actions
                      • Set column2 = (column2 + 1)
                    • Else - Actions
                      • Unit - Remove (Constructed structure) from the game
                      • Player - Add 100 to (Owner of (Triggering unit)) Current gold
                      • Player - Add 15 to (Owner of (Triggering unit)) Current lumber
                      • Quest - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the Hint message: |cff32cd32HINT|r: Y...
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Column 3 <gen> contains (Constructed structure)) Equal to True
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • column1 Equal to 2
                          • column2 Equal to 2
                        • Then - Actions
                          • Set column3 = (column3 + 1)
                        • Else - Actions
                          • Unit - Remove (Constructed structure) from the game
                          • Player - Add 100 to (Owner of (Triggering unit)) Current gold
                          • Player - Add 15 to (Owner of (Triggering unit)) Current lumber
                          • Quest - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the Hint message: |cff32cd32HINT|r: Y...
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Column4 <gen> contains (Constructed structure)) Equal to True
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • column1 Equal to 2
                              • column2 Equal to 2
                              • column3 Equal to 2
                            • Then - Actions
                              • Set column4 = (column4 + 1)
                            • Else - Actions
                              • Unit - Remove (Constructed structure) from the game
                              • Player - Add 100 to (Owner of (Triggering unit)) Current gold
                              • Player - Add 15 to (Owner of (Triggering unit)) Current lumber
                              • Quest - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the Hint message: |cff32cd32HINT|r: Y...
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (blue statue <gen> contains (Constructed structure)) Equal to True
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • column1 Equal to 2
                                  • column2 Equal to 2
                                  • column3 Equal to 2
                                  • column4 Equal to 2
                                • Then - Actions
                                • Else - Actions
                                  • Unit - Remove (Constructed structure) from the game
                                  • Player - Add 100 to (Owner of (Triggering unit)) Current gold
                                  • Player - Add 15 to (Owner of (Triggering unit)) Current lumber
                                  • Quest - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the Hint message: |cff32cd32HINT|r: Y...
                            • Else - Actions
                              • Do nothing
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Column4 <gen> contains (Constructed structure)) Equal to True
            • Then - Actions
              • Set p2column1 = (p2column1 + 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Column 3 <gen> contains (Constructed structure)) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • p2column1 Equal to 2
                    • Then - Actions
                      • Set p2column2 = (p2column2 + 1)
                    • Else - Actions
                      • Unit - Remove (Constructed structure) from the game
                      • Player - Add 100 to (Owner of (Triggering unit)) Current gold
                      • Player - Add 15 to (Owner of (Triggering unit)) Current lumber
                      • Quest - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the Hint message: |cff32cd32HINT|r: Y...
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Column 2 <gen> contains (Constructed structure)) Equal to True
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • p2column1 Equal to 2
                          • p2column2 Equal to 2
                        • Then - Actions
                          • Set p2column3 = (p2column3 + 1)
                        • Else - Actions
                          • Unit - Remove (Constructed structure) from the game
                          • Player - Add 100 to (Owner of (Triggering unit)) Current gold
                          • Player - Add 15 to (Owner of (Triggering unit)) Current lumber
                          • Quest - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the Hint message: |cff32cd32HINT|r: Y...
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Column 1 <gen> contains (Constructed structure)) Equal to True
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • p2column1 Equal to 2
                              • p2column2 Equal to 2
                              • p2column3 Equal to 2
                            • Then - Actions
                              • Set p2column4 = (p2column4 + 1)
                            • Else - Actions
                              • Unit - Remove (Constructed structure) from the game
                              • Player - Add 100 to (Owner of (Triggering unit)) Current gold
                              • Player - Add 15 to (Owner of (Triggering unit)) Current lumber
                              • Quest - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the Hint message: |cff32cd32HINT|r: Y...
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (red statue <gen> contains (Constructed structure)) Equal to True
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • p2column1 Equal to 2
                                  • p2column2 Equal to 2
                                  • p2column3 Equal to 2
                                  • p2column4 Equal to 2
                                • Then - Actions
                                • Else - Actions
                                  • Unit - Remove (Constructed structure) from the game
                                  • Player - Add 100 to (Owner of (Triggering unit)) Current gold
                                  • Player - Add 15 to (Owner of (Triggering unit)) Current lumber
                                  • Quest - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the Hint message: |cff32cd32HINT|r: Y...
                            • Else - Actions
                              • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Constructed structure) is alive) Equal to True
        • Then - Actions
          • If ((Owner of (Triggering unit)) Equal to Player 4 (Purple)) then do (Set bluecolumn = (bluecolumn + 1)) else do (Do nothing)
          • If ((Owner of (Triggering unit)) Equal to Player 8 (Pink)) then do (Set redcolumn = (redcolumn + 1)) else do (Do nothing)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Constructed structure) is alive) Equal to True
        • Then - Actions
          • Leaderboard - Change the value for Player 2 (Blue) in (Last created leaderboard) to (Integer(((String((bluecolumn x 10))) + %)))
          • Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to (Integer(((String((redcolumn x 10))) + %)))
          • Unit Group - Add (Constructed structure) to towerclub[(Player number of (Owner of (Constructed structure)))]
        • Else - Actions
WELL, so if a tower is cleared, then it isn't removed instantly upon construction and it then contributes to the players' income and reflects that on the leaderboard.

But for some reason, it's not working in registering that the previous columns meet the all spaces occupied first. I can still build towers in columns I'm not eligible for because a tower in my previous column is destroyed. That's why I'm also including this trigger:

  • An Obsidian Statue is Displaced
    • Events
      • Unit - A unit owned by Player 8 (Pink) Dies
      • Unit - A unit owned by Player 4 (Purple) Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Territorial Banner (forgotten worker)
      • ((Dying unit) is in towerclub[(Player number of (Owner of (Dying unit)))]) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Dying unit)) Equal to Player 4 (Purple)
        • Then - Actions
          • Set bluecolumn = (bluecolumn - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Column4 <gen> contains (Dying unit)) Equal to True
            • Then - Actions
              • Set p2column1 = (p2column1 - 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Column 3 <gen> contains (Dying unit)) Equal to True
                • Then - Actions
                  • Set p2column2 = (p2column2 - 1)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Column 2 <gen> contains (Dying unit)) Equal to True
                    • Then - Actions
                      • Set p2column3 = (p2column3 - 1)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Column 1 <gen> contains (Dying unit)) Equal to True
                        • Then - Actions
                          • Set p2column4 = (p2column4 - 1)
                        • Else - Actions
                          • Do nothing
          • Quest - Display to Player Group - Player 4 (Purple) the Warning message: |cffff0000WARNING|r...
          • Quest - Display to Player Group - Player 2 (Blue) the Warning message: |cffff0000WARNING|r...
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Dying unit)) Equal to Player 8 (Pink)
            • Then - Actions
              • Set redcolumn = (redcolumn - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Column 1 <gen> contains (Dying unit)) Equal to True
                • Then - Actions
                  • Set column1 = (column1 - 1)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Column 2 <gen> contains (Dying unit)) Equal to True
                    • Then - Actions
                      • Set column2 = (column2 - 1)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Column 3 <gen> contains (Dying unit)) Equal to True
                        • Then - Actions
                          • Set column3 = (column3 - 1)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Column4 <gen> contains (Dying unit)) Equal to True
                            • Then - Actions
                              • Set column4 = (column4 - 1)
                            • Else - Actions
                              • Do nothing
              • Quest - Display to Player Group - Player 8 (Pink) the Warning message: |cffff0000WARNING|r...
              • Quest - Display to Player Group - Player 1 (Red) the Warning message: |cffff0000WARNING|r...
            • Else - Actions
      • Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to (Integer(((String((redcolumn x 10))) + %)))
      • Leaderboard - Change the value for Player 2 (Blue) in (Last created leaderboard) to (Integer(((String((bluecolumn x 10))) + %)))

So I've looked over all my triggers multiple times and I just can't seem to find what's wrong with it and why it isn't working. It used to work and now it doesn't for some reason :( I know it's a lot to look at in one go so I understand if I don't get a solution right away but if you can help, then it would be greatly appreciated.
 
Level 6
Joined
Mar 17, 2012
Messages
105
Ok so to clarify so that this problem can be worked out:

You have a worker who,
builds territorial banners,
that can only be built,
outside of the base,
in columns in the lane,
but only if the previous column is occupied,
by two towers?
 
Level 21
Joined
Nov 4, 2013
Messages
2,017
All right, I'll tell you that your triggers are needlessly intricate and hard to decipher. I'd like to simplify them a bit while providing the solution as well if possible.
First step is removing the variables column(1-4) and replace them with an unique array variable called column with a size of 4. That will make things much easier and the variables simpler to handle.
Now here is the trigger:

  • An Obsidian Statue is Placed
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Territorial Banner (forgotten worker)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Constructed structure)) Equal to Player 8 (Pink)
          • (Column 1 <gen> contains (Constructing structure)) Equal to True
        • Then - Actions
          • Set column[1] = (column[1] + 1)
        • Else - Actions
          • Unit - Kill (Constructed structure)
          • Player - Add 100 to (Owner of (Triggering unit)) Current gold
          • Player - Add 15 to (Owner of (Triggering unit)) Current lumber
          • Quest - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the Hint message: |cff32cd32HINT|r: Y...
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Constructed structure)) Equal to Player 8 (Pink)
          • (Column 2 <gen> contains (Constructing structure)) Equal to True
          • column[1] Less than 2
        • Then - Actions
          • Set column[2] = (column[2] + 1)
        • Else - Actions
          • Unit - Kill (Constructed structure)
          • Player - Add 100 to (Owner of (Triggering unit)) Current gold
          • Player - Add 15 to (Owner of (Triggering unit)) Current lumber
          • Quest - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the Hint message: |cff32cd32HINT|r: Y...
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Constructed structure)) Equal to Player 8 (Pink)
          • (Column 3 <gen> contains (Constructing structure)) Equal to True
          • column[1] Less than 2
          • column[2] Less than 2
        • Then - Actions
          • Set column[3] = (column[3] + 1)
        • Else - Actions
          • Unit - Kill (Constructed structure)
          • Player - Add 100 to (Owner of (Triggering unit)) Current gold
          • Player - Add 15 to (Owner of (Triggering unit)) Current lumber
          • Quest - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the Hint message: |cff32cd32HINT|r: Y...
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Constructed structure)) Equal to Player 8 (Pink)
          • (Column 4 <gen> contains (Constructing structure)) Equal to True
          • column[1] Less than 2
          • column[2] Less than 2
          • column[3] Less than 2
        • Then - Actions
          • Set column[4] = (column[4] + 1)
        • Else - Actions
          • Unit - Kill (Constructed structure)
          • Player - Add 100 to (Owner of (Triggering unit)) Current gold
          • Player - Add 15 to (Owner of (Triggering unit)) Current lumber
          • Quest - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the Hint message: |cff32cd32HINT|r: Y...
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Constructed structure) is alive) Equal to True
        • Then - Actions
          • If ((Owner of (Triggering unit)) Equal to Player 4 (Purple)) then do (Set bluecolumn = (bluecolumn + 1)) else do (Do nothing)
          • If ((Owner of (Triggering unit)) Equal to Player 8 (Pink)) then do (Set redcolumn = (redcolumn + 1)) else do (Do nothing)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Constructed structure) is alive) Equal to True
        • Then - Actions
          • Leaderboard - Change the value for Player 2 (Blue) in (Last created leaderboard) to (Integer(((String((bluecolumn x 10))) + %)))
          • Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to (Integer(((String((redcolumn x 10))) + %)))
          • Unit Group - Add (Constructed structure) to towerclub[(Player number of (Owner of (Constructed structure)))]
        • Else - Actions
This should work fine and it's 100 times simpler than the one you made. Whenever a tower is removed, you decrease column[Lane number in which tower is in] by 1.
 
Level 4
Joined
Jul 14, 2012
Messages
100
I think your trigger makes it always die, because it can't meet every single one of the if/then/elses... And if it doesn't meet the if, it runs the else, and the else is to kill the unit. I would have to put "skip remaining actions" but even then, if it runs the wrong if/then/else before it gets to the one where it fits, then it will be killed before it gets a chance to prove its allowed to be built.

Here's what I made, and it still doesn't work. It lets me build where I'm not supposed to. It seems that the "Banner Destroyed" trigger doesn't even run because it's supposed to say "error" when it doesnt register anything and it doesn't. Help?? Problem still same as before... the only progress I made was made the trigger easier to read and simplify it to two triggers:

  • Banner Created
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Territorial Banner (forgotten worker)
    • Actions
      • -------- Running Pink Construction --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Constructed structure)) Equal to Player 8 (Pink)
          • (Column 1 <gen> contains (Constructed structure)) Equal to True
          • success Equal to False
        • Then - Actions
          • Set Column[1] = (Column[1] + 1)
          • Set success = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Constructed structure)) Equal to Player 8 (Pink)
          • (Column 2 <gen> contains (Constructed structure)) Equal to True
          • Column[1] Equal to 2
          • success Equal to False
        • Then - Actions
          • Set Column[2] = (Column[2] + 1)
          • Set success = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Constructed structure)) Equal to Player 8 (Pink)
          • (Column 3 <gen> contains (Constructed structure)) Equal to True
          • Column[1] Equal to 2
          • Column[2] Equal to 2
          • success Equal to False
        • Then - Actions
          • Set Column[3] = (Column[3] + 1)
          • Set success = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Constructed structure)) Equal to Player 8 (Pink)
          • (Column4 <gen> contains (Constructed structure)) Equal to True
          • Column[1] Equal to 2
          • Column[2] Equal to 2
          • Column[3] Equal to 2
          • success Equal to False
        • Then - Actions
          • Set Column[4] = (Column[4] + 1)
          • Set success = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Constructed structure)) Equal to Player 8 (Pink)
          • (blue statue <gen> contains (Constructed structure)) Equal to True
          • Column[1] Equal to 2
          • Column[2] Equal to 2
          • Column[3] Equal to 2
          • Column[4] Equal to 2
          • success Equal to False
        • Then - Actions
          • Set success = True
        • Else - Actions
      • -------- Finished Running Check --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • success Equal to False
        • Then - Actions
          • Unit - Kill (Constructed structure)
          • Player - Add 100 to (Owner of (Triggering unit)) Current gold
          • Player - Add 15 to (Owner of (Triggering unit)) Current lumber
          • Quest - Display to (All players matching ((Matching player) Equal to (Owner of (Triggering unit)))) the Hint message: |cff32cd32HINT|r: Y...
        • Else - Actions
          • If ((Owner of (Triggering unit)) Equal to Player 4 (Purple)) then do (Set bluecolumn = (bluecolumn + 1)) else do (Do nothing)
          • If ((Owner of (Triggering unit)) Equal to Player 8 (Pink)) then do (Set redcolumn = (redcolumn + 1)) else do (Do nothing)
          • Unit Group - Add (Constructed structure) to towerclub[(Player number of (Owner of (Constructed structure)))]
          • Leaderboard - Change the value for Player 2 (Blue) in (Last created leaderboard) to (Integer(((String((bluecolumn x 10))) + %)))
          • Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to (Integer(((String((redcolumn x 10))) + %)))


And the second trigger, the destroying trigger, doesn't even run:


  • Banner Destroyed
    • Events
      • Unit - A unit owned by Player 8 (Pink) Dies
      • Unit - A unit owned by Player 4 (Purple) Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Territorial Banner (forgotten worker)
      • (((Dying unit) is in towerclub[4]) Equal to True) or (((Dying unit) is in towerclub[8]) Equal to True)
    • Actions
      • -------- Running Pink Destruction --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Dying unit)) Equal to Player 8 (Pink)
          • (Column 1 <gen> contains (Dying unit)) Equal to True
          • success Equal to False
        • Then - Actions
          • Set Column[1] = (Column[1] - 1)
          • Set success = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Dying unit)) Equal to Player 8 (Pink)
          • (Column 2 <gen> contains (Dying unit)) Equal to True
          • success Equal to False
        • Then - Actions
          • Set Column[2] = (Column[2] - 1)
          • Set success = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Dying unit)) Equal to Player 8 (Pink)
          • (Column 3 <gen> contains (Dying unit)) Equal to True
          • success Equal to False
        • Then - Actions
          • Set Column[3] = (Column[3] - 1)
          • Set success = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Dying unit)) Equal to Player 8 (Pink)
          • (Column4 <gen> contains (Dying unit)) Equal to True
          • success Equal to False
        • Then - Actions
          • Set Column[4] = (Column[4] - 1)
          • Set success = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Dying unit)) Equal to Player 8 (Pink)
          • (blue statue <gen> contains (Dying unit)) Equal to True
          • success Equal to False
        • Then - Actions
          • Set success = True
        • Else - Actions
      • -------- Finished Running Check --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • success Equal to True
        • Then - Actions
          • If ((Owner of (Triggering unit)) Equal to Player 4 (Purple)) then do (Set bluecolumn = (bluecolumn - 1)) else do (Do nothing)
          • If ((Owner of (Triggering unit)) Equal to Player 8 (Pink)) then do (Set redcolumn = (redcolumn - 1)) else do (Do nothing)
          • Leaderboard - Change the value for Player 2 (Blue) in (Last created leaderboard) to (Integer(((String((bluecolumn x 10))) + %)))
          • Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to (Integer(((String((redcolumn x 10))) + %)))
        • Else - Actions
          • Game - Display to (All players) the text: error in dying
Help please. I can't find what's wrong with them.

EDIT: Replying to Marine

Ok so to clarify so that this problem can be worked out:

You have a worker who,
builds territorial banners,
that can only be built,
outside of the base,
in columns in the lane,
but only if the previous column is occupied,
by two towers?

Yes! I have posted my most recent work on the trigger, and the primary trigger, "Banner created" works just fine, but the "banner destroyed" doesn't work at all. It doesn't even run, so it doesn't register a tower as being destroyed which renders the "banner created" rules' obsolete when building where one is not supposed to, because the game still thinks the tower is there because the "banner destroyed' wouldnt run.

EDIT: I found the problem with the Dying not running; it was because apparently the constructed towers weren't being assigned to the towerclub(4) or(8) because the array wasn't big enough. I ended up just making it a single variable(no array) because upon thinking about, I realized it was not necessary to even have an array. The sole purpose of the unit group was to differentiate constructed successful structures from constructing successful structures. If a constructing Tower was destroyed, it would reduce income even though the tower never gave income yet so it would result in the player losing income unfairly. By only destroying towers in the towerclub, and by making only constructed towers join the towerclub, I solved that problem. I don't know why I made it an array though.

Anyway, now the problem is now in the fact that I am allowed to build in rows whose previous towers I have destroyed. Here's what I did for the test:

Built a tower in column 2- it was destroyed for failure to have 2 towers in column 1
Built a tower in column 1-it was successful
built the second tower in column 1-it was successful
built a tower in column 2- it was successful
Built a second tower in column 2-it was succesful
Destroyed a tower in column 1
Destroyed a tower in column 2
built a tower in column 2- it was successful <----this should not have been successful because the previous column only has 1 tower instead of 2. However, it properly removed income when the tower from column 1 died, which means that Banner Destroyed trigger did run. But either it's not properly registering the correct column tower as being destroyed or the Banner Created trigger isn't reading it properly?

Thanks for any help you can provide.
 
Last edited:
Status
Not open for further replies.
Top