Arma 3 Scripting

forceCadetDifficulty

  • Arma 3 v2.02

Command · Markdown · JSON · original wiki page

Description

Forces showCadetHints and showCadetWP global Cadet Arma 3 difficulty, returns previous settings.

Syntax

forceCadetDifficulty [showCadetHints, showCadetWP]

Parameters:

Returns: Array of Booleans - [prev_showCadetHints, prev_showCadetWP]

Examples

Example 1

private _previousSettings = forceCadetDifficulty [true, false];

Example 2

private _fnc_forceCadetDifficulty =
{
    params ["_OKButtonPressed"];
    if (_OKButtonPressed) then
    {
        forceCadetDifficulty (switch (toLowerANSI configName ((configFile >> "CfgDifficultyPresets") select difficulty)) do
        {
            case "recruit";
            case "regular":
            {
                // showCadetHints = 1;
                // showCadetWP = 1;
                [true, true]
            };
            case "veteran":
            {
                // showCadetHints = 0;
                // showCadetWP = 1;
                [false, true]
            };
            default
            {
                // showCadetHints = 0;
                // showCadetWP = 0;
                [false, false]
            };
        });
    };
};
[true] call _fnc_forceCadetDifficulty;
[missionNamespace, "OnGameOptionsExited", _fnc_forceCadetDifficulty] call BIS_fnc_addScriptedEventHandler;

See also

difficulty · cadetMode · hintCadet · Arma 3: Scripted Event Handlers