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

Control "point" Trigger Help

Status
Not open for further replies.
Level 5
Joined
May 1, 2009
Messages
52
Right... I have a building in the center of the map which is meant to be controlled by the team who has the most heroes near it, If no heroes are near it or if the amounts are equal the building should become under neutral passive's control now i have the problem that the structure itself, and summoned units count towards the unit number, which isnt fair obviously, Can't seem to figure out how to do it.

  • Observatory
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set Team1 = (Units in Observatory Capture Area <gen> owned by Player 1 (Red))
      • Unit Group - Add all units of (Units in Observatory Capture Area <gen> owned by Player 4 (Purple)) to Team1
      • Unit Group - Add all units of (Units in Observatory Capture Area <gen> owned by Player 8 (Pink)) to Team1
      • Set Team2 = (Units in Observatory Capture Area <gen> owned by Player 2 (Blue))
      • Unit Group - Add all units of (Units in Observatory Capture Area <gen> owned by Player 10 (Light Blue)) to Team2
      • Unit Group - Add all units of (Units in Observatory Capture Area <gen> owned by Player 9 (Gray)) to Team2
      • Set Team3 = (Units in Observatory Capture Area <gen> owned by Player 3 (Teal))
      • Unit Group - Add all units of (Units in Observatory Capture Area <gen> owned by Player 7 (Green)) to Team3
      • Unit Group - Add all units of (Units in Observatory Capture Area <gen> owned by Player 11 (Dark Green)) to Team3
      • Set Team4 = (Units in Observatory Capture Area <gen> owned by Player 5 (Yellow))
      • Unit Group - Add all units of (Units in Observatory Capture Area <gen> owned by Player 6 (Orange)) to Team4
      • Unit Group - Add all units of (Units in Observatory Capture Area <gen> owned by Player 12 (Brown)) to Team4
      • Set Team1number = (Real((Number of units in Team1)))
      • Set Team2number = (Real((Number of units in Team2)))
      • Set Team3number = (Real((Number of units in Team3)))
      • Set Team4number = (Real((Number of units in Team4)))
      • Set ControllerObs = (Owner of The Observatory 0059 <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Team1number Greater than Team2number
          • Team1number Greater than Team3number
          • Team1number Greater than Team4number
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ControllerObs Equal to Player 1 (Red)
            • Then - Actions
            • Else - Actions
              • Unit - Change ownership of The Observatory 0059 <gen> to Player 1 (Red) and Change color
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • Team2number Greater than Team1number
                  • Team2number Greater than Team3number
                  • Team2number Greater than Team4number
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ControllerObs Equal to Player 2 (Blue)
                • Then - Actions
                • Else - Actions
                  • Unit - Change ownership of The Observatory 0059 <gen> to Player 2 (Blue) and Change color
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • Team3number Greater than Team1number
                      • Team3number Greater than Team2number
                      • Team3number Greater than Team4number
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ControllerObs Equal to Player 3 (Teal)
                    • Then - Actions
                    • Else - Actions
                      • Unit - Change ownership of The Observatory 0059 <gen> to Player 3 (Teal) and Change color
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • And - All (Conditions) are true
                        • Conditions
                          • Team4number Greater than Team1number
                          • Team4number Greater than Team2number
                          • Team4number Greater than Team3number
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of The Observatory 0059 <gen>) Equal to Player 5 (Yellow)
                        • Then - Actions
                        • Else - Actions
                          • Unit - Change ownership of The Observatory 0059 <gen> to Player 5 (Yellow) and Change color
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ControllerObs Equal to Neutral Passive
                        • Then - Actions
                        • Else - Actions
                          • Unit - Change ownership of The Observatory 0059 <gen> to Neutral Passive and Change color

Team1 = Red(computer), Purple and Pink.
Team2 = Blue(computer, Light Blue and Grey.
Team3 = Teal(computer), Green and Dark Green.
Team4 = Yellow(computer), Orange and Brown.

When a team controls the center the computer player is meant to have control over the central building.

I know my trigger might be bit messy, or leaky, and if there is an easyer way to do something like this tell me please :)

Edit: Updated Triggers
 
Last edited:
Level 5
Joined
May 1, 2009
Messages
52
I guess i could do that.
But thats not the main things i was looking for so, If anyone knows how to fix my problem please help me

(wil update in a min or so after ive added variables/removed do nothing)
 
Level 5
Joined
May 1, 2009
Messages
52
yay!, just to check: like this then?
  • Set Team1 = (Units in Observatory Capture Area <gen> matching (((Owner of (Matching unit)) Equal to Player 1 (Red)) and (((Matching unit) is A Hero) Equal to True)))
Edit: Seems to work, Thx alot! +rep
 
Last edited:
Status
Not open for further replies.
Top