forceCadetDifficulty: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) (Page creation) |
Lou Montana (talk | contribs) m (Text replacement - "\|(arg|eff|serverExec|mp|seealso)= " to "") |
||
(20 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
|game1= | |game1= arma3 | ||
|version1= 2.02 | |||
| | |gr1= Difficulty | ||
| | |descr= Forces <tt>showCadetHints</tt> and <tt>showCadetWP</tt> global Cadet [[Arma 3: Difficulty Settings|{{arma3}} difficulty]], returns previous settings. | ||
| | |s1= [[forceCadetDifficulty]] [showCadetHints, showCadetWP] | ||
| | |p1= showCadetHints: [[Boolean]] - <tt>showCadetHints</tt> difficulty | ||
| | |p2= showCadetWP: [[Boolean]] - <tt>showCadetWP</tt> difficulty | ||
| | |r1= [[Array]] of [[Boolean]]s - [prev_showCadetHints, prev_showCadetWP] | ||
| | |x1= <code>[[private]] _previousSettings = [[forceCadetDifficulty]] [<nowiki/>[[true]], [[false]]];</code> | ||
| | |x2= <code>[[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; | |||
<nowiki>[</nowiki>[[true]], [[true]]] | |||
}; | |||
[[case]] "veteran": | |||
{ | |||
// showCadetHints = 0; | |||
// showCadetWP = 1; | |||
<nowiki>[</nowiki>[[false]], [[true]]] | |||
}; | |||
[[default]] | |||
{ | |||
// showCadetHints = 0; | |||
// showCadetWP = 0; | |||
<nowiki>[</nowiki>[[false]], [[false]]] | |||
}; | |||
}); | |||
}; | |||
}; | |||
<nowiki>[</nowiki>[[true]]] [[call]] _fnc_forceCadetDifficulty; | |||
<nowiki>[</nowiki>[[missionNamespace]], "OnGameOptionsExited", _fnc_forceCadetDifficulty] [[call]] [[BIS_fnc_addScriptedEventHandler]];</code> | |||
| | |seealso= [[difficulty]], [[cadetMode]], [[hintCadet]], [[Arma 3: Scripted Event Handlers|Arma 3 Scripted Event Handlers]] | ||
| | |||
}} | }} | ||
Revision as of 22:02, 21 May 2021
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
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