Change ownership of selected unit(-s)

NightMagi

Member
Reaction score
5
is it possible to change ownership of selected unit(-s)?

like i select 3 Footmen and type -(player color) e.x. Blue or just -player2 and the 3 footmen turn blue? and also, only Player 1 (red) can change ownership.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Why do u have 2 threads ontopic make event when chat enterd the change the ownership dont know how to do the selected part
 

free_killing

TH.net Regular
Reaction score
23
maybe something like this? ;D
Trigger:
  • red to blue
    • Events
      • Player - Player 1 (Red) types a chat message containing -blue as An exact match
      • Player - Player 1 (Red) types a chat message containing -player2 as An exact match
      • Player - Player 1 (Red) types a chat message containing (- + (Name of Player 2 (Blue))) as An exact match
    • Conditions
    • Actions
      • Set OwnerShip = (Units currently selected by Player 1 (Red))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in OwnerShip) Less than or equal to 1
        • Then - Actions
          • Game - Display to (All players) the text: not enough units selected
          • Custom script: call DestroyGroup(udg_OwnerShip)
          • Skip remaining actions
        • Else - Actions
          • Game - Display to (All players) the text: player 1 changed units with player 2
      • Unit Group - Pick every unit in OwnerShip and do (Actions)
        • Loop - Actions
          • Unit - Change ownership of (Picked unit) to Player 2 (Blue) and Change color
      • Custom script: call DestroyGroup(udg_OwnerShip)

Trigger:
  • red to teal
    • Events
      • Player - Player 1 (Red) types a chat message containing -teal as An exact match
      • Player - Player 1 (Red) types a chat message containing -player3 as An exact match
      • Player - Player 1 (Red) types a chat message containing (- + (Name of Player 3 (Teal))) as An exact match
    • Conditions
    • Actions
      • Set OwnerShip = (Units currently selected by Player 1 (Red))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in OwnerShip) Less than or equal to 1
        • Then - Actions
          • Game - Display to (All players) the text: not enough units selected
          • Custom script: call DestroyGroup(udg_OwnerShip)
          • Skip remaining actions
        • Else - Actions
          • Game - Display to (All players) the text: player 1 changed units with player 3
      • Unit Group - Pick every unit in OwnerShip and do (Actions)
        • Loop - Actions
          • Unit - Change ownership of (Picked unit) to Player 3 (Teal) and Change color
      • Custom script: call DestroyGroup(udg_OwnerShip)
 

free_killing

TH.net Regular
Reaction score
23
oka, on my map ihelp2, i help some other ppls too, so you dont need all the triggers..
 

Attachments

  • ihelp2.w3x
    34.3 KB · Views: 125

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Freekiling i also have a map that is to help people with 1 variable of each type and the same name as what they are
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Freekiling i also have a map that is to help people with 1 variable of each type and the same name as what they are.
 

free_killing

TH.net Regular
Reaction score
23
Freekiling i also have a map that is to help people with 1 variable of each type and the same name as what they are

What do you mean?
so there is a variable of type unit, called unit, one of type unit group, called unitGroup?


Edit: Thanks for reputation ;)
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Yes thats what i mean o and sory for the dp i acedently presed cancel the i submited again the there was 2
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Sory for the dp again but to give rep click on that scale next to the post number and red triangle with ! In the midle
 
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