• 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.

When player leaves, share units?

Status
Not open for further replies.
Level 10
Joined
Jun 7, 2008
Messages
420
Hi, I need to create a trigger where when a player leaves, his units are shared with all allied units (2,3,4,5,6,11)

And what was the way to add resources to everyone without having to put them manually for each player again?
I mean at the moment its
Add <amount> to player2red current gold
Add <amount> to player3red current gold
Add <amount> to player4red current gold
etc etc

Thanks!!
 
Level 14
Joined
Nov 2, 2008
Messages
579
For the unit share trigger do this:

  • Player Leaves
    • Events
      • Player - Player 1 (Red) leaves the game
    • Conditions
    • Actions
      • Set Group = (Units owned by Player 1 (Red))
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • Unit - Change ownership of (Picked unit) to Player 2 (Blue) and Retain color
          • Unit - Change ownership of (Picked unit) to Player 3 (Teal) and Retain color
          • -------- \/ Rest of players you want --------
      • Custom script: call DestroyGroup( udg_Group )
For the Gold trigger do this:

  • Player Gold
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Add 1000 to (Picked player) Current gold
 
Level 10
Joined
Jun 7, 2008
Messages
420
Don't think that will work, but gona test it ASAP to find out. My existing one that didn't work is
--------------------
Leaver
Events
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
Player - Player 6 (Orange) leaves the game
Player - Player 11 (Dark Green) leaves the game
Conditions
Actions
Game - Display to (All players) for 10.00 seconds the text: ((Name of (Triggering player)) + has left the game to go touch little boys and experiment on his baby sister while licking his mother's cunt and 'playing' with grampa.)
Player - For (Triggering player), turn Full shared units On toward Player 2 (Blue)
Player - For (Triggering player), turn Full shared units On toward Player 3 (Teal)
Player - For (Triggering player), turn Full shared units On toward Player 4 (Purple)
Player - For (Triggering player), turn Full shared units On toward Player 5 (Yellow)
Player - For (Triggering player), turn Full shared units On toward Player 6 (Orange)
Player - For (Triggering player), turn Full shared units On toward Player 11 (Dark Green)

-------------------
The message displays, but the units did not share. Going to try with the unit group suggestion (the 'picked player' one) and see if it works.
 
Status
Not open for further replies.
Top