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

Change Units from Player 8 to Player 12(Help)

Status
Not open for further replies.
Level 37
Joined
Mar 6, 2006
Messages
9,243
Use the action Almia mentioned.

Running this trigger changes the owner of all P8 units to P12.
  • Untitled Trigger 090
    • Events
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by Player 8 (Pink)) and do (Actions)
        • Loop - Actions
          • Unit - Change ownership of (Picked unit) to Player 12 (Brown) and Change color
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
You could start with your grammar first.
The situation is there, but the content is still vague.

I don't mean by trigger! I know the trigger way too. Theres a Units i don't want change them!
Let me try to decipher this.
You want all units Player 8 to be given to Player 12 BUT there are some units that is/are excluded ?

  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units owned by Player 8 (Pink)) and do (Actions)
      • Loop - Actions
        • Set TempUnit = (Picked unit)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (TempUnit is in ExcludedGroup) Equal to False
          • Then - Actions
            • Unit - Change ownership of TempUnit to Player 12 (Brown) and Change color
          • Else - Actions
1. Create a Unit Group variable (ExcludedGroup)
2. Put all the units that is/are non-transferable in that Unit Group
3. Follow the exact coding above
4. Player 8 will transfer all of his/her unit(s) with the exception if that unit is not in the ExcludedGroup
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Have player 12 units cast Charm on player 8 units.
This is probably the only non-trigger way to change ownership, but it's for 1 unit per cast only. I don't think there is any other way apart from triggering.

(but really, why have 36 units cast charm on 36 enemies when you can do this via trigger with 6 lines)
 
Have player 12 units cast Charm on player 8 units.
This is probably the only non-trigger way to change ownership, but it's for 1 unit per cast only. I don't think there is any other way apart from triggering.

(but really, why have 36 units cast charm on 36 enemies when you can do this via trigger with 6 lines)

Possation, taking over his enemies, no need for triggers.
:ogre_haosis:
 
Status
Not open for further replies.
Top