=====================================================================================
  Air Drop Expanded
  Version: 2.0 (ArmA) 5/14/2008
  Modifications By: Pirin (www.arma-tow.com / gmail: armapirin)
  Original Author: Kronzky (www.kronzky.info / kronzky@gmail.com)

======================================================================================

Welcome to Air Drop Expanded!  This is an attempt by me to take Kronzky's wonderful AirDrop script and make it a more expandable version using human spawned cargo and human controlled drops.

=====================================================================================
  To Use:
=====================================================================================
You'll need the following pre-placed to use this system as written:

1.  A marker for where your cargo will start out from.
2.  A marker for where you'll store your cargo while in transit.
3.  EventHandlers added to your transport vehicle.  See below.
4.  The scripts in place and configured for use by init.sqf.  See below.

EventHandlers to add to your transport vehicle:

this addEventHandler ["GetIn", {_this execVM "airdrop_getin.sqf"}]; 
this addEventHandler ["GetOut", {_this execVM "airdrop_getout.sqf"}]; 
this addEventHandler ["Killed", {_this execVM "airdrop_killed.sqf"}];

init.sqf configuration information:

ADmindropheight = 70; // Configure min drop from height.
ADmaxdropheight = 150; // Configure max drop from height.
ADspawnpoint = "spawnpoint"; // This is the marker name for where you want to spawn your possible cargo.
ADspawnrange = 20; // This is the range around the spawn marker you want to be able to keep cargo.
ADloadedcargo = "loadedcargo"; // This is the marker name for where loaded cargo is stored.
ADvehicletypes = ["Car","ReammoBox","Barrels"]; // This is an array of vehicle types that can be transported as cargo.

=====================================================================================
  Required Files:
=====================================================================================
Apparently I've bloated the script from 1 file to 9 required files!  It's part of my trying to make things modular I guess.  Here's the file list needed:

Config Files:
-------------
init.sqf

Event Handler Files:
--------------------
airdrop_getin.sqf
airdrop_getout.sqf
airdrop_killed.sqf

Cargo Control Files:
--------------------
listcargo.sqf
loadcargo.sqf
cargo_drop.sqf

Helper Files:
-------------
findinZone.sqf
removeActions.sqf

spawnVehicle.sqf (only part of this demo, not really needed for the script.)

=====================================================================================
  Descriptions of files:
=====================================================================================
init.sqf holds the configuration options for the scripts as AD-prefixed global variables.  It also initilizes the findinZone.sqf script for use later.  Basically this was an attempt at dynamically checking available cargo rather than pre-placing a trigger.

airdrop_getin.sqf controls the GetIn eventhandler.  If there's no cargo it gives you a LoadCargo option.  If there is cargo it gives you the Release Cargo option.  If there's cargo and you're a passenger it tells you there's no room and kicks you out!  I suppose that feature should be configurable.  Maybe next version!

airdrop_getout.sqf controls the GetOut eventhandler.  Basically it just removes the actions added.

airdrop_killed.sqf controls the Killed eventhandler.  It checks if cargo was loaded and if so destroys it.

listcargo.sqf checks the preplaced marker area for any available cargo types using an external call to the precomplied findinZone function.  If it finds cargo it adds options to "load" the cargo.

loadcargo.sqf is what actually "loads" the cargo.  Loading of cargo is abstracted by moving the item to a seperate storage area, perhaps a remote island or gated area, so that it cannot be used while in transit.

cargo_drop.sqf is the meat behind this script and is mostly all the orginial Kronzky's code.  The main feature that I added was making it take custom items to drop and leaving a map marker at the locations landing spot.

findinZone.sqf is simply the "check what's there" code ripped out of the listcargo.sqf and used as an external function.  In my more robust version of this script suite I double check available cargo more often so wanted it seperate and a single instance rather than repeat code over and over.

removeActions.sqf is also simply a case of "I was using this code in almost everything, lets just have one copy of it!"  It simply adds an action, then removes all actions before that one to clear the menu back to default.  Mostly needed for multiple cargo runs of listcargo.sqf

spawnVehicle.sqf is just a simple spawning system inspired by code from AToW as written by BarmyArmy.

=====================================================================================
  Original Usage:
=====================================================================================
  Parachutes an item from a plane.

  Place into your mission folder, and call at the desired drop-off point via:
  nul=[plane,object] execVM "dropit.sqf";

  Required parameters:
    'plane'  - Name of the air vehice the item should be dropped out of.
    'object' - Name of the item to be dropped. This item has to be exist somewhere on the map.
    
  Optional parameters:
    "smoke"   - Will create a smoke plume at the landing point.
    "message" - Will display a message with drop-off and landing coordinates.
    "usebox"  - Eject item inside heavier shipping box.
=====================================================================================

=====================================================================================
  Known Bugs w/demo:
=====================================================================================
The ammo crate won't trip the "cargo loaded" trigger.

=====================================================================================
  Known Bugs w/script:
=====================================================================================
In some cases the parachutes will "burn" on the way down when using MadMatt's ArmaEffects.
Vehicle options are visible to passengers and from outside the transport vehicle. (Not really a bug per se, just a lack of features included with this quick demo that would prevent that sort of thing.)

=====================================================================================
  Furthur Ideas:
=====================================================================================
Build in more error checking.
Add in configurable smoke/message/usebox options from init.sqf
Always have an ammo box available as a drop option?
Max speed to drop at?

=====================================================================================
  Acknowledgements:
=====================================================================================
Kronzky for writing the AirDrop code in the first place and his permission to reuse his work.
ViperMaul from AToW for giving me the project of getting this working with our mod.
BarmyArmy from AToW for helping write better code and giving me ideas of how better to do things.  Also for letting me use his code as well.
Myke from OFPEC and Armaholic for helping me learn scripting.
ArmA Theatre of War (http://www.arma-tow.com/) for being the best tournament ever!
