Internal Radio Setup - Superxpdude/tmtm_template GitHub Wiki
Internal document detailing how the radio setup script works.
Variables
Global variables
TFAR_defaultFrequencies_sr_side
Default SW frequencies for that side. Formatted as an array of 9 strings.
TFAR_defaultFrequencies_lr_side
Default LR frequencies for that side. Formatted as an array of 9 strings.
Unit variables (Set during the mission)
XPT_savedSRSettings
Variable attached to a unit that stores their SR radio settings when they die. Consists of the following values:
- The prototype classname of the radio
- SR radio settings obtained from TFAR_fnc_getSWSettings
XPT_savedLRSettings
Variable attached to a unit that stores their LR radio settings when they die. Consists of the following values:
- The classname of the backpack LR radio
- LR radio settings obtained from TFAR_fnc_getLRSettings
Setup variables
TFAR_SRChannel
Variable set on a unit or group in the editor. Defines the default SW radio channel for that group.
Value is a number between 0 and 7.
TFAR_LRChannel
Variable set on a unit or group in the editor. Defines the default LR radio channel for that group.
Value is a number between 0 and 7.
TFAR functions
TFAR_fnc_getSWSettings
Returns an array of radio settings in the following format
- Active channel (0-7)
- Volume (0-9)
- Array of channel frequencies (array of 9 strings)
- Stereo setting (0 = both, 1 = left, 2 = right)
- Encryption code (String)
- Additional Channel (0-7, -1 to disable)
- Additional stereo
- PlayerUID of owner
- Speakers (Bool)
- Power status (Bool, can only be set by script)
TFAR_fnc_getLRSettings
Returns an array of radio settings in the following format
- Active channel (0-8)
- Volume (0-9)
- Array of channel frequencies (array of 9 strings)
- Stereo setting (0 = both, 1 = left, 2 = right)
- Encryption code (String)
- Additional Channel (0-7, -1 to disable)
- Additional stereo
- Radio Owner (not sure what this is for LR)
- Speakers (Bool)
- Power status (Bool, can only be set by script)