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

A trigger i need for my problem

Status
Not open for further replies.
Level 9
Joined
Jun 7, 2008
Messages
440
Okay, so here's my problem, i want to make a trigger that when a player leaves, his gold and lumber is divided with the rest of the teammates. I think i recall see a trigger for that very thing here earlier... but i cannot recall where. Can someone help/redirect me please?
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
  • Actions
    • Set lum_var = (Triggering Player) current lumber
    • Set gold_var = (Triggering Player) current gold
    • Set playersplaying = All players matching matching player plays equal to true
    • Player Group - Pick every Player in playersplaying and do
      • Player - Add (lum_var / Number of players in playersplaying) to (Picked Player) current lumber
      • Player - Add (gold_var / Number of players in playersplaying) to (Picked Player) current gold
    • Set lum_var = 0
    • Set gold_var = 0
    • Player - Set (Triggering Player) current gold to 0
    • Player - Set (Triggering Player) current lumber to 0
    • Custom script: call DestroyForce(udg_playersplaying)
should work / untested
 
Level 9
Joined
Jun 7, 2008
Messages
440
K fair enough... Got that part. Thanks alot. In the trigger, it says :

set playerisplaying = all players matching matching player plays equal to true.

I know this is a set variable function. What i dont know is where to find the part after - all players matching (condition) - matching player plays equal to true.
Where do i find this?
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
Might be caused by a translational error..by the way, use: Player group as variabletype for the playersplaying variable.
And in case the player has unit which you want to kill, use
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Playable map area) owned by (Triggering Player) and do Unit - Remove/Kill (Picked Unit)
 
Status
Not open for further replies.
Top