Sabre99 0 Posted May 20, 2022 I need to enemy tank stay on roads. So I put " this forceFollowRoad ture; " script on it. However, this causes problem on AI behavior. Tanks are won't moving. Plus, they just wiggling and spinning around. How can I fix this? Share this post Link to post Share on other sites
RCA3 581 Posted May 20, 2022 Better skip that command and set their behaviour to SAFE on the editor or apply to the group. this setBehaviourStrong "SAFE"; 2 Share this post Link to post Share on other sites
pierremgi 4736 Posted May 20, 2022 "CARELESS" and "SAFE" are 2 behaviors for units reaching and following the roads each time it's possible. But "SAFE" can fall into "COMBAT" if needed, even with setBehaviourStrong... So, your best bet is to write: driver yourTank setCombatBehaviour "CARELESS"; This way you can set "CARELESS" to driver only, he'll follow the roads. Meanwhile gunner and commander can fall into "COMBAT" and engage targets. 4 Share this post Link to post Share on other sites
fn_Quiksilver 1633 Posted May 21, 2022 the vehicle AI driving was left in a broken state around 2016/2017 Share this post Link to post Share on other sites
.kju 3239 Posted May 21, 2022 make the driver an agent Share this post Link to post Share on other sites
bLAcKmAgE87 13 Posted May 21, 2022 you could add a eventhandler that detects when the tank gets really close to the edge or just outside of the nearest road, which is probably what its on... https://community.bistudio.com/wiki/isOnRoad or https://community.bistudio.com/wiki/BIS_fnc_nearestRoad but I have no clue about BIS_fnc so I'd use https://community.bistudio.com/wiki/nearRoads ... get the road and info https://community.bistudio.com/wiki/getRoadInfo ...determine the difference between your units and the center of the road... not sure what that works too... but I'd probably use the nearRoads function again and again... and as they say... determine the AIs behavior, but try to keep them running without much change. However getting them on a waypoint is another great deal as well... you want the next segment of the road in the array... Everytime they start getting lose or near the edge... you pop their waypoints. But you gotta look ahead so you feed the next segment again. Share this post Link to post Share on other sites