difficultyEnabled: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " \| *s([0-9]) *= ([^ ]+)? ?'''([a-zA-Z0-9_]+)''' ?([^ ]+)? " to " |s$1= $2 $3 $4 ")
m (Text replacement - "(\|[pr][0-9]+ *= *[^-]+) *- *D([a-z])" to "$1 - d$2")
 
(10 intermediate revisions by the same user not shown)
Line 22: Line 22:
|mp= This command checks the difficulty flags of the computer (client/server) where it is executed.
|mp= This command checks the difficulty flags of the computer (client/server) where it is executed.


{{Feature|Arma3|This command is '''deprecated since Arma 3 v1.58'''. Since this version it always returns false. Use [[difficultyOption]] instead. See [[Arma 3: Difficulty Settings#Difficulty_Overhaul|Arma 3 Difficulty Overhaul]] for further details.
{{Feature|arma3|
* Stress damage is a separate difficulty settings. There are two dedicated commands for it:
This command is '''deprecated since {{arma3}} v1.58'''. Since this version it always returns false. Use [[difficultyOption]] instead.
See [[Arma 3: Difficulty Settings#Difficulty_Overhaul|Arma 3 Difficulty Overhaul]] for further details.
* Stress damage is a separate difficulty setting. There are two dedicated commands for it:
** [[enableStressDamage]]
** [[enableStressDamage]]
** [[isStressDamageEnabled]]
** [[isStressDamageEnabled]]
* Auto trim is also a separate difficulty. There are also two dedicated commands for it:
* Auto trim is also a separate difficulty setting. There are also two dedicated commands for it:
** [[enableAutoTrimRTD]]
** [[enableAutoTrimRTD]]
** [[isAutoTrimOnRTD]]}}
** [[isAutoTrimOnRTD]]
}}


|s1= [[difficultyEnabled]] flagName
|s1= [[difficultyEnabled]] flagName


|p1= flagName: [[String]] - Difficulty flag name. Following values are available:<br>
|p1= flagName: [[String]] - difficulty flag name. Following values are available:<br>
<spoiler text="Arma 3 Flags">
<spoiler text="Arma 3 Flags">
<div style="-webkit-column-count:5;-moz-column-count:5;column-count:5;margin-top:1em;">
{{Columns|5|
* 3rdPersonView
* 3rdPersonView
* armor
* armor
Line 62: Line 65:
* weaponCursor
* weaponCursor
* windEnabled
* windEnabled
</div></spoiler>
}}
 
</spoiler>
<spoiler text="Arma 2 Flags">
<spoiler text="Arma 2 Flags">
<div style="-webkit-column-count:5;-moz-column-count:5;column-count:5;margin-top:1em;">
{{Columns|5|
* 3rdPersonView
* 3rdPersonView
* armor
* armor
Line 88: Line 91:
* unlimitedSaves
* unlimitedSaves
* weaponCursor
* weaponCursor
</div></spoiler>
}}
</spoiler>


|r1= [[Boolean]]
|r1= [[Boolean]]


|x1= <code>[[hint]] [[str]] ([[difficultyEnabled]] "armor");</code>
|x1= <sqf>hint str (difficultyEnabled "armor");</sqf>


|x2= List current difficulty settings:
|x2= List current difficulty settings:
<code>[[call]] {
<sqf>
[[private]] ["_diff", "_cfg", "_flags", "_res"];
call {
_diff <nowiki>=</nowiki> [];
private ["_diff", "_cfg", "_flags", "_res"];
_cfg <nowiki>=</nowiki> [[configFile]] >> "CfgDifficulties";
_diff = [];
_cfg = configFile >> "CfgDifficulties";
{
{
_flags <nowiki>=</nowiki> _cfg >> [[configName]] _x >> "Flags";
_flags = _cfg >> configName _x >> "Flags";
[[for]] "_i" [[from]] 0 [[to]] [[count]] _flags - 1 [[do]] {
for "_i" from 0 to count _flags - 1 do {
_diff [[pushBack]] [[configName]] (_flags [[select]] _i);
_diff pushBack configName (_flags select _i);
};
};
} [[forEach]] ("true" [[configClasses]] _cfg);
} forEach ("true" configClasses _cfg);
_diff <nowiki>=</nowiki> _diff [[arrayIntersect]] _diff;
_diff = _diff arrayIntersect _diff;
_diff [[sort]] [[true]];
_diff sort true;
_res <nowiki>=</nowiki> [[text]] "";
_res = text "";
{
{
_res <nowiki>=</nowiki> [[composeText]] [_res, [[parseText]] [[format]] [
_res = composeText [_res, parseText format [
"<t align<nowiki>=</nowiki>'left'>%1 - %2</t>",  
"<t align='left'>%1 - %2</t>",  
_x,  
_x,  
[0, 1] [[select]] [[difficultyEnabled]] _x
[0, 1] select difficultyEnabled _x
], [[lineBreak]]];
], lineBreak];
} [[forEach]] _diff;
} forEach _diff;
[[hint]] _res;
hint _res;
};</code>
};
</sqf>


|seealso= [[difficultyOption]], [[difficulty]], [[difficultyEnabledRTD]], [[Arma 3: Difficulty Settings]]
|seealso= [[difficultyOption]] [[difficulty]] [[difficultyEnabledRTD]] [[Arma 3: Difficulty Settings]]
}}
}}

