forceCadetDifficulty: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{Command " to "{{RV|type=command ")
m (Some wiki formatting)
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


|game1= arma3dev
|game1= arma3
 
|version1= 2.02
|version= 2.01
 
|arg=
 
|eff=
 
|serverExec=


|gr1= Difficulty
|gr1= Difficulty


|descr= Forces <tt>showCadetHints</tt> and <tt>showCadetWP</tt> global Cadet [[Arma_3_Difficulty_Menu | Arma 3 difficulty]], returns previous settings.
|descr= Forces {{hl|showCadetHints}} and {{hl|showCadetWP}} global Cadet [[Arma 3: Difficulty Settings|{{arma3}} difficulty]], returns previous settings.
 
|mp= |Multiplayer Behaviour=
 
|pr= |Problems=


|s1= [[forceCadetDifficulty]] [showCadetHints, showCadetWP]
|s1= [[forceCadetDifficulty]] [showCadetHints, showCadetWP]


|p1= showCadetHints: [[Boolean]] - <tt>showCadetHints</tt> difficulty
|p1= showCadetHints: [[Boolean]] - {{hl|showCadetHints}} difficulty


|p2= showCadetWP: [[Boolean]] - <tt>showCadetWP</tt> difficulty
|p2= showCadetWP: [[Boolean]] - {{hl|showCadetWP}} difficulty


|r1= [[Array]] of [[Boolean]]s - [prev_showCadetHints, prev_showCadetWP]
|r1= [[Array]] of [[Boolean]]s - [prev_showCadetHints, prev_showCadetWP]


|x1= <code>[[private]] _previousSettings = [[forceCadetDifficulty]] [<nowiki/>[[true]], [[false]]];</code>
|x1= <sqf>private _previousSettings = forceCadetDifficulty [true, false];</sqf>


|x2= <code>[[private]] _fnc_forceCadetDifficulty =  
|x2= <sqf>
private _fnc_forceCadetDifficulty =  
{
{
[[params]] ["_OKButtonPressed"];
params ["_OKButtonPressed"];
[[if]] (_OKButtonPressed) [[then]]
if (_OKButtonPressed) then
{
{
[[forceCadetDifficulty]] ([[switch]] ([[toLowerANSI]] [[configName]] (([[configFile]] >> "CfgDifficultyPresets") [[select]] [[difficulty]])) [[do]]
forceCadetDifficulty (switch (toLowerANSI configName ((configFile >> "CfgDifficultyPresets") select difficulty)) do
{
{
[[case]] "recruit";
case "recruit";
[[case]] "regular":
case "regular":
{
{
// showCadetHints = 1;
// showCadetHints = 1;
// showCadetWP = 1;
// showCadetWP = 1;
<nowiki>[</nowiki>[[true]], [[true]]]
[true, true]
};
};
[[case]] "veteran":
case "veteran":
{
{
// showCadetHints = 0;
// showCadetHints = 0;
// showCadetWP = 1;
// showCadetWP = 1;
<nowiki>[</nowiki>[[false]], [[true]]]
[false, true]
};
};
[[default]]
default
{
{
// showCadetHints = 0;
// showCadetHints = 0;
// showCadetWP = 0;
// showCadetWP = 0;
<nowiki>[</nowiki>[[false]], [[false]]]
[false, false]
};
};
});
});
};
};
};
};
<nowiki>[</nowiki>[[true]]] [[call]] _fnc_forceCadetDifficulty;
[true] call _fnc_forceCadetDifficulty;
<nowiki>[</nowiki>[[missionNamespace]], "OnGameOptionsExited", _fnc_forceCadetDifficulty] [[call]] [[BIS_fnc_addScriptedEventHandler]];</code>
[missionNamespace, "OnGameOptionsExited", _fnc_forceCadetDifficulty] call BIS_fnc_addScriptedEventHandler;
</sqf>


|seealso= [[difficulty]], [[cadetMode]], [[hintCadet]], [[Arma_3:_Event_Handlers/ScriptedEventHandlers|Arma 3 Scripted Event Handlers]]
|seealso= [[difficulty]] [[cadetMode]] [[hintCadet]] [[Arma 3: Scripted Event Handlers|Arma 3 Scripted Event Handlers]]
}}
}}
<dl class="command_description">
<!-- BEGIN Note Section -->
<!-- END Note Section -->
</dl>

Latest revision as of 14:46, 5 May 2022

Hover & click on the images for description

Description

Description:
Forces showCadetHints and showCadetWP global Cadet Arma 3 difficulty, returns previous settings.
Groups:
Difficulty

Syntax

Syntax:
forceCadetDifficulty [showCadetHints, showCadetWP]
Parameters:
showCadetHints: Boolean - showCadetHints difficulty
showCadetWP: Boolean - showCadetWP difficulty
Return Value:
Array of Booleans - [prev_showCadetHints, prev_showCadetWP]

Examples

Example 1:
private _previousSettings = forceCadetDifficulty [true, false];
Example 2:
private _fnc_forceCadetDifficulty = { params ["_OKButtonPressed"]; if (_OKButtonPressed) then { forceCadetDifficulty (switch (toLowerANSI configName ((configFile >> "CfgDifficultyPresets") select difficulty)) do { case "recruit"; case "regular": { // showCadetHints = 1; // showCadetWP = 1; [true, true] }; case "veteran": { // showCadetHints = 0; // showCadetWP = 1; [false, true] }; default { // showCadetHints = 0; // showCadetWP = 0; [false, false] }; }); }; }; [true] call _fnc_forceCadetDifficulty; [missionNamespace, "OnGameOptionsExited", _fnc_forceCadetDifficulty] call BIS_fnc_addScriptedEventHandler;

Additional Information

See also:
difficulty cadetMode hintCadet Arma 3 Scripted Event Handlers

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