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

Unit group movement

Status
Not open for further replies.
Level 1
Joined
Aug 19, 2004
Messages
3
I've been trying different ways of trying to select 1 unit from a group every second, and move it to another region. So far what I've tried is:

Code:
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions

        Unit - Move (First unit of group UnitGroup[10]) instantly to (Center of region <gen>)

I also tried:

Code:
        Unit Group - Pick every unit in (Random 1 units from UnitGroup[10]) and do (Unit - Move (Picked unit) instantly to (Center of region <gen>))

and:

Code:
        Unit - Move (Random unit from UnitGroup[10]) instantly to (Center of region <gen>)

None of these have worked so far. As far as I can tell the problem is with this, units seem to be adding to the group without any problems.

I am using WEU if that may have any effect on it.

Thank you to anyone who can offer any help!
 
Level 7
Joined
Jul 30, 2004
Messages
451
well, this may sound simple and obvious but try putting this in the trigger

pick all units in UnitGroup[10] and Game display text message (name of picked unit)

before you try to move a random unit

cause you really have to make sure the units are actually in UnitGroup[10], and even if they are in a unitgroup you have to make sure its not like UnitGroup[0]

cause once a unit is in the group it should pose no problem to do any of those
 
Level 1
Joined
Aug 19, 2004
Messages
3
I tried out what you suggested, nothing shows up, so apparently its a problem with the adding to the group, which is odd because its a very simple trigger:

Code:
Ladder 10 Enter
    Events
        Unit - A unit enters RegionB <gen>
    Conditions
    Actions
        Unit Group - Add (Triggering unit) to UnitGroup[10]

Don't see what could really go wrong with it, unless its something screwy with the variable perhaps.

Edit: Seems that it was the variable, the array size was not 10.
 
Status
Not open for further replies.
Top