Latest revision as of 14:01, 8 November 2023

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 ArmA profile file under class Difficulties/xxx/Flags (xxx being regular or veteran).
Multiplayer:
This command checks the difficulty flags of the computer (client/server) where it is executed.
Arma 3
This command is deprecated since Arma 3 v1.58. Since this version it always returns false. Use difficultyOption instead.

See Arma 3 Difficulty Overhaul for further details.

Groups:
Difficulty

Syntax

Syntax:
difficultyEnabled flagName
Parameters:
flagName: String - difficulty flag name. Following values are available:
  • 3rdPersonView
  • armor
  • autoAim
  • autoGuideAT
  • autoSpot
  • autoTrimEnabled
  • cameraShake
  • clockIndicator
  • deathMessages
  • enemyTag
  • extendetInfoType
  • friendlyTag
  • hud
  • hudGroupInfo
  • hudPerm
  • hudWp
  • hudWpPerm
  • map
  • mineTag
  • netStats
  • roughLanding
  • stanceIndicator
  • stressDamageEnabled
  • unlimitedSaves
  • vonID
  • weaponCursor
  • windEnabled
  • 3rdPersonView
  • armor
  • autoSpot
  • autoGuideAT
  • autoAim
  • allowSeagull
  • clockIndicator
  • deathMessages
  • enemyTag
  • friendlyTag
  • hud
  • hudPerm
  • hudWp
  • hudWpPerm
  • map
  • netStats
  • suppressPlayer
  • tracers
  • realisticFatigue
  • ultraAI
  • unlimitedSaves
  • weaponCursor
Return Value:
Boolean

Examples

Example 1:
hint str (difficultyEnabled "armor");
Example 2:
List current difficulty settings:
call { private ["_diff", "_cfg", "_flags", "_res"]; _diff = []; _cfg = configFile >> "CfgDifficulties"; { _flags = _cfg >> configName _x >> "Flags"; for "_i" from 0 to count _flags - 1 do { _diff pushBack configName (_flags select _i); }; } forEach ("true" configClasses _cfg); _diff = _diff arrayIntersect _diff; _diff sort true; _res = text ""; { _res = composeText [_res, parseText format [ "<t align='left'>%1 - %2</t>", _x, [0, 1] select difficultyEnabled _x ], lineBreak]; } forEach _diff; hint _res; };

Additional Information

See also:
difficultyOption difficulty difficultyEnabledRTD Arma 3: Difficulty Settings

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