diff --git a/.vscode/settings.json b/.vscode/settings.json
index bf6e0308d..43357e01a 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -11,7 +11,9 @@
"KPLIB_eden_boxspawn",
"KPLIB_eden_startbase",
"KPLIB_eden_potatospawn",
+ "KPLIB_param_arsenalType",
"KPLIB_param_clearVehicleCargo",
+ "KPLIB_param_copyDistance",
"KPLIB_param_debug",
"KPLIB_param_fobRange",
"KPLIB_param_mobileRespawn",
@@ -33,8 +35,7 @@
"KPLIB_param_sectorCap",
"KPLIB_param_sectorCapRange",
"KPLIB_param_stamina",
- "KPLIB_param_arsenalType",
- "KPLIB_param_copyDistance",
+ "KPLIB_param_timeMulti",
"KPLIB_plm_groups",
"KPR_fnc_getPlaytime",
"KPR_fnc_getRankName",
@@ -44,6 +45,10 @@
"KPR_players",
"KPR_uniforms"
],
+ "sqflint.exclude": [
+ "Missionframework/modules/02_core/scripts/server/eventLoop.sqf",
+ "Missionframework/modules/02_core/scripts/server/sectorMonitor.sqf"
+ ],
"psi-header.lang-config": [
{
"license": "Custom",
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 04537372a..ac5563689 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,7 +17,8 @@
* Tweaked: Mission name now fits the [name standard](https://forums.bohemia.net/forums/topic/217676-mission-name-standard/).
* Tweaked: Versioning format from e.g. 0.97X to 0.97.X for a better separation.
* Tweaked: Sector garrisons are now persistent during activations and doesn't spawn fresh on each activation.
-* Tweaked: Unit/Army Presets are now universally used as friendly or enemy preset.
+* Tweaked: Unit/Army presets are now universally used as friendly or enemy preset.
+* Tweaked: Changing presets is now possible without server restart.
## 0.963a (10th April 2018 as "legacy support" release)
* Added: Action to raise/lower object while building. Thanks to [darrell-aevum](https://github.com/darrell-aevum)
diff --git a/Missionframework/modules/00_init/README.md b/Missionframework/modules/00_init/README.md
index 2d0fa9565..ee11aea60 100644
--- a/Missionframework/modules/00_init/README.md
+++ b/Missionframework/modules/00_init/README.md
@@ -59,5 +59,13 @@ This module uses no data or functions from other modules.
*Sorts sector markers and fills global sector arrays.*
+* KPLIB_fnc_init_timeMultiApply
+
+ *Applies the chosen time multiplier.*
+
+* KPLIB_fnc_init_wipe
+
+ *Completely wipes all data from the current campaign.*
+
### Scripts
No scripts will be started by this module
diff --git a/Missionframework/modules/00_init/fnc/fn_init_load.sqf b/Missionframework/modules/00_init/fnc/fn_init_load.sqf
index 25fe991be..c9d72b835 100644
--- a/Missionframework/modules/00_init/fnc/fn_init_load.sqf
+++ b/Missionframework/modules/00_init/fnc/fn_init_load.sqf
@@ -4,7 +4,7 @@
File: fn_init_load.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-03-29
- Last Update: 2018-11-09
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -19,13 +19,6 @@
if (KPLIB_param_debug) then {diag_log format ["[KP LIBERATION] [%1] [SAVE] ----- Load function started -----", diag_tickTime];};
-// Check for save wipe parameters
-// TODO: This should be done via the admin menu
-/*if (KPLIB_param_wipeSave1 > 0 && KPLIB_param_wipeSave2 > 0) then {
- if (KPLIB_param_debug) then {diag_log "[KP LIBERATION] [SAVE] Wipe parameters enabled, wiping save data...";};
- [] call KPLIB_fnc_init_wipe;
-};*/
-
// Load whole save data
KPLIB_save_data = profileNamespace getVariable [KPLIB_save_key, nil];
diff --git a/Missionframework/modules/00_init/fnc/fn_init_postInit.sqf b/Missionframework/modules/00_init/fnc/fn_init_postInit.sqf
index cb3c74ac0..7d30bcb25 100644
--- a/Missionframework/modules/00_init/fnc/fn_init_postInit.sqf
+++ b/Missionframework/modules/00_init/fnc/fn_init_postInit.sqf
@@ -4,7 +4,7 @@
File: fn_init_postInit.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-08-31
- Last Update: 2018-11-12
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
diff --git a/Missionframework/modules/00_init/fnc/fn_init_settings.sqf b/Missionframework/modules/00_init/fnc/fn_init_settings.sqf
index e556ba2d1..fe9a4b755 100644
--- a/Missionframework/modules/00_init/fnc/fn_init_settings.sqf
+++ b/Missionframework/modules/00_init/fnc/fn_init_settings.sqf
@@ -4,7 +4,7 @@
File: fn_init_settings.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-11-09
- Last Update: 2018-11-19
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -87,6 +87,19 @@
{}
] call CBA_Settings_fnc_init;
+// KPLIB_param_timeMulti
+// Time Multiplier.
+// Default: 4x
+[
+ "KPLIB_param_timeMulti",
+ "SLIDER",
+ [localize "STR_KPLIB_SETTINGS_GENERAL_TIMEMULTI", localize "STR_KPLIB_SETTINGS_GENERAL_TIMEMULTI_TT"],
+ localize "STR_KPLIB_SETTINGS_GENERAL",
+ [1, 24, 4, 0],
+ 1,
+ {[] call KPLIB_fnc_init_timeMultiApply;}
+] call CBA_Settings_fnc_init;
+
/*
----- PRESET SETTINGS -----
diff --git a/Missionframework/modules/00_init/fnc/fn_init_timeMultiApply.sqf b/Missionframework/modules/00_init/fnc/fn_init_timeMultiApply.sqf
new file mode 100644
index 000000000..ca9fe899a
--- /dev/null
+++ b/Missionframework/modules/00_init/fnc/fn_init_timeMultiApply.sqf
@@ -0,0 +1,24 @@
+/*
+ KPLIB_fnc_init_timeMultiApply
+
+ File: fn_init_timeMultiApply.sqf
+ Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
+ Date: 2018-11-27
+ Last Update: 2018-11-27
+ License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
+
+ Description:
+ Applies the chosen time multiplier.
+
+ Parameter(s):
+ NONE
+
+ Returns:
+ Function reached the end [BOOL]
+*/
+
+if !(isServer) exitWith {};
+
+setTimeMultiplier KPLIB_param_timeMulti;
+
+true
diff --git a/Missionframework/modules/00_init/fnc/fn_init_wipe.sqf b/Missionframework/modules/00_init/fnc/fn_init_wipe.sqf
index 03eccabd9..2d6d33322 100644
--- a/Missionframework/modules/00_init/fnc/fn_init_wipe.sqf
+++ b/Missionframework/modules/00_init/fnc/fn_init_wipe.sqf
@@ -4,7 +4,7 @@
File: fn_init_wipe.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-03-29
- Last Update: 2018-11-09
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -17,6 +17,11 @@
Function reached the end [BOOL]
*/
+// Interrupt all mission functionalities, especially the saving
+KPLIB_campaignRunning = false;
+publicVariable "KPLIB_campaignRunning";
+
+// Delete saved data
profileNamespace setVariable [KPLIB_save_key, nil];
saveProfileNamespace;
diag_log "[KP LIBERATION] [IMPORTANT] Save wiped";
diff --git a/Missionframework/modules/00_init/functions.hpp b/Missionframework/modules/00_init/functions.hpp
index 1b672c629..9d7ea96d2 100644
--- a/Missionframework/modules/00_init/functions.hpp
+++ b/Missionframework/modules/00_init/functions.hpp
@@ -4,7 +4,7 @@
File: functions.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-10-16
- Last Update: 2018-11-12
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -68,4 +68,10 @@ class init {
// Sorts sector markers and fills global sector arrays
class init_sortSectors {};
+
+ // Applies the chosen time multiplier
+ class init_timeMultiApply {};
+
+ // Completely wipes all data from the current campaign
+ class init_wipe {};
};
diff --git a/Missionframework/modules/02_core/README.md b/Missionframework/modules/02_core/README.md
index f11868e26..d43248886 100644
--- a/Missionframework/modules/02_core/README.md
+++ b/Missionframework/modules/02_core/README.md
@@ -30,10 +30,6 @@ So this is the core gameplay where all other modules are inject their functional
*Check if win conditions are met.*
-* KPLIB_fnc_core_cinematic
-
- *The intro cinematic procedure.*
-
* KPLIB_fnc_core_createFobMarker
*Creates FOB marker.*
@@ -54,10 +50,6 @@ So this is the core gameplay where all other modules are inject their functional
*Handle vehicle spawn event.*
-* KPLIB_fnc_core_intro
-
- *Start the intro cinematic.*
-
* KPLIB_fnc_core_reviveInit
*Initialize BIS revive.*
diff --git a/Missionframework/modules/02_core/fnc/fn_core_changeSectorOwner.sqf b/Missionframework/modules/02_core/fnc/fn_core_changeSectorOwner.sqf
index 81d01d299..263c9a6f4 100644
--- a/Missionframework/modules/02_core/fnc/fn_core_changeSectorOwner.sqf
+++ b/Missionframework/modules/02_core/fnc/fn_core_changeSectorOwner.sqf
@@ -4,7 +4,7 @@
File: fn_core_changeSectorOwner.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-05-07
- Last Update: 2018-11-09
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -25,9 +25,9 @@ params [
if (_toPlayerSide) then {
KPLIB_sectors_blufor pushBack _sectorToChange;
- call KPLIB_fnc_core_checkWinCond;
+ [] call KPLIB_fnc_core_checkWinCond;
} else {
- KPLIB_sectors_blufor = KPLIB_sectors_blufor - [_sectorToChange];
+ KPLIB_sectors_blufor deleteAt (KPLIB_sectors_blufor findIf {_x isEqualTo _sectorToChange});
};
publicVariable "KPLIB_sectors_blufor";
diff --git a/Missionframework/modules/02_core/fnc/fn_core_checkWinCond.sqf b/Missionframework/modules/02_core/fnc/fn_core_checkWinCond.sqf
index eb4dd620d..cad92cba2 100644
--- a/Missionframework/modules/02_core/fnc/fn_core_checkWinCond.sqf
+++ b/Missionframework/modules/02_core/fnc/fn_core_checkWinCond.sqf
@@ -4,7 +4,7 @@
File: fn_core_checkWinCond.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-05-10
- Last Update: 2018-11-09
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -20,7 +20,7 @@
// In the next steps we'll implement a parameter for more win conditions. For now the "old one" will be used.
if (({_x in KPLIB_sectors_blufor} count KPLIB_sectors_metropolis) == count KPLIB_sectors_metropolis) then {
KPLIB_campaignRunning = false;
- call KPLIB_fnc_init_wipe;
+ [] call KPLIB_fnc_init_wipe;
"KPLIB_win" call BIS_fnc_endMissionServer;
};
diff --git a/Missionframework/modules/02_core/fnc/fn_core_cinematic.sqf b/Missionframework/modules/02_core/fnc/fn_core_cinematic.sqf
deleted file mode 100644
index 66927820b..000000000
--- a/Missionframework/modules/02_core/fnc/fn_core_cinematic.sqf
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- KPLIB_fnc_core_cinematic
-
- File: fn_core_cinematic.sqf
- Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
- Date: 2017-12-31
- Last Update: 2018-11-12
- License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
-
- Description:
- The intro cinematic procedure.
-
- Parameter(s):
- NONE
-
- Returns:
- Function reached the end [BOOL]
-*/
-
-// Intro cinematic started
-KPLIB_intro_running = true;
-
-// Transition and position storage variables
-private _lastTransition = -1;
-private _lastTargetPos = [-1,-1,-1];
-
-// Activate cinema borders
-showCinemaBorder true;
-
-// Create camera
-private _cam = "camera" camCreate KPLIB_zeroPos;
-
-// Create invisible pointer for use as camera target
-private _pointer = "Sign_Arrow_Blue_F" createVehicleLocal KPLIB_zeroPos;
-_pointer hideObject true;
-_cam camSetTarget _pointer;
-_cam cameraEffect ["internal","back"];
-_cam camcommit 0;
-
-// Set variable for first camera round
-private _firstRound = true;
-
-// Show the intro cinematic until it's aborted
-while {KPLIB_intro_running} do {
-
- // Wait until the last camera round is finished or the intro is aborted
- waitUntil {!KPLIB_intro_running || camCommitted _cam};
-
- // If the intro is still running, commit next camera round
- if (KPLIB_intro_running) then {
-
- // Deactivate NVG effect for the camera
- camUseNVG false;
-
- // Create an array for possible camera targets
- private _targetPositions = [];
-
- // If it's the first round use the startbase, otherwise fill the targets array
- if (_firstRound) then {
- _targetPositions pushBack (getpos KPLIB_eden_startbase);
- } else {
- // Add 2 FOBs as possible camera targets
- if ((count KPLIB_sectors_fobs) > 0) then {
- for "_i" from 1 to 2 step 1 do {
- _targetPositions pushBack (getMarkerPos (selectRandom KPLIB_sectors_fobs));
- };
- };
-
- // If active, add up to 5 active sectors. Otherwise add 5 random sectors.
- if ((count KPLIB_sectors_active) > 0) then {
- for "_i" from 1 to 5 step 1 do {
- _targetPositions pushBack (getMarkerPos (selectRandom KPLIB_sectors_active));
- };
- } else {
- for "_i" from 1 to 5 step 1 do {
- _targetPositions pushBack (getMarkerPos (selectRandom KPLIB_sectors_all));
- };
- };
-
- // Add up to 3 players as cam targets who are not at the spawn area, if available
- private _targetPlayers = (allPlayers - entities "HeadlessClient_F") select {(alive _x) && ((_x distance KPLIB_eden_respawnPos) > 100)};
- if ((count _targetPlayers) > 0) then {
- for "_i" from 1 to 3 step 1 do {
- _targetPositions pushBack (getPos (selectRandom _targetPlayers));
- };
- };
- };
-
- // Pick a random position from the available target positions excluding the last one used
- private _actualTargetPos = selectRandom (_targetPositions - [_lastTargetPos]);
- _lastTargetPos = _actualTargetPos;
-
- // Target variable for the camera
- private _camtarget = KPLIB_eden_startbase;
-
- // If it's not the first camera round, select a new target by moving the pointer
- if (!_firstRound) then {
- _pointer setpos [_actualTargetPos select 0, _actualTargetPos select 1, (_actualTargetPos select 2) + 7];
- _camtarget = _pointer;
-
- // If there are alive players near the selected sector we should focus the camera on one of them
- private _nearPlayers = (allPlayers - entities "HeadlessClient_F") select {(alive _x) && ((_x distance _actualTargetPos) < 250)};
- if ((count _nearPlayers) > 0) then {
- _camtarget = selectRandom _nearPlayers;
- };
- };
-
- // Assign camera target
- _cam camSetTarget _camtarget;
-
- // Parameters for the camera round
- private _startPos = [((getPos _camtarget) select 0) - 60, ((getPos _camtarget) select 1) + 350, 5];
- private _endPos = [((getPos _camtarget) select 0) - 60, ((getPos _camtarget) select 1) - 230, 5];
- private _startFov = 0.5;
- private _endFov = 0.5;
-
- // Some diversity for the camera rounds
- if (!_firstRound) then {
- _startFov = 0.8;
- _endFov = 0.8;
-
- private _nextTransition = selectRandom ([0, 1, 2, 3, 4, 5, 6, 7 ,8 ,9 ,10, 11 ,12 ,13 ,14, 15] - [_lastTransition]);
- _lastTransition = _nextTransition;
-
- switch (_nextTransition) do {
- case 0: {
- _startPos = [((getpos _camtarget) select 0) - 30, ((getpos _camtarget) select 1) - 50, 15];
- _endPos = [((getpos _camtarget) select 0) - 30, ((getpos _camtarget) select 1) + 50, 15];
- _endFov = 0.8;
- };
-
- case 1: {
- _startPos = [((getpos _camtarget) select 0) + 5, ((getpos _camtarget) select 1) - 100, 1];
- _endPos = [((getpos _camtarget) select 0) + 5, ((getpos _camtarget) select 1) + 100, 40];
- _endFov = 0.55;
- };
-
- case 2: {
- _startPos = [((getpos _camtarget) select 0) + 50, ((getpos _camtarget) select 1) - 50, 100];
- _endPos = [((getpos _camtarget) select 0) + 50, ((getpos _camtarget) select 1) + 50, 100];
- _startFov = 0.5;
- _endFov = 0.3;
- };
-
- case 3: {
- _startPos = [((getpos _camtarget) select 0) + 50, ((getpos _camtarget) select 1) - 80, 2];
- _endPos = [((getpos _camtarget) select 0) + 50, ((getpos _camtarget) select 1) + 80, 20];
- };
-
- case 4: {
- _startPos = [((getpos _camtarget) select 0) - 400, ((getpos _camtarget) select 1) + 400, 50];
- _endPos = [((getpos _camtarget) select 0) + 400, ((getpos _camtarget) select 1) + 400, 50];
- _startFov = 0.25;
- _endFov = 0.25;
- };
-
- case 5: {
- _startPos = [((getpos _camtarget) select 0) + 300, ((getpos _camtarget) select 1) - 100, 15];
- _endPos = [((getpos _camtarget) select 0) -300, ((getpos _camtarget) select 1) - 120, 15];
- };
-
- case 6: {
- _startPos = [((getpos _camtarget) select 0) + 100, ((getpos _camtarget) select 1) - 100, 1];
- _endPos = [((getpos _camtarget) select 0) + 100, ((getpos _camtarget) select 1) - 100, 50];
- };
-
- case 7: {
- _startPos = [((getpos _camtarget) select 0) + 50, ((getpos _camtarget) select 1) - 50, 150];
- _endPos = [((getpos _camtarget) select 0) + 20, ((getpos _camtarget) select 1) - 20, 5];
- _startFov = 0.6;
- _endFov = 0.9;
- };
-
- case 8: {
- _startPos = [((getpos _camtarget) select 0) - 300, ((getpos _camtarget) select 1) - 80, 20];
- _endPos = [((getpos _camtarget) select 0) + 300, ((getpos _camtarget) select 1) + 120, 20];
- _startFov = 0.55;
- _endFov = 0.55;
- };
-
- case 9: {
- _startPos = [((getpos _camtarget) select 0) - 80, ((getpos _camtarget) select 1) - 300, 30];
- _endPos = [((getpos _camtarget) select 0) + 120, ((getpos _camtarget) select 1) + 300, 30];
- _startFov = 0.65;
- _endFov = 0.65;
- };
-
- case 10: {
- _startPos = [((getpos _camtarget) select 0) - 5, ((getpos _camtarget) select 1) + 30, 5];
- _endPos = [((getpos _camtarget) select 0) - 25, ((getpos _camtarget) select 1) -30, 150];
- };
-
- case 11 : {
- _cam cameraEffect ["Terminate", "BACK"];
- camDestroy _cam;
- _cam = "camera" camCreate [0,0,0];
- _cam cameraEffect ["internal","back"];
- _cam camcommit 0;
- _startPos = [((getpos _camtarget) select 0) + 2, ((getpos _camtarget) select 1) -200, 25];
- _endPos = [((getpos _camtarget) select 0) + 2, ((getpos _camtarget) select 1) +200, 25];
- _cam setDir 0;
- [_cam, -30, 0] call BIS_fnc_setPitchBank; // Maybe replace with setVectorDirAndUp ?
- };
-
- case 12 : {
- _cam cameraEffect ["Terminate", "BACK"];
- camDestroy _cam;
- _cam = "camera" camCreate [0,0,0];
- _cam cameraEffect ["internal","back"];
- _cam camcommit 0;
- _startPos = [((getpos _camtarget) select 0) + 302 , ((getpos _camtarget) select 1) + 300, 50];
- _endPos = [((getpos _camtarget) select 0) - 198, ((getpos _camtarget) select 1) - 200, 50];
- _cam setDir 225;
- [_cam, -25, 0] call BIS_fnc_setPitchBank; // Maybe replace with setVectorDirAndUp ?
- };
-
- case 13 : {
- _cam cameraEffect ["Terminate", "BACK"];
- camDestroy _cam;
- _cam = "camera" camCreate [0,0,0];
- _cam cameraEffect ["internal","back"];
- _cam camcommit 0;
- _startPos = [((getpos _camtarget) select 0) - 80 , ((getpos _camtarget) select 1) + 150, 20];
- _endPos = [((getpos _camtarget) select 0) - 80, ((getpos _camtarget) select 1) - 150, 20];
- _cam setDir 90;
- [_cam, -15, 0] call BIS_fnc_setPitchBank; // Maybe replace with setVectorDirAndUp ?
- };
-
- case 14 : {
- _cam cameraEffect ["Terminate", "BACK"];
- camDestroy _cam;
- _cam = "camera" camCreate [0,0,0];
- _cam cameraEffect ["internal","back"];
- _cam camcommit 0;
- _startPos = [((getpos _camtarget) select 0) - 50 , ((getpos _camtarget) select 1) + 2, 30];
- _endPos = [((getpos _camtarget) select 0) + 150, ((getpos _camtarget) select 1) - 2, 30];
- _cam setDir 270;
- [_cam, -20, 0] call BIS_fnc_setPitchBank; // Maybe replace with setVectorDirAndUp ?
- _startFov = 0.55;
- _endFov = 0.55;
- };
-
- case 15 : {
- _cam cameraEffect ["Terminate", "BACK"];
- camDestroy _cam;
- _cam = "camera" camCreate [0,0,0];
- _cam cameraEffect ["internal","back"];
- _cam camcommit 0;
- _startPos = [((getpos _camtarget) select 0) - 150 , ((getpos _camtarget) select 1) + 5, 250];
- _endPos = [((getpos _camtarget) select 0) + 150, ((getpos _camtarget) select 1) + 5, 250];
- _cam setDir 0;
- [_cam, -88, 0] call BIS_fnc_setPitchBank; // Maybe replace with setVectorDirAndUp ?
- _startFov = 0.3;
- _endFov = 0.3;
- };
- };
- };
-
- // Raise the start and end position if the target is above the water
- if (surfaceIsWater _actualTargetPos) then {
- _startPos = [_startPos select 0, _startPos select 1, (_startPos select 2) + 25];
- _endPos = [_endPos select 0, _endPos select 1, (_endPos select 2) + 25];
- };
-
- // Raise the start and end position until there is no terrain intersection between both positions
- while {terrainIntersect [_startPos, _endpos]} do {
- _startPos = [_startPos select 0, _startPos select 1, (_startPos select 2) + 30];
- _endPos = [_endPos select 0, _endPos select 1, (_endPos select 2) + 30];
- };
-
- // Do the camera round
- _cam camSetPos _startPos;
- _cam camSetFov _startFov;
- _cam camCommit 0;
- _cam camSetPos _endPos;
- _cam camSetFov _endFov;
-
- // Diversion for the commit time for the camera
- if (_firstRound) then {
- _cam camCommit 18;
- } else {
- if (KPLIB_intro_tutorial == 0) then {
- _cam camCommit 10;
- } else {
- _cam camCommit 20;
- };
- };
-
- // It's not the first round anymore
- _firstRound = false;
-
- // If the player didn't open the tutorial, show some information from the camera target
- if (KPLIB_intro_tutorial == 0) then {
-
- // Get the playername, if we have a player as target
- private _unitName = "";
- if (isPlayer _camtarget) then {_unitname = name _camtarget;};
-
- // Get the name of the sector we're looking at
- private _sectorName = "";
- if (_actualTargetPos distance KPLIB_eden_startbase < 300) then {
- _sectorName = localize "STR_KPLIB_INTRO_BEGIN";
- } else {
- _sectorName = [300, _actualTargetPos] call KPLIB_fnc_core_getNearestSector;
- if (_sectorName != "") then {
- _sectorName = markertext _sectorName;
- } else {
- // If it's not a player, not a sector and not the starting base, it has to be a FOB
- _nearFobs = KPLIB_sectors_fobs select {getMarkerPos _x distance _actualTargetPos < 300};
- if (count _nearFobs > 0) then {
- _sectorName = format ["FOB %1", KPLIB_preset_alphabet select (KPLIB_sectors_fobs find (_nearFobs select 0))];
- };
- };
- };
-
- [format ["%1
%2", _unitName, _sectorName],1,0.8,6,1] spawn BIS_fnc_dynamictext;
- };
- };
-};
-
-// End the intro
-_cam cameraEffect ["Terminate", "BACK"];
-camDestroy _cam;
-camUseNVG false;
-deleteVehicle _pointer;
-
-true
diff --git a/Missionframework/modules/02_core/fnc/fn_core_intro.sqf b/Missionframework/modules/02_core/fnc/fn_core_intro.sqf
deleted file mode 100644
index 2ad067bcc..000000000
--- a/Missionframework/modules/02_core/fnc/fn_core_intro.sqf
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- KPLIB_fnc_core_intro
-
- File: fn_core_intro.sqf
- Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
- Date: 2017-12-31
- Last Update: 2018-11-09
- License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
-
- Description:
- Starts the intro cinematic with the optional credit introduction line.
-
- Parameter(s):
- NONE
-
- Returns:
- Function reached the end [BOOL]
-*/
-
-/*
---- TODO IN SPRINT .... soon ^^ ---
-Rework the intro and cinematic. Currently it doesn't work reliable. Mostly an endless loop of the cinematic.
-Postponed, as it's not in the current scope of the sprint 5 tasks.
-
-Also: Refactor or even remove it completely
-*/
-
-// Spawn cinematic camera procedure
-// [] spawn KPLIB_fnc_core_cinematic;
-
-/* if (KPLIB_param_intro > 0) then {
- // Show intro texts
- uiSleep 1;
- cutRsc ["intro1", "PLAIN", 1, true];
- uiSleep 5.5;
- cutRsc ["intro2", "PLAIN", 1, true];
- uiSleep 10;
-};*/
-
-// Show the intro dialog for play or tutorial
-// createDialog "KPLIB_introMenu";
-// If we are not able to open introMenu we should continue
-// waitUntil {dialog};
-// waitUntil {KPLIB_intro_startGame == 1 || KPLIB_intro_tutorial == 1 || !dialog};
-// closeDialog 0;
-
-// Show tutorial, if selected
-/*if (KPLIB_intro_tutorial == 0) then {
- KPLIB_intro_running = false;
-};*/
-
-// Finish the intro
-KPLIB_intro_done = true;
-
-true
diff --git a/Missionframework/modules/02_core/fnc/fn_core_postInit.sqf b/Missionframework/modules/02_core/fnc/fn_core_postInit.sqf
index 00631599c..50047b35b 100644
--- a/Missionframework/modules/02_core/fnc/fn_core_postInit.sqf
+++ b/Missionframework/modules/02_core/fnc/fn_core_postInit.sqf
@@ -4,7 +4,7 @@
File: fn_core_postInit.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-08-31
- Last Update: 2018-11-12
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -47,8 +47,7 @@ if (!hasInterface && !isDedicated) then {
// Player section
if (hasInterface) then {
- // Start the intro cinematic
- [] spawn KPLIB_fnc_core_intro;
+
};
if (isServer) then {diag_log format ["[KP LIBERATION] [%1] [POST] [CORE] Module initialized", diag_tickTime];};
diff --git a/Missionframework/modules/02_core/fnc/fn_core_preInit.sqf b/Missionframework/modules/02_core/fnc/fn_core_preInit.sqf
index 7f5785bd7..f5fc3698e 100644
--- a/Missionframework/modules/02_core/fnc/fn_core_preInit.sqf
+++ b/Missionframework/modules/02_core/fnc/fn_core_preInit.sqf
@@ -4,7 +4,7 @@
File: fn_core_preInit.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-10-18
- Last Update: 2018-11-12
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -30,14 +30,6 @@ if (isServer) then {diag_log format ["[KP LIBERATION] [%1] [PRE] [CORE] Module i
KPLIB_core_potato01 = objNull;
// Deploy button trigger for redeploy dialog
KPLIB_dialog_deploy = 0;
-// Intro cinematic done
-KPLIB_intro_done = false;
-// Intro cinematic running
-KPLIB_intro_running = false;
-// Start game button state in intro cinematic
-KPLIB_intro_startGame = 0;
-// Tutorial button state in intro cinematic
-KPLIB_intro_tutorial = 0;
if (isServer) then {diag_log format ["[KP LIBERATION] [%1] [PRE] [CORE] Module initialized", diag_tickTime];};
diff --git a/Missionframework/modules/02_core/functions.hpp b/Missionframework/modules/02_core/functions.hpp
index 63c1eab6c..eab610613 100644
--- a/Missionframework/modules/02_core/functions.hpp
+++ b/Missionframework/modules/02_core/functions.hpp
@@ -4,7 +4,7 @@
File: functions.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-10-28
- Last Update: 2018-11-18
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -29,9 +29,6 @@ class core {
// Check if win conditions are met
class core_checkWinCond {};
- // The intro cinematic procedure
- class core_cinematic {};
-
// Creates FOB marker
class core_createFobMarker {};
@@ -47,9 +44,6 @@ class core {
// Handle vehicle spawn event
class core_handleVehicleSpawn {};
- // Start the intro cinematic
- class core_intro {};
-
// Module post initialization
class core_postInit {
postInit = 1;
diff --git a/Missionframework/modules/02_core/ui.hpp b/Missionframework/modules/02_core/ui.hpp
index d5fb6ef86..a0adf7788 100644
--- a/Missionframework/modules/02_core/ui.hpp
+++ b/Missionframework/modules/02_core/ui.hpp
@@ -4,12 +4,11 @@
File: ui.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-10-28
- Last Update: 2018-11-09
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
Initializes the ui defines, dialogs and elements which are brought by this module.
*/
-#include "ui\KPLIB_introMenu.hpp"
#include "ui\KPLIB_titles.hpp"
diff --git a/Missionframework/modules/02_core/ui/KPLIB_introMenu.hpp b/Missionframework/modules/02_core/ui/KPLIB_introMenu.hpp
deleted file mode 100644
index d0ad2aa92..000000000
--- a/Missionframework/modules/02_core/ui/KPLIB_introMenu.hpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- KP Liberation intro menu defines
-
- File: KPLIB_introMenu.hpp
- Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
- Date: 2017-10-28
- Last Update: 2018-11-09
- License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
-
- Description:
- The intro menu which appears after joining the mission.
-*/
-
-// TODO: REWORK!
-
-class KPLIB_introMenu {
- idd = 75802;
- movingEnable = false;
- controls[] = {"Splash", "Start", "Help"};
- objects[] = {};
-
- class Splash {
- idc = -1;
- type = 0;
- style = 48;
- colorText[] = COLOR_WHITE;
- colorBackground[] = COLOR_NOALPHA;
- font = "RobotoCondensed";
- sizeEx = 0.1 * safezoneH;
- x = 0.08 * safezoneW + safezoneX;
- w = 0.25 * safezoneW;
- y = 0.15 * safezoneH + safezoneY;
- h = 0.43 * safezoneH;
- text = "res\splash.paa";
- };
-
- class Start {
- idc = 758021;
- type = 16;
- style = 2;
- x = (0.137 * safezoneW + safezoneX) - (0.01);
- y = (0.53 * safezoneH + safezoneY);
- w = (0.15 * safezoneW) - (0.01);
- h = (0.07 * safezoneH);
- sizeEx = 0.025 * safezoneH;
- size = 0.025 * safezoneH;
- text = "";
- action = "KPLIB_intro_startGame = 1;";
- textureNoShortcut = "res\btn_join_spl_idl3.paa";
- animTextureNormal = "res\btn_join_spl_idl3.paa";
- animTextureDisabled = "res\btn_join_spl_idl3.paa";
- animTextureOver = "res\btn_join_spl_hov3.paa";
- animTextureFocused = "res\btn_join_spl_idl3.paa";
- animTexturePressed = "res\btn_join_spl_hov3.paa";
- animTextureDefault = "res\btn_join_spl_idl3.paa";
- color[] = COLOR_WHITE;
- color2[] = COLOR_WHITE;
- colorActiveBackground[] = COLOR_WHITE;
- colorBackground[] = COLOR_WHITE;
- colorBackgroundFocused[] = COLOR_WHITE;
- colorBackground2[] = COLOR_WHITE;
- colorDisabled[] = COLOR_WHITE;
- colorFocused[] = COLOR_WHITE;
- font = "RobotoCondensed";
- soundEnter[] = { "", 0, 1 }; // no sound
- soundPush[] = {"\a3\Ui_f\data\Sound\CfgIngameUI\hintExpand", 0.891251, 1};
- soundClick[] = { "", 0, 1 }; // no sound
- soundEscape[] = { "", 0, 1 }; // no sound
- class HitZone {
- Left = 0;
- Right = 0;
- Top = 0;
- Bottom = 0;
- };
- class ShortcutPos {
- Left = 0;
- Top = 0;
- w = 0;
- h = 0;
- };
- class TextPos {
- left = 0;
- top = 0;
- right = 0;
- bottom = 0;
- };
- };
-
- class Help : Start {
- idc = 758022;
- y = (0.62 * safezoneH + safezoneY);
- animTextureNormal = "res\btn_htp_spl_idl3.paa";
- animTextureDisabled = "res\btn_htp_spl_idl3.paa";
- animTextureOver = "res\btn_htp_spl_hov3.paa";
- animTextureFocused = "res\btn_htp_spl_idl3.paa";
- animTexturePressed = "res\btn_htp_spl_hov3.paa";
- animTextureDefault = "res\btn_htp_spl_idl3.paa";
- tooltipColorShade[] = COLOR_BROWN;
- tooltipColorText[] = COLOR_WHITE;
- tooltipColorBox[] = COLOR_GREEN;
- action = "KPLIB_intro_tutorial = 1;";
- };
-
-
-};
diff --git a/Missionframework/modules/02_core/ui/KPLIB_titles.hpp b/Missionframework/modules/02_core/ui/KPLIB_titles.hpp
index f155390a7..5bac7cad7 100644
--- a/Missionframework/modules/02_core/ui/KPLIB_titles.hpp
+++ b/Missionframework/modules/02_core/ui/KPLIB_titles.hpp
@@ -4,7 +4,7 @@
File: KPLIB_defines.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-10-28
- Last Update: 2018-11-12
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -24,81 +24,6 @@ class CfgSounds
class RscTitles
{
- class intro1
- {
- name = "intro1";
- duration = 4;
- idd = -1;
- movingEnable = false;
- controls[]=
- {
- GenericLabelShadow, GenericLabel2
- };
- class GenericLabel2 {
- idc = -1;
- type = 0 ;
- style = 2;
- colorText[] = COLOR_WHITE;
- colorBackground[] = COLOR_NOALPHA;
- font = "RobotoCondensed";
- sizeEx = 0.035 * safezoneH;
- x = 0.3 * safezoneW + safezoneX;
- w = 0.4 * safezoneW;
- y = 0.65 * safezoneH + safezoneY;
- h = 0.1 * safezoneH;
- text = "The Killah Potatoes present";
- shadow = 1;
- };
- class GenericLabelShadow : GenericLabel2{
- shadow = 2;
- };
- };
-
- class intro2
- {
- name = "intro2";
- duration = 7;
- idd = -1;
- movingEnable = false;
- controls[]=
- {
- VersionLabelShadow, Splash, VersionLabel
- };
- class Splash {
- idc = -1;
- type = 0;
- style = 48;
- colorText[] = COLOR_WHITE;
- colorBackground[] = COLOR_NOALPHA;
- font = "RobotoCondensed";
- sizeEx = 0.1 * safezoneH;
- x = 0.325 * safezoneW + safezoneX;
- w = 0.35 * safezoneW;
- y = 0.2 * safezoneH + safezoneY;
- h = 0.6 * safezoneH;
- text = "res\splash.paa";
- };
- class VersionLabel {
- idc = -1;
- type = 0;
- style = 2;
- shadow = 1;
- colorText[] = COLOR_WHITE;
- colorBackground[] = COLOR_NOALPHA;
- font = "RobotoCondensed";
- sizeEx = 0.035 * safezoneH;
- x = 0.45 * safezoneW + safezoneX;
- w = 0.3 * safezoneW;
- y = 0.65 * safezoneH + safezoneY;
- h = 0.1 * safezoneH;
- text = "$STR_KPLIB_VERSION";
- };
- class VersionLabelShadow : VersionLabel {
- shadow = 2;
- font = "RobotoCondensed";
- };
- };
-
class blank
{
name = "blank";
diff --git a/Missionframework/modules/03_respawn/fnc/fn_respawn_onKilled.sqf b/Missionframework/modules/03_respawn/fnc/fn_respawn_onKilled.sqf
index ff5eade0f..7251b316e 100644
--- a/Missionframework/modules/03_respawn/fnc/fn_respawn_onKilled.sqf
+++ b/Missionframework/modules/03_respawn/fnc/fn_respawn_onKilled.sqf
@@ -4,7 +4,7 @@
File: fn_respawn_onKilled.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-09-12
- Last Update: 2018-11-09
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -21,7 +21,7 @@ params ["_unit", "_killer", "_respawnType", "_delay"];
setPlayerRespawnTime 1e10;
// Do not spawn the dialog if we're before campaign was started
-[{KPLIB_campaignRunning && KPLIB_intro_done}, {
+[{KPLIB_campaignRunning}, {
// Open respawn dialog
[] call KPLIB_fnc_respawn_open;
}, _this] call CBA_fnc_waitUntilAndExecute;
diff --git a/Missionframework/modules/03_respawn/fnc/fn_respawn_spawnPlayer.sqf b/Missionframework/modules/03_respawn/fnc/fn_respawn_spawnPlayer.sqf
index 646e49c0d..38c4d643b 100644
--- a/Missionframework/modules/03_respawn/fnc/fn_respawn_spawnPlayer.sqf
+++ b/Missionframework/modules/03_respawn/fnc/fn_respawn_spawnPlayer.sqf
@@ -5,7 +5,7 @@
File: fn_respawn_doSpawn.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-09-12
- Last Update: 2018-11-12
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -49,6 +49,11 @@ setPlayerRespawnTime 0;
// Reveal player to nearby infantry so he is not "invisible" to them for a while
{_x reveal [player, 0.01]} forEach (player nearEntities ["Man", 10]);
+ // Disable stamina if selected in settings
+ if !(KPLIB_param_stamina) then {
+ player enableStamina false;
+ };
+
// Emit redeploy event
["KPLIB_player_redeploy", [player, _respawnPos, _loadout]] call CBA_fnc_globalEvent;
diff --git a/Missionframework/modules/04_build/README.md b/Missionframework/modules/04_build/README.md
index f3a4715e7..87c03f0c6 100644
--- a/Missionframework/modules/04_build/README.md
+++ b/Missionframework/modules/04_build/README.md
@@ -27,7 +27,7 @@ Furthermore it handles the saving/loading of all objects which are buildable/spa
*Creates the build camera.*
- * KPLIB_fnc_build_displayLoad
+* KPLIB_fnc_build_displayLoad
*Display initialization.*
diff --git a/Missionframework/modules/04_build/fnc/fn_build_camAreaLimiter.sqf b/Missionframework/modules/04_build/fnc/fn_build_camAreaLimiter.sqf
index 9c1dd47bf..3f41b31f3 100644
--- a/Missionframework/modules/04_build/fnc/fn_build_camAreaLimiter.sqf
+++ b/Missionframework/modules/04_build/fnc/fn_build_camAreaLimiter.sqf
@@ -4,7 +4,7 @@
File: fn_build_camAreaLimiter.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-07-01
- Last Update: 2018-11-12
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -21,12 +21,12 @@
params [
["_camera", objNull, [objNull]],
- ["_position", position _camera, [[]], 3],
+ ["_position", KPLIB_zeroPos, [[]], 3],
["_radius", KPLIB_param_fobRange, [0]]
];
// Default position to position of camera
-if (isNil "_position") then {_position = getPos _camera};
+if (_position isEqualTo KPLIB_zeroPos) then {_position = getPos _camera};
[{
params ["_args", "_handle"];
diff --git a/Missionframework/modules/04_build/ui/KPLIB_buildDisplay.hpp b/Missionframework/modules/04_build/ui/KPLIB_buildDisplay.hpp
index fb09154f3..ed042af58 100644
--- a/Missionframework/modules/04_build/ui/KPLIB_buildDisplay.hpp
+++ b/Missionframework/modules/04_build/ui/KPLIB_buildDisplay.hpp
@@ -4,7 +4,7 @@
File: KPLIB_defines.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-07-01
- Last Update: 2018-11-12
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -113,7 +113,7 @@ class KPLIB_build {
x = KP_GETCX(KP_X_VAL_LP,KP_WIDTH_VAL_LP,0,1);
y = KP_GETCY(KP_Y_VAL_LP,KP_HEIGHT_VAL_LP,2,20);
w = KP_GETW(KP_WIDTH_VAL_LP,1);
- h = KP_GETH(KP_HEIGHT_VAL_LP,20) * 19.55
+ h = KP_GETH(KP_HEIGHT_VAL_LP,20) * 19.55;
columns[] = { 0, 0.65, 0.75, 0.85 };
diff --git a/Missionframework/modules/05_garrison/README.md b/Missionframework/modules/05_garrison/README.md
index 736c94701..ac34b3f9d 100644
--- a/Missionframework/modules/05_garrison/README.md
+++ b/Missionframework/modules/05_garrison/README.md
@@ -31,6 +31,10 @@ It'll also provide functions to change garrison data and a garrison management d
*Initializes a sector garrison.*
+* KPLIB_fnc_garrison_reInitSectors
+
+ *Reinitialize sectors of given preset faction.*
+
* KPLIB_fnc_garrison_spawn
*Spawns the garrison upon sector activation.*
diff --git a/Missionframework/modules/05_garrison/fnc/fn_garrison_despawn.sqf b/Missionframework/modules/05_garrison/fnc/fn_garrison_despawn.sqf
index 670f33cec..bbe16b8a7 100644
--- a/Missionframework/modules/05_garrison/fnc/fn_garrison_despawn.sqf
+++ b/Missionframework/modules/05_garrison/fnc/fn_garrison_despawn.sqf
@@ -4,7 +4,7 @@
File: fn_garrison_despawn.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-10-20
- Last Update: 2018-10-25
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -49,7 +49,7 @@ private _heavyVeh = [];
// Despawn garrison light vehicles
{
- if (alive _x && !((crew _x) isEqualTo [])) then {
+ if ((alive _x) && !((crew _x) isEqualTo []) && !(_x getVariable ["KPLIB_captured", false])) then {
_vehicle = _x;
_lightVeh pushBack (typeOf _x);
{_handledCrew pushBack _x; _vehicle deleteVehicleCrew _x;} forEach (crew _x);
@@ -59,7 +59,7 @@ private _heavyVeh = [];
// Despawn garrison heavy vehicles
{
- if (alive _x && !((crew _x) isEqualTo [])) then {
+ if ((alive _x) && !((crew _x) isEqualTo []) && !(_x getVariable ["KPLIB_captured", false])) then {
_vehicle = _x;
_heavyVeh pushBack (typeOf _x);
{_handledCrew pushBack _x; _vehicle deleteVehicleCrew _x;} forEach (crew _x);
diff --git a/Missionframework/modules/05_garrison/fnc/fn_garrison_preInit.sqf b/Missionframework/modules/05_garrison/fnc/fn_garrison_preInit.sqf
index 1cc2ceb05..35a50d28e 100644
--- a/Missionframework/modules/05_garrison/fnc/fn_garrison_preInit.sqf
+++ b/Missionframework/modules/05_garrison/fnc/fn_garrison_preInit.sqf
@@ -4,7 +4,7 @@
File: fn_garrison_preInit.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-10-18
- Last Update: 2018-11-12
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -34,6 +34,15 @@ if (isServer) then {
// Register sector deactivation event handler
["KPLIB_sector_deactivated", {[_this select 0] call KPLIB_fnc_garrison_despawn;}] call CBA_fnc_addEventHandler;
+
+ // Register preset change event handler
+ ["CBA_SettingChanged", {
+ params ["_setting", "_value"];
+
+ if (_setting in ["KPLIB_param_presetF", "KPLIB_param_presetE"]) then {
+ [_setting] call KPLIB_fnc_garrison_reInitSectors;
+ };
+ }] call CBA_fnc_addEventHandler;
};
/*
diff --git a/Missionframework/modules/05_garrison/fnc/fn_garrison_reInitSectors.sqf b/Missionframework/modules/05_garrison/fnc/fn_garrison_reInitSectors.sqf
new file mode 100644
index 000000000..172474492
--- /dev/null
+++ b/Missionframework/modules/05_garrison/fnc/fn_garrison_reInitSectors.sqf
@@ -0,0 +1,78 @@
+/*
+ KPLIB_fnc_garrison_reInitSectors
+
+ File: fn_garrison_reInitSectors.sqf
+ Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
+ Date: 2018-11-27
+ Last Update: 2018-11-27
+ License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
+
+ Description:
+ Reinitializes all affected sectors, when preset was changed during the campaign.
+
+ Parameter(s):
+ _preset - Variable name of the changed preset [STRING, defaults to ""]
+
+ Returns:
+ Function reached the end [BOOL]
+*/
+
+params [
+ ["_preset", "", [""]]
+];
+
+// Only execute on server, with valid parameter and not in mission init
+if (!(time > 0) || !isServer || (_preset isEqualTo "")) exitWith {};
+
+diag_log format ["[KP LIBERATION] [%1] [GARRISON] ----- Reinitialization of sector garrisons started -----", diag_tickTime];
+
+// Fetch all not active sectors
+private _sectors = KPLIB_sectors_military + KPLIB_sectors_city + KPLIB_sectors_factory + KPLIB_sectors_metropolis + KPLIB_sectors_tower;
+_sectors = _sectors select {!(_x in KPLIB_sectors_active)};
+
+// Select only enemy or friendly sectors
+private _friendly = true;
+if (_preset isEqualTo "KPLIB_param_presetF") then {
+ _sectors = _sectors select {_x in KPLIB_sectors_blufor};
+} else {
+ _sectors = _sectors select {!(_x in KPLIB_sectors_blufor)};
+ _friendly = false;
+};
+
+// Get the correct classname arrays - NOTE: Needs to be adjusted for new preset template, placeholder for now and not working for blufor sector
+// private _lVehicles = missionNamespace getVariable ["KPLIB_preset_lVehPl" + (["E", "F"] select _friendly), []];
+// private _hVehicles = missionNamespace getVariable ["KPLIB_preset_hVehPl" + (["E", "F"] select _friendly), []];
+
+private _lVehicles = missionNamespace getVariable [["KPLIB_preset_oVehiclesLow", "F"] select _friendly, []];
+private _hVehicles = missionNamespace getVariable [["KPLIB_preset_oVehicles", "F"] select _friendly, []];
+
+// Reinitialize vehicle classnames in sector garrisons
+private _lVehCount = 0;
+private _hVehCount = 0;
+{
+ if ((_x select 0) in _sectors) then {
+ // Get amount of light vehicles and erase current entries
+ _lVehCount = count (_x select 3);
+ _x set [3, []];
+
+ // Add light vehicles
+ for "_i" from 1 to _lVehCount do {
+ (_x select 3) pushBack (selectRandom _lVehicles);
+ };
+
+ // Get amount of heavy vehicles and erase current entries
+ _hVehCount = count (_x select 4);
+ _x set [4, []];
+
+ // Add heavy vehicles
+ for "_i" from 1 to _hVehCount do {
+ (_x select 4) pushBack (selectRandom _hVehicles);
+ };
+
+ diag_log format ["[KP LIBERATION] [GARRISON] %1 reinitialized", markerText (_x select 0)];
+ };
+} forEach KPLIB_garrison_array;
+
+diag_log format ["[KP LIBERATION] [%1] [GARRISON] ----- Reinitialization of sector garrisons finished -----", diag_tickTime];
+
+true
diff --git a/Missionframework/modules/05_garrison/functions.hpp b/Missionframework/modules/05_garrison/functions.hpp
index 324b16021..aa079db05 100644
--- a/Missionframework/modules/05_garrison/functions.hpp
+++ b/Missionframework/modules/05_garrison/functions.hpp
@@ -4,7 +4,7 @@
File: functions.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-10-18
- Last Update: 2018-11-09
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -42,6 +42,9 @@ class garrison {
preInit = 1;
};
+ // Reinitializes sectors
+ class garrison_reInitSectors {};
+
// Saves module specific data for the save
class garrison_saveData {};
diff --git a/Missionframework/modules/06_arsenal/ui/KPLIB_arsenal.hpp b/Missionframework/modules/06_arsenal/ui/KPLIB_arsenal.hpp
index 964c6df6a..14e5d5f18 100644
--- a/Missionframework/modules/06_arsenal/ui/KPLIB_arsenal.hpp
+++ b/Missionframework/modules/06_arsenal/ui/KPLIB_arsenal.hpp
@@ -4,7 +4,7 @@
File: KPLIB_arsenal.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-11-12
- Last Update: 2018-11-25
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -12,7 +12,7 @@
*/
class KPLIB_arsenal {
- idd = 758076
+ idd = 758076;
movingEnable = 0;
onUnload = "";
diff --git a/Missionframework/modules/99_adm/README.md b/Missionframework/modules/99_adm/README.md
index 4b44b9e96..acd5fa5ec 100644
--- a/Missionframework/modules/99_adm/README.md
+++ b/Missionframework/modules/99_adm/README.md
@@ -31,9 +31,5 @@ The Admin Menu provides maintenance and debug functionalities for the logged in
*Export current campaign to admins profile and requests server to wipe the saved campaign.*
-* KPLIB_fnc_adm_wipeServer
-
- *Completely wipes all data from the current campaign.*
-
### Scripts
No scripts will be started by this module
diff --git a/Missionframework/modules/99_adm/fnc/fn_adm_postInit.sqf b/Missionframework/modules/99_adm/fnc/fn_adm_postInit.sqf
index c528874b1..9e63f7138 100644
--- a/Missionframework/modules/99_adm/fnc/fn_adm_postInit.sqf
+++ b/Missionframework/modules/99_adm/fnc/fn_adm_postInit.sqf
@@ -4,7 +4,7 @@
File: fn_adm_postInit.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-08-31
- Last Update: 2018-11-12
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -20,6 +20,22 @@
if (isServer) then {diag_log format ["[KP LIBERATION] [%1] [POST] [ADM] Module initializing...", diag_tickTime];};
+// Player section
+if (hasInterface) then {
+ // Action to open the dialog
+ private _actionArray = [
+ "" + localize "STR_KPLIB_ACTION_ADMIN_MENU" + "",
+ {[] call KPLIB_fnc_adm_openDialog;},
+ nil,
+ -804,
+ false,
+ true,
+ "",
+ '_target isEqualTo _originalTarget && serverCommandAvailable "#kick"'
+ ];
+ [_actionArray] call CBA_fnc_addPlayerAction;
+};
+
if (isServer) then {diag_log format ["[KP LIBERATION] [%1] [POST] [ADM] Module initialized", diag_tickTime];};
true
diff --git a/Missionframework/modules/99_adm/fnc/fn_adm_wipe.sqf b/Missionframework/modules/99_adm/fnc/fn_adm_wipe.sqf
index 0dea38c5a..faa59e285 100644
--- a/Missionframework/modules/99_adm/fnc/fn_adm_wipe.sqf
+++ b/Missionframework/modules/99_adm/fnc/fn_adm_wipe.sqf
@@ -4,7 +4,7 @@
File: fn_adm_wipe.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-03-29
- Last Update: 2018-11-11
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -24,9 +24,9 @@
[
{
if (isServer) then {
- [] call KPLIB_fnc_adm_wipeServer;
+ [] call KPLIB_fnc_init_wipe;
} else {
- [] remoteExecCall ["KPLIB_fnc_adm_wipeServer", 2];
+ [] remoteExecCall ["KPLIB_fnc_init_wipe", 2];
};
hint localize "STR_KPLIB_DIALOG_ADMIN_WIPE_NOTE";
diff --git a/Missionframework/modules/99_adm/fnc/fn_adm_wipeServer.sqf b/Missionframework/modules/99_adm/fnc/fn_adm_wipeServer.sqf
deleted file mode 100644
index 3876295fe..000000000
--- a/Missionframework/modules/99_adm/fnc/fn_adm_wipeServer.sqf
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- KPLIB_fnc_adm_wipeServer
-
- File: fn_adm_wipeServer.sqf
- Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
- Date: 2018-11-11
- Last Update: 2018-11-11
- License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
-
- Description:
- Wipes all save data.
-
- Parameter(s):
- NONE
-
- Returns:
- Function reached the end [BOOL]
-*/
-
-// Interrupt all mission functionalities, especially the saving
-KPLIB_campaignRunning = false;
-publicVariable "KPLIB_campaignRunning";
-
-// Delete saved data
-profileNamespace setVariable [KPLIB_save_key, nil];
-saveProfileNamespace;
-diag_log "[KP LIBERATION] [IMPORTANT] Save wiped";
-
-true
diff --git a/Missionframework/modules/99_adm/functions.hpp b/Missionframework/modules/99_adm/functions.hpp
index dc634d04e..32202a081 100644
--- a/Missionframework/modules/99_adm/functions.hpp
+++ b/Missionframework/modules/99_adm/functions.hpp
@@ -4,7 +4,7 @@
File: functions.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-08-02
- Last Update: 2018-11-12
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -41,7 +41,4 @@ class adm {
// Export current campaign to admins profile and requests server to wipe the saved campaign
class adm_wipe {};
-
- // Completely wipes all data from the current campaign
- class adm_wipeServer {};
};
diff --git a/Missionframework/modules/99_plm/fnc/fn_plm_postInit.sqf b/Missionframework/modules/99_plm/fnc/fn_plm_postInit.sqf
index eee212abc..ed40441a3 100644
--- a/Missionframework/modules/99_plm/fnc/fn_plm_postInit.sqf
+++ b/Missionframework/modules/99_plm/fnc/fn_plm_postInit.sqf
@@ -4,7 +4,7 @@
File: fn_plm_postInit.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-08-31
- Last Update: 2018-11-12
+ Last Update: 2018-11-27
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
@@ -20,26 +20,40 @@
if (isServer) then {diag_log format ["[KP LIBERATION] [%1] [POST] [PLM] Module initializing...", diag_tickTime];};
-// Load settings, if available
-private _settings = profileNamespace getVariable ["KP_PLM_Settings", []];
-if !(_settings isEqualTo []) then {
- KPLIB_plm_viewFoot = _settings select 0;
- KPLIB_plm_viewVeh = _settings select 1;
- KPLIB_plm_viewAir = _settings select 2;
- KPLIB_plm_terrain = _settings select 3;
- KPLIB_plm_tpv = _settings select 4;
- KPLIB_plm_radio = _settings select 5;
- KPLIB_plm_soundVeh = _settings select 6;
-};
-
-// Add event handler
+// Player section
if (hasInterface) then {
+ // Load settings, if available
+ private _settings = profileNamespace getVariable ["KP_PLM_Settings", []];
+ if !(_settings isEqualTo []) then {
+ KPLIB_plm_viewFoot = _settings select 0;
+ KPLIB_plm_viewVeh = _settings select 1;
+ KPLIB_plm_viewAir = _settings select 2;
+ KPLIB_plm_terrain = _settings select 3;
+ KPLIB_plm_tpv = _settings select 4;
+ KPLIB_plm_radio = _settings select 5;
+ KPLIB_plm_soundVeh = _settings select 6;
+ };
+
+ // Add event handler
player addEventHandler ["GetInMan", {[] call KPLIB_fnc_plm_getInOut}];
player addEventHandler ["GetOutMan", {[] call KPLIB_fnc_plm_getInOut}];
-};
-// Apply default/loaded values
-[] call KPLIB_fnc_plm_apply;
+ // Action to open the dialog
+ private _actionArray = [
+ "" + localize "STR_KPLIB_ACTION_PLAYER_MENU" + "",
+ {[] call KPLIB_fnc_plm_openDialog;},
+ nil,
+ -803,
+ false,
+ true,
+ "",
+ '_target isEqualTo _originalTarget'
+ ];
+ [_actionArray] call CBA_fnc_addPlayerAction;
+
+ // Apply default/loaded values
+ [] call KPLIB_fnc_plm_apply;
+};
if (isServer) then {diag_log format ["[KP LIBERATION] [%1] [POST] [PLM] Module initialized", diag_tickTime];};
diff --git a/Missionframework/onPlayerRespawn.sqf b/Missionframework/onPlayerRespawn.sqf
deleted file mode 100644
index 609eead32..000000000
--- a/Missionframework/onPlayerRespawn.sqf
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- KP LIBERATION RESPAWN EVENTHANDLING FILE
-
- File: onPlayerRespawn.sqf
- Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
- Date: 2017-10-16
- Last Update: 2018-11-25
- License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
-
- Description:
- This is running everytime a player respawns and/or entering the mission.
-*/
-
-waitUntil {!isNil "KPLIB_intro_running"};
-waitUntil {!KPLIB_intro_running};
-
-// Disable stamina if selected in settings
-if !(KPLIB_param_stamina) then {
- player enableStamina false;
-};
-
-/*
- --- TODO ---
- All the actions are still available on the corpse of a player, when they die.
- In one of the upcoming tasks we need to adjust the conditions (e.g. _target == player) or plan some kind of action manager.
-*/
-
-// Add player menu action
-player addAction ["" + localize "STR_KPLIB_ACTION_PLAYER_MENU" + "", {[] call KPLIB_fnc_plm_openDialog;}, nil, -803, false, true, "", 'player == _originalTarget'];
-
-// Add admin menu action, if player is logged in Admin
-if (serverCommandAvailable "#kick") then {
- player addAction ["" + localize "STR_KPLIB_ACTION_ADMIN_MENU" + "", {[] call KPLIB_fnc_adm_openDialog;}, nil, -804, false, true, "", 'player == _originalTarget'];
-};
diff --git a/Missionframework/stringtable.xml b/Missionframework/stringtable.xml
index 6f88d08b6..7f3ad1cba 100644
--- a/Missionframework/stringtable.xml
+++ b/Missionframework/stringtable.xml
@@ -27,34 +27,35 @@
Localization contributors:
English | Updated: 2018-11-10
- KP Liberation Dev Team: https://github.com/KillahPotatoes
+ KP Liberation Dev Team - https://github.com/KillahPotatoes
Chinese Simplified | Updated: pre 0.97
- Nercon: https://github.com/nercon
+ Nercon - https://github.com/nercon
Chinese Traditional | Updated: pre 0.97
- John M. Rodriguez: https://github.com/KOEI5113
+ John M. Rodriguez - https://github.com/KOEI5113
French | Updated: pre 0.97
- zbug: https://github.com/GreuhZbug
+ zbug - https://github.com/GreuhZbug
German | Updated: 2018-11-10
- Wyqer: https://github.com/Wyqer
+ Dubjunk - https://github.com/Dubjunk
+ Wyqer - https://github.com/Wyqer
Italian | Updated: pre 0.97
- k4s0: https://github.com/k4s0
+ k4s0 - https://github.com/k4s0
Portuguese | Updated: pre 0.97
- NomadRomeo: https://github.com/NomadRomeo
+ NomadRomeo - https://github.com/NomadRomeo
Russian | Updated: pre 0.97
- _KOC_: Constantin.rogozin@ya.ru
+ _KOC_ - Constantin.rogozin@ya.ru
Spanish | Updated: pre 0.97
- regiregi22: https://github.com/regiregi22
+ regiregi22 - https://github.com/regiregi22
Turkish | Updated: pre 0.97
- Carbneth: https://github.com/Carbneth
+ Carbneth - https://github.com/Carbneth
-->
@@ -115,10 +116,6 @@
Activado
Aktif
-
- BEGIN OF OPERATION
- BEGINN DER OPERATION
-
Operation Base
Operationsbasis
@@ -584,6 +581,56 @@
+
+
+ KPLIB - Arsenal
+ KPLIB - Arsenal
+
+
+ Arsenal
+ Arsenal
+
+
+ Selection between whitelist method, blacklist method or unrestricted arsenal access.
+ Auswahl des Whitelist Methode, der Blacklist Methode oder uneingeschränkten Arsenalzugang.
+
+
+ Unrestricted
+ Uneingeschränkt
+
+
+ Blacklist Method
+ Blacklist Methode
+
+
+ Whitelist Method
+ Whitelist Methode
+
+
+ Loadout Copy Distance
+ Loadout Kopierdistanz
+
+
+ Radius in meters around the player in which other players are recognized for loadout copying.
+ Radius in Metern um den Spieler, in dem andere Spieler zum Loadout kopieren registiert werden.
+
+
+ Arsenal Type
+ Arsenal Typ
+
+
+ Used arsenal, which can be accessed through the arsenal dialog.
+ Ausgewähltes Arsenal, das über den Arsenal Dialog benutzt werden kann.
+
+
+ BI Arsenal
+ BI Arsenal
+
+
+ ACE Arsenal
+ ACE Arsenal
+
+
KPLIB - General
@@ -629,6 +676,14 @@
Enables/Disables the BI stamina system. (doesn't affect ACE Advanced Fatigue)
Aktiviert/Deaktiviert das BI Ausdauersystem. (Kein Einfluss auf die erweiterte Ausdauer von ACE)
+
+ Time Multiplier
+ Zeitbeschleunigung
+
+
+ Sets the time multiplier. Default of 4 means 6 hours in realtime for 24 hours in ingame time.
+ Legt die Zeitbeschleunigung fest. Standard von 4 bedeutet 6 Stunden Echtzeit für 24 Stunden ingame Zeit.
+
@@ -765,48 +820,6 @@
Radius in meters around the sector center a unit has to be to being able to capture the sector.
Radius in Metern vom Sektor aus, in dem sich eine Einheit befinden muss, um den Sektor zu erobern.
-
-
-
- KPLIB - Arsenal
- KPLIB - Arsenal
-
-
- Arsenal
- Arsenal
-
-
- Selection between whitelist method, blacklist method or unrestricted arsenal access.
- Auswahl des Whitelist Methode, der Blacklist Methode oder uneingeschränkten Arsenalzugang.
-
-
- Unrestricted
- Uneingeschränkt
-
-
- Blacklist Method
- Blacklist Methode
-
-
- Whitelist Method
- Whitelist Methode
-
-
- Arsenal type
- Arsenal Typ
-
-
- Used arsenal, which can be accessed through the arsenal dialog.
- Ausgewähltes Arsenal, das über den Arsenal Dialog benutzt werden kann.
-
-
- BI Arsenal
- BI Arsenal
-
-
- ACE Arsenal
- ACE Arsenal
-