{"name":"difficultyOption","title":"difficultyOption","type":"command","url":"https://community.bistudio.com/wiki/difficultyOption","revid":369140,"updated":"2024-09-03T10:34:36Z","groups":["Difficulty"],"status":"ok","games":{"arma3":"1.58"},"since":"arma3 1.58","arma3_since":"1.58","description":"Checks specific difficulty settings of the current user.\nDifficulty 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).\nThis command replaces difficultyEnabled as many options have multiple values and former command only provided Boolean return.","syntaxes":[{"syntax":"difficultyOption optionName","params":[{"name":"optionName","type":"String","description":"difficulty option name; one of:\n\n- reducedDamage\n- groupIndicators\n- friendlyTags\n- enemyTags\n- detectedMines\n- commands\n- waypoints\n- weaponInfo\n- stanceIndicator\n- staminaBar\n- weaponCrosshair\n- visionAid\n- thirdPersonView\n- cameraShake\n- scoreTable\n- deathMessages\n- vonID\n- mapContent\n- autoReport\n- multipleSaves","type_expr":"String"}],"returns":{"type":"Number","type_expr":"Number"},"form":"unary","right":{"text":"optionName"}},{"syntax":"difficultyOption array","since":"arma3 2.14","params":[{"name":"array","type":"Array","description":"any array, could be empty array []","type_expr":"Array"}],"returns":{"type":"Array","type_expr":"Array","description":"array of all options and current values in format [[\"Option1\", value1], ...[\"OptionN\", valueN]]"},"form":"unary","right":{"text":"array"}}],"examples":[{"code":["hint str (difficultyOption \"friendlyTags\");"]},{"text":"Remember last cameraView per vehicle:\n\n```sqf\nplayer addEventHandler [\"GetOutMan\", {\n    params [\"_unit\", \"\", \"_vehicle\"];\n    _unit setVariable [_vehicle call BIS_fnc_netId, cameraView];\n}];\nplayer addEventHandler [\"GetInMan\", {\n    if (difficultyOption \"thirdPersonView\" == 2) then {\n        params [\"_unit\", \"\", \"_vehicle\"];\n        _unit switchCamera (_unit getVariable [_vehicle call BIS_fnc_netId, \"INTERNAL\"]);\n    };\n}];\n```","code":["player addEventHandler [\"GetOutMan\", {\n\tparams [\"_unit\", \"\", \"_vehicle\"];\n\t_unit setVariable [_vehicle call BIS_fnc_netId, cameraView];\n}];\nplayer addEventHandler [\"GetInMan\", {\n\tif (difficultyOption \"thirdPersonView\" == 2) then {\n\t\tparams [\"_unit\", \"\", \"_vehicle\"];\n\t\t_unit switchCamera (_unit getVariable [_vehicle call BIS_fnc_netId, \"INTERNAL\"]);\n\t};\n}];"]}],"see_also":["difficulty","difficultyEnabledRTD","Arma 3: Difficulty Settings","missionDifficulty"]}