OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Resources Beta Testing & Submission => Topic started by: Chris Death on 18 Oct 2006, 16:47:59

Title: Function: vehiclecrew
Post by: Chris Death on 18 Oct 2006, 16:47:59
This function returns the crew of a vehicle
seperated into vehicle's crew: driver,gunner,commander (if available)
and vehicle's cargo  (if available).

Input: vehicle

Output: an array featuring two subarrays;

[vehiclestaff,vehiclecargo]

:note - in init.sqs you have to put: vehiclecrew = preprocessFile "vehiclecrew.sqf"

example: my_result = my_apc call vehiclecrew

If my_apc has a driver and a gunner but no commander and 3 men in cargo, result would
be: [[driver,gunner],[cargo1,cargo2,cargo3]]

If my_apc is empty, result would be: [[],[]]

If my_apc is a person, result would be: [[],[]] and a hint message informing that given vehicle is a person.

If my_apc has no driver/gunner/commander but 2 men cargo, result would be: [[],[cargo1,cargo2]]

///

This function can be used e.g. for ejection scripts.
Also it can become useful for groups mounted onto a vehicle with personell from the
same group, to get an extra array for controlling the cargo units only and keeping
the vehicle's personell mounted.

There's a readme for the function included which basically repeats the content of this post.  ;)
Also there's an example mission on desert island with it's own readme which explains what
will happen included.

~S~ CD