• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Teammate Leaving Help

Status
Not open for further replies.
Level 17
Joined
Jun 17, 2007
Messages
1,433
  • Events
    • Player - Player 1 (Red) leaves the game
    • Conditions
    • Actions
      • Player Group - Pick every player in (All allies of (Triggering player)) and do (Actions)
        • Loop - Actions
          • Player - Make (Triggering player) treat (Picked player) as an Ally with shared vision and full shared units
Note: This leaks a force.
 
Level 6
Joined
May 13, 2005
Messages
164
Events
Player - Player 2 (Blue) leaves the game
Conditions
Actions
Player Group - Pick every player in (All players matching (((Matching player) Not equal to Player 1 (Red)) and ((((Matching player) is an ally of Player 1 (Red)) Equal to True) and (((Matching player) slot status) Equal to Is playing)))) and do (Actions)
Loop - Actions
Player - Add ((Player 2 (Blue) Current gold) / (Number of players in (All players matching (((Matching player) Not equal to Player 1 (Red)) and ((((Matching player) is an ally of Player 1 (Red)) Equal to True) and (((Matching player) slot status) Equal to Is playing)))))) to (Picked player) Current gold


This trigger is from my map. Player 1 to 7 are allies so if a player leaves, for example, Blue (player 2), his gold is split equally among the remaining players that are still in game. In this trigger, Red (player 1) doesnt get any gold because he is a computer player.
 
Status
Not open for further replies.
Top