diff --git a/core/functions.sqf b/core/functions.sqf
index 748315bf..cbc947f8 100644
--- a/core/functions.sqf
+++ b/core/functions.sqf
@@ -127,6 +127,24 @@ FNC_EventSpawned = {
};
+FNC_EventRespawned = {
+
+ private ["_new"];
+
+ _new = _this select 0;
+
+ if (!(_new getVariable "FW_Dead")) then {
+
+ _new call FNC_EventSpawned;
+
+ } else {
+
+ _new call FNC_UntrackUnit;
+
+ };
+
+};
+
FNC_EventDisconnect = {
private ["_unit", "_side", "_type", "_total", "_current"];
@@ -154,8 +172,6 @@ FNC_EventDisconnect = {
};
} forEach FW_Teams;
-
- deleteVehicle _unit;
};
@@ -163,24 +179,6 @@ FNC_EventDisconnect = {
};
-FNC_EventRespawned = {
-
- private ["_new"];
-
- _new = _this select 0;
-
- if (!(_new getVariable "FW_Dead")) then {
-
- _new call FNC_EventSpawned;
-
- } else {
-
- _new call FNC_UntrackUnit;
-
- };
-
-};
-
FNC_TrackUnit = {
private ["_unit"];
diff --git a/core/init.sqf b/core/init.sqf
index f8643c64..1daa7097 100644
--- a/core/init.sqf
+++ b/core/init.sqf
@@ -16,6 +16,8 @@ if (isServer) then {
FW_EventRespawnedHandle = addMissionEventHandler ["EntityRespawned", {_this call FNC_EventRespawned;}];
FW_EventKilledHandle = addMissionEventHandler ["EntityKilled", {_this call FNC_EventKilled;}];
+ FW_EventDisconnectHandle = addMissionEventHandler ["HandleDisconnect", {_this call FNC_EventDisconnect;}];
+
};
if (!isDedicated) then {
@@ -51,7 +53,7 @@ if (!isDedicated) then {
//Makes the player go into spectator mode when dead or respawn if he has respawn tickets
FW_KilledEh = player addEventHandler ["Killed", {"" spawn FNC_SpectateCheck;}];
- FW_RespawnEh = player addEventHandler ["Respawn", {"" call FNC_SpectatePrep;}];
+ FW_RespawnEh = player addEventHandler ["Respawn", {_this call FNC_SpectatePrep;}];
//Various settings
player addRating 100000; //Makes sure ai doesnt turn hostile when teamkilling
diff --git a/core/menu.sqf b/core/menu.sqf
index bae87884..7ea33050 100644
--- a/core/menu.sqf
+++ b/core/menu.sqf
@@ -9,7 +9,7 @@ The Olsen Framework is a simple framework designed for ArmA 3. It supports modul
Find out more about the framework on GitHub.
github.com/dklollol/Olsen-Framework-Arma-3
-Current Version: 3.0.6
+Current Version: 3.1.0
";
player createDiaryRecord ["FW_Menu", ["Framework Info", _info]];
diff --git a/core/preInitFunctions.sqf b/core/preInitFunctions.sqf
index cdd2a67b..5f866bb9 100644
--- a/core/preInitFunctions.sqf
+++ b/core/preInitFunctions.sqf
@@ -1,6 +1,6 @@
FW_DebugMessages = [];
-FNC_UntrackUnit = {
+FNC_NotTrackUnit = {
private ["_unit"];
diff --git a/customization/missionSettings.hpp b/customization/missionSettings.hpp
deleted file mode 100644
index ece54c6e..00000000
--- a/customization/missionSettings.hpp
+++ /dev/null
@@ -1,11 +0,0 @@
-author = "Olsen"; //Author of the mission
-loadScreen = "core\uoLogo.jpg"; //Sets the image displayed during the loading screen
-onLoadMission = "Test mission"; //Text displayed under the image during the loading screen
-
-class Header {
-
- gameType = Coop;
- minPlayers = 1;
- maxPlayers = 9; //maxPlayers must always be accurate to the amount of playable units
-
-};
\ No newline at end of file
diff --git a/description.ext b/description.ext
index 7e9cfdf9..4875f56e 100644
--- a/description.ext
+++ b/description.ext
@@ -1,7 +1,6 @@
#define description
#include "core\description.hpp" //DO NOT REMOVE
-#include "customization\missionSettings.hpp" //DO NOT REMOVE
#include "modules\modules.sqf" //DO NOT REMOVE
#undef description
@@ -32,4 +31,4 @@ class Params {
#include "core\description.hpp" //DO NOT REMOVE
#include "modules\modules.sqf" //DO NOT REMOVE
-};
\ No newline at end of file
+};
diff --git a/modules/EG_Spectator_Mode/init.sqf b/modules/EG_Spectator_Mode/init.sqf
index 76cb15f6..483f6a67 100644
--- a/modules/EG_Spectator_Mode/init.sqf
+++ b/modules/EG_Spectator_Mode/init.sqf
@@ -1,98 +1,265 @@
-["EG_Spectator_Mode", "Replaces the standard spectate script with the Vanilla Spectator script.", "BI & Perfk"] call FNC_RegisterModule;
-
-if (!isDedicated) then {
-
- FNC_SpectatePrep = {
-
- private ["_respawnName", "_respawnPoint", "_text", "_loadout"];
-
- if (FW_RespawnTickets > 0) then {
-
- _respawnName = toLower(format ["fw_%1_respawn", side player]);
- _respawnPoint = missionNamespace getVariable [_respawnName, objNull];
-
- _loadout = (player getVariable ["FW_Loadout", ""]);
-
- if (_loadout != "") then {
-
- [player, _loadout] call FNC_GearScript;
-
- };
-
- if (!isNull(_respawnPoint)) then {
-
- player setPos getPosATL _respawnPoint;
-
- };
-
- FW_RespawnTickets = FW_RespawnTickets - 1;
-
- _text = "respawns left";
-
- if (FW_RespawnTickets == 1) then {
-
- _text = "respawn left";
-
- };
-
- call BIS_fnc_VRFadeIn;
-
- cutText [format ['%1 %2', FW_RespawnTickets, _text], 'PLAIN DOWN'];
-
- player setVariable ["FW_Body", player, true];
-
+["EG Spectator Mode", "Replaces the Olsen Framework spectator script with the Vanilla Spectator.", "BI & Perfk"] call FNC_RegisterModule;
+
+#define DEBUG_MSG(MSG)\
+//systemchat MSG;\
+
+if (isDedicated) exitWith {};
+
+//function ran from keyHandler
+killcam_toggleFnc = {
+ //37 is DIK code for K
+ if ((_this select 1) == 37) then {
+ if (killcam_toggle) then {
+ killcam_toggle = false;
+ cutText ["", "PLAIN DOWN"];
+ }
+ else {
+ killcam_toggle = true;
+ cutText ["Line shows LINE OF SIGHT from postion of enemy to player's position during the time of death.\nPress K to toggle hud markers off.\n\nTHIS FRAMEWORK FEATURE IS WIP. It may contain bugs and may be updated or changed at any point.", "PLAIN DOWN"];
+ };
+ };
+};
+
+#include "settings.sqf"
+
+if (killcam_active) then {
+ DEBUG_MSG("killcam activated")
+ //hitHandler used for retrieving information if killed EH won't fire properly
+ killcam_hitHandle = player addEventHandler ["Hit", {
+ DEBUG_MSG("HIT EH")
+ if (vehicle (_this select 1) != vehicle player && (_this select 1) != objNull) then {
+ DEBUG_MSG("HIT data valid")
+ //we store this information in case it's needed if killed EH doesn't fire
+ missionNamespace setVariable ["killcam_LastHit",
+ [_this, time, ASLtoAGL eyePos (_this select 0), ASLtoAGL eyePos (_this select 1)]
+ ];
+ };
+ }];
+
+ //START OF KILLED EH///////////
+ killcam_killedHandle = player addEventHandler ["Killed", {
+ //let's remove hit EH, it's not needed
+ player removeEventHandler ["hit", killcam_hitHandle];
+
+ //we check if player didn't kill himself or died for unknown reasons
+ if (vehicle (_this select 1) != vehicle (_this select 0) && (_this select 1) != objNull) then {
+
+ //this is the standard case (killed EH got triggered by getting shot)
+ DEBUG_MSG("using killed EH")
+ killcam_unit_pos = ASLtoAGL eyePos (_this select 0);
+ killcam_killer = (_this select 1);
+ killcam_killer_pos = ASLtoAGL eyePos (_this select 1);
} else {
-
- player setVariable ["FW_Dead", true, true]; //Tells the framework the player is dead
+ //we will try to retrieve info from our hit EH
+ DEBUG_MSG("using hit EH")
+ _last_hit_info = missionNamespace getVariable ["killcam_LastHit", []];
- player setCaptive true;
- player allowdamage false;
- [player, true] remoteExec ["setCaptive", 2];
- [player, false] remoteExec ["allowdamage", 2];
-
- player call FNC_RemoveAllGear;
+ //hit info retrieved, now we check if it's not caused by fall damage etc.
+ //also we won't use info that's over 10 seconds old
+ if (count _last_hit_info != 0) then {
+ if ((_last_hit_info select 1) + 10 > time &&
+ ((_last_hit_info select 0) select 1) != objNull &&
+ ((_last_hit_info select 0) select 1) != player
+ ) then {
+ DEBUG_MSG("HIT data check successful")
+ killcam_unit_pos = _last_hit_info select 2;
+ killcam_killer = _last_hit_info select 0 select 1;
+ killcam_killer_pos = _last_hit_info select 3;
+ }
+ else {
+ DEBUG_MSG("HIT data not valid")
+ //everything failed, we set value we will detect later
+ killcam_killer_pos = [0,0,0];
+ killcam_unit_pos = ASLtoAGL eyePos (_this select 0);
+ killcam_killer = objNull;
+ };
+ }
+ else {
+ DEBUG_MSG("HIT and KILLED EHs not valid")
+ killcam_killer_pos = [0,0,0];
+ killcam_unit_pos = ASLtoAGL eyePos (_this select 0);
+ killcam_killer = objNull;
+ };
+ };
+ }];
+ //END OF KILLED EH///////////
- player addWeapon "itemMap";
+};
- player setPos [7519, 7526, 5];
- [player] join grpNull;
+FNC_SpectatePrep = {
- hideObjectGlobal player;
- player remoteExec ["hideObjectGlobal", 2];
+ private ["_respawnName", "_respawnPoint", "_text", "_loadout", "_pos", "_dir", "_cam", "_body", "_temp", "_temp1", "_killcam_msg"];
- if (!(player getVariable ["FW_Spectating", false])) then {
+ if (FW_RespawnTickets > 0) then {
- player setVariable ["FW_Spectating", true, true];
+ _respawnName = toLower(format ["fw_%1_respawn", side player]);
+ _respawnPoint = missionNamespace getVariable [_respawnName, objNull];
+ _loadout = (player getVariable ["FW_Loadout", ""]);
- [true] call acre_api_fnc_setSpectator;
+ if (_loadout != "") then {
+ [player, _loadout] call FNC_GearScript;
+ };
- call BIS_fnc_VRFadeIn;
-
- #include "settings.sqf"
+ if (!isNull(_respawnPoint)) then {
+ player setPos getPosATL _respawnPoint;
+ };
- if (getMarkerColor Spectator_Marker == "") then {
- } else {
- player setpos getmarkerpos Spectator_Marker;
- };
+ FW_RespawnTickets = FW_RespawnTickets - 1;
+ _text = "respawns left";
- ["Initialize", [player, Whitelisted_Sides, Ai_Viewed_By_Spectator, Free_Camera_Mode_Available, Third_Person_Perspective_Camera_mode_Available, Show_Focus_Info_Widget, Show_Camera_Buttons_Widget, Show_Controls_Helper_Widget, Show_Header_Widget, Show_Entities_And_Locations_Lists]] call BIS_fnc_EGSpectator;
-
- if (getMarkerColor Spectator_Marker == "") then {
- } else {
- player setPos [7519, 7526, 5];
- };
-
- "" execVM "modules\EG_Spectator_Mode\keepBreathing.sqf";
+ if (FW_RespawnTickets == 1) then {
+ _text = "respawn left";
+ };
+ call BIS_fnc_VRFadeIn;
+ cutText [format ['%1 %2', FW_RespawnTickets, _text], 'PLAIN DOWN'];
+ player setVariable ["FW_Body", player, true];
+ }
+ else {
+
+ player setVariable ["FW_Dead", true, true]; //Tells the framework the player is dead
+
+ player remoteExecCall ["hideObject", 0];
+ player remoteExecCall ["hideObjectGlobal", 2];
+
+ player setCaptive true;
+ player allowdamage false;
+ [player, true] remoteExec ["setCaptive", 2];
+ [player, false] remoteExec ["allowdamage", 2];
+
+ player call FNC_RemoveAllGear;
+ player addWeapon "itemMap";
+
+ player setPos [0, 0, 0];
+ [player] join grpNull;
+
+ if (!(player getVariable ["FW_Spectating", false])) then {
+
+ player setVariable ["FW_Spectating", true, true];
+ [true] call acre_api_fnc_setSpectator;
+ call BIS_fnc_VRFadeIn;
+
+ //we set default pos in case all methods fail and we and up with 0,0,0
+ _pos = [2000, 2000, 100];
+ _dir = 0;
+
+ //our function is called from Respawned EH, so select 1 is player's body
+ _body = (_this select 1);
+ if (getMarkerColor Spectator_Marker == "") then {
+ if (!isNull _body) then {
+ //set camera pos on player body
+ _pos = [(getpos _body) select 0, (getpos _body) select 1, ((getposATL _body) select 2)+1.2];
+ _dir = getDir _body;
+ };
} else {
+ _pos = getmarkerpos Spectator_Marker;
+ };
+
+ if (abs(_pos select 0) < 2 && abs(_pos select 1) < 2) then {
+ _pos = [2000, 2000, 100];
+ };
- call BIS_fnc_VRFadeIn;
-
+ ["Initialize",
+ [
+ player,
+ Whitelisted_Sides,
+ Ai_Viewed_By_Spectator,
+ Free_Camera_Mode_Available,
+ Third_Person_Perspective_Camera_mode_Available,
+ Show_Focus_Info_Widget,
+ Show_Camera_Buttons_Widget,
+ Show_Controls_Helper_Widget,
+ Show_Header_Widget,
+ Show_Entities_And_Locations_Lists
+ ]
+ ] call BIS_fnc_EGSpectator;
+
+ _cam = missionNamespace getVariable ["BIS_EGSpectatorCamera_camera", objNull];
+
+ if (_cam != objNull) then {
+ if (!killcam_active) then {
+ //we move 2 meters back so player's body is visible
+ _pos = ([_pos, -2, _dir] call BIS_fnc_relPos);
+ _cam setposATL _pos;
+ _cam setDir _dir;
+ }
+ else {
+ missionNamespace setVariable ["killcam_toggle", false];
+
+ //this cool piece of code adds key handler to spectator display
+ //it takes some time for display to create, so we have to delay it.
+ [{!isNull (findDisplay 60492)}, {
+ DEBUG_MSG("Display loaded, attaching key EH")
+ killcam_keyHandle = (findDisplay 60492) displayAddEventHandler ["keyDown", {call killcam_toggleFnc;}];
+ }, []] call CBA_fnc_waitUntilAndExecute;
+
+ if (!isNull killcam_killer) then {
+ DEBUG_MSG("found valid killer")
+ _pos = ([_pos, -1.8, ([(_this select 1), killcam_killer] call BIS_fnc_dirTo)] call BIS_fnc_relPos);
+ _cam setposATL _pos;
+
+ //vector magic
+ _temp1 = ([getposASL _cam, getposASL killcam_killer] call BIS_fnc_vectorFromXToY);
+ _temp = (_temp1 call CBA_fnc_vect2Polar);
+
+ //we check if camera is not pointing up, just in case
+ if (abs(_temp select 2) > 89) then {_temp set [2, 0]};
+ [_cam, [_temp select 1, _temp select 2]] call BIS_fnc_setObjectRotation;
+ }
+ else {
+ DEBUG_MSG("no valid killer")
+ _cam setposATL _pos;
+ _cam setDir _dir;
+ };
+
+ killcam_texture = "a3\ui_f\data\gui\cfg\debriefing\enddeath_ca.paa";
+
+ killcam_drawHandle = addMissionEventHandler ["Draw3D", {
+ //we don't draw hud unless we toggle it by keypress
+ if (missionNamespace getVariable ["killcam_toggle", false]) then {
+
+ if ((killcam_killer_pos select 0) != 0) then {
+
+ _u = killcam_unit_pos;
+ _k = killcam_killer_pos;
+ if ((_u distance _k) < 2000) then {
+ //TODO do it better
+ drawLine3D [[(_u select 0)+0.01, (_u select 1)+0.01, (_u select 2)+0.01], [(_k select 0)+0.01, (_k select 1)+0.01, (_k select 2)+0.01], [1,0,0,1]];
+ drawLine3D [[(_u select 0)-0.01, (_u select 1)-0.01, (_u select 2)-0.01], [(_k select 0)-0.01, (_k select 1)-0.01, (_k select 2)-0.01], [1,0,0,1]];
+ drawLine3D [[(_u select 0)-0.01, (_u select 1)+0.01, (_u select 2)-0.01], [(_k select 0)-0.01, (_k select 1)+0.01, (_k select 2)-0.01], [1,0,0,1]];
+ drawLine3D [[(_u select 0)+0.01, (_u select 1)-0.01, (_u select 2)+0.01], [(_k select 0)+0.01, (_k select 1)-0.01, (_k select 2)+0.01], [1,0,0,1]];
+ };
+ if (!isNull killcam_killer) then {
+ drawIcon3D [killcam_texture, [1,0,0,1], [eyePos killcam_killer select 0, eyePos killcam_killer select 1, (ASLtoAGL eyePos killcam_killer select 2) + 0.4], 0.7, 0.7, 0, "killer", 1, 0.04, "PuristaMedium"];
+ };
+ }
+ else {
+ cutText ["killer info unavailable", "PLAIN DOWN"];
+ missionNamespace setVariable ["killcam_toggle", false];
+ };
+ };
+ }];//draw EH
+ };//killcam (not) active
+ };//checking camera
+
+ _killcam_msg = "";
+ if (killcam_active) then {
+ _killcam_msg = "Press K to toggle indicator showing location where you were killed from.
";
};
+ _text = format ["%1Press SHIFT, ALT or SHIFT+ALT to modify camera speed. Open map by pressing M and click anywhere to move camera to that postion.
+ Spectator controls can be customized in game options->controls->'Camera' tab.", _killcam_msg];
+
+ [_text, 0.55, 0.8, 20, 1] spawn BIS_fnc_dynamicText;
+ [] spawn {
+ while {(player getVariable ["FW_Spectating", false])} do {
+ player setOxygenRemaining 1;
+ sleep 0.25;
+ };
+ };
+ } //not already spectator check
+ else {
+ call BIS_fnc_VRFadeIn;
};
-
-
-
};
-};
\ No newline at end of file
+};
diff --git a/modules/EG_Spectator_Mode/keepBreathing.sqf b/modules/EG_Spectator_Mode/keepBreathing.sqf
deleted file mode 100644
index 853ab9fb..00000000
--- a/modules/EG_Spectator_Mode/keepBreathing.sqf
+++ /dev/null
@@ -1,6 +0,0 @@
-while {(player getVariable ["FW_Spectating", false])} do {
-
- player setOxygenRemaining 1;
-
- sleep 0.25;
-};
\ No newline at end of file
diff --git a/modules/EG_Spectator_Mode/settings.sqf b/modules/EG_Spectator_Mode/settings.sqf
index 67c36044..77003158 100644
--- a/modules/EG_Spectator_Mode/settings.sqf
+++ b/modules/EG_Spectator_Mode/settings.sqf
@@ -19,4 +19,7 @@
Show_Entities_And_Locations_Lists = true;
// Define where the spectator camera starts. (add a marker with the name inside the "")
- Spectator_Marker = "SpectatorMarker";
\ No newline at end of file
+ Spectator_Marker = "";
+
+// Activate showing information about killer
+ killcam_active = true;
\ No newline at end of file
diff --git a/modules/anti_nd/init.sqf b/modules/anti_nd/init.sqf
index 34ab5870..93649528 100644
--- a/modules/anti_nd/init.sqf
+++ b/modules/anti_nd/init.sqf
@@ -33,7 +33,21 @@ if (!isDedicated) then {
if ((FW_SpawnPos distance player) <= ANTI_ND_DIST || missionNamespace getVariable ["FW_ND_Active", false]) then {
deleteVehicle _p;
- hintC "You are firing at base without approval. Cease your actions Immediately!";
+ _msg1 = "";
+ _msg2 = "";
+ if (missionNamespace getVariable ["FW_ND_Active", false]) then {
+ _msg1 = "\nTime remaining: " + str round (ANTI_ND_TIME - time) + " seconds.";
+ };
+ if ((FW_SpawnPos distance player) <= ANTI_ND_DIST) then {
+ _msg2 = "\nDistance from base: " + str round (FW_SpawnPos distance player) + " out of " + str (round ANTI_ND_DIST) + " meters.";
+ };
+ hintC format ["Anti-ND protection active!%1%2", _msg1, _msg2];
+ if ((_this select 5) call BIS_fnc_isThrowable) then {
+ player addMagazine (_this select 5);
+ }
+ else {
+ player setAmmo [currentWeapon player, (player ammo currentWeapon player) + 1];
+ };
};
}];
diff --git a/modules/anti_nd/settings.sqf b/modules/anti_nd/settings.sqf
index f2173295..e2a5f199 100644
--- a/modules/anti_nd/settings.sqf
+++ b/modules/anti_nd/settings.sqf
@@ -2,11 +2,11 @@
// You can make this work either on distance away from spawn location or time elapsed since mission start.
// Time:
// Time is recommended for defense mission.
-#define ANTI_ND_TIME 60 // in seconds.
+#define ANTI_ND_TIME 30 // in seconds.
// Distance:
// Distance is recommended for regular assault missions.
-#define ANTI_ND_DIST 200 // in meters.
+#define ANTI_ND_DIST 0 // in meters.
// If you want to disable a setting, set it to 0.
\ No newline at end of file
diff --git a/modules/disconnect_Control/init.sqf b/modules/disconnect_Control/init.sqf
new file mode 100644
index 00000000..025fd047
--- /dev/null
+++ b/modules/disconnect_Control/init.sqf
@@ -0,0 +1,28 @@
+["Disconect_Control", "Controls when player bodies should be deleted", "Olsen & Perfk"] call FNC_RegisterModule;
+
+ace_respawn_RemoveDeadBodiesDisconnected = false;
+
+if (isServer) then {
+ FW_EventDisconnectHandle_BodyCleanup = addMissionEventHandler ["HandleDisconnect", {_this call FNC_EventDisconnect_BodyCleanup;}];
+};
+
+FNC_EventDisconnect_BodyCleanup = {
+
+ private ["_unit"];
+
+ _unit = _this select 0;
+
+ if (_unit getVariable ["FW_Tracked", false]) then {
+
+
+ #include "settings.sqf"
+
+ if (time < disconnect_control_time * 60 && (side _unit) in disconnect_control_sides) then {
+
+ deleteVehicle _unit;
+
+ };
+
+ };
+
+};
\ No newline at end of file
diff --git a/modules/disconnect_Control/root.sqf b/modules/disconnect_Control/root.sqf
new file mode 100644
index 00000000..cc71188e
--- /dev/null
+++ b/modules/disconnect_Control/root.sqf
@@ -0,0 +1,5 @@
+#ifdef framework
+
+ #include "init.sqf"
+
+#endif
\ No newline at end of file
diff --git a/modules/disconnect_Control/settings.sqf b/modules/disconnect_Control/settings.sqf
new file mode 100644
index 00000000..f7e40ac5
--- /dev/null
+++ b/modules/disconnect_Control/settings.sqf
@@ -0,0 +1,5 @@
+//Time for how long disconnected players should be deleted since mission start (in minutes)
+disconnect_control_time = 2;
+
+//Sides which should have their gear deleted, none by default (example: [WEST, EAST])
+disconnect_control_sides = [WEST, EAST, INDEPENDENT, CIVILIAN];
\ No newline at end of file
diff --git a/modules/env_parameters/params.hpp b/modules/env_parameters/params.hpp
index 51d3f526..b4fd50d5 100644
--- a/modules/env_parameters/params.hpp
+++ b/modules/env_parameters/params.hpp
@@ -23,8 +23,8 @@ class Wind {
class Fog {
title = "Fog";
- texts[] = {"Mission default", "No Fog", "Slightly Foggy", "Foggy", "Very Foggy", "No Visibility"};
- values[] = {-1, 0, 2.5, 5, 7.5, 10};
+ texts[] = {"Mission default", "No Fog", "Slightly Foggy", "Foggy", "Very Foggy"};
+ values[] = {-1, 0, 1, 2, 3};
default = -1;
};
diff --git a/modules/env_parameters/preInit.sqf b/modules/env_parameters/preInit.sqf
index 7ed1a0d0..e7660211 100644
--- a/modules/env_parameters/preInit.sqf
+++ b/modules/env_parameters/preInit.sqf
@@ -1,5 +1,7 @@
["Environment / Mission Parameters", "Allows the admin to choose between different weather parameters.", "Starfox64, Olsen"] call FNC_RegisterModule;
+#include "settings.sqf"
+
if (isMultiplayer) then {
private ["_TimeOfDayParam", "_WeatherParam", "_WindParam", "_FogParam", "_date", "_overcast", "_wind", "_fog"];
@@ -48,9 +50,18 @@ if (isMultiplayer) then {
_FogParam = "Fog" call BIS_fnc_getParamValue;
if (_FogParam != -1) then {
-
- _fog = _FogParam;
- 0 setFog (_fog / 10);
+
+ if (defaultFogType) then {
+ _fog = _FogParam;
+ 0 setFog (_fog / 3.2);
+ }
+ else {
+ _fog = (fogArrays select _FogParam);
+ if (count _fog == 0) then {
+ _fog = [0,0,0];
+ };
+ 0 setFog _fog;
+ };
};
};
\ No newline at end of file
diff --git a/modules/env_parameters/settings.sqf b/modules/env_parameters/settings.sqf
new file mode 100644
index 00000000..80f07d63
--- /dev/null
+++ b/modules/env_parameters/settings.sqf
@@ -0,0 +1,8 @@
+//set it to false to use custom fogArray below
+defaultFogType = true;
+
+//https://community.bistudio.com/wiki/setFog
+//enter fog values you want into last three arrays
+//to preview a fog setting in-game execute following command through debug console: 0 setFog [1,2,3];
+//in order: no fog, light, medium, heavy
+fogArrays = [[0,0,0], [], [], []];
\ No newline at end of file
diff --git a/modules/modules.sqf b/modules/modules.sqf
index 9bb4e284..356a5d3b 100644
--- a/modules/modules.sqf
+++ b/modules/modules.sqf
@@ -5,27 +5,28 @@
//Enabled modules by default, disabled them by adding // in front.
-#include "jip\root.sqf"
+#include "anti_nd\root.sqf"
#include "auto_track_assets\root.sqf"
+#include "disconnect_control\root.sqf"
+#include "EG_Spectator_Mode\root.sqf"
#include "interact_menu_debug\root.sqf"
+#include "jip\root.sqf"
#include "start_on_safe\root.sqf"
#include "start_with_earplugs\root.sqf"
//Additional modules that can be enabled by removing the // please note that there might be settings to be tweaked inside the modules/module folder.
-//#include "radio_channel_names\root.sqf"
//#include "a3_endscreen\root.sqf"
//#include "aiskill\root.sqf"
-//#include "anti_nd\root.sqf"
//#include "ao_limit\root.sqf"
//#include "babel_setup\root.sqf"
//#include "call_mission\root.sqf"
//#include "capturezone\root.sqf"
-//#include "EG_Spectator_Mode\root.sqf"
//#include "env_parameters\root.sqf"
//#include "extract\root.sqf"
//#include "hostage\root.sqf"
//#include "marker_control\root.sqf"
+//#include "radio_channel_names\root.sqf"
//#include "radio_scrambler\root.sqf"
//#include "setup_timer\root.sqf"
//#include "start_in_parachute\root.sqf"
diff --git a/readme.txt b/readme.txt
new file mode 100644
index 00000000..f90b9959
--- /dev/null
+++ b/readme.txt
@@ -0,0 +1,409 @@
+Framework Version: 3.1.0
+
+For information on how to make a mission please visit:
+https://github.com/dklollol/Olsen-Framework-Arma-3/wiki/Making-your-first-mission
+
+
+
+Functions documentation:
+ This section documents all public functions.
+
+
+FNC_InArea
+
+ Description:
+ Checks if unit is within area of marker, supports all shapes
+
+ Parameters:
+ - unit [object]
+ - name of marker [string]
+
+ Returns:
+ is unit in marker [bool]
+
+ Example:
+ [player, "minefield"] call FNC_InArea
+
+ Result:
+ true/false depending on unit's position
+ Returned: true/false [bool]
+
+
+FNC_AreaCount
+
+ Description:
+ Counts units on set side in area of set diameter around object.
+
+ Parameters:
+ - side [side]
+ - radius [number]
+ - center of area [object]
+
+ Returns:
+ amount of units in area [number]
+
+ Example:
+ [WEST, 100, base] call FNC_AreaCount
+
+ Result:
+ units in set area are counted
+ Returned: 10
+
+
+FNC_EndMission
+
+ Description:
+ Ends mission in orderly fashion and displays end screen.
+
+ Parameters:
+ - text to display in end screen [string]
+
+ Returns:
+ nothing
+
+ Example:
+ "USMC Victory" call FNC_EndMission
+
+ Result:
+ mission is ended and above message is displayed on end screen
+ Returned: nothing
+
+
+FNC_CasualtyPercentage
+
+ Description:
+ Returns casualty percentage for set team
+
+ Parameters:
+ - team [string]
+
+ Returns:
+ casualty percentage (1-100) [number]
+
+ Example:
+ "USMC" call FNC_CasualtyPercentage
+ Result:
+ casualty percentage for USMC is returned
+ Returned: 70 [number]
+
+
+FNC_CasualtyCount
+
+ Description:
+ Counts number of casualties on set team
+
+ Parameters:
+ - team [string]
+
+ Returns:
+ casualty count [number]
+
+ Example:
+ "USMC" call FNC_CasualtyCount
+
+ Result:
+ number of casualties for USMC is returned
+ Returned: 10 [number]
+
+
+FNC_Alive
+
+ Description:
+ Checks if unit is considered alive by framework
+
+ Parameters:
+ - unit [object]
+
+ Returns:
+ unit's state [bool]
+
+ Example:
+ player call FNC_Alive
+
+ Result:
+ player's state is returned
+ Returned: true [bool]
+
+
+FNC_HasEmptyPositions
+
+ Description:
+ checks if vehicle has available positions
+
+ Parameters:
+ - vehicle [object]
+
+ Returns:
+ empty positions [bool]
+
+ Example:
+ (vehicle player) call FNC_HasEmptyPositions
+
+ Result:
+ player's vehicle has no free positions
+ Returned: false [bool]
+
+
+FNC_InVehicle
+
+ Description:
+ Checks if unit is in a vehicle
+
+ Parameters:
+ - unit [object]
+
+ Returns:
+ is unit in a vehicle [bool]
+
+ Example:
+ player call FNC_InVehicle
+
+ Result:
+ yep
+ Returned: true [bool]
+
+
+FNC_AddTeam
+
+ Description:
+ Adds team
+
+ Parameters:
+ - side of new team [side]
+ - name of new team [string]
+ - type of new team: "ai"/"player" [string]
+ Returns:
+ nothing
+
+ Example:
+ [WEST, "NATO", "player"] call FNC_AddTeam
+
+ Result:
+ new team is created
+ Returned: nothing
+
+
+FNC_NotTrackUnit
+
+ Description:
+ Disable tracking of unit by framework
+
+ Parameters:
+ - unit [object]
+
+ Returns:
+ nothing
+
+ Example:
+ player call FNC_NotTrackUnit
+
+ Result:
+ player is not tracked by framework
+ Returned: nothing
+
+
+FNC_DebugMessage
+
+ Description:
+ Display on-screen debug message.
+
+ Parameters:
+ - message [string]
+
+ Returns:
+ nothing
+
+ Example:
+ "Hello World" call FNC_DebugMessage
+
+ Result:
+ debug message displayed
+ Returned: nothing
+
+
+FNC_TrackAsset
+
+ Description:
+ Sets asset to be tracked by framework
+
+ Parameters:
+ - asset [object]
+ - name of asset [string]
+ - team of asset [string]
+
+ Returns:
+ nothing
+
+ Example:
+ [tank, "T90", "VDV"] call FNC_TrackAsset
+
+ Result:
+ Asset is tracked
+ Returned: nothing
+
+
+FNC_RemoveAllGear
+
+ Description:
+ Removes all gear from unit.
+
+ Parameters:
+ - unit [object]
+
+ Returns:
+ nothing
+
+ Example:
+ player call FNC_RemoveAllGear
+
+ Result:
+ player's gear removed
+ Returned: nothing
+
+
+FNC_RemoveAllVehicleGear
+
+ Description:
+ Clear cargo of a vehicle.
+
+ Parameters:
+ - vehicle [object]
+
+ Returns:
+ nothing
+
+ Example:
+ tank call FNC_RemoveAllVehicleGear
+
+ Result:
+ tank's cargo cleared
+ Returned: nothing
+
+
+FNC_GearScript
+
+ Description:
+ Run gearscript on set unit.
+
+ Parameters:
+ - unit to run gearscript for [object]
+ - loadout name [string]
+ - group name [string] (OPTIONAL)
+
+ Returns:
+ nothing
+
+ Example:
+ [this, "SL", "1'1"] call FNC_GearScript
+
+ Result:
+ Add SL loadout to unit, set it's group name to 1'1.
+ Returned: nothing
+
+
+FNC_VehicleGearScript
+
+ Description:
+ Add set loadout to vehicle.
+
+ Parameters:
+ - vehicle [object]
+ - loadout type [string]
+
+ Returns:
+ nothing
+
+ Example:
+ [this, "HUMMVEE"] call FNC_VehicleGearScript
+
+ Result:
+ Vehicle receives HUMVEE loadout.
+ Returned: nothing
+
+
+FNC_AddItem
+
+ Description:
+ Add item to local unit. Can specify container and amount.
+
+ Parameters:
+ - classname of item [string]
+ - amount of item to add [number] (OPTIONAL)
+ - container name "uniform"/"vest"/"backpack" available [string] (OPTIONAL)
+
+ Returns:
+ nothing
+
+ Example:
+ ["ItemMap", 1, "uniform"] call FNC_AddItem;
+
+ Result:
+ Map added to uniform.
+ Returned: nothing
+
+
+FNC_AddItemRandom
+
+ Description:
+ Add item random to local unit. Can specify container and amount.
+ For more info, visit https://github.com/dklollol/Olsen-Framework-Arma-3/wiki/gear.sqf
+
+ Parameters:
+ n/a
+
+ Returns:
+ nothing
+
+ Example:
+ n/a
+
+ Result:
+ n/a
+
+
+FNC_AddItemVehicle
+
+ Description:
+ Add item to vehicle's cargo.
+
+ Parameters:
+ - classname of item [string]
+ - amount [number] (OPTIONAL)
+
+ Returns:
+ nothing
+
+ Example:
+ ["30Rnd_556x45_Stanag", 8] call FNC_AddItemVehicle
+
+ Result:
+ 8 STANAGS added to vehicle inventory.
+
+
+FNC_AddItemVehicleRandom
+
+ Description:
+ Add random item to vehicle's cargo.
+
+ Parameters:
+ n/a
+
+ Returns:
+ nothing
+
+ Example:
+ n/a
+
+ Result:
+ n/a
+
+
+
+Internal gearscript's functions:
+FNC_CanLinkItem
+FNC_CanAttachItem
+FNC_AddItemOrg
+FNC_AddItemRandomOrg
+FNC_AddItemVehicleOrg
+FNC_AddItemVehicleRandomOrg
+FNC_Chance