• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Change Units from Player 8 to Player 12(Help)

Status
Not open for further replies.
Level 37
Joined
Mar 6, 2006
Messages
9,240
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 25
Joined
Sep 26, 2009
Messages
2,378
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