Home   Help Search Login Register  

Author Topic: AI group won't hold position, they charge enemy at first site.  (Read 669 times)

0 Members and 1 Guest are viewing this topic.

GYS-DOA

  • Guest
 ???
I want a group of infantry to approach a sandbag wall I have created and defend the position (City) from there. When the enemy forces approach, they go around the sand bag wall and charge at the enemy. Can I get them to stay put and defend, as waves of enemy try to take the city. (Remember The Alamo)
I give them a hold, or guard, or sentry, waypoint at the sandbag wall. They move into position well, but then they charge out after the enemy at first site. I am a beginner and will continue to work through the tutorials. TIA...DOA

Offline @cero

  • Members
  • *
  • Yeah! Get some!!
Hi, I don'y know if it will work but is worth to try.
 On the on activation field of the waypoiint that you want the unit to stay type this:

This setpos[getpos this select 0, getpos this select 1,2]

The 2 at the end is the actual height of the unit, so if its whrong just change the magic number and there you go.
 The other thing I would say is that if it don't work tr to give the unit a name, lets say Rambo,lol ;D and substitute all of the "This" you had typed in the example above for the name Rambo, so it would be like that:
Rambo setpos[getpos Rambo select 0, getpos Rambo select 1,2]
 
 I never tryed it so I don't know if it will work at all.
 Good luck.
Later.
@CERO
SCREWBY!!!

tflarsen

  • Guest
If you only need the ai guys to defend that exact spot, you can use the DisableAI command:

this disableAI "Move"

On the waypoint where the units reach the sandbag, just type in:
"_x disableai ""Move""" ForEach units group off1

The leader of that group must be named off1, otherwise it won't work.

Only problem with this, is that you can't make the units move on their own later on, without specifically telling them to (using the domove command).

Regards
Teddy