{"name":"difficultyOption","operator":null,"title":"difficultyOption","type":"command","url":"https://community.bistudio.com/wiki/difficultyOption","revid":369140,"updated":"2024-09-03T10:34:36Z","groups":["Difficulty"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.58"}],"since":{"game":"arma3","name":"Arma 3","version":"1.58"},"arma3_since":"1.58","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"optionName","type":"String","optional":false,"default":null,"description":"difficulty option name; one of:\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","types":["String"],"since":null,"text":"optionName: String - difficulty option name; one of:\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"}],"returns":{"type":"Number","types":["Number"],"description":null,"text":"Number"},"form":"unary","operator":null,"left":null,"right":{"text":"optionName","types":["String"]}},{"syntax":"difficultyOption array","since":"arma3 2.14","effect":null,"exec":null,"params":[{"name":"array","type":"Array","optional":false,"default":null,"description":"any array, could be empty array []","types":["Array"],"since":null,"text":"array: Array - any array, could be empty array []"}],"returns":{"type":"Array","types":["Array"],"description":"array of all options and current values in format [[\"Option1\", value1], ...[\"OptionN\", valueN]]","text":"Array - array of all options and current values in format [[\"Option1\", value1], ...[\"OptionN\", valueN]]"},"form":"unary","operator":null,"left":null,"right":{"text":"array","types":["Array"]}}],"examples":[{"text":"```sqf\nhint str (difficultyOption \"friendlyTags\");\n```","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}];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["difficulty","difficultyEnabledRTD","Arma 3: Difficulty Settings","missionDifficulty"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Difficulty","Introduced with Arma 3 version 1.58","Scripting Commands"]}