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:

  1. The prototype classname of the radio
  2. 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:

  1. The classname of the backpack LR radio
  2. 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

  1. Active channel (0-7)
  2. Volume (0-9)
  3. Array of channel frequencies (array of 9 strings)
  4. Stereo setting (0 = both, 1 = left, 2 = right)
  5. Encryption code (String)
  6. Additional Channel (0-7, -1 to disable)
  7. Additional stereo
  8. PlayerUID of owner
  9. Speakers (Bool)
  10. Power status (Bool, can only be set by script)

TFAR_fnc_getLRSettings

Returns an array of radio settings in the following format

  1. Active channel (0-8)
  2. Volume (0-9)
  3. Array of channel frequencies (array of 9 strings)
  4. Stereo setting (0 = both, 1 = left, 2 = right)
  5. Encryption code (String)
  6. Additional Channel (0-7, -1 to disable)
  7. Additional stereo
  8. Radio Owner (not sure what this is for LR)
  9. Speakers (Bool)
  10. Power status (Bool, can only be set by script)