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

Ally Question

Status
Not open for further replies.
Level 7
Joined
Mar 29, 2009
Messages
139
How do 1 player change team in game? Like,he is on team with red and blue and himself is teal. Then he wants to ally purple. Make purple ally and red and blue enemies... How do i do that? Tried a trigger but it didnt work... Help?
Shouldn't this work?

  • Then - Actions
    • Player - Make Player 1 (Red) treat Player 2 (Blue) as an Enemy
    • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Enemy
 
Well, you can make 2 teams in the map initialization
  • For each (IntegerA) from 1 to 6, do (Actions)
  • Loop - Actions
    • Player Group - Add (Player(IntegerA)) to Group1
  • For each (IntegerB) from 7 to 12, do (Actions)
    • Loop - Actions
      • Player Group - Add (Player(IntegerB)) to Group2
  • Player Group - Pick every player in (Group1) and do (Actions)
    • Loop - Actions
      • Set Player1 = (Picked player)
      • Player Group - Pick every player in (Group1) and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat Player1 as an Enemy
          • Player - Make Player1 treat (Picked player) as an Enemy
to get Player(IntegerA) and Player(IntegerB) respectively, when it asks for the player input, scroll to Convert Player to Player Index.

Then, when you want to remove a player from the first faction, check which group is he in, like this:
  • If (All conditions are true) then do (Actions) else do (Actions)
  • If - Conditions
    • ((Triggering player) is in Group1) Equal to True
  • Then - Actions
    • Player Group - Remove (Triggering Player) from (Group1)
    • Player Group - Add (Triggering Player) to (Group2)
 
Status
Not open for further replies.
Top