• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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