Selection Unit Control

dondonda

New Member
Reaction score
3
For my game i need a system where if any player selects a unit of player 9 they gain control over that unit, but if they select another unit then they lose control of the first unit and gain control over the new one. This only works if any other player selects a unit controlled by player 9.
 

Tru_Power22

You can change this now in User CP.
Reaction score
144
Trigger:
  • Unit Conversion
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - etc. Selects a unit
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 9 (Gray)
    • Actions
      • Set Temp_Group[0] = (Units in (Playable map area) matching (((Custom value of (Matching unit)) Equal to 1) and ((Owner of (Matching unit)) Equal to (Triggering player))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Temp_Group[0]) Equal to 0
        • Then - Actions
          • Unit - Set the custom value of (Triggering unit) to 1
          • Unit - Change ownership of (Triggering unit) to (Triggering player) and Change color
        • Else - Actions
          • Unit - Set the custom value of (Random unit from Temp_Group[0]) to 0
          • Unit - Change ownership of (Random unit from Temp_Group[0]) to Player 9 (Gray) and Change color
          • Unit - Set the custom value of (Triggering unit) to 1
          • Unit - Change ownership of (Triggering unit) to (Triggering player) and Change color
      • Custom script: call DestroyGroup (udg_Temp_Group[0])
 
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