Jump to content
Sign in to follow this  
goose4291

Dynamic Civillian transportation scripting

Recommended Posts

One of the missions I am currently making has an objective whereby 3x villages of Civilians need to be evacuated by BLUFOR.

As it stands I have triggers linked to a specific truck that once it gets into the village, the civilians mount the truck in empty cargo slots.

However I want to make it so that it doesn't have to be THAT specific truck that they will try to get in. (For example, if the player drives a Humvee into the town instead, I want the civvies to mount that instead.)

Any suggestions of a good scritping/trigger combination to allow that to happen?

Share this post


Link to post
Share on other sites

Set up a trigger. Activated by BLUFOR. Once. Put all the civvies inside the trigger area and name the group civGroup1. Call the following script from the activation field.

_vehicle = nearestObject [player, "Landvehicle"]; //assign the vehicle to be the one nearest to the player
{_x moveInCargo _vehicle;} forEach units civGroup1; //moves all of the units of civGroup1 into the vehicle

In the above script the moveInCargo will teleport the civvies into the truck - which works but doesn't look awefully pretty. If you want it to look better check out other commands such as getInCargo, orderGetIn or assignAsCargo.

Edited by Valfunction

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  

×