difficultyOption: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{uc:{{PAGENAME}}}}" to "{{uc:{{PAGENAME}}}}")
m (Text replacement - "<sqf>([^↵][^\/]*↵[^\/]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(57 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma3 |Game name=
|game1= arma3
|version1= 1.58


|1.58|Game version=
|gr1= Difficulty
____________________________________________________________________________________________


| Checks specific difficulty settings of the current user. Difficulty flag names can be found in the <tt>CfgDifficultyPresets</tt> config class or in  
|descr= Checks specific difficulty settings of the current user.
[[server.armaprofile|ArmA profile]] file under class <tt>DifficultyPresets/xxx/Options</tt> (xxx being Recruit, Regular or Veteran). This command replaces [[difficultyEnabled]] as many options have multiple values and former command only provided [[Boolean]] return.
Difficulty flag names can be found in the {{hl|CfgDifficultyPresets}} config class or in [[server.armaprofile|ArmA profile]] file under class {{hl|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.


| '''difficultyOption''' optionName |SYNTAX=
|s1= [[difficultyOption]] optionName


|p1= optionName: [[String]] - difficulty option name |PARAMETER1=
|p1= optionName: [[String]] - difficulty option name; one of:
 
{{Columns|5|
| [[Number]] |RETURNVALUE=
____________________________________________________________________________________________
 
|x1= <code>[[hint]] [[str]] ([[difficultyOption]] "friendlyTags");</code>  |EXAMPLE1=
|x2= Remember last [[cameraView]] per vehicle:<code>[[player]] [[addEventHandler]] ["GetOutMan",
{
[[params]] ["_unit", "_role", "_vehicle", "_turret"];
_unit [[setVariable]] [_vehicle [[call]] [[BIS_fnc_netId]], [[cameraView]]];
}];
[[player]] [[addEventHandler]] ["GetInMan",
{
[[if]] ([[difficultyOption]] "thirdPersonView" == 2) [[then]]
{
[[params]] ["_unit", "_role", "_vehicle", "_turret"];
_unit [[switchCamera]] (_unit [[getVariable]] [_vehicle [[call]] [[BIS_fnc_netId]], "INTERNAL"]);
};
}];</code>  |EXAMPLE2=
 
____________________________________________________________________________________________
 
| [[difficulty]], [[difficultyEnabledRTD]], [[Arma 3 Difficulty Menu]], [[missionDifficulty]] |SEEALSO=
 
}}
 
<h3 style="display:none">Notes</h3>
<dl class="command_description">
 
<!-- CONTINUE Notes -->
<dd class="notedate">Posted on March 23, 2016 - 19:06 (UTC)</dd>
<dt class="note">[[User:Muf|Muf]]</dt>
<dd class="note">
Arma 3 options:
<div style="-webkit-column-count:5;-moz-column-count:5;column-count:5;margin-top:1em;">
* reducedDamage
* reducedDamage
* groupIndicators
* groupIndicators
Line 67: Line 34:
* autoReport
* autoReport
* multipleSaves
* multipleSaves
</div>
}}
 
|r1= [[Number]]
 
|s2= [[difficultyOption]] array
|s2since= arma3 2.14
 
|p21= array: [[Array]] - any array, could be empty array []
|r2= [[Array]] - array of all options and current values in format <nowiki>[</nowiki>["Option1", value1], ...["OptionN", valueN]]


<!-- Note Section END -->
|x1= <sqf>hint str (difficultyOption "friendlyTags");</sqf>
</dl>


<h3 style="display:none">Bottom Section</h3>
|x2= Remember last [[cameraView]] per vehicle:
<sqf>
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"]);
};
}];
</sqf>


[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
|seealso= [[difficulty]] [[difficultyEnabledRTD]] [[Arma 3: Difficulty Settings]] [[missionDifficulty]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
}}
[[Category:Command_Group:_System|{{uc:{{PAGENAME}}}}]]

Latest revision as of 11:34, 3 September 2024

Hover & click on the images for description

Description

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.
Groups:
Difficulty

Syntax

Syntax:
difficultyOption optionName
Parameters:
optionName: String - difficulty option name; one of:
  • reducedDamage
  • groupIndicators
  • friendlyTags
  • enemyTags
  • detectedMines
  • commands
  • waypoints
  • weaponInfo
  • stanceIndicator
  • staminaBar
  • weaponCrosshair
  • visionAid
  • thirdPersonView
  • cameraShake
  • scoreTable
  • deathMessages
  • vonID
  • mapContent
  • autoReport
  • multipleSaves
Return Value:
Number

Alternative Syntax

Syntax:
difficultyOption array
Parameters:
array: Array - any array, could be empty array []
Return Value:
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"]); }; }];

Additional Information

See also:
difficulty difficultyEnabledRTD Arma 3: Difficulty Settings missionDifficulty

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note