• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Unit group movement

Status
Not open for further replies.

Sajuur

S

Sajuur

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!
 
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
 
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.
Back
Top