Jump to content
daanjules

Transport mission Livonia

Recommended Posts

Hello,

 

I'm creating a mission on the Livonia map where you drive around in a vehicle and transport troops from and to random locations. I already put markers , so you drive around from location X to X and discover the map by doing so. The problem is, I have no idea how to make a script that picks a random pick up and drop off location, I've searched online for help but due to my lack of scripting skills I'm afraid I can't do it myself. Would anyone be so kind to get me started with a basic script or something

 

Thanks in advance!

Share this post


Link to post
Share on other sites

Depends on what you want, if you just want random locations you can use BIS_fnc_randomPos. If i would make this i'd probably make a list of cities/towns and select one randomly, then select a random road to spawn a pick-up point on. Then you can filter different cities based on distance so you can't drive 100m and finish the mission quick. Also if you want to go with the random approach, select a location with randomPos and use getPos to set the drop-off point, this way you can set the min distance between the spawn/drop points.

Share this post


Link to post
Share on other sites
16 hours ago, Floof said:

Depends on what you want, if you just want random locations you can use BIS_fnc_randomPos. If i would make this i'd probably make a list of cities/towns and select one randomly, then select a random road to spawn a pick-up point on. Then you can filter different cities based on distance so you can't drive 100m and finish the mission quick. Also if you want to go with the random approach, select a location with randomPos and use getPos to set the drop-off point, this way you can set the min distance between the spawn/drop points.

Thanks! I'll try working with it. Just to be clear I already have pick up locations and drop off locations marked with markers, so I just want to make a script that picks a random marker, spawns troops, when u get to the location they get in and a the same at the drop off but other way around

I'll try to work with BIS_fnc_randomPos

Share this post


Link to post
Share on other sites

Put your markers in arrays, then use selectRandom to pick a random marker from the array.  It would work like this:

DropOffLocations = [drop1, drop2, drop3]; // assuming you named your markers drop1, drop2, drop3
_nextDropOffLocation = selectRandom DropOffLocations;  // selects one marker from the array

 

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

×