{"name":"forceCadetDifficulty","operator":null,"title":"forceCadetDifficulty","type":"command","url":"https://community.bistudio.com/wiki/forceCadetDifficulty","revid":310147,"updated":"2022-05-05T12:46:27Z","groups":["Difficulty"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.02"}],"since":{"game":"arma3","name":"Arma 3","version":"2.02"},"arma3_since":"2.02","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Forces `showCadetHints` and `showCadetWP` global Cadet Arma 3 difficulty, returns previous settings.","syntaxes":[{"syntax":"forceCadetDifficulty [showCadetHints, showCadetWP]","since":null,"effect":null,"exec":null,"params":[{"name":"showCadetHints","type":"Boolean","optional":false,"default":null,"description":"`showCadetHints` difficulty","types":["Boolean"],"since":null,"text":"showCadetHints: Boolean - `showCadetHints` difficulty"},{"name":"showCadetWP","type":"Boolean","optional":false,"default":null,"description":"`showCadetWP` difficulty","types":["Boolean"],"since":null,"text":"showCadetWP: Boolean - `showCadetWP` difficulty"}],"returns":{"type":"Array of Booleans","types":["Array","Boolean"],"description":"[prev_showCadetHints, prev_showCadetWP]","text":"Array of Booleans - [prev_showCadetHints, prev_showCadetWP]"},"form":"unary","operator":null,"left":null,"right":{"text":"[showCadetHints, showCadetWP]","types":["Array"]}}],"examples":[{"text":"```sqf\nprivate _previousSettings = forceCadetDifficulty [true, false];\n```","code":["private _previousSettings = forceCadetDifficulty [true, false];"]},{"text":"```sqf\nprivate _fnc_forceCadetDifficulty = \n{\n    params [\"_OKButtonPressed\"];\n    if (_OKButtonPressed) then\n    {\n        forceCadetDifficulty (switch (toLowerANSI configName ((configFile >> \"CfgDifficultyPresets\") select difficulty)) do\n        {\n            case \"recruit\";\n            case \"regular\":\n            {\n                // showCadetHints = 1;\n                // showCadetWP = 1;\n                [true, true]\n            };\n            case \"veteran\":\n            {\n                // showCadetHints = 0;\n                // showCadetWP = 1;\n                [false, true]\n            };\n            default\n            {\n                // showCadetHints = 0;\n                // showCadetWP = 0;\n                [false, false]\n            };\n        });\n    };\n};\n[true] call _fnc_forceCadetDifficulty;\n[missionNamespace, \"OnGameOptionsExited\", _fnc_forceCadetDifficulty] call BIS_fnc_addScriptedEventHandler;\n```","code":["private _fnc_forceCadetDifficulty = \n{\n\tparams [\"_OKButtonPressed\"];\n\tif (_OKButtonPressed) then\n\t{\n\t\tforceCadetDifficulty (switch (toLowerANSI configName ((configFile >> \"CfgDifficultyPresets\") select difficulty)) do\n\t\t{\n\t\t\tcase \"recruit\";\n\t\t\tcase \"regular\":\n\t\t\t{\n\t\t\t\t// showCadetHints = 1;\n\t\t\t\t// showCadetWP = 1;\n\t\t\t\t[true, true]\n\t\t\t};\n\t\t\tcase \"veteran\":\n\t\t\t{\n\t\t\t\t// showCadetHints = 0;\n\t\t\t\t// showCadetWP = 1;\n\t\t\t\t[false, true]\n\t\t\t};\n\t\t\tdefault\n\t\t\t{\n\t\t\t\t// showCadetHints = 0;\n\t\t\t\t// showCadetWP = 0;\n\t\t\t\t[false, false]\n\t\t\t};\n\t\t});\n\t};\n};\n[true] call _fnc_forceCadetDifficulty;\n[missionNamespace, \"OnGameOptionsExited\", _fnc_forceCadetDifficulty] call BIS_fnc_addScriptedEventHandler;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["difficulty","cadetMode","hintCadet","Arma 3: Scripted Event Handlers"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Difficulty","Introduced with Arma 3 version 2.02","Scripting Commands"]}