Arma 3 Scripting

Arma 3: Spectrum Device

  • Also known as Arma 3 Spectrum Device

Topic · Markdown · JSON · original wiki page

Arma 3 v1.96

The Spectrum Device is a tool / feature introduced in Arma 3 Contact. It's fully integrated only in the optionally loaded expansion data, relying on systems that cannot exist outside of Contact.

The default Arma 3 version contains a light version of the device, which has a basic API for usage in scripts.

Important

This is documentation for the Spectrum Device in the vanilla game's sandbox. It will not work as described when the spin-off Arma 3 Contact expansion is loaded into the game.
Keep in mind that players need to own Arma 3 Contact in order to pick up the device and use it without restrictions (it can still be added by script, but DLC purchase notifications will be shown).

Features

On its own, the simplified system handles these features:

All other features have to be controlled by user-made scripting, notably:

Certain aspects are not supported at all:

Spectrum Device

The device can be configured using global variables. Since the device is calculated locally, it is possible to set different values on each client in multiplayer.

The images display values set by the following code examples.

Display the UI

private _ctrlGroup = findDisplay 46 ctrlCreate ["ctrlControlsGroupNoScrollbars", -1];
_ctrlGroup ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH];
_ctrlGroup ctrlCommit 0;

[_ctrlGroup] call BIN_fnc_showPlayerSpectrumAnalyzer;

Frequency

Frequency range in which the analyzer operates. The values are in MHz.

missionNamespace setVariable ["#EM_FMin", 140];
missionNamespace setVariable ["#EM_FMax", 143];

Sensitivity

Sensitivity of signals the analyzer is able to detect. The values are in dBm.

missionNamespace setVariable ["#EM_SMin", -60];
missionNamespace setVariable ["#EM_SMax", -10];

Selected Frequency

Currently selected frequency. Must be within the frequency range, otherwise it will not be shown. The values are in MHz.

missionNamespace setVariable ["#EM_SelMin", 141.6];
missionNamespace setVariable ["#EM_SelMax", 141.9];

Since the player can change the selection, it is possible to use getVariable to get the current value.

Scanning Progress

When a signal is selected, it is possible to progress the scanning bar by setting the following variable. The value is in a range from 0 to 1.

missionNamespace setVariable ["#EM_Progress", 0.5];

Transmission

To visualize transmitting, set the following variable to true.

missionNamespace setVariable ["#EM_Transmit", true];

Spectrum Signals

List of displayed signal values. The array is in format [frequency1, strength1, frequency2, strength2, ... frequencyN, strengthN].

missionNamespace setVariable ["#EM_Values", [141.8, -30, 140.85, -50, 141.12, -40]];