Jump to content
Sign in to follow this  
_angus_

Just do as you're told!! You pesky AI!!!

Recommended Posts

A recurring problem I have with my very modest attempts at writing missions, is when I try to get an enemy soldier to patrol or simply walk from one place to another. They often seem to have other ideas, somewhere more interesting to go presumably.

Currently, I'm trying to loosely reconstruct an incident from the first Gulf war where some SAS soldiers behind enemy lines had hijacked a vehicle, and unexpectedly drove into a queue of traffic at an an enemy checkpoint.

I have got my guys to spawn in the vehicle and the civilian driver successfully stops near the line of traffic, but I want an enemy solider to walk up the line of vehicles towards them, and when he spots them, all hell to break loose.

Unfortunately, he keeps walking off in a different direction. I don't know why. Is he concerned about the civilian vehicles running him over, do the traffic cones make things too crowded for him to negotiate the route?

Its as if the progam is concerning itself with issues I don't currently want it to, what I want is for him to blindly follow my instructions, is there a mode where I can make that happen, or am I just doing something stupid?

Thanks for any thoughts.

Share this post


Link to post
Share on other sites

Objects definitely influence the AI's pathfinding, but what I wonder is whether or not you've set the SAS soldiers as civilians. If you set them as blufor, and the enemy approaching is opfor, AI have super vision and can instantly detect whether there is a friendly or an enemy vehicle, and so the opfor soldier, upon seeing a blufor vehicle, will move away into cover and start to engage.

If you did set the SAS soldiers as civilians, other vehicles and traffic cones may hinder the AI in his path finding. In this case, one thing you could do is to 'force' the ai to walk in a straight line by using a movement animation, upon closing in on the vehicle (using a trigger), stop the animation and make the AI engage.

Anyway, before I go too in depth with this, just tell me whether or not those SAS soldiers are blufor in the first place.

Kind regards,

Sanchez

Share this post


Link to post
Share on other sites

The SAS are Blufor, travelling in a civilian vehicle, driven by a civilian.

I tried using some text kindly supplied to me on another project some weeks back to reduce the AI soldier's awareness etc:

AISKILLS = group this;{_x setSkill ["aimingspeed", 0.15];_x setSkill ["spotdistance", 0.15];_x setSkill ["aimingaccuracy", 0.1];_x setSkill ["aimingshake", 0.1];_x setSkill ["spottime", 0.3];_x setSkill ["spotdistance", 0.5];_x setSkill ["commanding", 0.5];_x setSkill ["general", 0.6];} foreach units AISKILLS;

but it didn't make much difference to his behaviour in this situation.

I should add, I am very basic in my mission editing and don't use scripts or any clever stuff. :)

Share this post


Link to post
Share on other sites

You should test with setcaptive command on blufor and see If that may be the problem

Share this post


Link to post
Share on other sites

Do I just "setcaptive this;" into the soldier window thingy?

Share this post


Link to post
Share on other sites
Do I just "setcaptive this;" into the soldier window thingy?

put "this setcaptive true" in the init of your playable units, also give the units a name (p1 for example).

Create a trigger around the area where the car will be thats activated when OPFOR are present and OnAct put: p1 setCaptive false; p2 setCaptive false etc. Make the trigger area small enough so that its only activated when the guy is close to car.

I'm a editing noob though so might not work properly!

If you want to get fancy you could attach the trigger to the car using trigname attachTo [vehiclename,[0,0,0]]

Share this post


Link to post
Share on other sites

If you want to get fancy you could attach the trigger to the car using trigname attachTo [vehiclename,[0,0,0]]

Thanks, I'll try that out - and there's very little chance of me getting fancy. :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×