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

Need help with owner changing trigger! +rep

Status
Not open for further replies.
Level 5
Joined
Nov 3, 2007
Messages
113
Hey, Im making a trigger that in a certain region all the units owned by Gray should change color and ownership to Brown, but the units of other players in the same region should remain the same.. please help me out!
 
Level 2
Joined
Mar 25, 2008
Messages
11
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in Region 000 <gen>) and do (Actions)
    • Schleifen - Aktionen
      • If ((Owner of (Picked unit)) Equal to Player 9 (Gray)) then do (Unit - Change ownership of (Picked unit) to Player 12 (Brown) and change color) else do (Do nothing)
I think this is what you need.
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

I think I have to edit this post a little bit:

You should use:
  • TestTrigger 1234
    • Events
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 9 (Gray)) and do (Actions)
        • Loop - Actions
          • Unit - Change ownership of (Picked unit) to Player 12 (Brown) and Change color
First of all: XmmmX99's way isn't wrong

But I read that this way is better. You need to thing @XmmmX99 trigger ALL units and all structures will picked and after he check the condition. In my the condition is directly "checked" ( I don't know who said this to me - but I remember it )
 
Level 2
Joined
Mar 25, 2008
Messages
11
Yeah, you're right. Your trigger is faster.
Made this in a hurry and i don't use GUI very often. :csmile:
+rep for this
 
Status
Not open for further replies.
Top