diff --git a/docs/squad/squad.xml b/docs/squad/squad.xml index ad07564a2dc..3b536568e9e 100644 --- a/docs/squad/squad.xml +++ b/docs/squad/squad.xml @@ -7,7 +7,12 @@ ace_bux - + + ACE Core Developer + + + SilentSpike + ACE Core Developer diff --git a/docs/wiki/framework/cargo-framework.md b/docs/wiki/framework/cargo-framework.md index 091969b91f7..cf6ec054dd5 100644 --- a/docs/wiki/framework/cargo-framework.md +++ b/docs/wiki/framework/cargo-framework.md @@ -51,17 +51,64 @@ Event Name | Passed Parameter(s) | Locality | Description `ace_cargoLoaded` | [_item, _vehicle] | Global | Cargo has been Loaded into vehicle `ace_cargoUnloaded` | [_item, _vehicle] | Global | Cargo has been Unloaded from vehicle -## 3. Scripting +## 3. Editor Attributes -### 3.1 Disabling cargo for a mission object +In the 3D mission editor attributes for "Cargo Size" and "Cargo Space" are available on suitable objects. These can be adjusted to change the respective value on a per-object basis - as well as to enable loading for objects and vehicles which would usually not support it. + +If you wish to enable loading for an object/vehicle which does not have these editor attributes, see the `ace_cargo_fnc_setSize` and `ace_cargo_fnc_setSpace` functions. + +## 4. Scripting + +### 4.1 Disabling cargo for a mission object To disable cargo for a mission object use: ```cpp -this setVariable ["ace_cargo_size", -1]; +[this, -1] call ace_cargo_fnc_setSize; +``` + +### 4.2 Adjusting cargo size of an object + +`ace_cargo_fnc_setSize` +Note that this function can be used to make objects loadable/unloadable (set to `-1` for unloadable). + +```cpp + * Set the cargo size of any object. Has global effect. + * Adds the load action menu if necessary. + * Negative size makes unloadable. + * + * Arguments: + * 0: Object + * 1: Cargo size + * + * Return Value: + * None + * + * Example: + * [object, 3] call ace_cargo_fnc_setSize +``` + +### 4.3 Adjusting cargo space of a vehicle + +`ace_cargo_fnc_setSpace` +Note that this function can be used to enable/disable a vehicle's cargo space (set to `0` to disable). + +```cpp + * Set the cargo space of any object. Has global effect. + * Adds the cargo action menu if necessary. + * + * Arguments: + * 0: Vehicle + * 1: Cargo space + * + * Return Value: + * None + * + * Example: + * [vehicle, 20] call ace_cargo_fnc_setSpace ``` -### 3.2 Add cargo to vehicle +### 4.4 Load cargo into vehicle `ace_cargo_fnc_loadItem` (Also callable from cba event `ace_loadCargo`) Note first arg can be a in-game object or a classname of an object type. @@ -78,7 +125,7 @@ Note first arg can be a in-game object or a classname of an object type. * [object, vehicle] call ace_cargo_fnc_loadItem ``` -### 3.3 Unload cargo from vehicle +### 4.5 Unload cargo from vehicle `ace_cargo_fnc_unloadItem` (Also callable from cba event `ace_unloadCargo`)