Units always returning to their point of oringin

s3rius

Linux is only free if your time is worthless.
Reaction score
130
Hi,
I've a weird problems with spawning & ordering units. In my map I am spawning a bunch of soldiers at a random point and order them to attack-move to the middle of the map.
Everything's fine till then, but when those units reach their destination they turn around and run back to the place they spawned at o.0
I am sure that I don't use any other triggers that order units around, and I am also not using any AI script.
I've tried turning off the unit's guard position, but that doesn't change anything at all.
Also when I order them to move instead of attack-move it works fine. They also don't return when they received a stop order, though they do return when I give them a stop oder and let them attack-move after that.

I'm pretty much out of ideas of what it could be, hope some of you can help.
Thanks in advantage
~s3r
 

thewrongvine

The Evolved Panda Commandant
Reaction score
506
Is there anything to attack? o_O You have to have enemies there, of course. Also, if the middle is full and they can't get there after a while, they might return back.

Btw, is your wacraft username: JunoApollo? rofl.
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
No, my battlenet name is also s3rius^^
Well, I do have enemies roaming around the map, but the soldiers easily reach their point of destination and slay the few foes without casualties.
They're immediately turning back when their attack-move order "runs out".
It also only happens if the units are controlled by a computer player.
 

Pender

New Member
Reaction score
32
Easiest way to disable this is in Advanced > Gameplay Constants. Under "Creeps," take all three fields about returning to guard point, and set them all to 9999999.

EDIT: Here:

96612856rz3.gif


There's also a way to do it with AI triggers ("ignore guard points"), but this is an easier and more foolproof way.
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
That's no use. I forgot to mention that the units are owned by Player 10 (which is a computer player in my map) and not neutral aggressive.
Also, I have already set those 3 values to somewhat a billion a while ago concerning other issues..
 

Pender

New Member
Reaction score
32
Then based on your post, I have no idea. You'd have to post the map, or at least the text of all your actions.
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
Then based on your post, I have no idea. You'd have to post the map, or at least the text of all your actions.

For some reasons I'd like not to post the whole map, but the actions won't help much, also, I believe.

