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

Ordering multiple created units

Status
Not open for further replies.
Level 18
Joined
Aug 23, 2008
Messages
2,319
I've made a trigger to create 3 different units (3 triggers, 1 for each unit), but now i need these units to change owner. All I can find is the a trigger for the "Last created unit", but then I still have 2 others left.

I tried to get them all in a Unit Group, but that thing doesn't like me, since I can't seem to be able to select units to add to the group if those units are not placed on the map already!

So there are 2 ways to solve this:
1) Somebody teaches me how to change the owner of the units individually or
2) Somebody teaches me how to add those units to a Unit Group and changing theyre owners all together


If there is anything of arrays, costum scripts or strings involved, please explain those parts very clear to me. I've tried to get a good tutorial for those, but they either don't explain anything useful at all, or they simply frustrate me with they're too complicated brabbling.

Thank you very much in advance,
Avator
 
Last edited:
Level 18
Joined
Aug 23, 2008
Messages
2,319
No, sorry. I'm looking for help on how to change ownership of units that are not pre-placed on the map.

So I made a trigger that creates 3 individual units (so I can't use the Last Created Unit command), and all 3 have to change owner. So I think the only solution is a bit more advanced Action that allows me to select units that are created by this previous Action in another trigger, or i need to make a Unit Group of these 3 units, so I can select that Unit Group.

If it's still not clear to you, I'll try to explain with my actual map as sample.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
  • Creating Units
    • Events
      • Unit - A unit leaves <Region>
    • Conditions
    • Actions
      • Unit - Create 1 <Unit 1> for Player 1 (Red) at (Random point in <Region>) facing (Position of <Unit A>)
      • Unit - Create 1 <Unit 2> for Player 1 (Red) at (Random point in <Region>) facing (Position of <Unit A>)
      • Unit - Create 1 <Unit 3> for Player 1 (Red) at (Random point in <Region>) facing (Position of <Unit A>)
This is the trigger I use to create the 3 units. Unit 1, 2 and 3 are 3 totally different units.
So I want to make them a group, and make a trigger that'll change ownership of every1 in the group or I want to make a trigger that'll change theyre ownership individually, thesame way I created them with the above mentioned trigger. But for that last option, I have the issiue that I can't select units for triggers that are not placed on the map.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
I'll explain the whole concept of that part of my map.

I have 1 unit (the one I play with during the entire game and I'll call him Unit A), 3 unique units that were created due to a trigger 'Create Unit' (which I'll call Unit 1, 2 & 3) and 1 unit (which I shall name Unit B) belonging to the player that I want to get the ownership of those 3 units to.

The trigger I want to create is:
When Unit A leaves the Region where they're all in, Units 1, 2 & 3 will move (teleport) instantly to their own spots in another area.
Solution: I need to be able to select all 3 units individually in a trigger command, so I can place them through that same trigger on the spots in the new area where they are supposed to end up. Also I need to be able to select them, so I can change theyre owner. This is nessecary, becouse only Unit A may be moved to the next area manually.

If I don't do this, I will either have no units in the new area, units staying in an old area where they don't belong, or units under control that can couse major bugs or glitches in the game.
 
Status
Not open for further replies.
Top