Warcraft III resources & community, 2003–2006 · archived

Unit group movement

3 posts
#1

Unit group movement

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:

    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:

        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:

        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!
#2
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
#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:

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.