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

[General] full shared control

Status
Not open for further replies.
I want to share control of the units of the players who leave. So, I amde these, but it's not working somehow

  • Set Player[1] = Player 1 (Red)
  • Set Player[2] = Player 2 (Blue)
  • Set Player[3] = Player 3 (Teal)
  • Set Player[4] = Player 4 (Purple)
  • Set Player[5] = Player 5 (Yellow)
  • For each (Integer A) from 1 to 5, do (Actions)
    • Loop - Actions
      • Player Group - Add Player[(Integer A)] to Allplayers
  • Leave Info
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
    • Conditions
    • Actions
      • Player Group - Add (Triggering player) to A_LEFT_PRS
      • Player Group - Remove (Triggering player) from Allplayers
      • Game - Display to (All players) the text: (PLayer_Colors[(Player number of (Triggering player))] + ((Name of (Triggering player)) + (( + (|r|cffff0000 + ((Name of Hero[(Player number of (Triggering player))]) + |r|cffffcc00) left the game!)))))
      • Sound - Play UpkeepRing <gen>
      • Player Group - Make Allplayers treat A_LEFT_PRS as an Ally with shared vision and full shared units
 
Level 21
Joined
Nov 4, 2013
Messages
2,017
It won't work because A_LEFT_PRS also has to treat Allplayers as an ally with shared vision and full shared units so just add this command:

  • Player Group - Make A_LEFT_PRS treat Allplayers as an Ally with shared vision and full shared units
It's like if both players (no matter if they're computers or humans) need to agree to be allied with shared vision and full shared units.

Also this:

  • Set Player[1] = Player 1 (Red)
  • Set Player[2] = Player 2 (Blue)
  • Set Player[3] = Player 3 (Teal)
  • Set Player[4] = Player 4 (Purple)
  • Set Player[5] = Player 5 (Yellow)
  • For each (Integer A) from 1 to 5, do (Actions)
    • Loop - Actions
      • Player Group - Add Player[(Integer A)] to Allplayers
Why creating a Player array variable? You can simply use Conversion - Convert Player Index To Player. It works exactly in the same way but without the need of any variable. Your trigger woud look like this:

  • For each (Integer A) from 1 to 5, do (Actions)
    • Loop - Actions
      • Player Group - Add (Player((Integer A))) to Allplayers
Works in the same way and it is much shorter than what you did.
 
Level 10
Joined
Apr 4, 2010
Messages
509
I think you need to use this.

  • Game - Grant shared vision and full shared unit control of Player 2 (Blue) units with his/her allies
Make sure that team share is on in Scenario -> Forces Properties

EDIT: You just need to switch it around.

Instead of this.
  • Player Group - Make Allplayers treat A_LEFT_PRS as an Ally with shared vision and full shared units
It's meant to be this.
  • Player Group - Make A_LEFT_PRS treat Allplayers as an Ally with shared vision and full shared units
EDIT2: Do it like this actually
  • Player Group - Pick every player in (All allies of LEAVER) and do (Actions)
    • Loop - Actions
      • Player - Make LEAVER treat (Picked player) as an Ally with shared vision and shared units
 
Last edited:
Status
Not open for further replies.
Top