Arma 3 Scripting

Command in Difficulty

difficultyOption

Also available as Markdown and JSON, or read the original wiki page.

Description

Checks specific difficulty settings of the current user. Difficulty flag names can be found in the CfgDifficultyPresets config class or in ArmA profile file under class DifficultyPresets/xxx/Options (xxx being Recruit, Regular or Veteran). This command replaces difficultyEnabled as many options have multiple values and former command only provided Boolean return.

Syntax

Syntax 1

difficultyOption optionName

Parameters:

Returns: Number

Syntax 2

since arma3 2.14

difficultyOption array

Parameters:

Returns: Array - array of all options and current values in format [["Option1", value1], ...["OptionN", valueN]]

Examples

Example 1

hint str (difficultyOption "friendlyTags");

Example 2

Remember last cameraView per vehicle:

player addEventHandler ["GetOutMan", {
    params ["_unit", "", "_vehicle"];
    _unit setVariable [_vehicle call BIS_fnc_netId, cameraView];
}];
player addEventHandler ["GetInMan", {
    if (difficultyOption "thirdPersonView" == 2) then {
        params ["_unit", "", "_vehicle"];
        _unit switchCamera (_unit getVariable [_vehicle call BIS_fnc_netId, "INTERNAL"]);
    };
}];

See also

difficulty · difficultyEnabledRTD · Arma 3: Difficulty Settings · missionDifficulty