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

Add units within a region to a unit group

Status
Not open for further replies.
Level 3
Joined
Jul 22, 2011
Messages
37
Hey,
so I've been mapping for a time back then in Warcraft III and now starting with Starcraft II. Now I had a trigger in one of my WC3 maps which was quite simple.
It was about a region and neutrals spawning in this region (periodically) if they're dead/or not in the region (similar to Dota neutrals). That was quite simple there, something happens, they spawn, and then I had a trigger that added units within Region 001 to Unit Group "X". I even opened my WC3 editor after those 2 years to look at the trigger:
  • TopLeftCreeps
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Unit Group - Add all units of (Units in CreepsTopLeft <gen>) to TopLeftCreepsGroup
Simple. Without further ado:
I want to do a very similar function in Starcraft II but I'm new to Starcraft II and can't find the trigger/function. So a player enters "RegionDoor" , and a few units are being created at the position/region "EvilGuys". Now all I want to do is: Create a Unit Group of all the units in this particular area and order an issue (to attack the player).
The tricky part (which should be REALLY simple) is creating a unit group who are standing in a Region.
All I find in "Add a Unit to Unit Group" with Region is "Unit attached to Region" which is nonsense... Couldn't it be as simple as the WC3 Editor? :(

//EDIT: CAN BE CLOSED NOW! I'm just stupid. Found the answer by playing around. The logic is a little bit different in Starcraft II Editor.
Generally it's just : "Unit Group - Pick each unit in (Any units in Banelings owned by player Any Player matching (No Value), with at most Any Amount) and do (Actions)" and then do action with the picked units.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
If the units are created by the trigger that dispatches them, you add them to the group as you create them.

If the units are created by some other event (perodic, map initilization etc) then you do the same as you did in WarCraft III...
Unit Group - Add all units in (Any units in (Entire map) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) to Target Unit Group

This action is...
Add Unit Group To Unit Group

Basicly the same as WarCraft III.
 
Level 3
Joined
Jul 22, 2011
Messages
37
If the units are created by the trigger that dispatches them, you add them to the group as you create them.

How do I do that? 2 actions like this?:
  • Unit - Create 5 Baneling for player 15 at Baneling Spawn facing (Position of ASD[2.55, 2.53]) (No Options)
  • Unit Group - Add all units in (Last created units) to EvilBanelings
For some reason the unit group keeps disappearing in object groups. It says 0 because they don't exist as units in the editor (obvious) and they're only being created in-game after a certain event.
Doesn't seem to work like this though.
 
Status
Not open for further replies.
Top