Jump to content
Chuc

Need help with Ai driver script

Recommended Posts

I am making a mission where when you occupy a safe zone there will be a driver in a car that can drive you to any other safe zone you have occupied. 

 

So you go up to the car or driver and get him to drive you to a set marker. I managed to find a taxi script but that let's you choose anywhere on the map to travel to and that will break my mission. 

 

Atm I have a teleport set up between safe zones but it really kills immersion. And I can't figure out how to add locations only once unlocked atm you can travel to any of them, which is a problem. 

 

Mission so far:

 

So you start at "base" and move upto "outpost_1". Once you get there you have a small task which then unlocks the teleport so you can now travel between "base" and "outpost_1".

 

I want to change the teleport to a npc that will drive you instead. But I can't figure it out. I'm not that good at scripting. 

Share this post


Link to post
Share on other sites

So i managed to get something together using triggers. Its not the best and the driver acts like he is drunk.

 

// Place a vehicle down in the editor and name it Car_1. Place a solder down and name him Driver_1. Put Driver_1 into Car_1.
// Make sure you put driver_1 into the drivers seat and also set him to careless and fire only if fired upon.

 

// Place a trigger Activation owned by driver_1 in your base, make it the size of the car and set it to presant.
// Also place a empty marker called Base where you want the car to drive to. Make sure the marker is in the trigger area.

 

// Add this in the trigger activation.
driver_1 disableAI "PATH";
TakemetoOutPost1 = Car_1 addAction ["Take me to OutPost 1", {driver_1 enableAI "PATH"}, driver_1 doMove (getMarkerPos "OutPost_1")];

 

// Add this in the trigger deactivation.
Car_1 removeAction TakemetoOutPost1;

 

// Place a trigger Activation owned by driver_1 in your Outpost, make it the size of the car and set it to presant.
// Also place a empty marker called OutPost_1 where you want the car to drive to. Make sure the marker is in the trigger area.

 

// Add this in the trigger activation.
driver_1 disableAI "PATH";
TakemetoBase = Car_1 addAction ["Take me to Base", {driver_1 enableAI "PATH"}, driver_1 doMove (getMarkerPos  "Base")];

 

// Add this in the trigger deactivation.
Car_1 removeAction TakemetoBase;

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

×