Unit Ceding from Leaving Players

BlackRabbit

New Member
Reaction score
3
Self-explainatory title [I see way too many non-descript titles to articles here]

I am looking for an idea of how to make a trigger that cedes all units of a leaver [TD-style gameplay] to a random player in the playergroup variable of all players in game. Any help would be great!
 

TomTTT

New Member
Reaction score
44
It would be pretty easy. First, you must set your player group at init of course:
Set GamePlayer = (All units matching ((Matching player) slot status equal to Is Playing) and ((Matching player) controller equal to User)
And then:
Code:
Ownership
    Events
        Player - Player 1 (Red) leaves the game
    Conditions
        ((Triggering player) is in GamePlayers) Equal to True
    Actions
        Set tmpUnitGroup = (Units in (Playable map area) owned by (Triggering player))
        Unit Group - Pick every unit in tmpUnitGroup and do (Actions)
            Loop - Actions
                Unit - Change ownership of (Picked unit) to (Random player from GamePlayers) and Change color
 

BlackRabbit

New Member
Reaction score
3
Tom, you've been extremely helpful to my posts! Much appreciation. Um, when I initiated the map, I initiated the players_ingame variable to

Edit: I posted triggers before, but they sucked and paled in comparrison to the one you posted. Will use that one. TY MUCHLY!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top