Commit c3ba4aba authored by Ryan Grupp's avatar Ryan Grupp 💀
Browse files

Updated documentation

parent a2d6aacb
......@@ -2,6 +2,8 @@
TSM is a group of script modules I've created for mission makers, but things that I don't feel are right to exist in framework.
Functions with _(Editor safe.)_ in their description are safe to run on all clients via an init box in 3DEN.
[[_TOC_]]
<br>
......@@ -81,6 +83,11 @@ _This module requires the use of [TSM Configuraiton](#using-tsm-configuration)._
Ambient Sounds plays audio in the background to make your players more _immersed_. _It plays the sound (sfx) audio channel, ie. not music._
<dl>
<dd><h4>Config Reference</h4></dd>
<dd>
<details>
<summary><strong>tsm_configuration.hpp</strong></summary>
| __Config Setting__ | __Type__ | __Description__ |
| ------------------ | -------- | --------------- |
......@@ -92,6 +99,12 @@ Ambient Sounds plays audio in the background to make your players more _immersed
<br>
<br>
</details>
</dd>
</dl>
<br>
<br>
......@@ -108,7 +121,7 @@ Car Radio allows a player in a vehicle _(doesn't actually need to be a car)_ to
<details>
<summary><strong>tsm_car_radio_fnc_init</strong></summary>
Initialises a vehicle to have a radio.
Initialises a vehicle to have a radio. _(Editor safe.)_ _(Should be run globally.)_
Arguments:
* __Vehicle__ <sub>_(object)_</sub>
......@@ -147,13 +160,127 @@ Arguments:
### Module - Components
<dl>
<dd><h4>Function Reference</h4></dd>
<dd>
<details>
<summary><strong>tsm_components_fnc_addComponent</strong></summary>
Adds a component to an item. _(Editor safe.)_
Arguments:
* __Project__ <sub>_(object)_</sub>
* The object that is the project.
* __Component ID__ <sub>_(string)_</sub>
* A unique ID for this component on this project.
* __Name__ <sub>_(string)_</sub>
* Name of the component, if `''` the item's displayName will be used from config.
* __Item__ <sub>_(string)_</sub>
* Classname of the inventory item that represents the component.
* __Initial State__ <sub>_(integer) [optional]_</sub>
* The initial state of the component.
* __0__ - Uninstalled/Missing. _(Default)_
* __1__ - Installed.
* __Removable__ <sub>_(boolean) [optional]_</sub>
* Whether or not the component can be removed. _(Default: false)_
* __Interact Time__ <sub>_(integer) [optional]_</sub>
* The time in seconds it takes to install or remove the component. _(Default: 10)_
```sqf
[
this,
"COMP_ID_1",
"",
"cbb_items_components_cable_metal",
1,
true,
20
] call tsm_components_fnc_addComponent;
```
<br>
<br>
</details>
</dd>
</dl>
<br>
<dl>
<dd><h4>Event Reference</h4></dd>
<dd>
<details>
<summary><strong>tsm_components_stateChanged</strong></summary>
Called globally when a project has a component change.
Arguments:
* __Project__ <sub>_(object)_</sub>
* The object that is the project.
* __Component ID__ <sub>_(string)_</sub>
* The unique ID of the component changed.
* __State__ <sub>_(boolean)_</sub>
* State of the object that was changed.
* __true__ - Installed.
* __false__ - Removed
```sqf
["tsm_components_stateChanged", {
systemChat format["stateChanged: %1", str _this];
}] call CBA_fnc_addEventHandler;
```
<br>
<br>
</details>
</dd>
<dd>
<details>
<summary><strong>tsm_components_projectComplete</strong></summary>
Called globally when a project has a project has had all of it's components installed. _(Can fire multiple times.)_
Arguments:
* __Project__ <sub>_(object)_</sub>
* The object that is the project.
```sqf
["tsm_components_projectComplete", {
systemChat format["projectComplete: %1", str _this];
}] call CBA_fnc_addEventHandler;
```
<br>
<br>
</details>
</dd>
<dd>
<details>
<summary><strong>tsm_components_projectEmpty</strong></summary>
Called globally when a project has a project has had all of it's components removed. _(Can fire multiple times.)_
Arguments:
* __Project__ <sub>_(object)_</sub>
* The object that is the project.
```sqf
["tsm_components_projectEmpty", {
systemChat format["projectEmpty: %1", str _this];
}] call CBA_fnc_addEventHandler;
```
<br>
<br>
</details>
</dd>
</dl>
<br>
<br>
......@@ -180,13 +307,17 @@ LZ Select add actions to a vehicle that call a script, usually a unitPlay script
<details>
<summary><strong>tsm_lz_select_fnc_init</strong></summary>
Initializes actions for a vehicle.
Initializes actions for a vehicle. _(Editor safe.)_ _(Should be run globally.)_
Arguments:
* __Vehicle__ <sub>_(object)_</sub>
* The vehicle to initialize.
* __LZ List__ <sub>_(array)_</sub>
* A list of classnames from CfgSounds _(config or mission config)_ of songs to play.
* An array of arrays contain LZ data.
* __Script__ <sub>_(string)_</sub>
* Path to the script to be run, script it run local to the vehicle, and is run in a scheduled environment.
* __Name__ <sub>_(string)_</sub>
* Name of the LZ in the menu.
```sqf
[
......@@ -207,16 +338,16 @@ Arguments:
<dd>
<details>
<summary><strong>tsm_static_radio_fnc_forceOut</strong></summary>
<summary><strong>tsm_lz_select_fnc_forceOut</strong></summary>
Kicks units out of a vehicle, but only FFV and Cargo seats.
Kicks units out of a vehicle, but only FFV and Cargo seats. _(Can be run on any machine.)_
Arguments:
* __Vehicle__ <sub>_(object)_</sub>
* The object to eject units from.
```sqf
[my_aircraft] call tsm_static_radio_fnc_forceOut;
[my_aircraft] call tsm_lz_select_fnc_forceOut;
```
<br>
<br>
......@@ -227,9 +358,9 @@ Arguments:
<dd>
<details>
<summary><strong>tsm_static_radio_fnc_fastrope</strong></summary>
<summary><strong>tsm_lz_select_fnc_fastrope</strong></summary>
Fast ropes units out of a vehicle.
Fast ropes units out of a vehicle. _(Editor safe.)_ _(Should be run local to the vehicle, but will self correct if it isn't.)_
Arguments:
* __Vehicle__ <sub>_(object)_</sub>
......@@ -238,7 +369,42 @@ Arguments:
* Causes every unit that isn't the pilot to fastrope, including co-pilot and gunners. _(Default: false)_
```sqf
[my_aircraft] call tsm_static_radio_fnc_fastrope;
[my_aircraft] call tsm_lz_select_fnc_fastrope;
```
<br>
<br>
</details>
</dd>
</dl>
<br>
<dl>
<dd><h4>Event Reference</h4></dd>
<dd>
<details>
<summary><strong>tsm_lz_select_transitStarted</strong></summary>
Called globally when a user selects an LZ.
Arguments:
* __Vehicle__ <sub>_(object)_</sub>
* The vehicle to departing.
* __Player__ <sub>_(object)_</sub>
* The player that chose an LZ.
* __Index__ <sub>_(integer)_</sub>
* Index of the LZ that was selected in the original LZ List.
```sqf
['tsm_lz_select_transitStarted', {
params ["_target", "_player", "_params"];
if !(vehicle player isEqualTo _target) exitWith {};
playMusic "cbb_music_path";
}] call CBA_fnc_addEventHandler;
```
<br>
<br>
......@@ -275,7 +441,7 @@ Static Radio creates Static Radios in the work to play music, or any other sound
<details>
<summary><strong>tsm_static_radio_fnc_init</strong></summary>
Initialises an object to be a radio.
Initialises an object to be a radio. _(Editor safe.)_ _(Should be run globally.)_
Arguments:
* __Object__ <sub>_(object)_</sub>
......@@ -305,7 +471,7 @@ Arguments:
<details>
<summary><strong>[BETA] tsm_static_radio_fnc_loopSoundGlobal</strong></summary>
Loops a sound from an object, always, forever.
Loops a sound from an object, always, forever. _(Editor safe.)_ _(Should be run on the server.)_
Arguments:
* __Object__ <sub>_(object|position)_</sub>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment