Jump to content
Sign in to follow this  
near_blind_sniper

How to keep AI in their vehicles under fire?

Recommended Posts

Howdy All.

I'm currently trying to make a scenario where an AI mechanized infantry unit embarked in BMPs (infantry is in the BMP as cargo, the BMP is part of the infantry group) is assaulting across a valley to a dismount waypoint, where they dismount and charge up a ridge that is held by a mixed force of dismounted player controlled infantry and tanks.

Problem I'm having is that as soon as the BMPs detect the tanks, they disembark their infantry. This is unsatisfactory as they usually do this at a range that is outside the maximum effective range of the player's rifle, and that leads to a boring experience for the infantry as they watch the tanks slaughter everything.

I know that you can use careless waypoints for the AI to ignore things like this, but it looks extremely odd to see IFVs rolling into enemy fire with their crew turned out.

So my question to you all is:

A) is there a way to keep the infantry from dismounting their vehicles underfire.

or failing that

B) is there a way to keep vehicle crew from turning out while careless?

Thanks.

Share this post


Link to post
Share on other sites

I never had luck getting the lock to work with AI only players. If you figure this out I'd like to know how aswell. It could make a convoy actually reach its destination even if under attack...

Share this post


Link to post
Share on other sites

I found in the past using {_x disableAI "FSM"} foreach crew this helps

this being the vehicle name if used else where other than init line

also this will stop them getting out if the vehicle is damaged.

this allowCrewInImmobile true;

Share this post


Link to post
Share on other sites

I've been fooling around with setVehicleLock. I've found if a squad is placed via the editor, the units in cargo won't disembark under fire. However if I try to use the command on a group spawned via script, the the units will disembark under fire.

Strange.

EDIT

I've got the lock vehicle method to work by making the infantry dismounts a separate group from the vehicle crew. By some black magic this stops the AI from trying to dismount, and they stay in the vehicle until it is unlocked.

Edited by near_blind_sniper

Share this post


Link to post
Share on other sites
I found in the past using {_x disableAI "FSM"} foreach crew this helps

this being the vehicle name if used else where other than init line

also this will stop them getting out if the vehicle is damaged.

this allowCrewInImmobile true;

Golden, Thank You F2k Sel

Share this post


Link to post
Share on other sites

I'm also trying to keep AI in a vehicle while the vehicle is under fire, but they constantly dismount. I tried the setVehicleLock and lock as suggested above, but this is not keeping AI in the vehicle if under fire (however it does prevent Player from exiting vehicle). I have also used disableAI "FSM" on all passengers in vehicle, and they still dismount.

BTW, I don't want to setBehaviour "CARELESS", as I want these AI to be able to fire from passenger positions in back of offroad.

Any other suggestions?

Edited by JohnnyBoy

Share this post


Link to post
Share on other sites

vehicle setUnloadInCombat [FALSE,FALSE];       // passengers and person turrets will stay mounted
vehicle setUnloadInCombat [TRUE,FALSE];       // passengers can dismount in combat, person turrets cannot

https://community.bistudio.com/wiki/setUnloadInCombat

https://community.bistudio.com/wiki/canUnloadInCombat

Edited by MDCCLXXVI
  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites
vehicle setUnloadInCombat [FALSE,FALSE];       // passengers and person turrets will stay mounted
vehicle setUnloadInCombat [TRUE,FALSE];       // passengers can dismount in combat, person turrets cannot

Thanks MD. That works beautifully. The Cargo dudes now stay in vehicle under fire. I guess I need to keep up with all the new commands!

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  

×