Adding units to a Unit-Group

Awlips

New Member
Reaction score
1
I need a Unit-Group of specific units for a map I'm working on, but I've hit a wall...b/c I can't seem to find out how to add a group of units to said Unit-Group.
 

saw792

Is known to say things. That is all.
Reaction score
280
How are you sorting the units you want?
Are you trying to pick all of a particular unit type, or all of a particular unit type owned by a player, or all owned by a player, etc?
 

Jagan

New Member
Reaction score
30
Unit Group - Add Unit. Set the Unit (or Units you want to add) in a Variable first.
 

Awlips

New Member
Reaction score
1
How are you sorting the units you want?
Are you trying to pick all of a particular unit type, or all of a particular unit type owned by a player, or all owned by a player, etc?

I'm picking about 58 specific, different units which are all on the map itself.

Unit Group - Add Unit.

Can you walk me through the (most likely embarrassingly simple) steps to add the units I want into the Unit-Group.
 

saw792

Is known to say things. That is all.
Reaction score
280
So there is absolutely nothing in common between these units? Because using Group - Add Unit will take a long time for 58 units.
 

Jagan

New Member
Reaction score
30
58 specific units? Whoa...that'd take quite some time to add...perhaps make it so they have at least something in common? A buff, perhaps?
 

vypur85

Hibernate
Reaction score
803
You can try making the units common in Object Editor. You can do this by adding a dummy ability without icon. Then pick the units by checking the ability presence in them. Else, you can also adjust their Point Value to a unique number so that you can refer to this value. Also, you can change their classification, though this might not be preferable. Anyway, do anything that's possible to make them common in the Object Editor so that you can use them in-game.
 

Awlips

New Member
Reaction score
1
71 units, all considered "Custom Units -> Neutral Passive -> Meele -> Heroes" Where do I actual begin to add units to the unit group?
 

saw792

Is known to say things. That is all.
Reaction score
280
Code:
Set TempGroup = (Units owned by Neutral Passive matching (((Triggering unit) is A Hero) Equal to True))
 

Awlips

New Member
Reaction score
1
Figured out how to add units to a unit group via a trigger, but with the current conditions it adds units for players who may not necessarily be playing. It doesn't impair the gameplay but obviously something I'd prefer to avoid. How can I best specify the trigger to only add the 1/71 units to the players actually playing?
 

saw792

Is known to say things. That is all.
Reaction score
280
Well I'm not exactly sure what you are trying to do with the group. Can you post your whole trigger please?
 

vypur85

Hibernate
Reaction score
803
Also, please explain how are the heroes created in the map =.=. Through tavern? If so, just add 'Sold unit' to the unit group when the unit is bought. Only add them when they are created.

Code:
Event
 A unit sells a unit
Condition
 (Sold unit) is a hero Equal to True
 Unit type of (Triggering unit) Equal to YOurTavern
Actions
 Unit Group - Add (Sold unit) to YourUnitGroup
 

Awlips

New Member
Reaction score
1
Events
-Player - Player 1 (Red) types a chat message containing -AR as An exact match

Conditions
-(AR Timer 0480 <gen> is alive) Equal to True

Actions
-Unit - Explode Hero Selector 0178 <gen>
-// // // // 2-12
Unit - Create 1 (Unit-type of (Random unit from Starters)) for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
-// // // // etc. Players 2-12


ATM this is generating a random hero for each of 12 players, regardless of whether or not they are in fact actually playing. I'd like to change it so it only spawns heroes for actual players (or computers)
 

vypur85

Hibernate
Reaction score
803
Events
-Player - Player 1 (Red) types a chat message containing -AR as An exact match

Conditions
-(AR Timer 0480 <gen> is alive) Equal to True

Actions
-Unit - Explode Hero Selector 0178 <gen>
-// // // // 2-12
Unit - Create 1 (Unit-type of (Random unit from Starters)) for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
Unit group - Add (Last created unit) to YOURUNITGROUP
-// // // // etc. Players 2-12


Just add the bolded line.
 

saw792

Is known to say things. That is all.
Reaction score
280
Code:
Untitled Trigger 001
    Events
        Player - Player 1 (Red) types a chat message containing -AR as An exact match
    Conditions
        (AR Timer 0480 <gen> is alive) Equal to True
    Actions
        Unit - Explode Hero Selector 0178 <gen>
              etc
        Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is playing)) and do (Actions)
            Loop - Actions
              Unit - Create 1 (Unit-type of (Random unit from Starters)) for (Picked player) at (Center of (Playable map area)) facing Default building facing degrees
 

Awlips

New Member
Reaction score
1
Thx guys, with your help I worked it out. It was a trigger permitting red to trigger an All Random function from 71 heroes to those player in game.

next up...a single random option...and then the real trouble makers, custom quantity duels. (I'll need some help then :p! )
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top