JASS:
set groupLeader = CreateUnitAtLoc(Player(9), 'z003', Location(*lot of text that defines a random loc*)
    call UnitAddItemById(groupLeader, 'I009') //adding his equipment
    call UnitAddItemById(groupLeader, 'I00I') //not really important
    call RemoveGuardPosition(groupLeader) //Just for testing purpose
    call IssuePointOrder(groupLeader, "attack", 0,0)


I tried using this and it made the unit act correctly:
JASS:
set groupLeader = CreateUnitAtLoc(Player(9), 'z003', Location(*lot of text that defines a random loc*)
    call UnitAddItemById(groupLeader, 'I009') //adding his equipment
    call UnitAddItemById(groupLeader, 'I00I') //not really important
    call RemoveGuardPosition(groupLeader) //Just for testing purpose
    call IssuePointOrder(groupLeader, "attack", 0,0)
    call TriggerSleepAction(0.)
    call IssueImmediateOrder(groupLeader, "stop")
    call TriggerSleepAction(0.)
    call IssuePointOrder(groupLeader, "attack", 0,0)

(Ofc now it went to Loc(0,0) and not my randomly chosen location, but doesn't really matter.)
But it's a rather uncomfortable thing to do with several unit that are created via loop >.<
 

Templarion

Member
Reaction score
8
I have exactly the same problem. Was this ever solved?

Spawned units (owned by computer player #12) return to their spawning point after reaching their region - and I do NOT want that happening.
 

X-maul

AKA: Demtrod
Reaction score
201
Easiest way to disable this is in Advanced > Gameplay Constants. Under "Creeps," take all three fields about returning to guard point, and set them all to 9999999.

EDIT: Here:

96612856rz3.gif


There's also a way to do it with AI triggers ("ignore guard points"), but this is an easier and more foolproof way.

a bit offtopic but: what WE is that?
 

Templarion

Member
Reaction score
8
BornANoob[MR], thanks. I try that but for some reason I doubt it will work in the way I want. Maybe because units don't have a particular mission to do in the regions (like killing a unit).

In my map there are plenty of regions and units move between them. It is like: When units arrive at region 1 they randomly choose to move on region 2,3 or 4.

Here is an example:
EastP01
Events
Time - Every 5.00 seconds of game time
Conditions
(Number of units in (Units in MovePointEast01 <gen> owned by Player 12 (Brown))) Greater than 3
Actions
Set Number = (Random integer number between 1 and 4)
Unit Group - Pick every unit in (Units in MovePointEast01 <gen>) and do (Unit Group - Add (Picked unit) to Zombies01)
If (Number Equal to 1) then do (Unit Group - Order Zombies01 to Attack-Move To (Center of MovePointEast15 <gen>)) else do (Do nothing)
If (Number Equal to 2) then do (Unit Group - Order Zombies01 to Attack-Move To (Center of MovePointEast02 <gen>)) else do (Do nothing)
If (Number Equal to 3) then do (Unit Group - Order Zombies01 to Attack-Move To (Center of MovePointEast10 <gen>)) else do (Do nothing)
If (Number Equal to 4) then do (Unit Group - Order Zombies01 to Attack-Move To (Center of MovePointEast11 <gen>)) else do (Do nothing)
Unit Group - Remove all units from Zombies01

And I do want that units stop before starting to move again so they don't look like they are moving all the time. This is excatly why I want to remove that 'returning' thing.
 

X-maul

AKA: Demtrod
Reaction score
201
BornANoob[MR], thanks. I try that but for some reason I doubt it will work in the way I want. Maybe because units don't have a particular mission to do in the regions (like killing a unit).

In my map there are plenty of regions and units move between them. It is like: When units arrive at region 1 they randomly choose to move on region 2,3 or 4.

Here is an example:


And I do want that units stop before starting to move again so they don't look like they are moving all the time. This is excatly why I want to remove that 'returning' thing.

just a tip, post triggers in Codes, highlight your trigger an press the # button
 

AdamGriffith

You can change this now in User CP.
Reaction score
69
Is this unsolved?
If so, do you have the Melee Init triggers still in your map?
They cause problems.
If you have them, delete them and you should be fine!
 

Templarion

Member
Reaction score
8
CheesyBeefy, yep. It is machintosh. But let's stay in topic, PLEASE.

AdamGriffith, thanks for reply but I am sure that there are no melee initialization triggers (if u mean triggers like: "Run Melee AI" etc.). I have tried to change Game Constant values (guard distances & times) and tried to disable returning via initialization triggers (was something like: AI - turn on/off Guard distances).

I was wondering, should I really make the creeps neutral hostile and not some computer player property? Would that help anything? If not, what should I do?

Has anyone ever even made this shit before?! Hard to believe but it is true that usually creeps are ordered to move/attack from a region to a region without a pause or time to think anything else.

I have tried to find a solution for this matter for some time without success. Please, help if you can and tell me if you need more trigger examples.
 
Reaction score
86
You could order the units to stop once they enter the region, put a wait in for however long you want them to stop, then order them to move again.

Thats what I did, without the "wait" part.
 

Templarion

Member
Reaction score
8
Infinitegde,

In my map there are over 30 regions where zombies can travel. And there are at least the same amount of zombies walking between the regions. If I add "wait"-action in the 30 triggers wouldn't they overwrite each other or something? Would it still work even they were executed at the same time?

I try this, too, when I get home. I am working at the moment. Thanks for the hint. Maybe I should make somekind of general "stop"-trigger or something...
 
Reaction score
86
Do something like this.

Event
A unit enters region(Whatever Region)

Condition
Unit-type of entering unit equal to Zombie

Actions
Order (entering unit) to stop
Wait 2 seconds
Pick every unit in region(whatever region) matching condition (unit-type of matching unit = to Zombie)
Loop
Order unit to Attack-move to (wherever)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top