Home   Help Search Login Register  

Author Topic: Prevent AI From moving?  (Read 1919 times)

0 Members and 1 Guest are viewing this topic.

Offline unknownx9

  • Members
  • *
Prevent AI From moving?
« on: 08 Apr 2010, 02:42:25 »
Hello,

I have searched the posts and found related questions, but so far none have been able to help solve my problem.

I am trying to make AI units stay in the position that I placed them in. I placed units in buildings and used the commands in the units Init "this disableai move" alone or combined with "this disableai target", now in some cases that will work, but what ends up happening is the AI will not turn to fire, but rather remain in facing the direction he was told to face and will only fire if you get in his line of sight. In other cases they wont fire at all.

All I want is the AI to not move from the location I placed him in, and be able to at least turn around and fire when he sees a target.

Any help would be greatly appreciated.

Thanks

Offline Gubas little helper

  • Members
  • *
  • Gubas real name is John. I would know.
Re: Prevent AI From moving?
« Reply #1 on: 09 Apr 2010, 10:06:21 »
Well in OFP the command for prevent ai from moving is: 'unitname disableAi "MOVE";
But im not sure for the command for arma. Tip: If you need any scripting help, go to the bis wiki. They have a list of all the commands in all the games. Really useful.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Prevent AI From moving?
« Reply #2 on: 09 Apr 2010, 11:05:47 »
Just pointing out that we do have the commands listed here too ;)
OFPEC Command Reference

@unknownx9
Have you tried using disableAI "target" alone instead of using it with the disableAI "move"?
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline unknownx9

  • Members
  • *
Re: Prevent AI From moving?
« Reply #3 on: 10 Apr 2010, 03:56:58 »
hello h-,

Thank you and Gubas little helper for the quick response.

@h-, yes I have tried to use that alone, now what happens is when there is no shooting going on the unit will stay in its position as they would do if no orders was given to them. Once the shooting start the unit will run out of the house, in this case he runs through the window of the second story building and runs and holds position in another place, and engages from their.

Just to Clarify I am using Arma 2.

unknownx9
« Last Edit: 10 Apr 2010, 04:09:41 by unknownx9 »

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Prevent AI From moving?
« Reply #4 on: 10 Apr 2010, 09:03:52 »
Maybe using disableAI "autotarget" with it helps :dunno:

There's also the command doStop although I'm not sure it works anymore, haven't had much luck with it in Arma1 (haven't done much of scripting in Arma2 yet).

You could also try unit setCombatMode "yellow" or unit setCombatMode "green", "yellow" stands for fire at will and "green" stands for hold fire-defend only (which I guess is that the unit will return fire only when shot at). I remember using "yellow" for keeping snipers at their positions in the past, but that might as far as in OFP times.

The AI has more of an mind of it's own now so it seems that it's much more difficult to control them.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Ironman

  • Former Staff
  • ****
    • {GSF} Home Page
Re: Prevent AI From moving?
« Reply #5 on: 10 May 2010, 01:51:36 »
putting them at a WP sentry/hold should work I believe.
TS3 IP: tor.zebgames.com:9992