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

Players choosing side

Status
Not open for further replies.
Level 3
Joined
Oct 3, 2009
Messages
39
I seek help on how to make a trigger where people all start in one big region and have the option to enter region 1 and they will join team 1. If they enter region 2, they will join team 2 instead.

There's 6 players in the map, so once a team reaches 3 members, it should no longer be possible to join that team.

Is this possible? And how?

I suppose I need to make one team where all players start and then 2 seperate teams where people then join?
 
  • One
    • Events
      • Unit - A unit enters Team 1 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in Team1) Less than 3
        • Then - Actions
          • Player Group - Add (Owner of (Triggering unit)) to Team1
        • Else - Actions
  • Two
    • Events
      • Unit - A unit enters Team 2 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in Team2) Less than 3
        • Then - Actions
          • Player Group - Add (Owner of (Triggering unit)) to Team2
        • Else - Actions
 
Level 7
Joined
May 11, 2010
Messages
278
To clarify Pharaoh's triggers:
in the events "A unit enters Team 1 <gen>" and "A unit enters Team 2 <gen>", the "Team 1" and "Team 2" is regions.
Make sure the players start in player team "Team Neutral" or something.
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
Team 1 <gen>/Team 2 <gen> are regions created on your map actually.

Team 1/Team 2 are global GUI variables of type: player group, created in variable editor.

That condition can be found under: Conditions -> Integer Comparisons -> Player - Count players in Player Group.
Additionaly: main condition - ((Triggering unit) is A Hero) Equal to True - is the first comparison you will see when you click on 'Conditions' (boolean comparisons); now, just change classification to 'Hero'.
 
Status
Not open for further replies.
Top