OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: unknownx9 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
-
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.
-
Just pointing out that we do have the commands listed here too ;)
OFPEC Command Reference (http://www.ofpec.com/COMREF/)
@unknownx9
Have you tried using disableAI "target" alone instead of using it with the disableAI "move"?
-
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
-
Maybe using disableAI "autotarget" with it helps :dunno:
There's also the command doStop (http://www.ofpec.com/COMREF/index.php?action=details&id=112&game=All) 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.
-
putting them at a WP sentry/hold should work I believe.