Question Involving NPC Movement

MorbazanRhot

New Member
Reaction score
7
Alright, basically the situation is that there's a part on the map I'm making where your heroes go on a military campaign with some computer controlled units. Your heroes are moved outside this city and the computer forces spawn in the same area, and then all these units are supposed to move east and then south to get into position for the battle.

There are 7 rects for spawning units outside the city, 3 in the front for the 3 groups of melee soldiers, 3 in the back for the 3 groups of archers, and 1 in the middle for the heroes and the army's general. The soldiers and archers in each row are then ordered to move to a corresponding rect to the east (3 different rects at the 3 different levels so they each move in a relatively straight line).

When a unit enters one of these 2nd set of rects, it's ordered to move south to a final rect (once again 3 corresponding rects based on the original grouping). There the army should stop, listen to a speech, and eventually go into battle.

Except here's the problem: all the units, after reaching the final rect, will proceed to move back to where they spawned at (with the exception of 1 unit in each rect, that stays and follows the commands correctly - I'm not sure if this unit is the first one to reach the rect or not).

I realize this has to do something with the computer unit AI, because there's no trigger sending the units back. So my question is: what's causing these units to do this? I would assume it has something to do with units attempting to return to their original spawning/placement location, but then why does 1 unit from each group stay where it's supposed to? And is there a way to fix this effectively? (I know I could make a trigger that orders the units to hold position or maybe even stop once they enter the final rect, but that would make the setting a lot uglier so a better fix would be preferred)

Thanks, and +rep for any help.
 

nabbig2

New Member
Reaction score
43
You can have it Ignore it's Guard position.

However, this will not work if the unit Neutral Hostile.
 

MorbazanRhot

New Member
Reaction score
7
That works, thanks. +rep.

While I'm on the subject of weird AI movement, I actually have one more, much simpler question. When an enemy hero controlled by the computer, whether it's neutral hostile or an actual comp, (I would assume it would be the same for enemy units too, but I've yet to do it to one) gets hexed, it behaves extremely erratically afterward, usually running in some direction until it gets to some point, ignoring everything else (this point is not it's original location either). What's the cause of this? And what's an easy way to fix it?
 
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