From 038e4544abbf7ae60eae7d456e7f220415eb7351 Mon Sep 17 00:00:00 2001 From: Chase <29675446+theace0296@users.noreply.github.com> Date: Tue, 26 Oct 2021 21:50:11 -0400 Subject: [PATCH] Advanced Settings get/set rather than pushback --- .../Client/camera/fn_missionOverAnimation.sqf | 2 +- .../camera/fn_postStartMissionCamera.sqf | 2 +- .../Client/init/fn_generalPlayerLoop.sqf | 2 +- RandFramework/Client/init/fn_main.sqf | 12 +- .../Client/init/fn_onlyAllowDirectMapDraw.sqf | 2 +- .../fn_openDialogAdvancedMissionSettings.sqf | 16 ++- .../GUI/fn_openDialogMissionSelection.sqf | 78 +++--------- .../Global/factions/fn_buildEnemyFaction.sqf | 4 +- .../factions/fn_buildFriendlyFaction.sqf | 2 +- .../Global/init/fn_initGlobalVars.sqf | 1 - RandFramework/Missions/defuseIEDsMission.sqf | 8 +- .../Missions/searchAndDestroyMission.sqf | 8 +- RandFramework/Server/init/fn_initUnitVars.sqf | 116 +++++++++++++----- RandFramework/Server/init/fn_main.sqf | 8 +- .../Server/mission/fn_populateSideMission.sqf | 10 +- .../Server/objectives/fn_aoCampCreator.sqf | 2 +- 16 files changed, 128 insertions(+), 145 deletions(-) diff --git a/RandFramework/Client/camera/fn_missionOverAnimation.sqf b/RandFramework/Client/camera/fn_missionOverAnimation.sqf index 20a46ca7..04c4dc51 100644 --- a/RandFramework/Client/camera/fn_missionOverAnimation.sqf +++ b/RandFramework/Client/camera/fn_missionOverAnimation.sqf @@ -39,7 +39,7 @@ while {!_bEnd} do { sleep 8; ["" + localize "STR_TRGM2_Description_Name" + "
" + localize "STR_TRGM2_TRGMInitPlayerLocal_TRGM2Title" + "",-1,0.2,6,1,0,789] spawn BIS_fnc_dynamicText; sleep 10; - ["" + (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_GROUP_NAME_IDX) + "

" + localize "STR_TRGM2_TRGMInitPlayerLocal_RTBDebreif" + "
",-1,0.2,6,1,0,789] spawn BIS_fnc_dynamicText; + ["" + (call TRGM_GETTER_fnc_sGroupName) + "

" + localize "STR_TRGM2_TRGMInitPlayerLocal_RTBDebreif" + "
",-1,0.2,6,1,0,789] spawn BIS_fnc_dynamicText; sleep 10; private _stars = ""; private _iCount = 0; diff --git a/RandFramework/Client/camera/fn_postStartMissionCamera.sqf b/RandFramework/Client/camera/fn_postStartMissionCamera.sqf index 5829fe06..6a982aff 100644 --- a/RandFramework/Client/camera/fn_postStartMissionCamera.sqf +++ b/RandFramework/Client/camera/fn_postStartMissionCamera.sqf @@ -75,7 +75,7 @@ if (hasInterface && {!((player getVariable ["TRGM_postStartMissionCamRunning", " _texta = "" + _LineOne +""; [_texta, -0, 0.150, 7, 1,0,_txt5Layer] spawn BIS_fnc_dynamicText; - _texta = "" + (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_GROUP_NAME_IDX) + ""; + _texta = "" + (call TRGM_GETTER_fnc_sGroupName) + ""; [_texta, -0, 0.350, 7, 1,0,_txt6Layer] spawn BIS_fnc_dynamicText; showcinemaborder true; diff --git a/RandFramework/Client/init/fn_generalPlayerLoop.sqf b/RandFramework/Client/init/fn_generalPlayerLoop.sqf index a0819717..9aa5ee3d 100644 --- a/RandFramework/Client/init/fn_generalPlayerLoop.sqf +++ b/RandFramework/Client/init/fn_generalPlayerLoop.sqf @@ -19,7 +19,7 @@ while {true} do { }; }; }; - if (leader (group (vehicle player)) isEqualTo player && TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_SUPPORT_OPTION_IDX isEqualTo 1) then { + if (leader (group (vehicle player)) isEqualTo player && (call TRGM_GETTER_fnc_bSupportOption)) then { if (TRGM_VAR_iMissionIsCampaign) then { if (TRGM_VAR_CampaignInitiated) then { diff --git a/RandFramework/Client/init/fn_main.sqf b/RandFramework/Client/init/fn_main.sqf index cc4fcca4..eabce27a 100644 --- a/RandFramework/Client/init/fn_main.sqf +++ b/RandFramework/Client/init/fn_main.sqf @@ -117,15 +117,14 @@ if (call TRGM_GLOBAL_fnc_isCbaLoaded && call TRGM_GLOBAL_fnc_isAceLoaded) then { playMusic ""; }; -private _iEnableGroupManagement = TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_GROUP_MANAGE_IDX; -if (_iEnableGroupManagement isEqualTo 1) then { +if (call TRGM_GETTER_fnc_bEnableGroupManagement) then { ["InitializePlayer", [player]] call BIS_fnc_dynamicGroups;//Exec on client }; [] spawn TRGM_CLIENT_fnc_playerScripts; player addEventHandler ["Respawn", { [] spawn TRGM_CLIENT_fnc_playerScripts; }]; -if (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_VIRTUAL_ARSENAL_IDX isEqualTo 1) then { +if (call TRGM_GETTER_fnc_bEnableVirtualArsenal) then { box1 addAction [localize "STR_TRGM2_startInfMission_VirtualArsenal", {["Open",true] spawn BIS_fnc_arsenal}]; }; @@ -153,11 +152,8 @@ if (_isTraining) then { } else { - private _iTicketCount = TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_RESPAWN_TICKET_COUNT_IDX; - [player, _iTicketCount] call BIS_fnc_respawnTickets; - - private _iRespawnTimer = TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_RESPAWN_TIMER_IDX; - setPlayerRespawnTime _iRespawnTimer; + [player, call TRGM_GETTER_fnc_iTicketCount] call BIS_fnc_respawnTickets; + setPlayerRespawnTime (call TRGM_GETTER_fnc_iRespawnTimer); }; diff --git a/RandFramework/Client/init/fn_onlyAllowDirectMapDraw.sqf b/RandFramework/Client/init/fn_onlyAllowDirectMapDraw.sqf index 722bc3b9..eac771b6 100644 --- a/RandFramework/Client/init/fn_onlyAllowDirectMapDraw.sqf +++ b/RandFramework/Client/init/fn_onlyAllowDirectMapDraw.sqf @@ -2,7 +2,7 @@ format[localize "STR_TRGM2_debugFunctionString", _fnc_scriptName, _fnc_scriptNameParent, (["Client", "Server"] select isServer)] call TRGM_GLOBAL_fnc_log; -while {isMultiplayer && (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_MAP_DRAW_DIRECT_ONLY_IDX isEqualTo 1)} do { +while {isMultiplayer && (call TRGM_GETTER_fnc_bMapDrawDirectOnly)} do { waitUntil { ({private _ret = false; private _sTest = _x splitString "/"; if (count _sTest > 2 && {str(_sTest select 2) != str("5")}) then {_ret = true}; ret; } count allMapMarkers) > 0; }; { deleteMarker _x; diff --git a/RandFramework/GUI/fn_openDialogAdvancedMissionSettings.sqf b/RandFramework/GUI/fn_openDialogAdvancedMissionSettings.sqf index 351e7556..ebc9a01f 100644 --- a/RandFramework/GUI/fn_openDialogAdvancedMissionSettings.sqf +++ b/RandFramework/GUI/fn_openDialogAdvancedMissionSettings.sqf @@ -48,7 +48,9 @@ _lblctrlTitle ctrlCommit 0; private _inpXPos = ([0, ((2 * _ctrlWidth) + 0.1)] select (_forEachIndex > 12)) + (0.4 * safezoneW + safezoneX); private _ctrlYPos = ((0.27 + _currentLinePos) * safezoneH + safezoneY); - _x params ["_lblCtrlID", "_lblText", "_lnpCtrlType", "_Options", "_Values", "_DefaultValue", "_toolTip", "_appendText"]; + _x params ["_index", "_lblText", "_lnpCtrlType", "_Options", "_Values", "_DefaultValue", "_toolTip", "_appendText"]; + #define ADVCTRLIDC(IDX) 6001 + (2 * IDX) + private _lblCtrlID = ADVCTRLIDC(_index); private _InpCtrlID = _lblCtrlID + 1; _display ctrlCreate ["RscText", _lblCtrlID]; @@ -65,23 +67,27 @@ _lblctrlTitle ctrlCommit 0; { _inpctrl lbAdd _x; } forEach _Options; - private _savedValue = _Values find (TRGM_VAR_AdvancedSettings select _forEachIndex); + private _savedValue = _Values find (TRGM_VAR_AdvancedSettings select _index); _inpctrl lbSetCurSel ([_savedValue, _DefaultValue] select (isNil "_savedValue")); }; if (_lnpCtrlType isEqualTo "RscEdit") then { - private _savedValue = (TRGM_VAR_AdvancedSettings select _forEachIndex); + private _savedValue = (TRGM_VAR_AdvancedSettings select _index); _inpctrl ctrlSetText ([_savedValue, _DefaultValue] select (isNil "_savedValue")); }; if (_lnpCtrlType isEqualTo "RscXSliderH") then { _inpctrl sliderSetRange [_Options, _Values]; _inpctrl sliderSetSpeed [(_Values / _Options), 1]; - private _savedValue = (TRGM_VAR_AdvancedSettings select _forEachIndex); + private _savedValue = (TRGM_VAR_AdvancedSettings select _index); _inpctrl sliderSetPosition ([_savedValue, _DefaultValue] select (isNil "_savedValue")); _display ctrlCreate ["ctrlEdit", (_InpCtrlID+500)]; private _valctrl = _display displayCtrl (_InpCtrlID+500); _valctrl ctrlSetPosition [_inpXPos+(.75*_ctrlWidth), _ctrlYPos,.25*_ctrlWidth,_ctrlHeight]; - _valctrl ctrlSetText (str(round ([_savedValue, _DefaultValue] select (isNil "_savedValue"))) + "s"); + private _ctrlText = str(round ([_savedValue, _DefaultValue] select (isNil "_savedValue"))); + if !(isNil "_appendText") then { + _ctrlText = format ["%1%2", _ctrlText, _appendText]; + }; + _ctrlVal ctrlSetText _ctrlText; _valctrl ctrlCommit 0; _inpctrl ctrlAddEventHandler ["SliderPosChanged", { diff --git a/RandFramework/GUI/fn_openDialogMissionSelection.sqf b/RandFramework/GUI/fn_openDialogMissionSelection.sqf index 88b678ff..43b12e37 100644 --- a/RandFramework/GUI/fn_openDialogMissionSelection.sqf +++ b/RandFramework/GUI/fn_openDialogMissionSelection.sqf @@ -46,61 +46,13 @@ if (isNil "TRGM_VAR_InitialLoadedPreviousSettings" && !TRGM_VAR_ForceMissionSetu TRGM_VAR_IsFullMap = _IsFullMap; publicVariable "TRGM_VAR_IsFullMap"; }; - if (count TRGM_VAR_AdvancedSettings < 6) then { - TRGM_VAR_AdvancedSettings pushBack 10; - }; - - if (count TRGM_VAR_AdvancedSettings < 7) then { - TRGM_VAR_AdvancedSettings pushBack (TRGM_VAR_DefaultEnemyFactionValue select 0); - }; - - if (TRGM_VAR_AdvancedSettings select 6 isEqualTo 0) then { //we had an issue with some being set to zero (due to a bad published version, this makes sure any zeros are adjusted to correct id) - TRGM_VAR_AdvancedSettings set [6,TRGM_VAR_DefaultEnemyFactionValue select 0]; - }; - - if (count TRGM_VAR_AdvancedSettings < 8) then { - TRGM_VAR_AdvancedSettings pushBack (TRGM_VAR_DefaultMilitiaFactionValue select 0); - }; - - if (count TRGM_VAR_AdvancedSettings < 9) then { - TRGM_VAR_AdvancedSettings pushBack (TRGM_VAR_DefaultFriendlyFactionValue select 0); - }; - - if !(TRGM_VAR_AdvancedSettings select 6 in TRGM_VAR_DefaultEnemyFactionArray) then { - private _bFound = false; - { - if (!_bFound && _x in TRGM_VAR_DefaultEnemyFactionArray) then { - _bFound = true; - TRGM_VAR_AdvancedSettings set [6,_x]; - }; - } forEach TRGM_VAR_DefaultEnemyFactionValue; - }; - - if !(TRGM_VAR_AdvancedSettings select 7 in TRGM_VAR_DefaultMilitiaFactionArray) then { - private _bFound = false; - { - if (!_bFound && _x in TRGM_VAR_DefaultMilitiaFactionArray) then { - _bFound = true; - TRGM_VAR_AdvancedSettings set [7,_x]; - }; - } forEach TRGM_VAR_DefaultMilitiaFactionValue; - }; - - if !(TRGM_VAR_AdvancedSettings select 8 in TRGM_VAR_DefaultFriendlyFactionArray) then { - private _bFound = false; - { - if (!_bFound && _x in TRGM_VAR_DefaultFriendlyFactionArray) then { - _bFound = true; - TRGM_VAR_AdvancedSettings set [8,_x]; - }; - } forEach TRGM_VAR_DefaultFriendlyFactionValue; - }; - - for [{private _i = 9}, {_i < count TRGM_VAR_DefaultAdvancedSettings}, {_i = _i + 1}] do { - if (count TRGM_VAR_AdvancedSettings < (_i + 1)) then { - TRGM_VAR_AdvancedSettings pushBack (TRGM_VAR_DefaultAdvancedSettings select _i); + { + private _index = _x select 0; + private _defaultValue = _x select 5; + if (count TRGM_VAR_AdvancedSettings <= _index) then { + TRGM_VAR_AdvancedSettings set [_index, _defaultValue]; }; - }; + } forEach TRGM_VAR_AdvControls; if (isClass(configFile >> "CfgPatches" >> "ace_medical")) then { if (TRGM_VAR_iUseRevive != 0) then { //Ace is active, so need to make sure "no revive" is selected @@ -113,25 +65,25 @@ if (isNil "TRGM_VAR_InitialLoadedPreviousSettings" && !TRGM_VAR_ForceMissionSetu if (!isNull (findDisplay 6000)) then { TRGM_VAR_AdvancedSettings = []; { - private _CurrentControl = _x; - private _lnpCtrlType = _x select 2; - private _ThisControlOptions = (_x select 4); - private _ThisControlIDX = (_x select 0) + 1; - private _ctrlItem = (findDisplay 6000) displayCtrl _ThisControlIDX; + _x params ["_index", "_lblText", "_lnpCtrlType", "_Options", "_Values", "_DefaultValue", "_toolTip", "_appendText"]; + #define ADVCTRLIDC(IDX) 6001 + (2 * IDX) + private _lblCtrlID = ADVCTRLIDC(_index); + private _InpCtrlID = _lblCtrlID + 1; + private _ctrlItem = (findDisplay 6000) displayCtrl _InpCtrlID; TRGM_VAR_debugMessages = TRGM_VAR_debugMessages + "\n\n" + str(lbCurSel _ctrlItem); publicVariable "TRGM_VAR_debugMessages"; private _value = nil; if (_lnpCtrlType isEqualTo "RscCombo") then { TRGM_VAR_debugMessages = TRGM_VAR_debugMessages + "\n\nHERE80:" + str(lbCurSel _ctrlItem); - _value = _ThisControlOptions select ([lbCurSel _ctrlItem, 0] select (lbCurSel _ctrlItem isEqualTo -1)); + _value = _Options select ([lbCurSel _ctrlItem, 0] select (lbCurSel _ctrlItem isEqualTo -1)); }; if (_lnpCtrlType isEqualTo "RscEdit") then { - _value = ctrlText _ThisControlIDX; + _value = ctrlText _InpCtrlID; }; if (_lnpCtrlType isEqualTo "RscXSliderH") then { - _value = sliderPosition _ThisControlIDX; + _value = sliderPosition _InpCtrlID; }; - TRGM_VAR_AdvancedSettings pushBack _value; + TRGM_VAR_AdvancedSettings set [_index, _value]; } forEach TRGM_VAR_AdvControls; publicVariable "TRGM_VAR_AdvancedSettings"; }; diff --git a/RandFramework/Global/factions/fn_buildEnemyFaction.sqf b/RandFramework/Global/factions/fn_buildEnemyFaction.sqf index d3a8e2bd..80ce02ca 100644 --- a/RandFramework/Global/factions/fn_buildEnemyFaction.sqf +++ b/RandFramework/Global/factions/fn_buildEnemyFaction.sqf @@ -3,7 +3,7 @@ format[localize "STR_TRGM2_debugFunctionString", _fnc_scriptName, _fnc_scriptNam -private _enemyFactionIndex = TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_ENEMY_FACTIONS_IDX; +private _enemyFactionIndex = call TRGM_GETTER_fnc_enemyFactionIndex; (TRGM_VAR_AvailableFactions select _enemyFactionIndex) params ["_eastClassName", "_eastDisplayName"]; private _eastData = TRGM_VAR_AllFactionMap get _eastClassName; @@ -68,7 +68,7 @@ EnemyBaseChoppers = { _veh = ["O_Heli_Light_02_unarmed_F"]; if (count -private _guerFactionIndex = TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_MILITIA_FACTIONS_IDX; +private _guerFactionIndex = call TRGM_GETTER_fnc_militiaFactionIndex; (TRGM_VAR_AvailableFactions select _guerFactionIndex) params ["_guerClassName", "_guerDisplayName"]; private _guerData = TRGM_VAR_AllFactionMap get _guerClassName; diff --git a/RandFramework/Global/factions/fn_buildFriendlyFaction.sqf b/RandFramework/Global/factions/fn_buildFriendlyFaction.sqf index 90f193cd..5b192139 100644 --- a/RandFramework/Global/factions/fn_buildFriendlyFaction.sqf +++ b/RandFramework/Global/factions/fn_buildFriendlyFaction.sqf @@ -3,7 +3,7 @@ format[localize "STR_TRGM2_debugFunctionString", _fnc_scriptName, _fnc_scriptNam -private _friendlyFactionIndex = TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_FRIENDLY_FACTIONS_IDX; +private _friendlyFactionIndex = call TRGM_GETTER_fnc_friendlyFactionIndex; (TRGM_VAR_AvailableFactions select _friendlyFactionIndex) params ["_westClassName", "_westDisplayName"]; private _westData = TRGM_VAR_AllFactionMap get _westClassName; diff --git a/RandFramework/Global/init/fn_initGlobalVars.sqf b/RandFramework/Global/init/fn_initGlobalVars.sqf index e19844ed..25d272d0 100644 --- a/RandFramework/Global/init/fn_initGlobalVars.sqf +++ b/RandFramework/Global/init/fn_initGlobalVars.sqf @@ -228,7 +228,6 @@ if (isNil "TRGM_VAR_AODetails") then {TRGM_VAR_AOD if (isNil "TRGM_VAR_ATFieldPos") then {TRGM_VAR_ATFieldPos = []; publicVariable "TRGM_VAR_ATFieldPos";}; if (isNil "TRGM_VAR_ActiveTasks") then {TRGM_VAR_ActiveTasks = []; publicVariable "TRGM_VAR_ActiveTasks";}; if (isNil "TRGM_VAR_AdminPlayer") then {TRGM_VAR_AdminPlayer = objNull; publicVariable "TRGM_VAR_AdminPlayer";}; -if (isNil "TRGM_VAR_AdvancedSettings") then {TRGM_VAR_AdvancedSettings = TRGM_VAR_DefaultAdvancedSettings; publicVariable "TRGM_VAR_AdvancedSettings";}; if (isNil "TRGM_VAR_AllowAOFires") then {TRGM_VAR_AllowAOFires = true; publicVariable "TRGM_VAR_AllowAOFires";}; if (isNil "TRGM_VAR_AllowUAVLocateHelp") then {TRGM_VAR_AllowUAVLocateHelp = false; publicVariable "TRGM_VAR_AllowUAVLocateHelp";}; if (isNil "TRGM_VAR_BadPoints") then {TRGM_VAR_BadPoints = 0; publicVariable "TRGM_VAR_BadPoints";}; diff --git a/RandFramework/Missions/defuseIEDsMission.sqf b/RandFramework/Missions/defuseIEDsMission.sqf index 6bccbce9..945d812e 100644 --- a/RandFramework/Missions/defuseIEDsMission.sqf +++ b/RandFramework/Missions/defuseIEDsMission.sqf @@ -39,13 +39,7 @@ MISSION_fnc_CustomMission = { //This function is the main script for your missio params ["_markerType","_objectiveMainBuilding","_centralAO_x","_centralAO_y","_roadSearchRange", "_bCreateTask", "_iTaskIndex", "_bIsMainObjective", ["_args", []]]; if (_markerType != "empty") then { _markerType = "hd_unknown"; }; // Set marker type here... - _compactIedTargets = false; - if (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_IEDTARGET_COMPACT_SPACING_IDX isEqualTo 1) then { - _compactIedTargets = true; - }; - if (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_IEDTARGET_COMPACT_SPACING_IDX isEqualTo 0) then { - _compactIedTargets = random 1 < .50; - }; + _compactIedTargets = call TRGM_GETTER_fnc_bCompactTargetMissions; _spacingBetweenTargets = 1500; if (_compactIedTargets) then {_spacingBetweenTargets = 150}; diff --git a/RandFramework/Missions/searchAndDestroyMission.sqf b/RandFramework/Missions/searchAndDestroyMission.sqf index 6ba9778a..0e164963 100644 --- a/RandFramework/Missions/searchAndDestroyMission.sqf +++ b/RandFramework/Missions/searchAndDestroyMission.sqf @@ -39,13 +39,7 @@ MISSION_fnc_CustomMission = { //This function is the main script for your missio params ["_markerType","_objectiveMainBuilding","_centralAO_x","_centralAO_y","_roadSearchRange", "_bCreateTask", "_iTaskIndex", "_bIsMainObjective", ["_args", []]]; if (_markerType != "empty") then { _markerType = "hd_unknown"; }; // Set marker type here... - _compactIedTargets = false; - if (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_IEDTARGET_COMPACT_SPACING_IDX isEqualTo 1) then { - _compactIedTargets = true; - }; - if (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_IEDTARGET_COMPACT_SPACING_IDX isEqualTo 0) then { - _compactIedTargets = random 1 < .50; - }; + _compactIedTargets = call TRGM_GETTER_fnc_bCompactTargetMissions; _spacingBetweenTargets = 1500; if (_compactIedTargets) then {_spacingBetweenTargets = 150}; diff --git a/RandFramework/Server/init/fn_initUnitVars.sqf b/RandFramework/Server/init/fn_initUnitVars.sqf index 621c3adf..fa59235c 100644 --- a/RandFramework/Server/init/fn_initUnitVars.sqf +++ b/RandFramework/Server/init/fn_initUnitVars.sqf @@ -4,9 +4,9 @@ format[localize "STR_TRGM2_debugFunctionString", _fnc_scriptName, _fnc_scriptNam //hardcoded for now... see notes in root setunitglobalvars.sqf (main git/malden version of this sqf!) -TRGM_VAR_DefaultEnemyFactionValue = [2]; publicVariable "TRGM_VAR_DefaultEnemyFactionValue"; //default to FIA -TRGM_VAR_DefaultMilitiaFactionValue = [1]; publicVariable "TRGM_VAR_DefaultMilitiaFactionValue"; //default to AAF -TRGM_VAR_DefaultFriendlyFactionValue = [1]; publicVariable "TRGM_VAR_DefaultFriendlyFactionValue"; //default to NATO +TRGM_VAR_DefaultEnemyFactionValue = 2; publicVariable "TRGM_VAR_DefaultEnemyFactionValue"; //default to FIA +TRGM_VAR_DefaultMilitiaFactionValue = 1; publicVariable "TRGM_VAR_DefaultMilitiaFactionValue"; //default to AAF +TRGM_VAR_DefaultFriendlyFactionValue = 1; publicVariable "TRGM_VAR_DefaultFriendlyFactionValue"; //default to NATO /////// Set up faction arrays /////// // TRGM_VAR_AvailableFactions --- Initialized in initGlobalVars @@ -23,7 +23,7 @@ for "_i" from 0 to (count TRGM_VAR_AvailableFactions - 1) do { TRGM_VAR_DefaultFriendlyFactionArrayText pushBack _displayName; TRGM_VAR_DefaultFriendlyFactionArray pushBack _i; if (_className isEqualTo "BLU_F") then { - TRGM_VAR_DefaultFriendlyFactionValue = [_i]; publicVariable "TRGM_VAR_DefaultFriendlyFactionValue"; + TRGM_VAR_DefaultFriendlyFactionValue = _i; publicVariable "TRGM_VAR_DefaultFriendlyFactionValue"; }; }; @@ -32,7 +32,7 @@ for "_i" from 0 to (count TRGM_VAR_AvailableFactions - 1) do { TRGM_VAR_DefaultEnemyFactionArrayText pushBack _displayName; TRGM_VAR_DefaultEnemyFactionArray pushBack _i; if (_className isEqualTo "OPF_F") then { - TRGM_VAR_DefaultEnemyFactionValue = [_i]; publicVariable "TRGM_VAR_DefaultEnemyFactionValue"; + TRGM_VAR_DefaultEnemyFactionValue = _i; publicVariable "TRGM_VAR_DefaultEnemyFactionValue"; }; }; @@ -41,7 +41,7 @@ for "_i" from 0 to (count TRGM_VAR_AvailableFactions - 1) do { TRGM_VAR_DefaultMilitiaFactionArrayText pushBack _displayName; TRGM_VAR_DefaultMilitiaFactionArray pushBack _i; if (_className isEqualTo "IND_G_F") then { - TRGM_VAR_DefaultMilitiaFactionValue = [_i]; publicVariable "TRGM_VAR_DefaultMilitiaFactionValue"; + TRGM_VAR_DefaultMilitiaFactionValue = _i; publicVariable "TRGM_VAR_DefaultMilitiaFactionValue"; }; }; @@ -80,42 +80,94 @@ TRGM_VAR_ADVSET_ALLOW_AO_FIRES_IDX = 23; publicVariable "TRGM_VAR_ /////// Advanced Settings Set up /////// //NOTE the id's must go up in twos! -#define ADVCTRLIDC(IDX) 6001 + (2 * IDX) TRGM_VAR_AdvControls = [ //IDX,Title,Type,Options,OptionValues,DefaultOptionIndex(zero based index) - [ADVCTRLIDC(TRGM_VAR_ADVSET_VIRTUAL_ARSENAL_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_VirtualArsenal","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[1,0],1,localize "STR_TRGM2_Tooltip_AdvVirtualArsenal"], - [ADVCTRLIDC(TRGM_VAR_ADVSET_GROUP_NAME_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_GroupName","RscEdit",[""],"","",localize "STR_TRGM2_Tooltip_AdvGroupName"], - [ADVCTRLIDC(TRGM_VAR_ADVSET_SUPPORT_OPTION_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_SupportOptions","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[1,0],0,""], - [ADVCTRLIDC(TRGM_VAR_ADVSET_RESPAWN_TICKET_COUNT_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_RespawnTickets","RscCombo",["1","2","3","4","5","6","7","8","9","10",localize "STR_TRGM2_TRGMSetUnitGlobalVars_Unlimited"],[1,2,3,4,5,6,7,8,9,10,99999],0,""], - [ADVCTRLIDC(TRGM_VAR_ADVSET_MAP_DRAW_DIRECT_ONLY_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_Mapdraw","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[1,0],0,localize "STR_TRGM2_Tooltip_AdvMapDraw"], - [ADVCTRLIDC(TRGM_VAR_ADVSET_RESPAWN_TIMER_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_RespawnTimer","RscCombo",["5 " + localize "STR_TRGM2_TRGMSetUnitGlobalVars_Sec","10 " + localize "STR_TRGM2_TRGMSetUnitGlobalVars_Sec","30 " + localize "STR_TRGM2_TRGMSetUnitGlobalVars_Sec","1 " + localize "STR_TRGM2_TRGMSetUnitGlobalVars_Min","5 " + localize "STR_TRGM2_TRGMSetUnitGlobalVars_Min","10 " + localize "STR_TRGM2_TRGMSetUnitGlobalVars_Min","20 " + localize "STR_TRGM2_TRGMSetUnitGlobalVars_Min"],[5,10,30,60,300,600,1200],1,""], - [ADVCTRLIDC(TRGM_VAR_ADVSET_ENEMY_FACTIONS_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_EnemyFactions","RscCombo",TRGM_VAR_DefaultEnemyFactionArrayText,TRGM_VAR_DefaultEnemyFactionArray,TRGM_VAR_DefaultEnemyFactionValue select 0,""], - [ADVCTRLIDC(TRGM_VAR_ADVSET_MILITIA_FACTIONS_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_MilitiaFactions","RscCombo",TRGM_VAR_DefaultMilitiaFactionArrayText,TRGM_VAR_DefaultMilitiaFactionArray,TRGM_VAR_DefaultMilitiaFactionValue select 0,""], - [ADVCTRLIDC(TRGM_VAR_ADVSET_FRIENDLY_FACTIONS_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_FriendlyFactions","RscCombo",TRGM_VAR_DefaultFriendlyFactionArrayText,TRGM_VAR_DefaultFriendlyFactionArray,TRGM_VAR_DefaultFriendlyFactionValue select 0,""], - [ADVCTRLIDC(TRGM_VAR_ADVSET_SANDSTORM_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_SandStorm","RscCombo",[localize "STR_TRGM2_TRGMSetUnitGlobalVars_Random",localize "STR_TRGM2_TRGMSetUnitGlobalVars_SandStorm_Always",localize "STR_TRGM2_TRGMSetUnitGlobalVars_Never",localize "STR_TRGM2_TRGMSetUnitGlobalVars_SandStorm_5Hours"],[0,1,2,3],2,""], - [ADVCTRLIDC(TRGM_VAR_ADVSET_GROUP_MANAGE_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_GroupManagement","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[1,0],1,localize "STR_TRGM2_Tooltip_AdvGroupManagement"], - [ADVCTRLIDC(TRGM_VAR_ADVSET_SELECT_AO_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_MainAOSelect","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[1,0],1,localize "STR_TRGM2_Tooltip_AdvAoSelect"], - [ADVCTRLIDC(TRGM_VAR_ADVSET_SELECT_AO_CAMP_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_MainAO_CAMP_Select","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[1,0],1,localize "STR_TRGM2_Tooltip_AdvCampStart"], - [ADVCTRLIDC(TRGM_VAR_ADVSET_SELECT_ENEMY_FLASHLIGHTS_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_EnemyFlashLights","RscCombo",[localize "STR_TRGM2_TRGMSetUnitGlobalVars_Random",localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[0,1,2],0,""], - [ADVCTRLIDC(TRGM_VAR_ADVSET_MINIMISSIONS_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_MiniMissions","RscCombo",[localize "STR_TRGM2_TRGMSetUnitGlobalVars_Random",localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[0,1,2],2,localize "STR_TRGM2_Tooltip_AdvMinimission"], - [ADVCTRLIDC(TRGM_VAR_ADVSET_IEDTARGET_COMPACT_SPACING_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_IedTargetCompact","RscCombo",[localize "STR_TRGM2_TRGMSetUnitGlobalVars_Random",localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[0,1,2],2,localize "STR_TRGM2_Tooltip_AdvIedTargetCompact"], - [ADVCTRLIDC(TRGM_VAR_ADVSET_HIGHER_ENEMY_COUNT_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_MoreEnemies","RscXSliderH",1,100,50,localize "STR_TRGM2_Tooltip_AdvMoreEnemies"], - [ADVCTRLIDC(TRGM_VAR_ADVSET_LARGE_PATROLS_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_LargePatrols","RscCombo",[localize "STR_TRGM2_TRGMSetUnitGlobalVars_Random",localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[0,1,2],1,localize "STR_TRGM2_Tooltip_AdvLargePatrols"], - [ADVCTRLIDC(TRGM_VAR_ADVSET_TIME_BETWEEN_SPOTTED_ACTIONS_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_TimeBetweenSpotted","RscXSliderH",600,1800,1200,localize "STR_TRGM2_Tooltip_TimeBetweenSpotted", localize "STR_TRGM2_SecondsAbbreviation"], - [ADVCTRLIDC(TRGM_VAR_ADVSET_VEHICLE_SPAWNING_REQ_REP_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_VehicleReqRep","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Disable", localize "STR_TRGM2_TRGMInitPlayerLocal_Enable"],[0,1],0,localize "STR_TRGM2_Tooltip_AdvVehicleReqRep"], - [ADVCTRLIDC(TRGM_VAR_ADVSET_VEHICLE_SPAWNING_REQ_LEADER_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_VehicleLeaderOnly","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Disable", localize "STR_TRGM2_TRGMInitPlayerLocal_Enable"],[0,1],0,localize "STR_TRGM2_Tooltip_VehicleLeaderOnly"], - [ADVCTRLIDC(TRGM_VAR_ADVSET_ENABLE_TRANSPORT_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_EnableTransport","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Disable", localize "STR_TRGM2_TRGMInitPlayerLocal_Enable", localize "STR_TRGM2_TRGMInitPlayerLocal_EnableLeaderOnly"],[0,1,2],1,localize "STR_TRGM2_Tooltip_EnableTransport"], - [ADVCTRLIDC(TRGM_VAR_ADVSET_ENABLE_CHECKPOINT_RESPAWN_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_EnableCheckpointRespawn","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Disable", localize "STR_TRGM2_TRGMInitPlayerLocal_Enable", localize "STR_TRGM2_Option_EnableAfterVisit"],[0,1,2],1,localize "STR_TRGM2_Tooltip_EnableCheckpointRespawn"], - [ADVCTRLIDC(TRGM_VAR_ADVSET_ALLOW_AO_FIRES_IDX), localize "STR_TRGM2_TRGMSetUnitGlobalVars_AOFires","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Disable", localize "STR_TRGM2_TRGMInitPlayerLocal_Enable"],[0,1],1,localize "STR_TRGM2_Tooltip_AOFires"] + [TRGM_VAR_ADVSET_VIRTUAL_ARSENAL_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_VirtualArsenal","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[1,0],1,localize "STR_TRGM2_Tooltip_AdvVirtualArsenal"], + [TRGM_VAR_ADVSET_GROUP_NAME_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_GroupName","RscEdit",[""],"","",localize "STR_TRGM2_Tooltip_AdvGroupName"], + [TRGM_VAR_ADVSET_SUPPORT_OPTION_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_SupportOptions","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[1,0],0,""], + [TRGM_VAR_ADVSET_RESPAWN_TICKET_COUNT_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_RespawnTickets","RscCombo",["1","2","3","4","5","6","7","8","9","10",localize "STR_TRGM2_TRGMSetUnitGlobalVars_Unlimited"],[1,2,3,4,5,6,7,8,9,10,99999],0,""], + [TRGM_VAR_ADVSET_MAP_DRAW_DIRECT_ONLY_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_Mapdraw","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[1,0],0,localize "STR_TRGM2_Tooltip_AdvMapDraw"], + [TRGM_VAR_ADVSET_RESPAWN_TIMER_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_RespawnTimer","RscCombo",["5 " + localize "STR_TRGM2_TRGMSetUnitGlobalVars_Sec","10 " + localize "STR_TRGM2_TRGMSetUnitGlobalVars_Sec","30 " + localize "STR_TRGM2_TRGMSetUnitGlobalVars_Sec","1 " + localize "STR_TRGM2_TRGMSetUnitGlobalVars_Min","5 " + localize "STR_TRGM2_TRGMSetUnitGlobalVars_Min","10 " + localize "STR_TRGM2_TRGMSetUnitGlobalVars_Min","20 " + localize "STR_TRGM2_TRGMSetUnitGlobalVars_Min"],[5,10,30,60,300,600,1200],1,""], + [TRGM_VAR_ADVSET_ENEMY_FACTIONS_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_EnemyFactions","RscCombo",TRGM_VAR_DefaultEnemyFactionArrayText,TRGM_VAR_DefaultEnemyFactionArray,TRGM_VAR_DefaultEnemyFactionValue,""], + [TRGM_VAR_ADVSET_MILITIA_FACTIONS_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_MilitiaFactions","RscCombo",TRGM_VAR_DefaultMilitiaFactionArrayText,TRGM_VAR_DefaultMilitiaFactionArray,TRGM_VAR_DefaultMilitiaFactionValue,""], + [TRGM_VAR_ADVSET_FRIENDLY_FACTIONS_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_FriendlyFactions","RscCombo",TRGM_VAR_DefaultFriendlyFactionArrayText,TRGM_VAR_DefaultFriendlyFactionArray,TRGM_VAR_DefaultFriendlyFactionValue,""], + [TRGM_VAR_ADVSET_SANDSTORM_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_SandStorm","RscCombo",[localize "STR_TRGM2_TRGMSetUnitGlobalVars_Random",localize "STR_TRGM2_TRGMSetUnitGlobalVars_SandStorm_Always",localize "STR_TRGM2_TRGMSetUnitGlobalVars_Never",localize "STR_TRGM2_TRGMSetUnitGlobalVars_SandStorm_5Hours"],[0,1,2,3],2,""], + [TRGM_VAR_ADVSET_GROUP_MANAGE_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_GroupManagement","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[1,0],1,localize "STR_TRGM2_Tooltip_AdvGroupManagement"], + [TRGM_VAR_ADVSET_SELECT_AO_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_MainAOSelect","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[1,0],1,localize "STR_TRGM2_Tooltip_AdvAoSelect"], + [TRGM_VAR_ADVSET_SELECT_AO_CAMP_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_MainAO_CAMP_Select","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[1,0],1,localize "STR_TRGM2_Tooltip_AdvCampStart"], + [TRGM_VAR_ADVSET_SELECT_ENEMY_FLASHLIGHTS_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_EnemyFlashLights","RscCombo",[localize "STR_TRGM2_TRGMSetUnitGlobalVars_Random",localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[0,1,2],0,""], + [TRGM_VAR_ADVSET_MINIMISSIONS_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_MiniMissions","RscCombo",[localize "STR_TRGM2_TRGMSetUnitGlobalVars_Random",localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[0,1,2],2,localize "STR_TRGM2_Tooltip_AdvMinimission"], + [TRGM_VAR_ADVSET_IEDTARGET_COMPACT_SPACING_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_IedTargetCompact","RscCombo",[localize "STR_TRGM2_TRGMSetUnitGlobalVars_Random",localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[0,1,2],2,localize "STR_TRGM2_Tooltip_AdvIedTargetCompact"], + [TRGM_VAR_ADVSET_HIGHER_ENEMY_COUNT_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_MoreEnemies","RscXSliderH",1,100,50,localize "STR_TRGM2_Tooltip_AdvMoreEnemies"], + [TRGM_VAR_ADVSET_LARGE_PATROLS_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_LargePatrols","RscCombo",[localize "STR_TRGM2_TRGMSetUnitGlobalVars_Random",localize "STR_TRGM2_TRGMInitPlayerLocal_Enable",localize "STR_TRGM2_TRGMInitPlayerLocal_Disable"],[0,1,2],1,localize "STR_TRGM2_Tooltip_AdvLargePatrols"], + [TRGM_VAR_ADVSET_TIME_BETWEEN_SPOTTED_ACTIONS_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_TimeBetweenSpotted","RscXSliderH",600,1800,1200,localize "STR_TRGM2_Tooltip_TimeBetweenSpotted", localize "STR_TRGM2_SecondsAbbreviation"], + [TRGM_VAR_ADVSET_VEHICLE_SPAWNING_REQ_REP_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_VehicleReqRep","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Disable", localize "STR_TRGM2_TRGMInitPlayerLocal_Enable"],[0,1],0,localize "STR_TRGM2_Tooltip_AdvVehicleReqRep"], + [TRGM_VAR_ADVSET_VEHICLE_SPAWNING_REQ_LEADER_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_VehicleLeaderOnly","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Disable", localize "STR_TRGM2_TRGMInitPlayerLocal_Enable"],[0,1],0,localize "STR_TRGM2_Tooltip_VehicleLeaderOnly"], + [TRGM_VAR_ADVSET_ENABLE_TRANSPORT_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_EnableTransport","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Disable", localize "STR_TRGM2_TRGMInitPlayerLocal_Enable", localize "STR_TRGM2_TRGMInitPlayerLocal_EnableLeaderOnly"],[0,1,2],1,localize "STR_TRGM2_Tooltip_EnableTransport"], + [TRGM_VAR_ADVSET_ENABLE_CHECKPOINT_RESPAWN_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_EnableCheckpointRespawn","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Disable", localize "STR_TRGM2_TRGMInitPlayerLocal_Enable", localize "STR_TRGM2_Option_EnableAfterVisit"],[0,1,2],1,localize "STR_TRGM2_Tooltip_EnableCheckpointRespawn"], + [TRGM_VAR_ADVSET_ALLOW_AO_FIRES_IDX, localize "STR_TRGM2_TRGMSetUnitGlobalVars_AOFires","RscCombo",[localize "STR_TRGM2_TRGMInitPlayerLocal_Disable", localize "STR_TRGM2_TRGMInitPlayerLocal_Enable"],[0,1],1,localize "STR_TRGM2_Tooltip_AOFires"] ]; publicVariable "TRGM_VAR_AdvControls"; TRGM_VAR_DefaultAdvancedSettings = []; +TRGM_VAR_AdvancedSettings = []; { + private _index = _x select 0; private _defaultValue = _x select 5; - TRGM_VAR_DefaultAdvancedSettings pushBack _defaultValue; + TRGM_VAR_DefaultAdvancedSettings set [_index, _defaultValue]; + TRGM_VAR_AdvancedSettings set [_index, _defaultValue]; } forEach TRGM_VAR_AdvControls; publicVariable "TRGM_VAR_DefaultAdvancedSettings"; +publicVariable "TRGM_VAR_AdvancedSettings"; +/////// Group Name /////// +TRGM_GETTER_fnc_sGroupName = { TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_GROUP_NAME_IDX; }; +publicVariable "TRGM_GETTER_fnc_sGroupName"; + +/////// Support Option /////// +TRGM_GETTER_fnc_bSupportOption = { (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_SUPPORT_OPTION_IDX) isEqualTo 1; }; +publicVariable "TRGM_GETTER_fnc_bSupportOption"; + +/////// Group Management /////// +TRGM_GETTER_fnc_bEnableGroupManagement = { (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_GROUP_MANAGE_IDX) isEqualTo 1; }; +publicVariable "TRGM_GETTER_fnc_bEnableGroupManagement"; + +/////// Virtual Arsenal /////// +TRGM_GETTER_fnc_bEnableVirtualArsenal = { (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_VIRTUAL_ARSENAL_IDX) isEqualTo 1; }; +publicVariable "TRGM_GETTER_fnc_bEnableVirtualArsenal"; + +/////// Ticket Count /////// +TRGM_GETTER_fnc_iTicketCount = { TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_RESPAWN_TICKET_COUNT_IDX; }; +publicVariable "TRGM_GETTER_fnc_iTicketCount"; + +/////// Respawn Timer /////// +TRGM_GETTER_fnc_iRespawnTimer = { TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_RESPAWN_TIMER_IDX; }; +publicVariable "TRGM_GETTER_fnc_iRespawnTimer"; + +////// Map Draw Direct Only /////// +TRGM_GETTER_fnc_bMapDrawDirectOnly = { (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_MAP_DRAW_DIRECT_ONLY_IDX) isEqualTo 1; }; +publicVariable "TRGM_GETTER_fnc_bMapDrawDirectOnly"; + +/////// Faction Indicies /////// +TRGM_GETTER_fnc_enemyFactionIndex = { TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_ENEMY_FACTIONS_IDX; }; +publicVariable "TRGM_GETTER_fnc_enemyFactionIndex"; + +TRGM_GETTER_fnc_militiaFactionIndex = { TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_MILITIA_FACTIONS_IDX; }; +publicVariable "TRGM_GETTER_fnc_militiaFactionIndex"; + +TRGM_GETTER_fnc_friendlyFactionIndex = { TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_FRIENDLY_FACTIONS_IDX; }; +publicVariable "TRGM_GETTER_fnc_friendlyFactionIndex"; + +/////// Compact Target Missions /////// +TRGM_GETTER_fnc_bCompactTargetMissions = { [random 1 < .50, true, false] select (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_IEDTARGET_COMPACT_SPACING_IDX); }; +publicVariable "TRGM_GETTER_fnc_bCompactTargetMissions"; + +/////// Mini Missions /////// +TRGM_GETTER_fnc_bMiniMissions = { [random 1 < .50, true, false] select (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_MINIMISSIONS_IDX); }; +publicVariable "TRGM_GETTER_fnc_bMiniMissions"; + +/////// Enemy Flashlight Option /////// +TRGM_GETTER_fnc_bEnemyFlashlight = { [random 1 < .50, true, false] select (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_SELECT_ENEMY_FLASHLIGHTS_IDX); }; +publicVariable "TRGM_GETTER_fnc_bEnemyFlashlight"; /////// Sandstorm settings /////// if (isNil "TRGM_VAR_DefaultSandStormOption") then { TRGM_VAR_DefaultSandStormOption = 2; publicVariable "TRGM_VAR_DefaultSandStormOption"; }; diff --git a/RandFramework/Server/init/fn_main.sqf b/RandFramework/Server/init/fn_main.sqf index c81c6258..92413492 100644 --- a/RandFramework/Server/init/fn_main.sqf +++ b/RandFramework/Server/init/fn_main.sqf @@ -103,7 +103,7 @@ TRGM_VAR_PopulateLoadingWait_percentage = 0; publicVariable "TRGM_VAR_PopulateLo [format["Mission Core: %1", "Init"], true] call TRGM_GLOBAL_fnc_log; [5] spawn TRGM_GLOBAL_fnc_populateLoadingWait; -if (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_GROUP_MANAGE_IDX isEqualTo 1) then { +if (call TRGM_GETTER_fnc_bEnableGroupManagement) then { ["Initialize"] call BIS_fnc_dynamicGroups;//Exec on Server }; @@ -223,7 +223,7 @@ TRGM_VAR_transportHelosToGetActions = [chopper1]; try { if (_bReplaceFriendlyVehicles && {isClass(configFile >> "CfgVehicles" >> typeOf _x) && {_x isKindOf "LandVehicle" || _x isKindOf "Air" || _x isKindOf "Ship"}}) then { private _faction = getText(configFile >> "CfgVehicles" >> typeOf _x >> "faction"); - private _friendlyFactionIndex = TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_FRIENDLY_FACTIONS_IDX; + private _friendlyFactionIndex = call TRGM_GETTER_fnc_friendlyFactionIndex; private _westFaction = (TRGM_VAR_AvailableFactions select _friendlyFactionIndex) select 0; if (getNumber(configFile >> "CfgFactionClasses" >> _faction >> "side") isEqualTo 1 && {_faction != _westFaction}) then { private _newVehClass = [_x, TRGM_VAR_FriendlySide] call TRGM_GLOBAL_fnc_getFactionVehicle; @@ -428,9 +428,7 @@ if (TRGM_VAR_iMissionIsCampaign) then { [format["Mission Core: %1", "RunFlashLightState"], true] call TRGM_GLOBAL_fnc_log; -private _iEnemyFlashLightOption = TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_SELECT_ENEMY_FLASHLIGHTS_IDX; -if (_iEnemyFlashLightOption isEqualTo 0) then {_iEnemyFlashLightOption = selectRandom [1,2]}; //1=yes, 2=no -if (_iEnemyFlashLightOption isEqualTo 1) then { +if (call TRGM_GETTER_fnc_bEnemyFlashlight) then { { if ((side _x) isEqualTo TRGM_VAR_EnemySide) then { diff --git a/RandFramework/Server/mission/fn_populateSideMission.sqf b/RandFramework/Server/mission/fn_populateSideMission.sqf index e55e9614..7a0de64c 100644 --- a/RandFramework/Server/mission/fn_populateSideMission.sqf +++ b/RandFramework/Server/mission/fn_populateSideMission.sqf @@ -140,15 +140,7 @@ TRGM_VAR_debugMessages = TRGM_VAR_debugMessages + format["\n\ntrendFunctions.sqf if (!_bFriendlyInsurgents) then { if (!_bThisMissionCivsOnly) then { - private _minimission = false; - if (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_MINIMISSIONS_IDX isEqualTo 1) then { - _minimission = true; - }; - if (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_MINIMISSIONS_IDX isEqualTo 0) then { - _minimission = random 1 < .50; - }; - - + private _minimission = call TRGM_GETTER_fnc_bMiniMissions; TRGM_VAR_debugMessages = TRGM_VAR_debugMessages + format["\n\ntrendFunctions.sqf : inside populate enemy - _bFriendlyInsurgents: %1 - _bThisMissionCivsOnly: %2 ",str(_bFriendlyInsurgents),str(_bThisMissionCivsOnly)]; //Spawn patrol //if main need a couple of these and always have 2 or 3 diff --git a/RandFramework/Server/objectives/fn_aoCampCreator.sqf b/RandFramework/Server/objectives/fn_aoCampCreator.sqf index 27707a75..ca885e4b 100644 --- a/RandFramework/Server/objectives/fn_aoCampCreator.sqf +++ b/RandFramework/Server/objectives/fn_aoCampCreator.sqf @@ -122,7 +122,7 @@ if (isServer) then { ["Mission Setup: 4", true] call TRGM_GLOBAL_fnc_log; sleep 1; - if (TRGM_VAR_AdvancedSettings select TRGM_VAR_ADVSET_VIRTUAL_ARSENAL_IDX isEqualTo 1) then { + if (call TRGM_GETTER_fnc_bEnableVirtualArsenal) then { [_AmmoBox1, [localize "STR_TRGM2_startInfMission_VirtualArsenal",{["Open",true] spawn BIS_fnc_arsenal}]] remoteExec ["addAction", 0]; };