From bb0bcd198b82fc4f179915e7ce62548f6b9534fa Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Tue, 31 Dec 2024 21:12:32 +0000
Subject: [PATCH 01/81] systems respawn support
---
description.ext | 42 +++++++++++++++++---------------
f/assignGear/fn_assignGear.sqf | 19 ++++++++++++---
f/functions.hpp | 5 ++++
f/respawn/fn_respawn.sqf | 3 +++
f/spect/fn_activateSpectator.sqf | 22 +++++++++++------
5 files changed, 61 insertions(+), 30 deletions(-)
create mode 100644 f/respawn/fn_respawn.sqf
diff --git a/description.ext b/description.ext
index 1a99b15b..ab6e19ab 100644
--- a/description.ext
+++ b/description.ext
@@ -28,9 +28,30 @@ minPlayerDistance = 500; // The minimum distance between corpse or wreck and nea
// FA3 - Respawn Settings
respawn = 1;
-respawndelay = 3;
+respawndelay = 30;
respawnOnStart = 0;
-respawnTemplates[] = {"F_Spectator"};
+respawnTemplates[] = {"F_Respawn","Base", "Tickets"};
+
+// ============================================================================================
+
+// FA3 - Respawn templates
+// DO NOT REMOVE OR DISABLE THIS BLOCK OF CODE
+
+
+// ============================================================================================
+class CfgRespawnTemplates
+{
+ class F_Respawn
+ {
+ onPlayerRespawn = "f_fnc_respawn";
+ onPlayerKilled = "f_fnc_activateSpectator";
+ };
+ class F_Spectator
+ {
+ onPlayerRespawn = "f_fnc_activateSpectator";
+ };
+};
+
// ============================================================================================
@@ -357,23 +378,6 @@ class CfgDebriefing
};
-
-
-// ============================================================================================
-
-// FA3 - Respawn templates
-// DO NOT REMOVE OR DISABLE THIS BLOCK OF CODE
-
-
-// ============================================================================================
-class CfgRespawnTemplates
-{
- class F_Spectator
- {
- onPlayerRespawn = "f\spect\fn_activateSpectator.sqf";
- };
-};
-
// ============================================================================================
// FA3 - Functions
diff --git a/f/assignGear/fn_assignGear.sqf b/f/assignGear/fn_assignGear.sqf
index 430b1d1a..66e93a1d 100644
--- a/f/assignGear/fn_assignGear.sqf
+++ b/f/assignGear/fn_assignGear.sqf
@@ -7,7 +7,9 @@
// The following interprets what has been passed to this script
params[
["_typeofUnit", "", [""]],
- ["_unit", objNull, [objNull]]
+ ["_unit", objNull, [objNull]],
+ ["_faction", ""],
+ ["_isRespawn",false]
];
private _isMan = _unit isKindOf "CAManBase"; // We check if we're dealing with a soldier or a vehicle
_typeofUnit = toLower _typeofUnit; // Tidy input for SWITCH/CASE statements, expecting something like : r = Rifleman, co = Commanding Officer, rat = Rifleman (AT)
@@ -18,8 +20,9 @@ _typeofUnit = toLower _typeofUnit; // Tidy input for SWITCH/CASE statements, exp
// The following code detects what faction the unit's slot belongs to, and stores
// it in the private variable _faction. It can also be passed as an optional parameter.
-private _faction = toLower (param[2, ([_unit] call f_fnc_virtualFaction)]);
-
+if (_faction = "") then {
+ _faction = toLower ([_unit] call f_fnc_virtualFaction);
+};
// ====================================================================================
// INSIGNIA
@@ -56,6 +59,7 @@ if !(local _unit) exitWith {};
// A public variable is set on the unit, indicating their type. This is mostly relevant for the FA3 respawn component
_unit setVariable ["f_var_assignGear",_typeofUnit,true];
+_unit setVariable ["f_var_assignGearFaction",_faction,true];
// ====================================================================================
@@ -279,6 +283,13 @@ if (_isMan) then {
};
+if !_isRespawn then {
+ _unit addEventHandler ["Respawned", {
+ params ["_unit", "_corpse"];
+ [_unit, _unit getVariable ["f_var_assignGear","r"], _unit getVariable ["f_var_assignGearFaction", toLower [_unit] call f_fnc_virtualFaction]] call f_fnc_assignGear;
+ }];
+};
+
// ====================================================================================
// This variable simply tracks the progress of the gear assignation process, for other
@@ -299,4 +310,4 @@ if (isNil "_carbine") then { //_carbine should exist unless no faction has been
};
};
-// ====================================================================================
+// ====================================================================================
\ No newline at end of file
diff --git a/f/functions.hpp b/f/functions.hpp
index c1e5e2fd..cee7d4e4 100644
--- a/f/functions.hpp
+++ b/f/functions.hpp
@@ -83,6 +83,11 @@ class F // Defines the "owner"
class mapClickTeleportRemoveAction{};
class mapClickTeleportBriefing{};
};
+ class respawn
+ {
+ file = "f\respawn";
+ class respawn{};
+ };
class nametag
{
file = "f\nametag\functions";
diff --git a/f/respawn/fn_respawn.sqf b/f/respawn/fn_respawn.sqf
new file mode 100644
index 00000000..d00e0473
--- /dev/null
+++ b/f/respawn/fn_respawn.sqf
@@ -0,0 +1,3 @@
+[side group player, -1] call BIS_fnc_respawnTickets;
+
+call f_fnc_terminateSpectator;
diff --git a/f/spect/fn_activateSpectator.sqf b/f/spect/fn_activateSpectator.sqf
index d64b86d5..2d68cd4c 100644
--- a/f/spect/fn_activateSpectator.sqf
+++ b/f/spect/fn_activateSpectator.sqf
@@ -1,8 +1,10 @@
// FA3 - Spectator component
if (f_param_debugMode == 1) then {
- diag_log "activating spectator";
+ diag_log "FA3 Spectator: activating spectator";
};
+params ["_oldUnit", "_killer", "_respawn", "_respawnDelay",["_isFullSpectator",false]];
+
// 'Cinematic' delay before spectator activates
sleep 3;
@@ -11,13 +13,19 @@ sleep 3;
waitUntil {missionnamespace getvariable ["BIS_fnc_feedback_allowDeathScreen", true]};
BIS_fnc_feedback_allowPP = false;
-// Create a new (alive) unit to prevent draw3D bug with floating head tags
-// Credit to SilentSpike: https://github.com/acemod/ACE3/pull/5868
-private _cameraUnit = (createGroup sideLogic) createUnit ["VirtualMan_F", player, [], 0, "NONE"];
-_cameraUnit enableSimulation false;
-selectPlayer _cameraUnit;
+if (_isFullSpectator) then {
+ // Create a new (alive) unit to prevent draw3D bug with floating head tags
+ // Credit to SilentSpike: https://github.com/acemod/ACE3/pull/5868
+ private _cameraUnit = (createGroup sideLogic) createUnit ["VirtualMan_F", player, [], 0, "NONE"];
+ _cameraUnit enableSimulation false;
+ selectPlayer _cameraUnit;
-["Initialize", [player, [], true, true, true, false, true, true, true, true]] call BIS_fnc_EGSpectator;
+ ["Initialize", [player, [], true, true, true, false, true, true, true, true]] call BIS_fnc_EGSpectator;
+
+} else {
+ ["Initialize", [player, [side group player], false, false, false, false, false, true, true, true]] call BIS_fnc_EGSpectator;
+
+};
// Disable direct chat to prevent ghosts interacting with the living
5 enableChannel false;
\ No newline at end of file
From 5910cdcadde1dd6b501169c0e8caec4e2ea91b97 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Tue, 31 Dec 2024 22:34:49 +0000
Subject: [PATCH 02/81] systems respawn support 2
---
description.ext | 17 ++++++++-
f/respawn/fn_respawn.sqf | 13 +++++++
f/respawn/fn_respawnBeaconAction.sqf | 51 ++++++++++++++++++++++++++
f/respawn/fn_respawnBeaconDeploy.sqf | 43 ++++++++++++++++++++++
f/respawn/fn_respawnBeaconTeleport.sqf | 15 ++++++++
f/respawn/fn_respawnTerminalAction.sqf | 23 ++++++++++++
f/spect/fn_activateSpectator.sqf | 2 +-
init.sqf | 11 ++++++
8 files changed, 172 insertions(+), 3 deletions(-)
create mode 100644 f/respawn/fn_respawnBeaconAction.sqf
create mode 100644 f/respawn/fn_respawnBeaconDeploy.sqf
create mode 100644 f/respawn/fn_respawnBeaconTeleport.sqf
create mode 100644 f/respawn/fn_respawnTerminalAction.sqf
diff --git a/description.ext b/description.ext
index ab6e19ab..c5598f9c 100644
--- a/description.ext
+++ b/description.ext
@@ -28,8 +28,8 @@ minPlayerDistance = 500; // The minimum distance between corpse or wreck and nea
// FA3 - Respawn Settings
respawn = 1;
-respawndelay = 30;
-respawnOnStart = 0;
+respawndelay = -1;
+respawnOnStart = -1;
respawnTemplates[] = {"F_Respawn","Base", "Tickets"};
// ============================================================================================
@@ -43,6 +43,8 @@ class CfgRespawnTemplates
{
class F_Respawn
{
+ respawnDelay = 30;
+ respawn = 3;
onPlayerRespawn = "f_fnc_respawn";
onPlayerKilled = "f_fnc_activateSpectator";
};
@@ -290,6 +292,17 @@ class Params
default = 0;
};
+// FA3 - Respawn Tickets Parameters
+// Credits and documentation: https://github.com/folkarps/F3/wiki
+
+ class f_param_respawnTickets
+ {
+ title = "Respawn tickets per side";
+ values[] = {0,10,25,50,2000};
+ texts[] = {"None", "10", "25", "50", "2000"};
+ default = 10;
+ };
+
// ============================================================================================
// FA3 - Caching
diff --git a/f/respawn/fn_respawn.sqf b/f/respawn/fn_respawn.sqf
index d00e0473..4ba69d25 100644
--- a/f/respawn/fn_respawn.sqf
+++ b/f/respawn/fn_respawn.sqf
@@ -1,3 +1,16 @@
[side group player, -1] call BIS_fnc_respawnTickets;
call f_fnc_terminateSpectator;
+
+private _newTickets = [side group player] call BIS_fnc_respawnTickets;
+private _respawnText = format ["FA3: [%1] %2 respawned, %3 tickets remaining", side group player, name player, _newTickets];
+[_respawnText] remoteExec ["systemChat"];
+
+player allowDamage false;
+player setPosASL getPosASL f_respawnBase;
+
+waitUntil {
+ sleep 2;
+ (player distance f_respawnBase) > 100;
+};
+player allowDamage true;
\ No newline at end of file
diff --git a/f/respawn/fn_respawnBeaconAction.sqf b/f/respawn/fn_respawnBeaconAction.sqf
new file mode 100644
index 00000000..e5f53514
--- /dev/null
+++ b/f/respawn/fn_respawnBeaconAction.sqf
@@ -0,0 +1,51 @@
+params [["_respawned",false]];
+
+// Don't add the action if it's already got one
+if (player getVariable ["f_var_hasRespawnBeaconAction",false] && !_respawned) exitWith { diag_log "FA3 Respawn: tried to add beacon action on something that already has it"};
+
+// Add the action
+[
+ player,
+ "Deploy respawn beacon (destroys others!)",
+ "a3\ui_f_oldman\data\igui\cfg\holdactions\meet_ca.paa",
+ "a3\ui_f_oldman\data\igui\cfg\holdactions\meet_ca.paa",
+ "(isNull objectParent _this) && {(_target == _this) && {leader _this == _this}}",
+ "(isNull objectParent _this) && {(_target == _this) && {leader _this == _this}}",
+ {
+ private _text = format ["[%1] %2 is deploying a respawn beacon.", str side group _caller, name _caller];
+ [_text] remoteExec ["systemChat"];
+ },
+ {},
+ {
+ private _text = format ["[%1] %2 deployed a respawn beacon.", str side group _caller, name _caller];
+ _caller call f_fnc_respawnBeaconDeploy;
+ },
+ {},
+ [],
+ 10,
+ 0,
+ false,
+ false,
+ false
+] call BIS_fnc_holdActionAdd;
+
+// If this is a respawn then we don't need anything else
+if _respawned exitWith {};
+
+player addEventHandler ["Respawn", {
+ true call f_fnc_respawnBeaconAction;
+}];
+
+// Add the variable to prove it's already done
+player setVariable ["f_var_hasRespawnBeaconAction",true];
+
+// Add an event handler to the server that can catch JIP/reslots
+if isServer then {
+ addMissionEventHandler ["PlayerConnected",
+ {
+ params ["_id", "_uid", "_name", "_jip", "_owner", "_idstr"];
+ if (_jip) then {
+ [] remoteExec ["f_fnc_respawnBeaconAction",_owner];
+ };
+ }];
+};
\ No newline at end of file
diff --git a/f/respawn/fn_respawnBeaconDeploy.sqf b/f/respawn/fn_respawnBeaconDeploy.sqf
new file mode 100644
index 00000000..3712297a
--- /dev/null
+++ b/f/respawn/fn_respawnBeaconDeploy.sqf
@@ -0,0 +1,43 @@
+params ["_caller"];
+
+_caller playActionNow "PutDown";
+
+// Check 3 possible positions
+{
+ // Aim about waist height
+ private _position = _caller modelToWorldWorld [0,1.5,0.8];
+ private _positionATL = ASLtoATL _position;
+ private _heightATL = _positionATL select 2;
+ // Can't place flag below terrain
+ if (_heightATL < -2.5) then { continue };
+ // If it's not too far below terrain, adjust up
+ if (_heightATL < 0.1) then {
+ _position = _position vectorAdd [0,0, - _heightATL];
+ };
+ // Determine whether a valid surface is within vertical range
+ private _intersects = lineIntersectsSurfaces [_position, _position vectorAdd [0,0,-2.5], _caller, objNull, true, 1, "GEOM"];
+ if (count _intersects > 0) then {
+ private _intersection = _intersects select 0;
+ // Can't place on or in vehicles
+ if (["Air","LandVehicle","Ship"] findIf {(_intersection select 2) isKindOf _x} > -1) then { continue };
+
+ _position = _intersection select 0;
+ private _beacon = createSimpleObject ["OmniDirectionalAntenna_01_olive_F", [0,0,0], [], 0, "CAN_COLLIDE"];
+ [_beacon, false] remoteExec ["setPhysicsCollisionFlag",0,true];
+ _beacon setPosASL _position;
+
+ playSound3D ["A3\Sounds_F_AoW\SFX\Showcase_Future\place_flag.wss",_flag,false,_position, 2, 1, 25];
+ _beacon setVectorUp [0,0,1];
+ _beacon setDir (getDir _caller - 90);
+
+ private _smoke = "SmokeShellRed_Infinite" createVehicle [0,0,0];
+ _smoke attachTo [_beacon,[0,0,0.2]];
+
+ // If we got this far we can skip any remaining positions
+ private _varName = format ["f_var_respawnBeacon_%1", str side group _caller];
+ private _oldBeacon = missionNamespace getVariable [_varName, objNull];
+ deleteVehicle (attachedObjects _oldBeacon) pushback _oldBeacon;
+ missionNamespace setVariable [_varName, _beacon, true];
+ break;
+ };
+} forEach [[0,1.5,0.8],[0,0.75,0.8],[0,0.1,0.1]];
\ No newline at end of file
diff --git a/f/respawn/fn_respawnBeaconTeleport.sqf b/f/respawn/fn_respawnBeaconTeleport.sqf
new file mode 100644
index 00000000..91eef63c
--- /dev/null
+++ b/f/respawn/fn_respawnBeaconTeleport.sqf
@@ -0,0 +1,15 @@
+params ["_caller"];
+
+private _sideString = str side group _caller;
+
+private _varName = format ["f_var_respawnBeacon_%1", _sideString];
+private _respawnBeacon = missionNamespace getVariable [_varname, objNull];
+
+if (isNull _varName) exitWith {
+ systemChat format ["[%1] No available respawn beacon for your side.", _sideString];
+};
+
+private _text = format ["[%1] %2 is deploying to the respawn beacon.", _sideString, name _caller];
+
+private _pos = (getPosASL _respawnBeacon) vectorAdd [0.5,0,0];
+_caller setPosASL _pos;
\ No newline at end of file
diff --git a/f/respawn/fn_respawnTerminalAction.sqf b/f/respawn/fn_respawnTerminalAction.sqf
new file mode 100644
index 00000000..30da6866
--- /dev/null
+++ b/f/respawn/fn_respawnTerminalAction.sqf
@@ -0,0 +1,23 @@
+[
+ f_respawnTerminal,
+ "Deploy to side respawn beacon",
+ "a3\ui_f_oldman\data\igui\cfg\holdactions\meet_ca.paa",
+ "a3\ui_f_oldman\data\igui\cfg\holdactions\meet_ca.paa",
+ "isNull objectParent _this",
+ "(isNull objectParent _this",
+ {
+ private _text = format ["[%1] Searching for valid respawn beacon...", str side group _caller];
+ systemChat _text;
+ },
+ {},
+ {
+ _caller call f_fnc_respawnBeaconTeleport;
+ },
+ {},
+ [],
+ 2,
+ 0,
+ false,
+ false,
+ true
+] call BIS_fnc_holdActionAdd;
\ No newline at end of file
diff --git a/f/spect/fn_activateSpectator.sqf b/f/spect/fn_activateSpectator.sqf
index 2d68cd4c..4cbc0a59 100644
--- a/f/spect/fn_activateSpectator.sqf
+++ b/f/spect/fn_activateSpectator.sqf
@@ -13,7 +13,7 @@ sleep 3;
waitUntil {missionnamespace getvariable ["BIS_fnc_feedback_allowDeathScreen", true]};
BIS_fnc_feedback_allowPP = false;
-if (_isFullSpectator) then {
+if (_isFullSpectator or (([player] call BIS_fnc_respawnTickets) < 1)) then {
// Create a new (alive) unit to prevent draw3D bug with floating head tags
// Credit to SilentSpike: https://github.com/acemod/ACE3/pull/5868
private _cameraUnit = (createGroup sideLogic) createUnit ["VirtualMan_F", player, [], 0, "NONE"];
diff --git a/init.sqf b/init.sqf
index d7301774..50416920 100644
--- a/init.sqf
+++ b/init.sqf
@@ -172,6 +172,17 @@ f_var_viewDistance_crewOnly = true;
// ====================================================================================
+// FA3 - Respawn
+// Credits and documentation: https://github.com/folkarps/F3/wiki
+if isServer then {
+ {
+ [_x, f_param_respawnTickets] call BIS_fnc_respawnTickets;
+ } forEach [east, west, independent, civilian];
+};
+player call f_fnc_respawnBeaconAction;
+
+// ====================================================================================
+
// FA3 - Skulls
// Credits and documentation: https://github.com/folkarps/F3/wiki
From bdf397ae58d78bbd6952154f7d273b0d9539c53e Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Tue, 31 Dec 2024 22:55:58 +0000
Subject: [PATCH 03/81] systems respawn support 3
---
f/respawn/fn_respawnBeaconAction.sqf | 5 +++-
f/respawn/fn_respawnTerminalAction.sqf | 36 +++++++++++++++++++++++++-
f/spect/fn_activateSpectator.sqf | 4 +--
3 files changed, 41 insertions(+), 4 deletions(-)
diff --git a/f/respawn/fn_respawnBeaconAction.sqf b/f/respawn/fn_respawnBeaconAction.sqf
index e5f53514..4c7a77cb 100644
--- a/f/respawn/fn_respawnBeaconAction.sqf
+++ b/f/respawn/fn_respawnBeaconAction.sqf
@@ -12,6 +12,7 @@ if (player getVariable ["f_var_hasRespawnBeaconAction",false] && !_respawned) ex
"(isNull objectParent _this) && {(_target == _this) && {leader _this == _this}}",
"(isNull objectParent _this) && {(_target == _this) && {leader _this == _this}}",
{
+ _caller playActionNow "MedicOther";
private _text = format ["[%1] %2 is deploying a respawn beacon.", str side group _caller, name _caller];
[_text] remoteExec ["systemChat"];
},
@@ -20,7 +21,9 @@ if (player getVariable ["f_var_hasRespawnBeaconAction",false] && !_respawned) ex
private _text = format ["[%1] %2 deployed a respawn beacon.", str side group _caller, name _caller];
_caller call f_fnc_respawnBeaconDeploy;
},
- {},
+ {
+ _caller playActionNow "MedicStop";
+ },
[],
10,
0,
diff --git a/f/respawn/fn_respawnTerminalAction.sqf b/f/respawn/fn_respawnTerminalAction.sqf
index 30da6866..b0af0b63 100644
--- a/f/respawn/fn_respawnTerminalAction.sqf
+++ b/f/respawn/fn_respawnTerminalAction.sqf
@@ -4,7 +4,7 @@
"a3\ui_f_oldman\data\igui\cfg\holdactions\meet_ca.paa",
"a3\ui_f_oldman\data\igui\cfg\holdactions\meet_ca.paa",
"isNull objectParent _this",
- "(isNull objectParent _this",
+ "isNull objectParent _this",
{
private _text = format ["[%1] Searching for valid respawn beacon...", str side group _caller];
systemChat _text;
@@ -20,4 +20,38 @@
false,
false,
true
+] call BIS_fnc_holdActionAdd;
+
+
+[
+ f_respawnTerminal,
+ "Spectate your team",
+ "a3\ui_f\data\igui\cfg\holdactions\holdaction_search_ca.paa",
+ "a3\ui_f\data\igui\cfg\holdactions\holdaction_search_ca.paa",
+ "isNull objectParent _this",
+ "isNull objectParent _this",
+ {
+ private _text = format ["[%1] Press ESC to exit spectator.", str side group _caller];
+ systemChat _text;
+ },
+ {},
+ {
+ private _text = format ["[%1] Press ESC to exit spectator.", str side group _caller];
+ systemChat _text;
+ 0 call f_fnc_activateSpectator;
+ (findDisplay 46) displayAddEventHandler ["keyDown",{
+ params ["", "_key"];
+ if (_key == 1) then {
+ call f_fnc_terminateSpectator;
+ (findDisplay 46) displayRemoveEventHandler _thisEventHandler;
+ };
+ }];
+ },
+ {},
+ [],
+ 2,
+ 0,
+ false,
+ false,
+ true
] call BIS_fnc_holdActionAdd;
\ No newline at end of file
diff --git a/f/spect/fn_activateSpectator.sqf b/f/spect/fn_activateSpectator.sqf
index 4cbc0a59..65f6031a 100644
--- a/f/spect/fn_activateSpectator.sqf
+++ b/f/spect/fn_activateSpectator.sqf
@@ -3,7 +3,7 @@ if (f_param_debugMode == 1) then {
diag_log "FA3 Spectator: activating spectator";
};
-params ["_oldUnit", "_killer", "_respawn", "_respawnDelay",["_isFullSpectator",false]];
+params [["",""],["",""],["",""],["",""],["_isFullSpectator",false]];
// 'Cinematic' delay before spectator activates
sleep 3;
@@ -13,7 +13,7 @@ sleep 3;
waitUntil {missionnamespace getvariable ["BIS_fnc_feedback_allowDeathScreen", true]};
BIS_fnc_feedback_allowPP = false;
-if (_isFullSpectator or (([player] call BIS_fnc_respawnTickets) < 1)) then {
+if (_isFullSpectator or (!(alive player) && ([side group player] call BIS_fnc_respawnTickets) < 1)) then {
// Create a new (alive) unit to prevent draw3D bug with floating head tags
// Credit to SilentSpike: https://github.com/acemod/ACE3/pull/5868
private _cameraUnit = (createGroup sideLogic) createUnit ["VirtualMan_F", player, [], 0, "NONE"];
From d9fa57698692e3f58c3c1fec47e424cabf4254c2 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Tue, 31 Dec 2024 23:46:44 +0000
Subject: [PATCH 04/81] medical respawn handling and prevent death
---
f/medical/fn_famDamageHandler.sqf | 6 ++++++
f/medical/fn_famEH.sqf | 17 ++++++++++++++---
f/medical/fn_famInit.sqf | 2 +-
f/medical/fn_famLoop.sqf | 2 +-
4 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/f/medical/fn_famDamageHandler.sqf b/f/medical/fn_famDamageHandler.sqf
index a94de9ba..f0d998f0 100644
--- a/f/medical/fn_famDamageHandler.sqf
+++ b/f/medical/fn_famDamageHandler.sqf
@@ -59,6 +59,12 @@ if (vehicle _unit isKindof "Air" && {driver vehicle _unit == _unit}) then {
};
_newDamage = _currentDamage + _newHit;
+// Prevent outright death
+if (_newDamage > 0.95) then {
+ _newDamage = 0.95;
+ _unit setVariable ["f_var_fam_forcedown",true];
+ _unit setVariable ["f_var_fam_forcedownparams",[_source,_selection,_projectile]];
+};
// Down you on a big hit.
if (_selection != "" && {!(_selection in ["hands","arms"]) && {_hitSize > 2 || {_hitSize > 1 && random 2 > 1}}}) then {
diff --git a/f/medical/fn_famEH.sqf b/f/medical/fn_famEH.sqf
index 7014fc7a..b803a190 100644
--- a/f/medical/fn_famEH.sqf
+++ b/f/medical/fn_famEH.sqf
@@ -6,7 +6,7 @@ params ["_unit"];
// ====================================================================================
// When they die
-_ehKilled = _unit addEventHandler ["Killed", {
+private _ehKilled = _unit addEventHandler ["Killed", {
params ["_unit"];
// EXIT
// This occurs after death, make sure that none of the wounded affects carry over.
@@ -32,7 +32,7 @@ _ehKilled = _unit addEventHandler ["Killed", {
// ====================================================================================
// Treatment Feedback
-_ehHeal = _unit addEventHandler ["HandleHeal", {
+private _ehHeal = _unit addEventHandler ["HandleHeal", {
// notification correction for self FAK usage.
params ["_injured", "_healer"];
@@ -56,10 +56,21 @@ _ehHeal = _unit addEventHandler ["HandleHeal", {
}];
+// ====================================================================================
+// Respawn handling
+private _ehRespawn = _unit addEventHandler ["Respawn", {
+ params ["_unit"];
+ if !(local _unit) exitWith {};
+ if !(_unit isKindOf "VirtualMan_F") then {
+ _unit setVariable ["f_var_fam_actions",false,true];
+ [_unit] spawn f_fnc_famLoop;
+ [_unit] remoteExec ["f_fnc_famAddAllActions", 0, ("f_jip_famAddAllActions" + netId _unit)];
+ };
+}];
// ====================================================================================
waitUntil {sleep 0.1; f_param_mission_timer <= 0}; // need to wait until post safeStart for this.
// Handle Damage
_ehDamage = _unit addEventHandler ["HandleDamage",{_this call f_fnc_famDamageHandler;}];
-_unit setVariable ["f_var_fam_allEHs",[_ehDamage,_ehKilled,_ehHeal]];
\ No newline at end of file
+_unit setVariable ["f_var_fam_allEHs",[_ehDamage,_ehKilled,_ehHeal,_ehRespawn]];
\ No newline at end of file
diff --git a/f/medical/fn_famInit.sqf b/f/medical/fn_famInit.sqf
index 15102ccd..6877e3ec 100644
--- a/f/medical/fn_famInit.sqf
+++ b/f/medical/fn_famInit.sqf
@@ -87,7 +87,7 @@ if (count (_unit getVariable ["f_var_fam_allEHs",[]]) == 0) then {
if (!(_unit getVariable ["f_var_fam_actions",false]) && {hasInterface}) then {
- [_unit] remoteExec ["f_fnc_famAddAllActions", 0, ("f_jip_famAddAllActions" + (_unit call BIS_fnc_netId))];
+ [_unit] remoteExec ["f_fnc_famAddAllActions", 0, ("f_jip_famAddAllActions" + netId _unit)];
_unit setVariable ["f_var_fam_actions",true,true];
};
diff --git a/f/medical/fn_famLoop.sqf b/f/medical/fn_famLoop.sqf
index 837b20cb..03f3be44 100644
--- a/f/medical/fn_famLoop.sqf
+++ b/f/medical/fn_famLoop.sqf
@@ -125,7 +125,7 @@ while {alive _unit && {local _unit}} do {
_tick = selectRandom [0.001,0.002,0.004]; // slower rate closer to death.
} else {
_tick = selectRandom [0.06,0.08,0.11]; // faster rate until you are forced down.
- if (_currentDamage + _tick >= 1) then {_tick = 0.01}; //careful not to overdamage you with the bleed.
+ if (_currentDamage + _tick >= 0.98) then {_tick = 0}; //careful not to overdamage you with the bleed.
};
{ // save current hands and legs damage.
From 100cb77abd2e56a7e27ec6318d6951c390514875 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Wed, 1 Jan 2025 00:11:59 +0000
Subject: [PATCH 05/81] Force respawn button
---
f/medical/f_FAMUI.hpp | 59 +++++++++++++++++++++++++++++++++++++
f/medical/fn_famLoop.sqf | 6 ++++
f/medical/fn_famPassOut.sqf | 1 +
f/medical/fn_famWakeUp.sqf | 3 ++
4 files changed, 69 insertions(+)
diff --git a/f/medical/f_FAMUI.hpp b/f/medical/f_FAMUI.hpp
index 623a2dce..33e6dfe5 100644
--- a/f/medical/f_FAMUI.hpp
+++ b/f/medical/f_FAMUI.hpp
@@ -111,4 +111,63 @@ class f_FAMdiagnoseUI
};
};
};
+};
+
+class f_FAMrespawnUI
+{
+ idd = 3680;
+ duration = 1e+6;
+ access = 0;
+ movingEnable = false;
+ enableSimulation = true;
+ fadeIn = 0;
+ fadeOut = 0;
+ onLoad = "";
+
+ class Controls
+ {
+ class f_FAMcontrolsGroupRespawn : f_FAMcontrolsGroup
+ {
+ onLoad = "[_this#0] spawn f_fnc_FAMdiagnoseInitUI;";
+
+ class Controls
+ {
+ class f_FAMbackgroundRespawn : f_FAMbackGround
+ {
+ idc = 3689;
+ };
+ class f_FAMstatusTextRespawn : f_FAMstatusText
+ {
+ type = CT_STRUCTURED_TEXT;
+ idc = 3681;
+ text = "You have been downed for more than 3 minutes.";
+ };
+ class f_FAMbleedTextRespawn : f_FAMbleedText
+ {
+ type = CT_STRUCTURED_TEXT;
+ idc = 3682;
+ text = "Click on the button to the left to respawn.";
+ };
+ class f_FAMnameTextRespawn : f_FAMnameText
+ {
+ type = CT_STRUCTURED_TEXT;
+ idc = 3683;
+ text = "MEDICAL SYSTEM";
+ };
+ class f_FAMbleedWarnRespawn : f_FAMbleedWarn
+ {
+ type = CT_BUTTON;
+ idc = 3684;
+ x = safeZoneW * 0.003;
+ y = safeZoneH * 0.025;
+ w = safeZoneW * 0.02;
+ h = safeZoneH * 0.063;
+ style = 0;
+ text = "";
+ colorBackground[] = {0,0,0,0.1};
+ action = "player setDamage 1; (missionNamespace getVariable ['f_var_fam_respawnDisplay', displayNull]) closeDisplay 1;";
+ };
+ };
+ };
+ };
};
\ No newline at end of file
diff --git a/f/medical/fn_famLoop.sqf b/f/medical/fn_famLoop.sqf
index 03f3be44..7c94476b 100644
--- a/f/medical/fn_famLoop.sqf
+++ b/f/medical/fn_famLoop.sqf
@@ -21,6 +21,12 @@ while {alive _unit && {local _unit}} do {
};
// ====================================================================================
+ // Timeout for being downed
+ private _knockoutTime = _unit getGetVariable ["f_var_fam_knockOutTime", serverTime];
+ if ((serverTime - _knockOutTime) > 180) then {
+ f_var_fam_respawnDisplay = findDisplay 46 createDisplay "f_FAMrespawnUI";
+ };
+
// PASSOUT TEST
// Force Unit Down above damage threshold.
if (damage _unit >= 0.9 && {_unit getVariable ["f_var_fam_conscious",true]}) then {
diff --git a/f/medical/fn_famPassOut.sqf b/f/medical/fn_famPassOut.sqf
index 64a7214e..4ee3b53d 100644
--- a/f/medical/fn_famPassOut.sqf
+++ b/f/medical/fn_famPassOut.sqf
@@ -112,6 +112,7 @@ if (isPlayer _unit) then {
};
};
+_unit setVariable ["f_var_famKnockOutTime", serverTime, true];
// VISUAL EFFECTS
// Create a loop for the wounded visual effects.
_unit spawn {
diff --git a/f/medical/fn_famWakeUp.sqf b/f/medical/fn_famWakeUp.sqf
index ac0b28d9..4579eeb7 100644
--- a/f/medical/fn_famWakeUp.sqf
+++ b/f/medical/fn_famWakeUp.sqf
@@ -22,6 +22,9 @@ for "_i" from 2 to 5 do {
_i enableChannel true;
};
+_unit setVariable ["f_var_fam_knockOutTime",nil,true];
+(missionNamespace getVariable ["f_var_fam_respawnDisplay", displayNull]) closeDisplay 1;
+
// check for radio channels
[_unit] spawn f_fnc_radioCheckChannels;
From 1ea534f57ba3ba07f2d7bcc5984e012ecb0b3664 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Wed, 1 Jan 2025 00:15:52 +0000
Subject: [PATCH 06/81] respawn tweaks
---
f/functions.hpp | 4 ++++
f/medical/f_FAMUI.hpp | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/f/functions.hpp b/f/functions.hpp
index cee7d4e4..578a7ff9 100644
--- a/f/functions.hpp
+++ b/f/functions.hpp
@@ -87,6 +87,10 @@ class F // Defines the "owner"
{
file = "f\respawn";
class respawn{};
+ class respawnBeaconAction{};
+ class respawnBeaconDeploy{};
+ class respawnTeleport{};
+ class respawnTerminalAction{};
};
class nametag
{
diff --git a/f/medical/f_FAMUI.hpp b/f/medical/f_FAMUI.hpp
index 33e6dfe5..b2146df8 100644
--- a/f/medical/f_FAMUI.hpp
+++ b/f/medical/f_FAMUI.hpp
@@ -128,7 +128,7 @@ class f_FAMrespawnUI
{
class f_FAMcontrolsGroupRespawn : f_FAMcontrolsGroup
{
- onLoad = "[_this#0] spawn f_fnc_FAMdiagnoseInitUI;";
+ onLoad = "";
class Controls
{
From a903d413e771f592d019c29929aeff39e5a34486 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Wed, 1 Jan 2025 00:18:48 +0000
Subject: [PATCH 07/81] Add missiondev safety
---
f/respawn/fn_respawnTerminalAction.sqf | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/f/respawn/fn_respawnTerminalAction.sqf b/f/respawn/fn_respawnTerminalAction.sqf
index b0af0b63..df39355a 100644
--- a/f/respawn/fn_respawnTerminalAction.sqf
+++ b/f/respawn/fn_respawnTerminalAction.sqf
@@ -1,3 +1,10 @@
+if (isNil "f_respawnTerminal") exitWith {
+ systemChat "FA3 Respawn: Critical: Respawn Terminal object is not present or not correctly named f_respawnTerminal.";
+};
+if (isNil "f_respawnBase") exitWith {
+ systemChat "FA3 Respawn: Critical: Respawn Base object is not present or not correctly named f_respawnBase.";
+};
+
[
f_respawnTerminal,
"Deploy to side respawn beacon",
From 1166e3465702cfffbd9f5277b005b1542158fa8c Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Wed, 1 Jan 2025 18:21:30 +0000
Subject: [PATCH 08/81] add scripted EH calls
---
f/medical/fn_famPassOut.sqf | 2 ++
f/medical/fn_famWakeUp.sqf | 2 ++
2 files changed, 4 insertions(+)
diff --git a/f/medical/fn_famPassOut.sqf b/f/medical/fn_famPassOut.sqf
index 4ee3b53d..dcbc7be2 100644
--- a/f/medical/fn_famPassOut.sqf
+++ b/f/medical/fn_famPassOut.sqf
@@ -113,6 +113,8 @@ if (isPlayer _unit) then {
};
_unit setVariable ["f_var_famKnockOutTime", serverTime, true];
+
+[_unit, "f_fam_knockOut", [_unit]] call BIS_fnc_callScriptedEventHandler;
// VISUAL EFFECTS
// Create a loop for the wounded visual effects.
_unit spawn {
diff --git a/f/medical/fn_famWakeUp.sqf b/f/medical/fn_famWakeUp.sqf
index 4579eeb7..5e7ffebb 100644
--- a/f/medical/fn_famWakeUp.sqf
+++ b/f/medical/fn_famWakeUp.sqf
@@ -92,6 +92,8 @@ titleText ["","PLAIN"];
_unit setCaptive false;
+[_unit, "f_fam_wakeUp", [_unit]] call BIS_fnc_callScriptedEventHandler;
+
// DELAYED RESETS
_unit spawn {
From f2894c21e0caaa1a75d95023aba77169c50da50b Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Wed, 1 Jan 2025 18:22:24 +0000
Subject: [PATCH 09/81] fix display stacking
---
f/medical/fn_famLoop.sqf | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/f/medical/fn_famLoop.sqf b/f/medical/fn_famLoop.sqf
index 7c94476b..29b370dc 100644
--- a/f/medical/fn_famLoop.sqf
+++ b/f/medical/fn_famLoop.sqf
@@ -24,7 +24,9 @@ while {alive _unit && {local _unit}} do {
// Timeout for being downed
private _knockoutTime = _unit getGetVariable ["f_var_fam_knockOutTime", serverTime];
if ((serverTime - _knockOutTime) > 180) then {
- f_var_fam_respawnDisplay = findDisplay 46 createDisplay "f_FAMrespawnUI";
+ if (isNull (missionNamespace getVariable ["f_var_fam_respawnDisplay",displayNull])) then {
+ f_var_fam_respawnDisplay = findDisplay 46 createDisplay "f_FAMrespawnUI";
+ };
};
// PASSOUT TEST
From fb11705b06adef62a463eb29b628e79cd19b26eb Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Thu, 2 Jan 2025 21:48:29 +0000
Subject: [PATCH 10/81] possible config fix
---
f/medical/f_FAMUI.hpp | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/f/medical/f_FAMUI.hpp b/f/medical/f_FAMUI.hpp
index b2146df8..0cbef7d8 100644
--- a/f/medical/f_FAMUI.hpp
+++ b/f/medical/f_FAMUI.hpp
@@ -113,7 +113,7 @@ class f_FAMdiagnoseUI
};
};
-class f_FAMrespawnUI
+class f_FAMrespawnUI : f_FAMdiagnoseUI
{
idd = 3680;
duration = 1e+6;
@@ -126,35 +126,35 @@ class f_FAMrespawnUI
class Controls
{
- class f_FAMcontrolsGroupRespawn : f_FAMcontrolsGroup
+ class f_FAMcontrolsGroupRespawn
{
onLoad = "";
class Controls
{
- class f_FAMbackgroundRespawn : f_FAMbackGround
+ class f_FAMbackgroundRespawn
{
idc = 3689;
};
- class f_FAMstatusTextRespawn : f_FAMstatusText
+ class f_FAMstatusTextRespawn
{
type = CT_STRUCTURED_TEXT;
idc = 3681;
text = "You have been downed for more than 3 minutes.";
};
- class f_FAMbleedTextRespawn : f_FAMbleedText
+ class f_FAMbleedTextRespawn
{
type = CT_STRUCTURED_TEXT;
idc = 3682;
text = "Click on the button to the left to respawn.";
};
- class f_FAMnameTextRespawn : f_FAMnameText
+ class f_FAMnameTextRespawn
{
type = CT_STRUCTURED_TEXT;
idc = 3683;
text = "MEDICAL SYSTEM";
};
- class f_FAMbleedWarnRespawn : f_FAMbleedWarn
+ class f_FAMbleedWarnRespawn
{
type = CT_BUTTON;
idc = 3684;
From 9001000d0eab665e609ea51e4343e5b054402c25 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 3 Jan 2025 10:36:04 +0000
Subject: [PATCH 11/81] Move beacon to Player Actions briefing
---
f/respawn/fn_respawnBeaconAction.sqf | 54 ----------------------------
f/respawn/fn_respawnBeaconDeploy.sqf | 18 ++++++++--
f/respawn/fn_respawnBriefing.sqf | 42 ++++++++++++++++++++++
init.sqf | 2 +-
4 files changed, 59 insertions(+), 57 deletions(-)
delete mode 100644 f/respawn/fn_respawnBeaconAction.sqf
create mode 100644 f/respawn/fn_respawnBriefing.sqf
diff --git a/f/respawn/fn_respawnBeaconAction.sqf b/f/respawn/fn_respawnBeaconAction.sqf
deleted file mode 100644
index 4c7a77cb..00000000
--- a/f/respawn/fn_respawnBeaconAction.sqf
+++ /dev/null
@@ -1,54 +0,0 @@
-params [["_respawned",false]];
-
-// Don't add the action if it's already got one
-if (player getVariable ["f_var_hasRespawnBeaconAction",false] && !_respawned) exitWith { diag_log "FA3 Respawn: tried to add beacon action on something that already has it"};
-
-// Add the action
-[
- player,
- "Deploy respawn beacon (destroys others!)",
- "a3\ui_f_oldman\data\igui\cfg\holdactions\meet_ca.paa",
- "a3\ui_f_oldman\data\igui\cfg\holdactions\meet_ca.paa",
- "(isNull objectParent _this) && {(_target == _this) && {leader _this == _this}}",
- "(isNull objectParent _this) && {(_target == _this) && {leader _this == _this}}",
- {
- _caller playActionNow "MedicOther";
- private _text = format ["[%1] %2 is deploying a respawn beacon.", str side group _caller, name _caller];
- [_text] remoteExec ["systemChat"];
- },
- {},
- {
- private _text = format ["[%1] %2 deployed a respawn beacon.", str side group _caller, name _caller];
- _caller call f_fnc_respawnBeaconDeploy;
- },
- {
- _caller playActionNow "MedicStop";
- },
- [],
- 10,
- 0,
- false,
- false,
- false
-] call BIS_fnc_holdActionAdd;
-
-// If this is a respawn then we don't need anything else
-if _respawned exitWith {};
-
-player addEventHandler ["Respawn", {
- true call f_fnc_respawnBeaconAction;
-}];
-
-// Add the variable to prove it's already done
-player setVariable ["f_var_hasRespawnBeaconAction",true];
-
-// Add an event handler to the server that can catch JIP/reslots
-if isServer then {
- addMissionEventHandler ["PlayerConnected",
- {
- params ["_id", "_uid", "_name", "_jip", "_owner", "_idstr"];
- if (_jip) then {
- [] remoteExec ["f_fnc_respawnBeaconAction",_owner];
- };
- }];
-};
\ No newline at end of file
diff --git a/f/respawn/fn_respawnBeaconDeploy.sqf b/f/respawn/fn_respawnBeaconDeploy.sqf
index 3712297a..53da2c6e 100644
--- a/f/respawn/fn_respawnBeaconDeploy.sqf
+++ b/f/respawn/fn_respawnBeaconDeploy.sqf
@@ -1,7 +1,18 @@
params ["_caller"];
+if !(isNull objectParent _caller) exitWith {
+ systemChat "Can't place respawn beacon while in a vehicle.";
+};
+if !(_caller == leader _caller) exitWith {
+ systemChat "Only group leaders can place a respawn beacon.";
+};
-_caller playActionNow "PutDown";
+_caller playActionNow "MedicOther";
+private _text = format ["[%1] %2 is deploying a respawn beacon.", str side group _caller, name _caller];
+[_text] remoteExec ["systemChat"];
+sleep 5;
+
+if !(alive _caller) exitWith {};
// Check 3 possible positions
{
// Aim about waist height
@@ -40,4 +51,7 @@ _caller playActionNow "PutDown";
missionNamespace setVariable [_varName, _beacon, true];
break;
};
-} forEach [[0,1.5,0.8],[0,0.75,0.8],[0,0.1,0.1]];
\ No newline at end of file
+} forEach [[0,1.5,0.8],[0,0.75,0.8],[0,0.1,0.1]];
+
+private _text = format ["[%1] %2 deployed a respawn beacon.", str side group _caller, name _caller];
+[_text] remoteExec ["systemChat"];
\ No newline at end of file
diff --git a/f/respawn/fn_respawnBriefing.sqf b/f/respawn/fn_respawnBriefing.sqf
new file mode 100644
index 00000000..d3dccf44
--- /dev/null
+++ b/f/respawn/fn_respawnBriefing.sqf
@@ -0,0 +1,42 @@
+// FA3 - Respawn Module - Briefing
+// Credits and documentation: https://github.com/folkarps/F3/wiki
+
+/* ========================
+This module is activated in init.sqf.
+Example:
+0 spawn f_fnc_respawnBriefing
+
+Arguments:
+None
+=========================== */
+if !(hasInterface) exitWith {};
+if !(isNil "f_var_respawn_briefingDone") exitWith{};
+
+waitUntil {scriptDone f_script_briefing};
+
+
+player createDiaryRecord ["fa3_actions",["FA3 Respawn Beacon","
+
+The FA3 Respawn system allows team leaders to deploy a respawn beacon for their side. Respawning players can teleport to this beacon.
+
+Placing this beacon will remove any previously-placed beacon for your side. You can only place this beacon if you are the leader of your group.
+
+Place respawn beacon"
+]];
+
+waitUntil {!isNil "f_script_loadoutNotes"};
+waitUntil {scriptDone f_script_loadoutNotes};
+
+_fcs = player createDiaryRecord ["diary", ["FA3 Respawn",format ["
+
+If you have been unconscious for 3 minutes straight, you will have the option to respawn. After a brief timeout, you will respawn at a neutral base location.
+
+At the base, you will have access to a terminal, which you can use to either spectate your team, or teleport to your side's respawn beacon.
+
+Group leaders can place their side's respawn beacon from the FA3 Player Actions briefing menu.
+
+Your side has %1 respawn tickets at mission start.
+",f_param_respawnTickets]]];
+
+// Set a variable so this won't be generated again by subsequent inits
+f_var_respawn_briefingDone = true;
\ No newline at end of file
diff --git a/init.sqf b/init.sqf
index 50416920..74f1fd26 100644
--- a/init.sqf
+++ b/init.sqf
@@ -179,7 +179,7 @@ if isServer then {
[_x, f_param_respawnTickets] call BIS_fnc_respawnTickets;
} forEach [east, west, independent, civilian];
};
-player call f_fnc_respawnBeaconAction;
+0 spawn f_fnc_respawnBriefing;
// ====================================================================================
From b0e25ee2a966fac737a5efafe242c8352ce65c4b Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 3 Jan 2025 10:48:01 +0000
Subject: [PATCH 12/81] Update comments
---
f/respawn/fn_respawn.sqf | 12 ++++++++++++
f/respawn/fn_respawnBeaconDeploy.sqf | 12 ++++++++++++
f/respawn/fn_respawnBeaconTeleport.sqf | 11 +++++++++++
f/respawn/fn_respawnBriefing.sqf | 2 +-
f/respawn/fn_respawnTerminalAction.sqf | 12 ++++++++++++
5 files changed, 48 insertions(+), 1 deletion(-)
diff --git a/f/respawn/fn_respawn.sqf b/f/respawn/fn_respawn.sqf
index 4ba69d25..aaa869a7 100644
--- a/f/respawn/fn_respawn.sqf
+++ b/f/respawn/fn_respawn.sqf
@@ -1,3 +1,15 @@
+// FA3 - Respawn Module - Respawn Event
+// Credits and documentation: https://github.com/folkarps/F3/wiki
+
+/* ========================
+This function is executed from the FA3 Respawn Template in description.ext and should not be used for other purposes.
+This function relies on the f_respawnBase object being present in the mission - a proxy object used to set the player's position on spawning, and to gauge when they've left the respawn base.
+Example:
+onPlayerRespawn = "f_fnc_respawn";
+
+Arguments:
+None
+=========================== */
[side group player, -1] call BIS_fnc_respawnTickets;
call f_fnc_terminateSpectator;
diff --git a/f/respawn/fn_respawnBeaconDeploy.sqf b/f/respawn/fn_respawnBeaconDeploy.sqf
index 53da2c6e..dfe5a2e2 100644
--- a/f/respawn/fn_respawnBeaconDeploy.sqf
+++ b/f/respawn/fn_respawnBeaconDeploy.sqf
@@ -1,3 +1,15 @@
+// FA3 - Respawn Module - Beacon Placement
+// Credits and documentation: https://github.com/folkarps/F3/wiki
+
+/* ========================
+This function is typically executed by the FA3 Respawn Player Actions briefing tab, but it can be used in other contexts if needed. It must be executed in a scheduled environment, and should be executed only on one machine at a time.
+Example:
+[player] spawn f_fnc_respawnBeaconDeploy
+
+Arguments:
+0. Unit (object) - Living unit which will place the beacon, ideally the local player.
+=========================== */
+
params ["_caller"];
if !(isNull objectParent _caller) exitWith {
systemChat "Can't place respawn beacon while in a vehicle.";
diff --git a/f/respawn/fn_respawnBeaconTeleport.sqf b/f/respawn/fn_respawnBeaconTeleport.sqf
index 91eef63c..cf84ef3a 100644
--- a/f/respawn/fn_respawnBeaconTeleport.sqf
+++ b/f/respawn/fn_respawnBeaconTeleport.sqf
@@ -1,3 +1,14 @@
+// FA3 - Respawn Module - Teleport
+// Credits and documentation: https://github.com/folkarps/F3/wiki
+
+/* ========================
+This function handles teleporting a unit to their side's FA3 Respawn Beacon.
+Example:
+[player] call f_fnc_respawnTeleport
+
+Arguments:
+0. Unit (object) - Living unit which will be teleported.
+=========================== */
params ["_caller"];
private _sideString = str side group _caller;
diff --git a/f/respawn/fn_respawnBriefing.sqf b/f/respawn/fn_respawnBriefing.sqf
index d3dccf44..8252d5a0 100644
--- a/f/respawn/fn_respawnBriefing.sqf
+++ b/f/respawn/fn_respawnBriefing.sqf
@@ -27,7 +27,7 @@ Placing this beacon will remove any previously-placed beacon for your side. You
waitUntil {!isNil "f_script_loadoutNotes"};
waitUntil {scriptDone f_script_loadoutNotes};
-_fcs = player createDiaryRecord ["diary", ["FA3 Respawn",format ["
+player createDiaryRecord ["diary", ["FA3 Respawn",format ["
If you have been unconscious for 3 minutes straight, you will have the option to respawn. After a brief timeout, you will respawn at a neutral base location.
diff --git a/f/respawn/fn_respawnTerminalAction.sqf b/f/respawn/fn_respawnTerminalAction.sqf
index df39355a..e1e95e44 100644
--- a/f/respawn/fn_respawnTerminalAction.sqf
+++ b/f/respawn/fn_respawnTerminalAction.sqf
@@ -1,3 +1,15 @@
+// FA3 - Respawn Module - Terminal Action
+// Credits and documentation: https://github.com/folkarps/F3/wiki
+
+/* ========================
+This function is executed from init.sqf.
+Two objects must be defined as global variables in the mission for this function to operate: f_respawnTerminal, an object which players can interact with to teleport and spectate; and f_respawnBase, a proxy object which is used as their spawn position upon respawning.
+Example:
+0 spawn f_fnc_terminalAction
+
+Arguments:
+None
+=========================== */
if (isNil "f_respawnTerminal") exitWith {
systemChat "FA3 Respawn: Critical: Respawn Terminal object is not present or not correctly named f_respawnTerminal.";
};
From a7f75143c188f4ddb185dafc210ece408354b977 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 3 Jan 2025 10:48:09 +0000
Subject: [PATCH 13/81] fix missing function call
---
init.sqf | 1 +
1 file changed, 1 insertion(+)
diff --git a/init.sqf b/init.sqf
index 74f1fd26..a0769d81 100644
--- a/init.sqf
+++ b/init.sqf
@@ -180,6 +180,7 @@ if isServer then {
} forEach [east, west, independent, civilian];
};
0 spawn f_fnc_respawnBriefing;
+0 spawn f_fnc_respawnTerminalAction;
// ====================================================================================
From 5d8c863f9251dd972ec05c841e3aa01b741db95e Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 3 Jan 2025 11:43:40 +0000
Subject: [PATCH 14/81] fix function name
---
f/functions.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/functions.hpp b/f/functions.hpp
index 578a7ff9..fa0bd444 100644
--- a/f/functions.hpp
+++ b/f/functions.hpp
@@ -87,7 +87,7 @@ class F // Defines the "owner"
{
file = "f\respawn";
class respawn{};
- class respawnBeaconAction{};
+ class respawnBriefing{};
class respawnBeaconDeploy{};
class respawnTeleport{};
class respawnTerminalAction{};
From e366de8846697fb99dff38b2d8d819d9c829a069 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 3 Jan 2025 11:57:21 +0000
Subject: [PATCH 15/81] Close map after doing beacon action
---
f/respawn/fn_respawnBriefing.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/respawn/fn_respawnBriefing.sqf b/f/respawn/fn_respawnBriefing.sqf
index 8252d5a0..ed59a77d 100644
--- a/f/respawn/fn_respawnBriefing.sqf
+++ b/f/respawn/fn_respawnBriefing.sqf
@@ -21,7 +21,7 @@ The FA3 Respawn system allows team leaders to deploy a respawn beacon for their
Placing this beacon will remove any previously-placed beacon for your side. You can only place this beacon if you are the leader of your group.
-Place respawn beacon"
+Place respawn beacon"
]];
waitUntil {!isNil "f_script_loadoutNotes"};
From 101ac51452d6f3c135ff981c973f068b68323e99 Mon Sep 17 00:00:00 2001
From: costno
Date: Fri, 3 Jan 2025 12:34:32 -0500
Subject: [PATCH 16/81] Cas Cap Support
In theory this checks if the side or group watched by cascap still has respawn tickets.
---
f/casualtiesCap/f_CasualtiesCapCheck.sqf | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/f/casualtiesCap/f_CasualtiesCapCheck.sqf b/f/casualtiesCap/f_CasualtiesCapCheck.sqf
index 4e9ee63c..6ff5bc83 100644
--- a/f/casualtiesCap/f_CasualtiesCapCheck.sqf
+++ b/f/casualtiesCap/f_CasualtiesCapCheck.sqf
@@ -65,6 +65,9 @@ if(_sideorgrps isEqualType sideUnknown) then
};
{alive _x} count _filteredUnits;
};
+ _ticketsRemaining = {
+ [_side] call BIS_fnc_respawnTickets;
+ };
// DEBUG
if (f_param_debugMode == 1) then
@@ -79,7 +82,7 @@ else
// COLLECT GROUPS TO CHECK
// If a groups variable was passed we collect all relevant groups
- _grps = [];
+ _grps = [];
sleep 1;
{
@@ -100,6 +103,22 @@ else
_countAliveUnits = {
{alive _x} count (flatten (_grps apply {units _x}));
};
+
+ _ticketsRemaining = {
+ // check if tickets exist for the group itself or the group's side.
+ _tickets_remaining = 0;
+ {
+ _tickets_check = [_x] call BIS_fnc_respawnTickets; // update ticket count if group has tickets applied;
+ if (_tickets_check > 0) then {
+ _tickets_remaining = _tickets_check;
+ };
+ _tickets_check = [side _x] call BIS_fnc_respawnTickets; // update ticket count if group's side has tickets applied;
+ if (_tickets_check > 0) then {
+ _tickets_remaining = _tickets_check;
+ };
+ } foreach _grps;
+ _tickets_remaining // return some number of tickets if at least one group or side has > 0 tickets
+ };
// DEBUG
if (f_param_debugMode == 1) then
@@ -131,6 +150,7 @@ while {true} do
{
// Call the local function to determine how many units are still alive
_remaining = [] call _countAliveUnits;
+ _respawn_tickets = [] call _ticketsRemaining;
// DEBUG
if (f_param_debugMode == 1) then
@@ -138,7 +158,7 @@ while {true} do
systemChat format ["DEBUG (f\casualtiesCap\f_CasualtiesCapCheck.sqf): _remaining = %1",_remaining];
};
- if (_remaining == 0 || ((_started - _remaining) / _started) >= (_pc / 100)) exitWith {};
+ if (_respawn_tickets == 0 && {_remaining == 0 || ((_started - _remaining) / _started) >= (_pc / 100)}) exitWith {};
sleep 6;
};
From 468d94e726968b3850d92fd35727e921c7a14572 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 3 Jan 2025 17:54:07 +0000
Subject: [PATCH 17/81] just in case
---
f/casualtiesCap/f_CasualtiesCapCheck.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/casualtiesCap/f_CasualtiesCapCheck.sqf b/f/casualtiesCap/f_CasualtiesCapCheck.sqf
index 6ff5bc83..c7b5bdde 100644
--- a/f/casualtiesCap/f_CasualtiesCapCheck.sqf
+++ b/f/casualtiesCap/f_CasualtiesCapCheck.sqf
@@ -158,7 +158,7 @@ while {true} do
systemChat format ["DEBUG (f\casualtiesCap\f_CasualtiesCapCheck.sqf): _remaining = %1",_remaining];
};
- if (_respawn_tickets == 0 && {_remaining == 0 || ((_started - _remaining) / _started) >= (_pc / 100)}) exitWith {};
+ if (_respawn_tickets <= 0 && {_remaining == 0 || ((_started - _remaining) / _started) >= (_pc / 100)}) exitWith {};
sleep 6;
};
From 6faa31af598256734f94e36902a98c88b6477e78 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 3 Jan 2025 18:02:46 +0000
Subject: [PATCH 18/81] optimisations
---
f/casualtiesCap/f_CasualtiesCapCheck.sqf | 146 +++++++++++------------
1 file changed, 73 insertions(+), 73 deletions(-)
diff --git a/f/casualtiesCap/f_CasualtiesCapCheck.sqf b/f/casualtiesCap/f_CasualtiesCapCheck.sqf
index c7b5bdde..4ce4c739 100644
--- a/f/casualtiesCap/f_CasualtiesCapCheck.sqf
+++ b/f/casualtiesCap/f_CasualtiesCapCheck.sqf
@@ -18,7 +18,7 @@ sleep 0.1;
// DECLARE PRIVATE VARIABLES
-private ["_grps", "_side", "_factionsOnly", "_countAliveUnits", "_started", "_remaining"];
+private ["_grps", "_side", "_factionsOnly", "_countAliveUnits", "_started", "_remaining", "_ticketsRemaining", "_respawn_tickets"];
// ====================================================================================
@@ -33,11 +33,11 @@ private ["_grps", "_side", "_factionsOnly", "_countAliveUnits", "_started", "_re
// 4: = If in side mode, only units from these faction(s) will be included (e.g. ["blu_f"])
params [
- ["_sideorgrps", sideUnknown, [sideUnknown,[]]],
- ["_pc", 100, [0]],
- ["_end", 1, [0,{}]],
- ["_onlyPlayable", true, [true]],
- ["_factions",[], [[]]]
+ ["_sideorgrps", sideUnknown, [sideUnknown,[]]],
+ ["_pc", 100, [0]],
+ ["_end", 1, [0,{}]],
+ ["_onlyPlayable", true, [true]],
+ ["_factions",[], [[]]]
];
// ====================================================================================
@@ -47,96 +47,96 @@ params [
if(_sideorgrps isEqualType sideUnknown) then
{
- // SIDE MODE
+ // SIDE MODE
- _side = _sideorgrps;
+ _side = _sideorgrps;
_factionsOnly = count _factions > 0;
_countAliveUnits = {
- // switchableUnits is to support SP; there playableUnits is empty
- // Conversely swichableUnits is empty in MP on the DS. So, one of these will always be empty
- private _eligibleUnits = if(_onlyPlayable) then {(playableUnits + switchableUnits)} else {allUnits};
+ // switchableUnits is to support SP; there playableUnits is empty
+ // Conversely swichableUnits is empty in MP on the DS. So, one of these will always be empty
+ private _eligibleUnits = if(_onlyPlayable) then {(playableUnits + switchableUnits)} else {allUnits};
private _filteredUnits = if(_factionsOnly) then
{
- _eligibleUnits select {(side _x == _side) && (([_x] call f_fnc_virtualFaction) in _factions)};
+ _eligibleUnits select {(side _x == _side) && (([_x] call f_fnc_virtualFaction) in _factions)};
}
else
{
- _eligibleUnits select {side _x == _side};
+ _eligibleUnits select {side _x == _side};
};
{alive _x} count _filteredUnits;
};
- _ticketsRemaining = {
- [_side] call BIS_fnc_respawnTickets;
- };
+ _ticketsRemaining = {
+ [_side] call BIS_fnc_respawnTickets;
+ };
- // DEBUG
- if (f_param_debugMode == 1) then
- {
- systemChat format ["DEBUG (f\casualtiesCap\f_CasualtiesCapCheck.sqf): CasCap operating in SIDE mode. _side = %1, _onlyPlayable = %2, _factionsOnly = %3, _factions = %4",_side,_onlyPlayable,_factionsOnly,_factions];
- };
+ // DEBUG
+ if (f_param_debugMode == 1) then
+ {
+ systemChat format ["DEBUG (f\casualtiesCap\f_CasualtiesCapCheck.sqf): CasCap operating in SIDE mode. _side = %1, _onlyPlayable = %2, _factionsOnly = %3, _factions = %4",_side,_onlyPlayable,_factionsOnly,_factions];
+ };
}
else
{
- // GROUP MODE
+ // GROUP MODE
// COLLECT GROUPS TO CHECK
// If a groups variable was passed we collect all relevant groups
_grps = [];
- sleep 1;
- {
- private _Tgrp = call compile format ["%1",_x];
- if(!isNil "_Tgrp") then
- {
- _grps pushBackUnique _Tgrp;
- };
- } forEach _sideorgrps;
+ sleep 1;
+ {
+ private _Tgrp = call compile format ["%1",_x];
+ if(!isNil "_Tgrp") then
+ {
+ _grps pushBackUnique _Tgrp;
+ };
+ } forEach _sideorgrps;
// FAULT CHECK
- // Check if any groups were found. If not, exit with an error message
-
- if (count _grps == 0) exitWith {
- systemChat format ["DEBUG (f\casualtiesCap\f_CasualtiesCapCheck.sqf): No groups found, _sideorgrps = %1, _grps = %2",_sideorgrps,_grps];
- };
-
- _countAliveUnits = {
- {alive _x} count (flatten (_grps apply {units _x}));
- };
-
- _ticketsRemaining = {
- // check if tickets exist for the group itself or the group's side.
- _tickets_remaining = 0;
- {
- _tickets_check = [_x] call BIS_fnc_respawnTickets; // update ticket count if group has tickets applied;
- if (_tickets_check > 0) then {
- _tickets_remaining = _tickets_check;
- };
- _tickets_check = [side _x] call BIS_fnc_respawnTickets; // update ticket count if group's side has tickets applied;
- if (_tickets_check > 0) then {
- _tickets_remaining = _tickets_check;
- };
- } foreach _grps;
- _tickets_remaining // return some number of tickets if at least one group or side has > 0 tickets
- };
+ // Check if any groups were found. If not, exit with an error message
+
+ if (count _grps == 0) exitWith {
+ systemChat format ["DEBUG (f\casualtiesCap\f_CasualtiesCapCheck.sqf): No groups found, _sideorgrps = %1, _grps = %2",_sideorgrps,_grps];
+ };
+
+ _countAliveUnits = {
+ {alive _x} count (flatten (_grps apply {units _x}));
+ };
+
+ _ticketsRemaining = {
+ // check if tickets exist for the group itself or the group's side.
+ _tickets_remaining = 0;
+ {
+ private _tickets_check = [_x] call BIS_fnc_respawnTickets; // update ticket count if group has tickets applied;
+ if (_tickets_check > 0) then {
+ _tickets_remaining = _tickets_check;
+ };
+ private _tickets_check = [side _x] call BIS_fnc_respawnTickets; // update ticket count if group's side has tickets applied;
+ if (_tickets_check > 0) then {
+ _tickets_remaining = _tickets_check;
+ };
+ } foreach _grps;
+ _tickets_remaining // return some number of tickets if at least one group or side has > 0 tickets
+ };
// DEBUG
- if (f_param_debugMode == 1) then
- {
- systemChat format ["DEBUG (f\casualtiesCap\f_CasualtiesCapCheck.sqf): CasCap operating in GROUP mode. _grps = %1",_grps];
- };
+ if (f_param_debugMode == 1) then
+ {
+ systemChat format ["DEBUG (f\casualtiesCap\f_CasualtiesCapCheck.sqf): CasCap operating in GROUP mode. _grps = %1",_grps];
+ };
};
// ====================================================================================
// CREATE STARTING VALUES
// A initial count is made of units in the groups listed in _grps.
-_started = [] call _countAliveUnits;
+_started = call _countAliveUnits;
// DEBUG
if (f_param_debugMode == 1) then
{
- systemChat format ["DEBUG (f\casualtiesCap\f_CasualtiesCapCheck.sqf): _started = %1",_started];
+ systemChat format ["DEBUG (f\casualtiesCap\f_CasualtiesCapCheck.sqf): _started = %1",_started];
};
// ====================================================================================
@@ -148,19 +148,19 @@ if (f_param_debugMode == 1) then
while {true} do
{
- // Call the local function to determine how many units are still alive
- _remaining = [] call _countAliveUnits;
- _respawn_tickets = [] call _ticketsRemaining;
+ // Call the local function to determine how many units are still alive
+ _remaining = call _countAliveUnits;
+ _respawn_tickets = call _ticketsRemaining;
- // DEBUG
- if (f_param_debugMode == 1) then
- {
- systemChat format ["DEBUG (f\casualtiesCap\f_CasualtiesCapCheck.sqf): _remaining = %1",_remaining];
- };
+ // DEBUG
+ if (f_param_debugMode == 1) then
+ {
+ systemChat format ["DEBUG (f\casualtiesCap\f_CasualtiesCapCheck.sqf): _remaining = %1",_remaining];
+ };
- if (_respawn_tickets <= 0 && {_remaining == 0 || ((_started - _remaining) / _started) >= (_pc / 100)}) exitWith {};
+ if (_respawn_tickets <= 0 && {_remaining == 0 || ((_started - _remaining) / _started) >= (_pc / 100)}) exitWith {};
- sleep 6;
+ sleep 6;
};
// ====================================================================================
@@ -169,11 +169,11 @@ while {true} do
// Depending on input, either MPEnd or the parsed code itself is called
if (_end isEqualType 0) exitWith {
- [_end] call f_fnc_mpEnd;
+ [_end] call f_fnc_mpEnd;
};
if (_end isEqualType {}) exitWith {
- _end remoteExec ["bis_fnc_spawn", 0];
+ _end remoteExec ["bis_fnc_spawn", 0];
};
systemChat format ["DEBUG (f\casualtiesCap\f_CasualtiesCapCheck.sqf): Ending didn't fire, should either be code or scalar. _end = %1, typeName _end: %2",_end,typeName _end];
From 7b29c2cbb2d1bf18fdc6a7c4210cf429b80ebe1d Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sat, 4 Jan 2025 17:11:55 +0000
Subject: [PATCH 19/81] Disable menu respawn button
---
description.ext | 1 +
1 file changed, 1 insertion(+)
diff --git a/description.ext b/description.ext
index c5598f9c..4c3bc9fa 100644
--- a/description.ext
+++ b/description.ext
@@ -30,6 +30,7 @@ minPlayerDistance = 500; // The minimum distance between corpse or wreck and nea
respawn = 1;
respawndelay = -1;
respawnOnStart = -1;
+respawnButton = 0;
respawnTemplates[] = {"F_Respawn","Base", "Tickets"};
// ============================================================================================
From 0bce17c7cc812d77a66376ce963092512564d560 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sat, 4 Jan 2025 17:27:01 +0000
Subject: [PATCH 20/81] fix getvariable
---
f/medical/fn_famLoop.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/medical/fn_famLoop.sqf b/f/medical/fn_famLoop.sqf
index 29b370dc..5a8e7c4e 100644
--- a/f/medical/fn_famLoop.sqf
+++ b/f/medical/fn_famLoop.sqf
@@ -22,7 +22,7 @@ while {alive _unit && {local _unit}} do {
// ====================================================================================
// Timeout for being downed
- private _knockoutTime = _unit getGetVariable ["f_var_fam_knockOutTime", serverTime];
+ private _knockoutTime = _unit getVariable ["f_var_fam_knockOutTime", serverTime];
if ((serverTime - _knockOutTime) > 180) then {
if (isNull (missionNamespace getVariable ["f_var_fam_respawnDisplay",displayNull])) then {
f_var_fam_respawnDisplay = findDisplay 46 createDisplay "f_FAMrespawnUI";
From 331c107f41d9213503424f3f5ac89be51be05344 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sat, 4 Jan 2025 17:27:56 +0000
Subject: [PATCH 21/81] fix function name
---
f/functions.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/functions.hpp b/f/functions.hpp
index fa0bd444..c39e9b38 100644
--- a/f/functions.hpp
+++ b/f/functions.hpp
@@ -89,7 +89,7 @@ class F // Defines the "owner"
class respawn{};
class respawnBriefing{};
class respawnBeaconDeploy{};
- class respawnTeleport{};
+ class respawnBeaconTeleport{};
class respawnTerminalAction{};
};
class nametag
From ffe9df6410c938d27afdc68720265d47d2c72d9c Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sat, 4 Jan 2025 18:47:22 +0000
Subject: [PATCH 22/81] fix faction check
---
f/assignGear/fn_assignGear.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/assignGear/fn_assignGear.sqf b/f/assignGear/fn_assignGear.sqf
index 66e93a1d..e1f2ae93 100644
--- a/f/assignGear/fn_assignGear.sqf
+++ b/f/assignGear/fn_assignGear.sqf
@@ -20,7 +20,7 @@ _typeofUnit = toLower _typeofUnit; // Tidy input for SWITCH/CASE statements, exp
// The following code detects what faction the unit's slot belongs to, and stores
// it in the private variable _faction. It can also be passed as an optional parameter.
-if (_faction = "") then {
+if (_faction == "") then {
_faction = toLower ([_unit] call f_fnc_virtualFaction);
};
// ====================================================================================
From 7479b22e9616268dd359802f6b106657b8769cb0 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sat, 4 Jan 2025 18:48:29 +0000
Subject: [PATCH 23/81] fix respawn EH
---
f/assignGear/fn_assignGear.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/assignGear/fn_assignGear.sqf b/f/assignGear/fn_assignGear.sqf
index e1f2ae93..a50fedd9 100644
--- a/f/assignGear/fn_assignGear.sqf
+++ b/f/assignGear/fn_assignGear.sqf
@@ -284,7 +284,7 @@ if (_isMan) then {
};
if !_isRespawn then {
- _unit addEventHandler ["Respawned", {
+ _unit addEventHandler ["Respawn", {
params ["_unit", "_corpse"];
[_unit, _unit getVariable ["f_var_assignGear","r"], _unit getVariable ["f_var_assignGearFaction", toLower [_unit] call f_fnc_virtualFaction]] call f_fnc_assignGear;
}];
From 0e7611e3e47b36ca39b21f94bec72abc46736cf9 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sat, 4 Jan 2025 20:20:46 +0000
Subject: [PATCH 24/81] fix respawn EH again
---
f/assignGear/fn_assignGear.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/assignGear/fn_assignGear.sqf b/f/assignGear/fn_assignGear.sqf
index a50fedd9..680db96b 100644
--- a/f/assignGear/fn_assignGear.sqf
+++ b/f/assignGear/fn_assignGear.sqf
@@ -286,7 +286,7 @@ if (_isMan) then {
if !_isRespawn then {
_unit addEventHandler ["Respawn", {
params ["_unit", "_corpse"];
- [_unit, _unit getVariable ["f_var_assignGear","r"], _unit getVariable ["f_var_assignGearFaction", toLower [_unit] call f_fnc_virtualFaction]] call f_fnc_assignGear;
+ [_unit, _unit getVariable ["f_var_assignGear","r"], _unit getVariable ["f_var_assignGearFaction", toLower ([_unit] call f_fnc_virtualFaction)]] call f_fnc_assignGear;
}];
};
From b3857e308561d94281e644dc284d5fb069f7d236 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sat, 4 Jan 2025 20:21:27 +0000
Subject: [PATCH 25/81] Fix respawn type
---
description.ext | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/description.ext b/description.ext
index 4c3bc9fa..d50f611c 100644
--- a/description.ext
+++ b/description.ext
@@ -27,7 +27,7 @@ minPlayerDistance = 500; // The minimum distance between corpse or wreck and nea
// FA3 - Respawn Settings
-respawn = 1;
+respawn = 3;
respawndelay = -1;
respawnOnStart = -1;
respawnButton = 0;
@@ -45,7 +45,6 @@ class CfgRespawnTemplates
class F_Respawn
{
respawnDelay = 30;
- respawn = 3;
onPlayerRespawn = "f_fnc_respawn";
onPlayerKilled = "f_fnc_activateSpectator";
};
From 06671754592c9cacb26e6d8177b139ad703949ef Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sat, 4 Jan 2025 22:27:19 +0000
Subject: [PATCH 26/81] bug fixes
---
description.ext | 3 ++-
f/assignGear/fn_assignGear.sqf | 2 +-
f/medical/fn_famLoop.sqf | 4 ++--
f/medical/fn_famPassOut.sqf | 2 +-
f/respawn/fn_respawn.sqf | 2 --
f/respawn/fn_respawnBeaconDeploy.sqf | 9 +++++----
f/respawn/fn_respawnBeaconTeleport.sqf | 3 ++-
f/respawn/fn_respawnTerminalAction.sqf | 26 +++++++++++++++-----------
f/spect/fn_activateSpectator.sqf | 9 ++++++---
9 files changed, 34 insertions(+), 26 deletions(-)
diff --git a/description.ext b/description.ext
index d50f611c..ab339b49 100644
--- a/description.ext
+++ b/description.ext
@@ -28,10 +28,11 @@ minPlayerDistance = 500; // The minimum distance between corpse or wreck and nea
// FA3 - Respawn Settings
respawn = 3;
+respawnDialog = 0;
respawndelay = -1;
respawnOnStart = -1;
respawnButton = 0;
-respawnTemplates[] = {"F_Respawn","Base", "Tickets"};
+respawnTemplates[] = {"F_Respawn", "Tickets", "Counter"};
// ============================================================================================
diff --git a/f/assignGear/fn_assignGear.sqf b/f/assignGear/fn_assignGear.sqf
index 680db96b..913792af 100644
--- a/f/assignGear/fn_assignGear.sqf
+++ b/f/assignGear/fn_assignGear.sqf
@@ -286,7 +286,7 @@ if (_isMan) then {
if !_isRespawn then {
_unit addEventHandler ["Respawn", {
params ["_unit", "_corpse"];
- [_unit, _unit getVariable ["f_var_assignGear","r"], _unit getVariable ["f_var_assignGearFaction", toLower ([_unit] call f_fnc_virtualFaction)]] call f_fnc_assignGear;
+ [_unit getVariable ["f_var_assignGear","r"], _unit, _unit getVariable ["f_var_assignGearFaction", toLower ([_unit] call f_fnc_virtualFaction)]] spawn f_fnc_assignGear;
}];
};
diff --git a/f/medical/fn_famLoop.sqf b/f/medical/fn_famLoop.sqf
index 5a8e7c4e..5a02565c 100644
--- a/f/medical/fn_famLoop.sqf
+++ b/f/medical/fn_famLoop.sqf
@@ -24,8 +24,8 @@ while {alive _unit && {local _unit}} do {
// Timeout for being downed
private _knockoutTime = _unit getVariable ["f_var_fam_knockOutTime", serverTime];
if ((serverTime - _knockOutTime) > 180) then {
- if (isNull (missionNamespace getVariable ["f_var_fam_respawnDisplay",displayNull])) then {
- f_var_fam_respawnDisplay = findDisplay 46 createDisplay "f_FAMrespawnUI";
+ if (isNull (uiNamespace getVariable ["f_var_fam_respawnDisplay",displayNull])) then {
+ uiNamespace setVariable ["f_var_fam_respawnDisplay",findDisplay 46 createDisplay "f_FAMrespawnUI"];
};
};
diff --git a/f/medical/fn_famPassOut.sqf b/f/medical/fn_famPassOut.sqf
index dcbc7be2..701f2b7b 100644
--- a/f/medical/fn_famPassOut.sqf
+++ b/f/medical/fn_famPassOut.sqf
@@ -112,7 +112,7 @@ if (isPlayer _unit) then {
};
};
-_unit setVariable ["f_var_famKnockOutTime", serverTime, true];
+_unit setVariable ["f_var_fam_knockOutTime", serverTime, true];
[_unit, "f_fam_knockOut", [_unit]] call BIS_fnc_callScriptedEventHandler;
// VISUAL EFFECTS
diff --git a/f/respawn/fn_respawn.sqf b/f/respawn/fn_respawn.sqf
index aaa869a7..c3c18dd0 100644
--- a/f/respawn/fn_respawn.sqf
+++ b/f/respawn/fn_respawn.sqf
@@ -10,8 +10,6 @@ onPlayerRespawn = "f_fnc_respawn";
Arguments:
None
=========================== */
-[side group player, -1] call BIS_fnc_respawnTickets;
-
call f_fnc_terminateSpectator;
private _newTickets = [side group player] call BIS_fnc_respawnTickets;
diff --git a/f/respawn/fn_respawnBeaconDeploy.sqf b/f/respawn/fn_respawnBeaconDeploy.sqf
index dfe5a2e2..2de1cb5f 100644
--- a/f/respawn/fn_respawnBeaconDeploy.sqf
+++ b/f/respawn/fn_respawnBeaconDeploy.sqf
@@ -45,21 +45,22 @@ if !(alive _caller) exitWith {};
if (["Air","LandVehicle","Ship"] findIf {(_intersection select 2) isKindOf _x} > -1) then { continue };
_position = _intersection select 0;
- private _beacon = createSimpleObject ["OmniDirectionalAntenna_01_olive_F", [0,0,0], [], 0, "CAN_COLLIDE"];
+ private _beacon = createSimpleObject ["OmniDirectionalAntenna_01_olive_F", [0,0,0]];
[_beacon, false] remoteExec ["setPhysicsCollisionFlag",0,true];
_beacon setPosASL _position;
- playSound3D ["A3\Sounds_F_AoW\SFX\Showcase_Future\place_flag.wss",_flag,false,_position, 2, 1, 25];
+ playSound3D ["A3\Sounds_F_AoW\SFX\Showcase_Future\place_flag.wss",_beacon,false,_position, 2, 1, 25];
_beacon setVectorUp [0,0,1];
_beacon setDir (getDir _caller - 90);
private _smoke = "SmokeShellRed_Infinite" createVehicle [0,0,0];
- _smoke attachTo [_beacon,[0,0,0.2]];
+ _smoke setPosASL _position;
+ _beacon setVariable ["f_beaconSmoke",_smoke,true];
// If we got this far we can skip any remaining positions
private _varName = format ["f_var_respawnBeacon_%1", str side group _caller];
private _oldBeacon = missionNamespace getVariable [_varName, objNull];
- deleteVehicle (attachedObjects _oldBeacon) pushback _oldBeacon;
+ deleteVehicle ((attachedObjects _oldBeacon) + [_oldBeacon getVariable ["f_beaconSmoke",objNull], _oldBeacon]);
missionNamespace setVariable [_varName, _beacon, true];
break;
};
diff --git a/f/respawn/fn_respawnBeaconTeleport.sqf b/f/respawn/fn_respawnBeaconTeleport.sqf
index cf84ef3a..ec3632a2 100644
--- a/f/respawn/fn_respawnBeaconTeleport.sqf
+++ b/f/respawn/fn_respawnBeaconTeleport.sqf
@@ -16,11 +16,12 @@ private _sideString = str side group _caller;
private _varName = format ["f_var_respawnBeacon_%1", _sideString];
private _respawnBeacon = missionNamespace getVariable [_varname, objNull];
-if (isNull _varName) exitWith {
+if (isNull _respawnBeacon) exitWith {
systemChat format ["[%1] No available respawn beacon for your side.", _sideString];
};
private _text = format ["[%1] %2 is deploying to the respawn beacon.", _sideString, name _caller];
+[_text] remoteExec ["systemChat"];
private _pos = (getPosASL _respawnBeacon) vectorAdd [0.5,0,0];
_caller setPosASL _pos;
\ No newline at end of file
diff --git a/f/respawn/fn_respawnTerminalAction.sqf b/f/respawn/fn_respawnTerminalAction.sqf
index e1e95e44..9218504e 100644
--- a/f/respawn/fn_respawnTerminalAction.sqf
+++ b/f/respawn/fn_respawnTerminalAction.sqf
@@ -50,21 +50,25 @@ if (isNil "f_respawnBase") exitWith {
"isNull objectParent _this",
"isNull objectParent _this",
{
- private _text = format ["[%1] Press ESC to exit spectator.", str side group _caller];
+ private _text = format ["[%1] Launching side spectator. Press ESC to exit spectator.", str side group _caller];
systemChat _text;
},
{},
{
- private _text = format ["[%1] Press ESC to exit spectator.", str side group _caller];
- systemChat _text;
- 0 call f_fnc_activateSpectator;
- (findDisplay 46) displayAddEventHandler ["keyDown",{
- params ["", "_key"];
- if (_key == 1) then {
- call f_fnc_terminateSpectator;
- (findDisplay 46) displayRemoveEventHandler _thisEventHandler;
- };
- }];
+ _caller spawn {
+ private _text = format ["[%1] Launched side spectator. Press ESC to exit spectator. Select units in the left panel to spectate.", str side group _this];
+ systemChat _text;
+ call f_fnc_activateSpectator;
+ waitUntil { !isNull findDisplay 60492 };
+ (findDisplay 60492) displayAddEventHandler ["keyDown",{
+ params ["", "_key"];
+ if (_key == 1) then {
+ (findDisplay 60492) displayRemoveEventHandler [_thisEvent,_thisEventHandler];
+ call f_fnc_terminateSpectator;
+ true;
+ };
+ }];
+ };
},
{},
[],
diff --git a/f/spect/fn_activateSpectator.sqf b/f/spect/fn_activateSpectator.sqf
index 65f6031a..7726691b 100644
--- a/f/spect/fn_activateSpectator.sqf
+++ b/f/spect/fn_activateSpectator.sqf
@@ -3,15 +3,18 @@ if (f_param_debugMode == 1) then {
diag_log "FA3 Spectator: activating spectator";
};
-params [["",""],["",""],["",""],["",""],["_isFullSpectator",false]];
+params ["","","","",["_isFullSpectator",false]];
// 'Cinematic' delay before spectator activates
sleep 3;
// Disable post-processing effects
// Borrowed from BIS_fnc_respawnSpectator
- waitUntil {missionnamespace getvariable ["BIS_fnc_feedback_allowDeathScreen", true]};
-BIS_fnc_feedback_allowPP = false;
+waitUntil {missionnamespace getvariable ["BIS_fnc_feedback_allowDeathScreen", true]};
+if ((0 call BIS_fnc_missionRespawnType) == 1) then {
+ waitUntil {missionnamespace getvariable ["BIS_fnc_feedback_allowDeathScreen", true]};
+ BIS_fnc_feedback_allowPP = false;
+};
if (_isFullSpectator or (!(alive player) && ([side group player] call BIS_fnc_respawnTickets) < 1)) then {
// Create a new (alive) unit to prevent draw3D bug with floating head tags
From 86d163817c93f47eb464315ddeec90cac112a4f9 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sat, 4 Jan 2025 22:28:24 +0000
Subject: [PATCH 27/81] fix var space
---
f/medical/f_FAMUI.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/medical/f_FAMUI.hpp b/f/medical/f_FAMUI.hpp
index 0cbef7d8..e5cb4fbe 100644
--- a/f/medical/f_FAMUI.hpp
+++ b/f/medical/f_FAMUI.hpp
@@ -165,7 +165,7 @@ class f_FAMrespawnUI : f_FAMdiagnoseUI
style = 0;
text = "";
colorBackground[] = {0,0,0,0.1};
- action = "player setDamage 1; (missionNamespace getVariable ['f_var_fam_respawnDisplay', displayNull]) closeDisplay 1;";
+ action = "player setDamage 1; (uiNamespace getVariable ['f_var_fam_respawnDisplay', displayNull]) closeDisplay 1;";
};
};
};
From 04e9e3fb4b9e294f6b9d410c5fcf7db3c33860a2 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 5 Jan 2025 00:49:48 +0000
Subject: [PATCH 28/81] Update respawn display
---
description.ext | 2 +
f/medical/f_FAMUI.hpp | 59 -----------------
f/medical/fn_famLoop.sqf | 2 +-
f/respawn/f_respawnDisplays.hpp | 112 ++++++++++++++++++++++++++++++++
4 files changed, 115 insertions(+), 60 deletions(-)
create mode 100644 f/respawn/f_respawnDisplays.hpp
diff --git a/description.ext b/description.ext
index ab339b49..f20cc85d 100644
--- a/description.ext
+++ b/description.ext
@@ -438,3 +438,5 @@ class RscTitles
// UI elements for the medical system
#include "f\medical\f_FAMUI.hpp"
};
+
+#include "f\respawn\f_respawnDisplays.hpp"
\ No newline at end of file
diff --git a/f/medical/f_FAMUI.hpp b/f/medical/f_FAMUI.hpp
index e5cb4fbe..623a2dce 100644
--- a/f/medical/f_FAMUI.hpp
+++ b/f/medical/f_FAMUI.hpp
@@ -111,63 +111,4 @@ class f_FAMdiagnoseUI
};
};
};
-};
-
-class f_FAMrespawnUI : f_FAMdiagnoseUI
-{
- idd = 3680;
- duration = 1e+6;
- access = 0;
- movingEnable = false;
- enableSimulation = true;
- fadeIn = 0;
- fadeOut = 0;
- onLoad = "";
-
- class Controls
- {
- class f_FAMcontrolsGroupRespawn
- {
- onLoad = "";
-
- class Controls
- {
- class f_FAMbackgroundRespawn
- {
- idc = 3689;
- };
- class f_FAMstatusTextRespawn
- {
- type = CT_STRUCTURED_TEXT;
- idc = 3681;
- text = "You have been downed for more than 3 minutes.";
- };
- class f_FAMbleedTextRespawn
- {
- type = CT_STRUCTURED_TEXT;
- idc = 3682;
- text = "Click on the button to the left to respawn.";
- };
- class f_FAMnameTextRespawn
- {
- type = CT_STRUCTURED_TEXT;
- idc = 3683;
- text = "MEDICAL SYSTEM";
- };
- class f_FAMbleedWarnRespawn
- {
- type = CT_BUTTON;
- idc = 3684;
- x = safeZoneW * 0.003;
- y = safeZoneH * 0.025;
- w = safeZoneW * 0.02;
- h = safeZoneH * 0.063;
- style = 0;
- text = "";
- colorBackground[] = {0,0,0,0.1};
- action = "player setDamage 1; (uiNamespace getVariable ['f_var_fam_respawnDisplay', displayNull]) closeDisplay 1;";
- };
- };
- };
- };
};
\ No newline at end of file
diff --git a/f/medical/fn_famLoop.sqf b/f/medical/fn_famLoop.sqf
index 5a02565c..44b14ff3 100644
--- a/f/medical/fn_famLoop.sqf
+++ b/f/medical/fn_famLoop.sqf
@@ -25,7 +25,7 @@ while {alive _unit && {local _unit}} do {
private _knockoutTime = _unit getVariable ["f_var_fam_knockOutTime", serverTime];
if ((serverTime - _knockOutTime) > 180) then {
if (isNull (uiNamespace getVariable ["f_var_fam_respawnDisplay",displayNull])) then {
- uiNamespace setVariable ["f_var_fam_respawnDisplay",findDisplay 46 createDisplay "f_FAMrespawnUI"];
+ uiNamespace setVariable ["f_var_fam_respawnDisplay",findDisplay 46 createDisplay "f_respawnUI"];
};
};
diff --git a/f/respawn/f_respawnDisplays.hpp b/f/respawn/f_respawnDisplays.hpp
new file mode 100644
index 00000000..7174fef7
--- /dev/null
+++ b/f/respawn/f_respawnDisplays.hpp
@@ -0,0 +1,112 @@
+class f_respawnUI
+{
+ idd = 3680;
+ duration = 1e+6;
+ access = 0;
+ movingEnable = false;
+ enableSimulation = true;
+ fadeIn = 0;
+ fadeOut = 0;
+ onLoad = "";
+
+ class Controls
+ {
+ class f_respawnControlsGroup : RscControlsGroupNoScrollbars
+ {
+ type = CT_CONTROLS_GROUP;
+ idc = -1;
+ style = 0;
+ x = safeZoneX + safeZoneW * 0.39;
+ y = safeZoneY + safeZoneH * 0.22;
+ w = safeZoneW * 0.22;
+ h = safeZoneH * 0.1;
+ onLoad = "";
+ class HScrollbar
+ {
+ height = 0;
+ width = 0;
+ shadow = 0;
+ };
+ class VScrollbar
+ {
+ height = 0;
+ width = 0;
+ };
+
+ class Controls
+ {
+ class f_respawnBackground : RscText
+ {
+ type = CT_STATIC;
+ idc = 3689;
+ x = 0;
+ y = 0;
+ w = safeZoneW * 0.22;
+ h = safeZoneH * 0.095;
+ style = 0;
+ text = "";
+ colorBackground[] = {0.05,0.05,0.05,0.7};
+ };
+ class f_respawnStatusText : RscStructuredText
+ {
+ type = CT_STRUCTURED_TEXT;
+ idc = 3681;
+ x = safeZoneW * 0.027;
+ y = safeZoneH * 0.032;
+ w = safeZoneW * 0.16;
+ h = safeZoneH * 0.02;
+ style = 0;
+ text = "You have been unconscious for more than 3 minutes.";
+ colorBackground[] = {0.8863,0.7294,0.7294,0};
+ colorText[] = {1,1,0.302,1};
+ font = "PuristaMedium";
+ sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1);
+
+ };
+ class f_respawnStatus2Text : RscStructuredText
+ {
+ type = CT_STRUCTURED_TEXT;
+ idc = 3682;
+ x = safeZoneW * 0.027;
+ y = safeZoneH * 0.057;
+ w = safeZoneW * 0.16;
+ h = safeZoneH * 0.02;
+ style = 0;
+ text = "Wait to be revived or click the button to the left to respawn.";
+ colorBackground[] = {0.8863,0.7294,0.7294,0};
+ colorText[] = {1,1,0.302,1};
+ font = "PuristaMedium";
+ sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1);
+ };
+ class f_respawnTitleText : RscStructuredText
+ {
+ type = CT_STRUCTURED_TEXT;
+ idc = 3683;
+ x = 0;
+ y = 0;
+ w = safeZoneW * 0.22;
+ h = safeZoneH * 0.019;
+ style = 0;
+ text = "FA3 Respawn";
+ colorBackground[] = {0.1,0.1,0.1,1};
+ colorText[] = {1,1,1,1};
+ font = "PuristaMedium";
+ sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1);
+ };
+ class f_respawnButton : RscButton
+ {
+ type = CT_BUTTON;
+ idc = 3684;
+ x = safeZoneW * 0.003;
+ y = safeZoneH * 0.025;
+ w = safeZoneW * 0.02;
+ h = safeZoneH * 0.063;
+ style = 0;
+ text = "";
+ colorBackground[] = {1,1,1,1};
+ action = "player setDamage 1; (uiNamespace getVariable ['f_var_fam_respawnDisplay', displayNull]) closeDisplay 1;";
+ };
+ };
+ };
+ };
+};
\ No newline at end of file
From ece0806fc0c7a36b5bafba0fb8c814aa970beb34 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 5 Jan 2025 01:26:00 +0000
Subject: [PATCH 29/81] Respawn fixes
---
description.ext | 2 +-
f/functions.hpp | 1 +
f/respawn/f_respawnDisplays.hpp | 9 ++++++---
f/respawn/fn_respawn.sqf | 8 ++++----
f/respawn/fn_respawnKilled.sqf | 15 +++++++++++++++
5 files changed, 27 insertions(+), 8 deletions(-)
create mode 100644 f/respawn/fn_respawnKilled.sqf
diff --git a/description.ext b/description.ext
index f20cc85d..014b17bc 100644
--- a/description.ext
+++ b/description.ext
@@ -47,7 +47,7 @@ class CfgRespawnTemplates
{
respawnDelay = 30;
onPlayerRespawn = "f_fnc_respawn";
- onPlayerKilled = "f_fnc_activateSpectator";
+ onPlayerKilled = "f_fnc_respawnKilled";
};
class F_Spectator
{
diff --git a/f/functions.hpp b/f/functions.hpp
index c39e9b38..95983f64 100644
--- a/f/functions.hpp
+++ b/f/functions.hpp
@@ -90,6 +90,7 @@ class F // Defines the "owner"
class respawnBriefing{};
class respawnBeaconDeploy{};
class respawnBeaconTeleport{};
+ class respawnKilled{};
class respawnTerminalAction{};
};
class nametag
diff --git a/f/respawn/f_respawnDisplays.hpp b/f/respawn/f_respawnDisplays.hpp
index 7174fef7..2d4d3a83 100644
--- a/f/respawn/f_respawnDisplays.hpp
+++ b/f/respawn/f_respawnDisplays.hpp
@@ -53,7 +53,7 @@ class f_respawnUI
idc = 3681;
x = safeZoneW * 0.027;
y = safeZoneH * 0.032;
- w = safeZoneW * 0.16;
+ w = safeZoneW * 0.18;
h = safeZoneH * 0.02;
style = 0;
text = "You have been unconscious for more than 3 minutes.";
@@ -69,10 +69,10 @@ class f_respawnUI
idc = 3682;
x = safeZoneW * 0.027;
y = safeZoneH * 0.057;
- w = safeZoneW * 0.16;
+ w = safeZoneW * 0.18;
h = safeZoneH * 0.02;
style = 0;
- text = "Wait to be revived or click the button to the left to respawn.";
+ text = "Wait for revive or click this button to respawn.";
colorBackground[] = {0.8863,0.7294,0.7294,0};
colorText[] = {1,1,0.302,1};
font = "PuristaMedium";
@@ -104,6 +104,9 @@ class f_respawnUI
style = 0;
text = "";
colorBackground[] = {1,1,1,1};
+ colorFocused[] = {0.98,0.51,0,1};
+ colorFocused2[] = {0.98,0.51,0,1};
+ colorBackGroundActive[] = {0.98,0.51,0,1};
action = "player setDamage 1; (uiNamespace getVariable ['f_var_fam_respawnDisplay', displayNull]) closeDisplay 1;";
};
};
diff --git a/f/respawn/fn_respawn.sqf b/f/respawn/fn_respawn.sqf
index c3c18dd0..48b1ecb6 100644
--- a/f/respawn/fn_respawn.sqf
+++ b/f/respawn/fn_respawn.sqf
@@ -7,15 +7,15 @@ This function relies on the f_respawnBase object being present in the mission -
Example:
onPlayerRespawn = "f_fnc_respawn";
-Arguments:
-None
+Arguments: as automatically passed to onPlayerRespawn.sqf
=========================== */
call f_fnc_terminateSpectator;
-
private _newTickets = [side group player] call BIS_fnc_respawnTickets;
-private _respawnText = format ["FA3: [%1] %2 respawned, %3 tickets remaining", side group player, name player, _newTickets];
+private _respawnText = format ["[%1] %2 respawned, %3 tickets remaining", side group player, name player, _newTickets];
[_respawnText] remoteExec ["systemChat"];
+player assignTeam ((_this#1) getVariable ["f_var_lastTeamColour","MAIN"]);
+
player allowDamage false;
player setPosASL getPosASL f_respawnBase;
diff --git a/f/respawn/fn_respawnKilled.sqf b/f/respawn/fn_respawnKilled.sqf
new file mode 100644
index 00000000..bfbdbea7
--- /dev/null
+++ b/f/respawn/fn_respawnKilled.sqf
@@ -0,0 +1,15 @@
+// FA3 - Respawn Module - Player Killed Event
+// Credits and documentation: https://github.com/folkarps/F3/wiki
+
+/* ========================
+This function is executed from the FA3 Respawn Template in description.ext and should not be used for other purposes.
+Example:
+onPlayerKilled = "f_fnc_respawnKilled";
+
+Arguments: as automatically passed to onPlayerKilled.sqf
+=========================== */
+
+_this spawn f_fnc_activateSpectator;
+private _unit = _this#0;
+private _oldTeam = assignedTeam _unit;
+_unit setVariable ["f_var_lastTeamColour",_oldTeam,true];
\ No newline at end of file
From 395425ac96acc6a1a30680e04a8ab8db568d152a Mon Sep 17 00:00:00 2001
From: costno
Date: Sun, 5 Jan 2025 00:12:05 -0500
Subject: [PATCH 30/81] Option to using a vehicle as a deployment point
Probably best practice to have a vehicle that respawns as the spawn point.
---
f/respawn/fn_respawnBeaconTeleport.sqf | 33 ++++++++++++++++++++++----
f/respawn/fn_respawnBriefing.sqf | 33 ++++++++++++++------------
init.sqf | 2 +-
3 files changed, 47 insertions(+), 21 deletions(-)
diff --git a/f/respawn/fn_respawnBeaconTeleport.sqf b/f/respawn/fn_respawnBeaconTeleport.sqf
index ec3632a2..20b686f5 100644
--- a/f/respawn/fn_respawnBeaconTeleport.sqf
+++ b/f/respawn/fn_respawnBeaconTeleport.sqf
@@ -2,10 +2,12 @@
// Credits and documentation: https://github.com/folkarps/F3/wiki
/* ========================
-This function handles teleporting a unit to their side's FA3 Respawn Beacon.
+This function handles teleporting a unit to their side's FA3 Respawn Beacon or deployment vehicle.
Example:
[player] call f_fnc_respawnTeleport
+If using a deployment vehicle, you must have a vehicle with name f_var_respawnBeacon_west (_east, _independent, etc) for your players force.
+
Arguments:
0. Unit (object) - Living unit which will be teleported.
=========================== */
@@ -20,8 +22,29 @@ if (isNull _respawnBeacon) exitWith {
systemChat format ["[%1] No available respawn beacon for your side.", _sideString];
};
-private _text = format ["[%1] %2 is deploying to the respawn beacon.", _sideString, name _caller];
-[_text] remoteExec ["systemChat"];
+if (typeOf _respawnBeacon == "OmniDirectionalAntenna_01_olive_F") exitWith {
+
+ private _text = format ["[%1] %2 is deploying to the respawn beacon.", _sideString, name _caller];
+ [_text] remoteExec ["systemChat"];
+
+ private _pos = (getPosASL _respawnBeacon) vectorAdd [0.5,0,0];
+ _caller setPosASL _pos;
+
+};
+
+if (_respawnBeacon isKindOf "AllVehicles") exitWith {
+
+ if (!alive _respawnBeacon) exitWith {
+ systemChat "Respawn vehicle has been destroyed! Please wait for a new deployment point.";
+ };
+ if (_respawnBeacon emptyPositions "Cargo" >= 1) then {
+ private _text = format ["[%1] %2 is deploying to the respawn vehicle.", _sideString, name _caller];
+ [_text] remoteExec ["systemChat"];
+
+ _caller moveInCargo _respawnBeacon;
+ } else {
+ systemChat "Respawn vehicle has no available cargo seats, please try again.";
+ };
+
+};
-private _pos = (getPosASL _respawnBeacon) vectorAdd [0.5,0,0];
-_caller setPosASL _pos;
\ No newline at end of file
diff --git a/f/respawn/fn_respawnBriefing.sqf b/f/respawn/fn_respawnBriefing.sqf
index ed59a77d..6bd2bc58 100644
--- a/f/respawn/fn_respawnBriefing.sqf
+++ b/f/respawn/fn_respawnBriefing.sqf
@@ -7,22 +7,27 @@ Example:
0 spawn f_fnc_respawnBriefing
Arguments:
-None
+_this: 0 - deployable beacons, 1 - teleport to vehicle
=========================== */
if !(hasInterface) exitWith {};
if !(isNil "f_var_respawn_briefingDone") exitWith{};
-waitUntil {scriptDone f_script_briefing};
-
+_respawnMode = _this;
-player createDiaryRecord ["fa3_actions",["FA3 Respawn Beacon","
-
-The FA3 Respawn system allows team leaders to deploy a respawn beacon for their side. Respawning players can teleport to this beacon.
-
-Placing this beacon will remove any previously-placed beacon for your side. You can only place this beacon if you are the leader of your group.
-
-Place respawn beacon"
-]];
+waitUntil {scriptDone f_script_briefing};
+_str_deploy = "deployment vehicle.";
+
+if (_respawnMode == 0) then {
+ player createDiaryRecord ["fa3_actions",["FA3 Respawn Beacon","
+
+ The FA3 Respawn system allows team leaders to deploy a respawn beacon for their side. Respawning players can teleport to this beacon.
+
+ Placing this beacon will remove any previously-placed beacon for your side. You can only place this beacon if you are the leader of your group.
+
+ Place respawn beacon"
+ ]];
+ _str_deploy = "respawn beacon.
Group leaders can place their side's respawn beacon from the FA3 Player Actions briefing menu.";
+};
waitUntil {!isNil "f_script_loadoutNotes"};
waitUntil {scriptDone f_script_loadoutNotes};
@@ -31,12 +36,10 @@ player createDiaryRecord ["diary", ["FA3 Respawn",format ["
If you have been unconscious for 3 minutes straight, you will have the option to respawn. After a brief timeout, you will respawn at a neutral base location.
-At the base, you will have access to a terminal, which you can use to either spectate your team, or teleport to your side's respawn beacon.
-
-Group leaders can place their side's respawn beacon from the FA3 Player Actions briefing menu.
+At the base, you will have access to a terminal, which you can use to either spectate your team, or teleport to your side's %2
Your side has %1 respawn tickets at mission start.
-",f_param_respawnTickets]]];
+",f_param_respawnTickets,_str_deploy]]];
// Set a variable so this won't be generated again by subsequent inits
f_var_respawn_briefingDone = true;
\ No newline at end of file
diff --git a/init.sqf b/init.sqf
index a0769d81..0c63bec2 100644
--- a/init.sqf
+++ b/init.sqf
@@ -179,7 +179,7 @@ if isServer then {
[_x, f_param_respawnTickets] call BIS_fnc_respawnTickets;
} forEach [east, west, independent, civilian];
};
-0 spawn f_fnc_respawnBriefing;
+0 spawn f_fnc_respawnBriefing; // 0 - deployable beacons, 1 - teleport to vehicle
0 spawn f_fnc_respawnTerminalAction;
// ====================================================================================
From ba6978fa565a32fae5413d1796156b1cf3af9222 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 5 Jan 2025 09:17:31 +0000
Subject: [PATCH 31/81] NO INDENTATION IN STRINGS
---
f/respawn/fn_respawnBriefing.sqf | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/f/respawn/fn_respawnBriefing.sqf b/f/respawn/fn_respawnBriefing.sqf
index 6bd2bc58..3cdfb454 100644
--- a/f/respawn/fn_respawnBriefing.sqf
+++ b/f/respawn/fn_respawnBriefing.sqf
@@ -19,12 +19,12 @@ _str_deploy = "deployment vehicle.";
if (_respawnMode == 0) then {
player createDiaryRecord ["fa3_actions",["FA3 Respawn Beacon","
-
- The FA3 Respawn system allows team leaders to deploy a respawn beacon for their side. Respawning players can teleport to this beacon.
-
- Placing this beacon will remove any previously-placed beacon for your side. You can only place this beacon if you are the leader of your group.
-
- Place respawn beacon"
+
+The FA3 Respawn system allows team leaders to deploy a respawn beacon for their side. Respawning players can teleport to this beacon.
+
+Placing this beacon will remove any previously-placed beacon for your side. You can only place this beacon if you are the leader of your group.
+
+Place respawn beacon"
]];
_str_deploy = "respawn beacon.
Group leaders can place their side's respawn beacon from the FA3 Player Actions briefing menu.";
};
From ff581d2defe2212273baf9f8b8d60db02f60eeb6 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 5 Jan 2025 09:17:52 +0000
Subject: [PATCH 32/81] use params
---
f/respawn/fn_respawnBriefing.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/respawn/fn_respawnBriefing.sqf b/f/respawn/fn_respawnBriefing.sqf
index 3cdfb454..982890b0 100644
--- a/f/respawn/fn_respawnBriefing.sqf
+++ b/f/respawn/fn_respawnBriefing.sqf
@@ -12,7 +12,7 @@ _this: 0 - deployable beacons, 1 - teleport to vehicle
if !(hasInterface) exitWith {};
if !(isNil "f_var_respawn_briefingDone") exitWith{};
-_respawnMode = _this;
+params ["_respawnMode"];
waitUntil {scriptDone f_script_briefing};
_str_deploy = "deployment vehicle.";
From 846d5f8f1b9bb761c11d06c256b01aa2de68031b Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 5 Jan 2025 09:18:16 +0000
Subject: [PATCH 33/81] comment
---
f/respawn/fn_respawnBriefing.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/respawn/fn_respawnBriefing.sqf b/f/respawn/fn_respawnBriefing.sqf
index 982890b0..e07303f8 100644
--- a/f/respawn/fn_respawnBriefing.sqf
+++ b/f/respawn/fn_respawnBriefing.sqf
@@ -7,7 +7,7 @@ Example:
0 spawn f_fnc_respawnBriefing
Arguments:
-_this: 0 - deployable beacons, 1 - teleport to vehicle
+0. mode: 0 - deployable beacons, 1 - teleport to vehicle
=========================== */
if !(hasInterface) exitWith {};
if !(isNil "f_var_respawn_briefingDone") exitWith{};
From 4a4be692d0becdc7a13b1390e91ea8d99b56fd05 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 5 Jan 2025 09:18:55 +0000
Subject: [PATCH 34/81] side name
---
f/respawn/fn_respawnBeaconTeleport.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/respawn/fn_respawnBeaconTeleport.sqf b/f/respawn/fn_respawnBeaconTeleport.sqf
index 20b686f5..d75081f2 100644
--- a/f/respawn/fn_respawnBeaconTeleport.sqf
+++ b/f/respawn/fn_respawnBeaconTeleport.sqf
@@ -6,7 +6,7 @@ This function handles teleporting a unit to their side's FA3 Respawn Beacon or d
Example:
[player] call f_fnc_respawnTeleport
-If using a deployment vehicle, you must have a vehicle with name f_var_respawnBeacon_west (_east, _independent, etc) for your players force.
+If using a deployment vehicle, you must have a vehicle with name f_var_respawnBeacon_west (_east, _guer, etc) for your players force.
Arguments:
0. Unit (object) - Living unit which will be teleported.
From db47820b642b0162796583ab6a9ee406adca08a1 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 5 Jan 2025 17:03:27 +0000
Subject: [PATCH 35/81] increase display width
---
f/respawn/f_respawnDisplays.hpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/f/respawn/f_respawnDisplays.hpp b/f/respawn/f_respawnDisplays.hpp
index 2d4d3a83..b3376e9c 100644
--- a/f/respawn/f_respawnDisplays.hpp
+++ b/f/respawn/f_respawnDisplays.hpp
@@ -41,7 +41,7 @@ class f_respawnUI
idc = 3689;
x = 0;
y = 0;
- w = safeZoneW * 0.22;
+ w = safeZoneW * 0.25;
h = safeZoneH * 0.095;
style = 0;
text = "";
@@ -53,7 +53,7 @@ class f_respawnUI
idc = 3681;
x = safeZoneW * 0.027;
y = safeZoneH * 0.032;
- w = safeZoneW * 0.18;
+ w = safeZoneW * 0.22;
h = safeZoneH * 0.02;
style = 0;
text = "You have been unconscious for more than 3 minutes.";
@@ -69,7 +69,7 @@ class f_respawnUI
idc = 3682;
x = safeZoneW * 0.027;
y = safeZoneH * 0.057;
- w = safeZoneW * 0.18;
+ w = safeZoneW * 0.22;
h = safeZoneH * 0.02;
style = 0;
text = "Wait for revive or click this button to respawn.";
From 5415d88e34a34ceb57add8d36cba3ce7a6cf9dd9 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 5 Jan 2025 17:09:38 +0000
Subject: [PATCH 36/81] Force unset captive after respawn
---
f/respawn/fn_respawn.sqf | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/f/respawn/fn_respawn.sqf b/f/respawn/fn_respawn.sqf
index 48b1ecb6..539796aa 100644
--- a/f/respawn/fn_respawn.sqf
+++ b/f/respawn/fn_respawn.sqf
@@ -23,4 +23,5 @@ waitUntil {
sleep 2;
(player distance f_respawnBase) > 100;
};
-player allowDamage true;
\ No newline at end of file
+player allowDamage true;
+player setCaptive false;
\ No newline at end of file
From cfafceb92995525de6505ef89aba8642066b6972 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 5 Jan 2025 21:13:24 +0000
Subject: [PATCH 37/81] fix duplications/no actions on respawn
---
f/medical/fn_famEH.sqf | 3 +--
f/medical/fn_famInit.sqf | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/f/medical/fn_famEH.sqf b/f/medical/fn_famEH.sqf
index b803a190..1c2fb12e 100644
--- a/f/medical/fn_famEH.sqf
+++ b/f/medical/fn_famEH.sqf
@@ -62,8 +62,7 @@ private _ehRespawn = _unit addEventHandler ["Respawn", {
params ["_unit"];
if !(local _unit) exitWith {};
if !(_unit isKindOf "VirtualMan_F") then {
- _unit setVariable ["f_var_fam_actions",false,true];
- [_unit] spawn f_fnc_famLoop;
+ _unit setVariable ["f_var_fam_actionsAdded",false,true];
[_unit] remoteExec ["f_fnc_famAddAllActions", 0, ("f_jip_famAddAllActions" + netId _unit)];
};
}];
diff --git a/f/medical/fn_famInit.sqf b/f/medical/fn_famInit.sqf
index 6877e3ec..efebf80b 100644
--- a/f/medical/fn_famInit.sqf
+++ b/f/medical/fn_famInit.sqf
@@ -69,7 +69,7 @@ _unit setVariable ["f_var_fam_forcedown",false];
_unit setVariable ["f_var_fam_hasfak",false];
_unit setVariable ["f_var_fam_hasbandage",false];
_unit getVariable ["f_var_fam_flag",false];
-_unit setVariable ["f_var_fam_actions",false];
+_unit setVariable ["f_var_fam_actionsAdded",false];
[_unit] spawn f_fnc_famLoop;
From e5c34ba78e0680f9d5bf0809d5038dc180806caa Mon Sep 17 00:00:00 2001
From: costno
Date: Sun, 5 Jan 2025 16:33:43 -0500
Subject: [PATCH 38/81] Protect against bleed out
---
f/medical/fn_famLoop.sqf | 1 +
1 file changed, 1 insertion(+)
diff --git a/f/medical/fn_famLoop.sqf b/f/medical/fn_famLoop.sqf
index 44b14ff3..b4d64a9f 100644
--- a/f/medical/fn_famLoop.sqf
+++ b/f/medical/fn_famLoop.sqf
@@ -131,6 +131,7 @@ while {alive _unit && {local _unit}} do {
if (_currentDamage > 0.95) then {
_tick = selectRandom [0.001,0.002,0.004]; // slower rate closer to death.
+ if (_currentDamage + _tick >= 0.98) then {_tick = 0}; //careful not to overdamage you with the bleed.
} else {
_tick = selectRandom [0.06,0.08,0.11]; // faster rate until you are forced down.
if (_currentDamage + _tick >= 0.98) then {_tick = 0}; //careful not to overdamage you with the bleed.
From dad98a1aea3fa9458060b64f1cfe76cd1588ba11 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 10 Jan 2025 16:53:15 +0000
Subject: [PATCH 39/81] EODflags respawn handling
---
f/assignGear/fn_assignGear.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/assignGear/fn_assignGear.sqf b/f/assignGear/fn_assignGear.sqf
index 913792af..a2079131 100644
--- a/f/assignGear/fn_assignGear.sqf
+++ b/f/assignGear/fn_assignGear.sqf
@@ -41,7 +41,7 @@ _insignia_styles = [_insignia_style_NATO,_insignia_style_CSAT];
// ====================================================================================
// Universal: assign EOD flags to engineer classes
-if (_typeofUnit in ["eng","engm"]) then {
+if ((_typeofUnit in ["eng","engm"]) or (_isRespawn && {(_unit getVariable ["f_var_eodFlagAction",-1]) > -1})) then {
[_unit] call f_fnc_assignEODflags;
};
From 3e9b1d79e0d4795505e667053a7a41beb4af8d45 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sat, 11 Jan 2025 20:30:12 +0000
Subject: [PATCH 40/81] changed assignGear respawn handling
---
f/assignGear/fn_assignGear.sqf | 7 -------
f/respawn/fn_respawn.sqf | 22 ++++++++++++++--------
2 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/f/assignGear/fn_assignGear.sqf b/f/assignGear/fn_assignGear.sqf
index a2079131..13b0021d 100644
--- a/f/assignGear/fn_assignGear.sqf
+++ b/f/assignGear/fn_assignGear.sqf
@@ -283,13 +283,6 @@ if (_isMan) then {
};
-if !_isRespawn then {
- _unit addEventHandler ["Respawn", {
- params ["_unit", "_corpse"];
- [_unit getVariable ["f_var_assignGear","r"], _unit, _unit getVariable ["f_var_assignGearFaction", toLower ([_unit] call f_fnc_virtualFaction)]] spawn f_fnc_assignGear;
- }];
-};
-
// ====================================================================================
// This variable simply tracks the progress of the gear assignation process, for other
diff --git a/f/respawn/fn_respawn.sqf b/f/respawn/fn_respawn.sqf
index 539796aa..c7404791 100644
--- a/f/respawn/fn_respawn.sqf
+++ b/f/respawn/fn_respawn.sqf
@@ -9,19 +9,25 @@ onPlayerRespawn = "f_fnc_respawn";
Arguments: as automatically passed to onPlayerRespawn.sqf
=========================== */
+params ["_newUnit", "_oldUnit"];
+
+waitUntil {local _newUnit};
+
+["respawn", _newUnit, _oldUnit getVariable ["f_var_assignGearFaction", toLower ([_unit] call f_fnc_virtualFaction)], true] call f_fnc_assignGear;
+
call f_fnc_terminateSpectator;
-private _newTickets = [side group player] call BIS_fnc_respawnTickets;
-private _respawnText = format ["[%1] %2 respawned, %3 tickets remaining", side group player, name player, _newTickets];
+private _newTickets = [side group _newUnit] call BIS_fnc_respawnTickets;
+private _respawnText = format ["[%1] %2 respawned, %3 tickets remaining", side group _newUnit, name _newUnit, _newTickets];
[_respawnText] remoteExec ["systemChat"];
-player assignTeam ((_this#1) getVariable ["f_var_lastTeamColour","MAIN"]);
+_newUnit assignTeam (_oldUnit getVariable ["f_var_lastTeamColour","MAIN"]);
-player allowDamage false;
-player setPosASL getPosASL f_respawnBase;
+_newUnit allowDamage false;
+_newUnit setPosASL getPosASL f_respawnBase;
waitUntil {
sleep 2;
- (player distance f_respawnBase) > 100;
+ (_newUnit distance f_respawnBase) > 100;
};
-player allowDamage true;
-player setCaptive false;
\ No newline at end of file
+_newUnit allowDamage true;
+_newUnit setCaptive false;
\ No newline at end of file
From d1edee716dda136f94d2ccbe730c67d3d39602b8 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sat, 11 Jan 2025 20:39:25 +0000
Subject: [PATCH 41/81] assignGear respawn class
---
f/assignGear/f_assignGear_3IFB_standard.sqf | 13 +++++++++++++
f/assignGear/f_assignGear_aaf_standard.sqf | 13 +++++++++++++
f/assignGear/f_assignGear_csatPacific_standard.sqf | 13 +++++++++++++
f/assignGear/f_assignGear_csat_standard.sqf | 13 +++++++++++++
f/assignGear/f_assignGear_ctrg_standard.sqf | 13 +++++++++++++
f/assignGear/f_assignGear_fia_standard.sqf | 13 +++++++++++++
f/assignGear/f_assignGear_gendarmerie.sqf | 13 +++++++++++++
f/assignGear/f_assignGear_ldf_standard.sqf | 13 +++++++++++++
f/assignGear/f_assignGear_natoPacific_standard.sqf | 13 +++++++++++++
f/assignGear/f_assignGear_natoWoodland_standard.sqf | 13 +++++++++++++
f/assignGear/f_assignGear_nato_standard.sqf | 13 +++++++++++++
f/assignGear/f_assignGear_npr_standard.sqf | 13 +++++++++++++
f/assignGear/f_assignGear_spetsnaz_standard.sqf | 13 +++++++++++++
f/assignGear/f_assignGear_syndikat_standard.sqf | 13 +++++++++++++
f/assignGear/fn_assignGear.sqf | 1 -
f/respawn/fn_respawnKilled.sqf | 4 ++--
16 files changed, 184 insertions(+), 3 deletions(-)
diff --git a/f/assignGear/f_assignGear_3IFB_standard.sqf b/f/assignGear/f_assignGear_3IFB_standard.sqf
index 24cefa14..5dce2180 100644
--- a/f/assignGear/f_assignGear_3IFB_standard.sqf
+++ b/f/assignGear/f_assignGear_3IFB_standard.sqf
@@ -588,6 +588,19 @@ switch (_typeofUnit) do
_unit addmagazines [_glmag, 10];
_unit addmagazines [_grenade, 2];
};
+// Respawn Loadout:
+ case "respawn":
+ {
+ _unit addmagazines [_riflemag, 1];
+ _unit addweapon _rifle;
+ _unit addmagazines [_smokegrenade, 3];
+ _unit addmagazines [_riflemag, 2];
+ _unit addmagazines [_riflemag_tr, 1];
+ _unit addmagazines [_grenade, 2];
+ {
+ _unit setUnitTrait [_x#0, _x#1];
+ } forEach (_unit getVariable ["f_var_unitTraits",[]]);
+ };
// Include the loadouts for vehicles and crates:
#include "f_assignGear_3IFB_v.sqf";
diff --git a/f/assignGear/f_assignGear_aaf_standard.sqf b/f/assignGear/f_assignGear_aaf_standard.sqf
index adf01dc2..fadfdbd3 100644
--- a/f/assignGear/f_assignGear_aaf_standard.sqf
+++ b/f/assignGear/f_assignGear_aaf_standard.sqf
@@ -589,6 +589,19 @@ switch (_typeofUnit) do
_unit addmagazines [_glmag, 10];
_unit addmagazines [_grenade, 2];
};
+// Respawn Loadout:
+ case "respawn":
+ {
+ _unit addmagazines [_riflemag, 1];
+ _unit addweapon _rifle;
+ _unit addmagazines [_smokegrenade, 3];
+ _unit addmagazines [_riflemag, 2];
+ _unit addmagazines [_riflemag_tr, 1];
+ _unit addmagazines [_grenade, 2];
+ {
+ _unit setUnitTrait [_x#0, _x#1];
+ } forEach (_unit getVariable ["f_var_unitTraits",[]]);
+ };
// Include the loadouts for vehicles and crates:
#include "f_assignGear_aaf_v.sqf";
diff --git a/f/assignGear/f_assignGear_csatPacific_standard.sqf b/f/assignGear/f_assignGear_csatPacific_standard.sqf
index 86bd7b1a..96989e00 100644
--- a/f/assignGear/f_assignGear_csatPacific_standard.sqf
+++ b/f/assignGear/f_assignGear_csatPacific_standard.sqf
@@ -589,6 +589,19 @@ switch (_typeofUnit) do
_unit addmagazines [_glmag, 10];
_unit addmagazines [_grenade, 2];
};
+// Respawn Loadout:
+ case "respawn":
+ {
+ _unit addmagazines [_riflemag, 1];
+ _unit addweapon _rifle;
+ _unit addmagazines [_smokegrenade, 3];
+ _unit addmagazines [_riflemag, 2];
+ _unit addmagazines [_riflemag_tr, 1];
+ _unit addmagazines [_grenade, 2];
+ {
+ _unit setUnitTrait [_x#0, _x#1];
+ } forEach (_unit getVariable ["f_var_unitTraits",[]]);
+ };
// Include the loadouts for vehicles and crates:
#include "f_assignGear_csat_v.sqf";
diff --git a/f/assignGear/f_assignGear_csat_standard.sqf b/f/assignGear/f_assignGear_csat_standard.sqf
index e092a1db..2537306e 100644
--- a/f/assignGear/f_assignGear_csat_standard.sqf
+++ b/f/assignGear/f_assignGear_csat_standard.sqf
@@ -589,6 +589,19 @@ switch (_typeofUnit) do
_unit addmagazines [_glmag, 10];
_unit addmagazines [_grenade, 2];
};
+// Respawn Loadout:
+ case "respawn":
+ {
+ _unit addmagazines [_riflemag, 1];
+ _unit addweapon _rifle;
+ _unit addmagazines [_smokegrenade, 3];
+ _unit addmagazines [_riflemag, 2];
+ _unit addmagazines [_riflemag_tr, 1];
+ _unit addmagazines [_grenade, 2];
+ {
+ _unit setUnitTrait [_x#0, _x#1];
+ } forEach (_unit getVariable ["f_var_unitTraits",[]]);
+ };
// Include the loadouts for vehicles and crates:
#include "f_assignGear_csat_v.sqf";
diff --git a/f/assignGear/f_assignGear_ctrg_standard.sqf b/f/assignGear/f_assignGear_ctrg_standard.sqf
index 8342ba1c..221e084e 100644
--- a/f/assignGear/f_assignGear_ctrg_standard.sqf
+++ b/f/assignGear/f_assignGear_ctrg_standard.sqf
@@ -589,6 +589,19 @@ switch (_typeofUnit) do
_unit addmagazines [_glmag, 10];
_unit addmagazines [_grenade, 2];
};
+// Respawn Loadout:
+ case "respawn":
+ {
+ _unit addmagazines [_riflemag, 1];
+ _unit addweapon _rifle;
+ _unit addmagazines [_smokegrenade, 3];
+ _unit addmagazines [_riflemag, 2];
+ _unit addmagazines [_riflemag_tr, 1];
+ _unit addmagazines [_grenade, 2];
+ {
+ _unit setUnitTrait [_x#0, _x#1];
+ } forEach (_unit getVariable ["f_var_unitTraits",[]]);
+ };
// Include the loadouts for vehicles and crates:
#include "f_assignGear_ctrg_v.sqf";
diff --git a/f/assignGear/f_assignGear_fia_standard.sqf b/f/assignGear/f_assignGear_fia_standard.sqf
index f7d7d70e..2ecf98f0 100644
--- a/f/assignGear/f_assignGear_fia_standard.sqf
+++ b/f/assignGear/f_assignGear_fia_standard.sqf
@@ -589,6 +589,19 @@ switch (_typeofUnit) do
_unit addmagazines [_glmag, 10];
_unit addmagazines [_grenade, 2];
};
+// Respawn Loadout:
+ case "respawn":
+ {
+ _unit addmagazines [_riflemag, 1];
+ _unit addweapon _rifle;
+ _unit addmagazines [_smokegrenade, 3];
+ _unit addmagazines [_riflemag, 2];
+ _unit addmagazines [_riflemag_tr, 1];
+ _unit addmagazines [_grenade, 2];
+ {
+ _unit setUnitTrait [_x#0, _x#1];
+ } forEach (_unit getVariable ["f_var_unitTraits",[]]);
+ };
// Include the loadouts for vehicles and crates:
#include "f_assignGear_fia_v.sqf";
diff --git a/f/assignGear/f_assignGear_gendarmerie.sqf b/f/assignGear/f_assignGear_gendarmerie.sqf
index 661e1889..dfbc4979 100644
--- a/f/assignGear/f_assignGear_gendarmerie.sqf
+++ b/f/assignGear/f_assignGear_gendarmerie.sqf
@@ -336,6 +336,19 @@ switch (_typeofUnit) do
_unit addmagazines [_chemred,1];
_unit addmagazines [_chemyellow,1];
};
+// Respawn Loadout:
+ case "respawn":
+ {
+ _unit addmagazines [_riflemag, 1];
+ _unit addweapon _rifle;
+ _unit addmagazines [_smokegrenade, 3];
+ _unit addmagazines [_riflemag, 2];
+ _unit addmagazines [_riflemag_tr, 1];
+ _unit addmagazines [_grenade, 2];
+ {
+ _unit setUnitTrait [_x#0, _x#1];
+ } forEach (_unit getVariable ["f_var_unitTraits",[]]);
+ };
// CARGO: CAR - room for 10 weapons and 50 cargo items
case "v_car":
{
diff --git a/f/assignGear/f_assignGear_ldf_standard.sqf b/f/assignGear/f_assignGear_ldf_standard.sqf
index 6637783f..8e0911ad 100644
--- a/f/assignGear/f_assignGear_ldf_standard.sqf
+++ b/f/assignGear/f_assignGear_ldf_standard.sqf
@@ -589,6 +589,19 @@ switch (_typeofUnit) do
_unit addmagazines [_glmag, 10];
_unit addmagazines [_grenade, 2];
};
+// Respawn Loadout:
+ case "respawn":
+ {
+ _unit addmagazines [_riflemag, 1];
+ _unit addweapon _rifle;
+ _unit addmagazines [_smokegrenade, 3];
+ _unit addmagazines [_riflemag, 2];
+ _unit addmagazines [_riflemag_tr, 1];
+ _unit addmagazines [_grenade, 2];
+ {
+ _unit setUnitTrait [_x#0, _x#1];
+ } forEach (_unit getVariable ["f_var_unitTraits",[]]);
+ };
// Include the loadouts for vehicles and crates:
#include "f_assignGear_ldf_v.sqf";
diff --git a/f/assignGear/f_assignGear_natoPacific_standard.sqf b/f/assignGear/f_assignGear_natoPacific_standard.sqf
index 03900428..d5d1e3dd 100644
--- a/f/assignGear/f_assignGear_natoPacific_standard.sqf
+++ b/f/assignGear/f_assignGear_natoPacific_standard.sqf
@@ -589,6 +589,19 @@ switch (_typeofUnit) do
_unit addmagazines [_glmag, 10];
_unit addmagazines [_grenade, 2];
};
+// Respawn Loadout:
+ case "respawn":
+ {
+ _unit addmagazines [_riflemag, 1];
+ _unit addweapon _rifle;
+ _unit addmagazines [_smokegrenade, 3];
+ _unit addmagazines [_riflemag, 2];
+ _unit addmagazines [_riflemag_tr, 1];
+ _unit addmagazines [_grenade, 2];
+ {
+ _unit setUnitTrait [_x#0, _x#1];
+ } forEach (_unit getVariable ["f_var_unitTraits",[]]);
+ };
// Include the loadouts for vehicles and crates:
#include "f_assignGear_nato_v.sqf";
diff --git a/f/assignGear/f_assignGear_natoWoodland_standard.sqf b/f/assignGear/f_assignGear_natoWoodland_standard.sqf
index b859678c..cac5dd51 100644
--- a/f/assignGear/f_assignGear_natoWoodland_standard.sqf
+++ b/f/assignGear/f_assignGear_natoWoodland_standard.sqf
@@ -589,6 +589,19 @@ switch (_typeofUnit) do
_unit addmagazines [_glmag, 10];
_unit addmagazines [_grenade, 2];
};
+// Respawn Loadout:
+ case "respawn":
+ {
+ _unit addmagazines [_riflemag, 1];
+ _unit addweapon _rifle;
+ _unit addmagazines [_smokegrenade, 3];
+ _unit addmagazines [_riflemag, 2];
+ _unit addmagazines [_riflemag_tr, 1];
+ _unit addmagazines [_grenade, 2];
+ {
+ _unit setUnitTrait [_x#0, _x#1];
+ } forEach (_unit getVariable ["f_var_unitTraits",[]]);
+ };
// Include the loadouts for vehicles and crates:
#include "f_assignGear_nato_v.sqf";
diff --git a/f/assignGear/f_assignGear_nato_standard.sqf b/f/assignGear/f_assignGear_nato_standard.sqf
index 37b66ce2..332d47dd 100644
--- a/f/assignGear/f_assignGear_nato_standard.sqf
+++ b/f/assignGear/f_assignGear_nato_standard.sqf
@@ -589,6 +589,19 @@ switch (_typeofUnit) do
_unit addmagazines [_glmag, 10];
_unit addmagazines [_grenade, 2];
};
+// Respawn Loadout:
+ case "respawn":
+ {
+ _unit addmagazines [_riflemag, 1];
+ _unit addweapon _rifle;
+ _unit addmagazines [_smokegrenade, 3];
+ _unit addmagazines [_riflemag, 2];
+ _unit addmagazines [_riflemag_tr, 1];
+ _unit addmagazines [_grenade, 2];
+ {
+ _unit setUnitTrait [_x#0, _x#1];
+ } forEach (_unit getVariable ["f_var_unitTraits",[]]);
+ };
// Include the loadouts for vehicles and crates:
#include "f_assignGear_nato_v.sqf";
diff --git a/f/assignGear/f_assignGear_npr_standard.sqf b/f/assignGear/f_assignGear_npr_standard.sqf
index 1ec078a5..03940a8e 100644
--- a/f/assignGear/f_assignGear_npr_standard.sqf
+++ b/f/assignGear/f_assignGear_npr_standard.sqf
@@ -589,6 +589,19 @@ switch (_typeofUnit) do
_unit addmagazines [_glmag, 10];
_unit addmagazines [_grenade, 2];
};
+// Respawn Loadout:
+ case "respawn":
+ {
+ _unit addmagazines [_riflemag, 1];
+ _unit addweapon _rifle;
+ _unit addmagazines [_smokegrenade, 3];
+ _unit addmagazines [_riflemag, 2];
+ _unit addmagazines [_riflemag_tr, 1];
+ _unit addmagazines [_grenade, 2];
+ {
+ _unit setUnitTrait [_x#0, _x#1];
+ } forEach (_unit getVariable ["f_var_unitTraits",[]]);
+ };
// Include the loadouts for vehicles and crates:
#include "f_assignGear_npr_v.sqf";
diff --git a/f/assignGear/f_assignGear_spetsnaz_standard.sqf b/f/assignGear/f_assignGear_spetsnaz_standard.sqf
index e046f89d..01b5484d 100644
--- a/f/assignGear/f_assignGear_spetsnaz_standard.sqf
+++ b/f/assignGear/f_assignGear_spetsnaz_standard.sqf
@@ -593,6 +593,19 @@ switch (_typeofUnit) do
_unit addmagazines [_glmag, 10];
_unit addmagazines [_grenade, 2];
};
+// Respawn Loadout:
+ case "respawn":
+ {
+ _unit addmagazines [_riflemag, 1];
+ _unit addweapon _rifle;
+ _unit addmagazines [_smokegrenade, 3];
+ _unit addmagazines [_riflemag, 2];
+ _unit addmagazines [_riflemag_tr, 1];
+ _unit addmagazines [_grenade, 2];
+ {
+ _unit setUnitTrait [_x#0, _x#1];
+ } forEach (_unit getVariable ["f_var_unitTraits",[]]);
+ };
// Include the loadouts for vehicles and crates:
#include "f_assignGear_spetsnaz_v.sqf";
diff --git a/f/assignGear/f_assignGear_syndikat_standard.sqf b/f/assignGear/f_assignGear_syndikat_standard.sqf
index c6f5ccfe..b41a6809 100644
--- a/f/assignGear/f_assignGear_syndikat_standard.sqf
+++ b/f/assignGear/f_assignGear_syndikat_standard.sqf
@@ -588,6 +588,19 @@ switch (_typeofUnit) do
_unit addmagazines [_glriflemag_tr, 2];
_unit addmagazines [_glmag, 5];
};
+// Respawn Loadout:
+ case "respawn":
+ {
+ _unit addmagazines [_riflemag, 1];
+ _unit addweapon _rifle;
+ _unit addmagazines [_smokegrenade, 3];
+ _unit addmagazines [_riflemag, 2];
+ _unit addmagazines [_riflemag_tr, 1];
+ _unit addmagazines [_grenade, 2];
+ {
+ _unit setUnitTrait [_x#0, _x#1];
+ } forEach (_unit getVariable ["f_var_unitTraits",[]]);
+ };
// Include the loadouts for vehicles and crates:
#include "f_assignGear_syndikat_v.sqf";
diff --git a/f/assignGear/fn_assignGear.sqf b/f/assignGear/fn_assignGear.sqf
index 13b0021d..77e411b7 100644
--- a/f/assignGear/fn_assignGear.sqf
+++ b/f/assignGear/fn_assignGear.sqf
@@ -287,7 +287,6 @@ if (_isMan) then {
// This variable simply tracks the progress of the gear assignation process, for other
// scripts to reference.
-
_unit setVariable ["f_var_assignGear_done",true,true];
// ====================================================================================
diff --git a/f/respawn/fn_respawnKilled.sqf b/f/respawn/fn_respawnKilled.sqf
index bfbdbea7..c6dfb988 100644
--- a/f/respawn/fn_respawnKilled.sqf
+++ b/f/respawn/fn_respawnKilled.sqf
@@ -11,5 +11,5 @@ Arguments: as automatically passed to onPlayerKilled.sqf
_this spawn f_fnc_activateSpectator;
private _unit = _this#0;
-private _oldTeam = assignedTeam _unit;
-_unit setVariable ["f_var_lastTeamColour",_oldTeam,true];
\ No newline at end of file
+_unit setVariable ["f_var_lastTeamColour",assignedTeam _unit,true];
+_unit setVariable ["f_var_unitTraits", getAllUnitTraits _unit, true];
\ No newline at end of file
From 623ac01ae9e60abce33024cb5aff24592fc610f3 Mon Sep 17 00:00:00 2001
From: costno
Date: Sat, 11 Jan 2025 15:49:48 -0500
Subject: [PATCH 42/81] Damage around 0.89 - 0.95 could sometimes result in no
bloodloss at all
---
f/medical/fn_famLoop.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/medical/fn_famLoop.sqf b/f/medical/fn_famLoop.sqf
index b4d64a9f..09624ed4 100644
--- a/f/medical/fn_famLoop.sqf
+++ b/f/medical/fn_famLoop.sqf
@@ -134,7 +134,7 @@ while {alive _unit && {local _unit}} do {
if (_currentDamage + _tick >= 0.98) then {_tick = 0}; //careful not to overdamage you with the bleed.
} else {
_tick = selectRandom [0.06,0.08,0.11]; // faster rate until you are forced down.
- if (_currentDamage + _tick >= 0.98) then {_tick = 0}; //careful not to overdamage you with the bleed.
+ if (_currentDamage + _tick >= 0.98) then {_tick = 0.01}; //careful not to overdamage you with the bleed.
};
{ // save current hands and legs damage.
From 10b2b506aa945c4e541fda52b12b965f0d2526df Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sat, 11 Jan 2025 21:04:40 +0000
Subject: [PATCH 43/81] Adjust language
---
f/respawn/fn_respawnBeaconTeleport.sqf | 6 +++---
f/respawn/fn_respawnBriefing.sqf | 10 +++++-----
f/respawn/fn_respawnTerminalAction.sqf | 4 ++--
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/f/respawn/fn_respawnBeaconTeleport.sqf b/f/respawn/fn_respawnBeaconTeleport.sqf
index d75081f2..bfc72046 100644
--- a/f/respawn/fn_respawnBeaconTeleport.sqf
+++ b/f/respawn/fn_respawnBeaconTeleport.sqf
@@ -24,7 +24,7 @@ if (isNull _respawnBeacon) exitWith {
if (typeOf _respawnBeacon == "OmniDirectionalAntenna_01_olive_F") exitWith {
- private _text = format ["[%1] %2 is deploying to the respawn beacon.", _sideString, name _caller];
+ private _text = format ["[%1] %2 is deploying to the rally point.", _sideString, name _caller];
[_text] remoteExec ["systemChat"];
private _pos = (getPosASL _respawnBeacon) vectorAdd [0.5,0,0];
@@ -38,12 +38,12 @@ if (_respawnBeacon isKindOf "AllVehicles") exitWith {
systemChat "Respawn vehicle has been destroyed! Please wait for a new deployment point.";
};
if (_respawnBeacon emptyPositions "Cargo" >= 1) then {
- private _text = format ["[%1] %2 is deploying to the respawn vehicle.", _sideString, name _caller];
+ private _text = format ["[%1] %2 is deploying to the rally point vehicle.", _sideString, name _caller];
[_text] remoteExec ["systemChat"];
_caller moveInCargo _respawnBeacon;
} else {
- systemChat "Respawn vehicle has no available cargo seats, please try again.";
+ systemChat "Rally point vehicle has no available cargo seats, please try again.";
};
};
diff --git a/f/respawn/fn_respawnBriefing.sqf b/f/respawn/fn_respawnBriefing.sqf
index e07303f8..1074f05e 100644
--- a/f/respawn/fn_respawnBriefing.sqf
+++ b/f/respawn/fn_respawnBriefing.sqf
@@ -18,15 +18,15 @@ waitUntil {scriptDone f_script_briefing};
_str_deploy = "deployment vehicle.";
if (_respawnMode == 0) then {
- player createDiaryRecord ["fa3_actions",["FA3 Respawn Beacon","
+ player createDiaryRecord ["fa3_actions",["FA3 Rally Point","
-The FA3 Respawn system allows team leaders to deploy a respawn beacon for their side. Respawning players can teleport to this beacon.
+The FA3 Respawn system allows team leaders to deploy a rally point for their side. Respawning players can teleport to this rally point.
-Placing this beacon will remove any previously-placed beacon for your side. You can only place this beacon if you are the leader of your group.
+Placing this rally point will remove any previously-placed rally point for your side. You can only place this rally point if you are the leader of your group.
-Place respawn beacon"
+Place rally point"
]];
- _str_deploy = "respawn beacon.
Group leaders can place their side's respawn beacon from the FA3 Player Actions briefing menu.";
+ _str_deploy = "rally point.
Group leaders can place their side's rally point from the FA3 Player Actions briefing menu.";
};
waitUntil {!isNil "f_script_loadoutNotes"};
diff --git a/f/respawn/fn_respawnTerminalAction.sqf b/f/respawn/fn_respawnTerminalAction.sqf
index 9218504e..e1f730f5 100644
--- a/f/respawn/fn_respawnTerminalAction.sqf
+++ b/f/respawn/fn_respawnTerminalAction.sqf
@@ -19,13 +19,13 @@ if (isNil "f_respawnBase") exitWith {
[
f_respawnTerminal,
- "Deploy to side respawn beacon",
+ "Deploy to side rally point",
"a3\ui_f_oldman\data\igui\cfg\holdactions\meet_ca.paa",
"a3\ui_f_oldman\data\igui\cfg\holdactions\meet_ca.paa",
"isNull objectParent _this",
"isNull objectParent _this",
{
- private _text = format ["[%1] Searching for valid respawn beacon...", str side group _caller];
+ private _text = format ["[%1] Searching for valid rally point...", str side group _caller];
systemChat _text;
},
{},
From e7793aac898ed398b2e92bb9bf4397fae7b617fd Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 12 Jan 2025 15:48:44 +0000
Subject: [PATCH 44/81] Death from vehicle death
---
f/medical/fn_famLoop.sqf | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/f/medical/fn_famLoop.sqf b/f/medical/fn_famLoop.sqf
index 09624ed4..21b91605 100644
--- a/f/medical/fn_famLoop.sqf
+++ b/f/medical/fn_famLoop.sqf
@@ -28,6 +28,19 @@ while {alive _unit && {local _unit}} do {
uiNamespace setVariable ["f_var_fam_respawnDisplay",findDisplay 46 createDisplay "f_respawnUI"];
};
};
+ // If the unit is in a dead vehicle, eject them (if vehicle is on the ground and at very low speed) or kill them (if it isn't)
+ if (!(isNull objectParent _unit) && {!alive objectParent _unit}) then {
+ sleep 3;
+ private _parent = objectParent _unit;
+ if (!(isNull _parent) && {!alive _parent}) then {
+ if (((getPos _parent select 2) < 5) && {(vectorMagnitude velocity _parent) < 2}) then {
+ moveOut _unit;
+ } else {
+ _unit setDamage 1;
+ break;
+ };
+ };
+ };
// PASSOUT TEST
// Force Unit Down above damage threshold.
From 64abeabc1e3b79858bcb9ece7710bf48a3f233c6 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 12 Jan 2025 15:52:28 +0000
Subject: [PATCH 45/81] Restore bleedout
---
f/medical/fn_famLoop.sqf | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/f/medical/fn_famLoop.sqf b/f/medical/fn_famLoop.sqf
index 21b91605..315c5f0a 100644
--- a/f/medical/fn_famLoop.sqf
+++ b/f/medical/fn_famLoop.sqf
@@ -144,10 +144,9 @@ while {alive _unit && {local _unit}} do {
if (_currentDamage > 0.95) then {
_tick = selectRandom [0.001,0.002,0.004]; // slower rate closer to death.
- if (_currentDamage + _tick >= 0.98) then {_tick = 0}; //careful not to overdamage you with the bleed.
} else {
_tick = selectRandom [0.06,0.08,0.11]; // faster rate until you are forced down.
- if (_currentDamage + _tick >= 0.98) then {_tick = 0.01}; //careful not to overdamage you with the bleed.
+ if (_currentDamage + _tick >= 0.99) then {_tick = 0.01}; //careful not to overdamage you with the bleed.
};
{ // save current hands and legs damage.
From 9687e82d1c90c25f7ca91d1b70e4d0b428919e93 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 12 Jan 2025 16:45:19 +0000
Subject: [PATCH 46/81] fix variable name
---
f/respawn/fn_respawn.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/respawn/fn_respawn.sqf b/f/respawn/fn_respawn.sqf
index c7404791..9c138f9c 100644
--- a/f/respawn/fn_respawn.sqf
+++ b/f/respawn/fn_respawn.sqf
@@ -13,7 +13,7 @@ params ["_newUnit", "_oldUnit"];
waitUntil {local _newUnit};
-["respawn", _newUnit, _oldUnit getVariable ["f_var_assignGearFaction", toLower ([_unit] call f_fnc_virtualFaction)], true] call f_fnc_assignGear;
+["respawn", _newUnit, _oldUnit getVariable ["f_var_assignGearFaction", toLower ([_oldUnit] call f_fnc_virtualFaction)], true] call f_fnc_assignGear;
call f_fnc_terminateSpectator;
private _newTickets = [side group _newUnit] call BIS_fnc_respawnTickets;
From efd6856d1b58d410c2751cc553a96cb0639202f9 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 12 Jan 2025 16:54:18 +0000
Subject: [PATCH 47/81] fix spectator
---
f/spect/fn_activateSpectator.sqf | 4 ----
1 file changed, 4 deletions(-)
diff --git a/f/spect/fn_activateSpectator.sqf b/f/spect/fn_activateSpectator.sqf
index 7726691b..865fcac5 100644
--- a/f/spect/fn_activateSpectator.sqf
+++ b/f/spect/fn_activateSpectator.sqf
@@ -5,12 +5,8 @@ if (f_param_debugMode == 1) then {
params ["","","","",["_isFullSpectator",false]];
-// 'Cinematic' delay before spectator activates
-sleep 3;
-
// Disable post-processing effects
// Borrowed from BIS_fnc_respawnSpectator
-waitUntil {missionnamespace getvariable ["BIS_fnc_feedback_allowDeathScreen", true]};
if ((0 call BIS_fnc_missionRespawnType) == 1) then {
waitUntil {missionnamespace getvariable ["BIS_fnc_feedback_allowDeathScreen", true]};
BIS_fnc_feedback_allowPP = false;
From 9b9e4eb13507a3867b053a9ac5d3ac05020fff41 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 12 Jan 2025 18:25:30 +0000
Subject: [PATCH 48/81] reset bleed state on death
---
f/medical/fn_famEH.sqf | 2 ++
1 file changed, 2 insertions(+)
diff --git a/f/medical/fn_famEH.sqf b/f/medical/fn_famEH.sqf
index 1c2fb12e..6fcca8d3 100644
--- a/f/medical/fn_famEH.sqf
+++ b/f/medical/fn_famEH.sqf
@@ -27,6 +27,8 @@ private _ehKilled = _unit addEventHandler ["Killed", {
// store name on corpse for future diagnosis.
_unit setVariable ["f_var_fam_corpse",name _unit,true];
+ _unit setVariable ["f_var_fam_bleed",false,true];
+ _unit setVariable ["f_var_fam_conscious",true,false,true];
}];
From d58134b4d29121b83baaaeb15459a1ac9f8829f7 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 12 Jan 2025 18:28:00 +0000
Subject: [PATCH 49/81] adjust ejection threshold
---
f/medical/fn_famLoop.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/medical/fn_famLoop.sqf b/f/medical/fn_famLoop.sqf
index 315c5f0a..23e519aa 100644
--- a/f/medical/fn_famLoop.sqf
+++ b/f/medical/fn_famLoop.sqf
@@ -33,7 +33,7 @@ while {alive _unit && {local _unit}} do {
sleep 3;
private _parent = objectParent _unit;
if (!(isNull _parent) && {!alive _parent}) then {
- if (((getPos _parent select 2) < 5) && {(vectorMagnitude velocity _parent) < 2}) then {
+ if (((getPos _parent select 2) < 5) && {(vectorMagnitude velocity _parent) < 4.2}) then {
moveOut _unit;
} else {
_unit setDamage 1;
From ec405a2c98b496f4d9763b40d52451b18de72990 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 12 Jan 2025 18:40:09 +0000
Subject: [PATCH 50/81] fix setVariable
---
f/medical/fn_famEH.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/medical/fn_famEH.sqf b/f/medical/fn_famEH.sqf
index 6fcca8d3..27200ab8 100644
--- a/f/medical/fn_famEH.sqf
+++ b/f/medical/fn_famEH.sqf
@@ -28,7 +28,7 @@ private _ehKilled = _unit addEventHandler ["Killed", {
// store name on corpse for future diagnosis.
_unit setVariable ["f_var_fam_corpse",name _unit,true];
_unit setVariable ["f_var_fam_bleed",false,true];
- _unit setVariable ["f_var_fam_conscious",true,false,true];
+ _unit setVariable ["f_var_fam_conscious",true,true];
}];
From fcf1e2f61366d05cb0b6ffc485bee3f9cde0c792 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Thu, 16 Jan 2025 19:22:04 +0000
Subject: [PATCH 51/81] Increase heal action times
---
f/medical/fn_famAddHealAction.sqf | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/f/medical/fn_famAddHealAction.sqf b/f/medical/fn_famAddHealAction.sqf
index 548ad418..988df165 100644
--- a/f/medical/fn_famAddHealAction.sqf
+++ b/f/medical/fn_famAddHealAction.sqf
@@ -11,8 +11,8 @@ if (_unit == player) exitWith {};
// Variables to streamline balancing/updates
private _healIcon = "a3\ui_f\data\igui\cfg\holdactions\holdaction_revive_ca.paa"; //Icon to Display
private _healProg = "(_target distance _caller < 3) && {alive _target && !(_target getVariable ['f_var_fam_conscious',true])}"; // This one is always the same, start condition varies by unit type.
-private _healTime = 6; // Action Duration
-private _healMedicTime = 4.5; // Action Duration
+private _healTime = 14; // Action Duration
+private _healMedicTime = 8.5; // Action Duration
// Starting Code
private _healCodeStart = {
@@ -21,7 +21,9 @@ private _healCodeStart = {
// Match medic animation speed to speed modifier.
if (_caller getUnitTrait 'medic') then {
- _caller setAnimSpeedCoef 1.25;
+ _caller setAnimSpeedCoef 0.9;
+ } else {
+ _caller setAnimSpeedCoef 0.6;
};
if (stance _caller == "PRONE") then {
From 1ab03cffdf2ea324b70258ed784d9a9349521975 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Thu, 16 Jan 2025 19:27:01 +0000
Subject: [PATCH 52/81] Allow slow damage when unconscious
---
f/medical/fn_famDamageHandler.sqf | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/f/medical/fn_famDamageHandler.sqf b/f/medical/fn_famDamageHandler.sqf
index f0d998f0..44d8fc6a 100644
--- a/f/medical/fn_famDamageHandler.sqf
+++ b/f/medical/fn_famDamageHandler.sqf
@@ -61,7 +61,11 @@ if (vehicle _unit isKindof "Air" && {driver vehicle _unit == _unit}) then {
_newDamage = _currentDamage + _newHit;
// Prevent outright death
if (_newDamage > 0.95) then {
- _newDamage = 0.95;
+ if !(_unit getVariable ["f_var_fam_conscious",true]) then {
+ _newDamage = _currentDamage + (_newHit min 0.005);
+ } else {
+ _newDamage = 0.95;
+ };
_unit setVariable ["f_var_fam_forcedown",true];
_unit setVariable ["f_var_fam_forcedownparams",[_source,_selection,_projectile]];
};
From 166418019bd3757643f7136cc98384b82ecc92d9 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 17 Jan 2025 13:56:54 +0000
Subject: [PATCH 53/81] Add a cooldown to the beacon
---
f/respawn/fn_respawnBeaconDeploy.sqf | 22 +++++++++++++++++-----
f/respawn/fn_respawnBriefing.sqf | 2 +-
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/f/respawn/fn_respawnBeaconDeploy.sqf b/f/respawn/fn_respawnBeaconDeploy.sqf
index 2de1cb5f..243be6e5 100644
--- a/f/respawn/fn_respawnBeaconDeploy.sqf
+++ b/f/respawn/fn_respawnBeaconDeploy.sqf
@@ -11,15 +11,24 @@ Arguments:
=========================== */
params ["_caller"];
+// Exit if you don't meet basic conditions
if !(isNull objectParent _caller) exitWith {
- systemChat "Can't place respawn beacon while in a vehicle.";
+ systemChat "Can't place rally beacon while in a vehicle.";
};
if !(_caller == leader _caller) exitWith {
- systemChat "Only group leaders can place a respawn beacon.";
+ systemChat "Only group leaders can place a rally beacon.";
+};
+// Check cooldown
+private _side = str side group _caller;
+private _timerVarName = format ["f_var_lastRespawnBeacon_%1", _side];
+private _cooldown = serverTime - (missionNamespace getVariable [_timerVarName, serverTime]);
+if (_cooldown < 300) exitWith {
+ private _text = format ["[%1] Rally beacon on cooldown: %2", _side, [_cooldown, "MM:SS"] call BIS_fnc_secondsToString];
+ systemChat _text;
};
_caller playActionNow "MedicOther";
-private _text = format ["[%1] %2 is deploying a respawn beacon.", str side group _caller, name _caller];
+private _text = format ["[%1] %2 is deploying a respawn beacon.", _side, name _caller];
[_text] remoteExec ["systemChat"];
sleep 5;
@@ -58,7 +67,7 @@ if !(alive _caller) exitWith {};
_beacon setVariable ["f_beaconSmoke",_smoke,true];
// If we got this far we can skip any remaining positions
- private _varName = format ["f_var_respawnBeacon_%1", str side group _caller];
+ private _varName = format ["f_var_respawnBeacon_%1", _side];
private _oldBeacon = missionNamespace getVariable [_varName, objNull];
deleteVehicle ((attachedObjects _oldBeacon) + [_oldBeacon getVariable ["f_beaconSmoke",objNull], _oldBeacon]);
missionNamespace setVariable [_varName, _beacon, true];
@@ -66,5 +75,8 @@ if !(alive _caller) exitWith {};
};
} forEach [[0,1.5,0.8],[0,0.75,0.8],[0,0.1,0.1]];
-private _text = format ["[%1] %2 deployed a respawn beacon.", str side group _caller, name _caller];
+// Cooldown marker
+missionNamespace setVariable [_timerVarName, serverTime, true];
+
+private _text = format ["[%1] %2 deployed a respawn beacon.", _side, name _caller];
[_text] remoteExec ["systemChat"];
\ No newline at end of file
diff --git a/f/respawn/fn_respawnBriefing.sqf b/f/respawn/fn_respawnBriefing.sqf
index 1074f05e..e50c46c0 100644
--- a/f/respawn/fn_respawnBriefing.sqf
+++ b/f/respawn/fn_respawnBriefing.sqf
@@ -22,7 +22,7 @@ if (_respawnMode == 0) then {
The FA3 Respawn system allows team leaders to deploy a rally point for their side. Respawning players can teleport to this rally point.
-Placing this rally point will remove any previously-placed rally point for your side. You can only place this rally point if you are the leader of your group.
+Placing this rally point will remove any previously-placed rally point for your side. You can only place this rally point if you are the leader of your group. There is a 5-minute cooldown after placing a beacon before another beacon for that side can be placed.
Place rally point"
]];
From 3dc9995c80c1706a054401ef8a298fb92e74f818 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 17 Jan 2025 14:01:04 +0000
Subject: [PATCH 54/81] Side-specific beacon colours
---
f/respawn/fn_respawnBeaconDeploy.sqf | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/f/respawn/fn_respawnBeaconDeploy.sqf b/f/respawn/fn_respawnBeaconDeploy.sqf
index 243be6e5..a0942d98 100644
--- a/f/respawn/fn_respawnBeaconDeploy.sqf
+++ b/f/respawn/fn_respawnBeaconDeploy.sqf
@@ -62,7 +62,8 @@ if !(alive _caller) exitWith {};
_beacon setVectorUp [0,0,1];
_beacon setDir (getDir _caller - 90);
- private _smoke = "SmokeShellRed_Infinite" createVehicle [0,0,0];
+ private _smokeType = ["SmokeShellRed_Infinite", "SmokeShellBlue_Infinite", "SmokeShellGreen_Infinite", "SmokeShellPurple_Infinite", "SmokeShellYellow_Infinite","SmokeShellWhite_Infinite","SmokeShellWhite_Infinite","SmokeShellWhite_Infinite","SmokeShellWhite_Infinite","SmokeShellWhite_Infinite"] select ((side group _caller) call BIS_fnc_sideID);
+ private _smoke = _smokeType createVehicle [0,0,0];
_smoke setPosASL _position;
_beacon setVariable ["f_beaconSmoke",_smoke,true];
From 4230bf88b7f1981a4bc5347465199c72f907b79d Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 17 Jan 2025 14:42:28 +0000
Subject: [PATCH 55/81] Switch to beacon-side deployment action
---
f/functions.hpp | 1 +
f/respawn/fn_respawnBeaconAction.sqf | 39 ++++++++++++++++++++++++
f/respawn/fn_respawnBeaconDeploy.sqf | 8 ++++-
f/respawn/fn_respawnBeaconTeleport.sqf | 42 ++++++++++++++------------
f/respawn/fn_respawnTerminalAction.sqf | 25 ---------------
5 files changed, 70 insertions(+), 45 deletions(-)
create mode 100644 f/respawn/fn_respawnBeaconAction.sqf
diff --git a/f/functions.hpp b/f/functions.hpp
index 95983f64..3feab4de 100644
--- a/f/functions.hpp
+++ b/f/functions.hpp
@@ -88,6 +88,7 @@ class F // Defines the "owner"
file = "f\respawn";
class respawn{};
class respawnBriefing{};
+ class respawnBeaconAction{};
class respawnBeaconDeploy{};
class respawnBeaconTeleport{};
class respawnKilled{};
diff --git a/f/respawn/fn_respawnBeaconAction.sqf b/f/respawn/fn_respawnBeaconAction.sqf
new file mode 100644
index 00000000..50c7ad18
--- /dev/null
+++ b/f/respawn/fn_respawnBeaconAction.sqf
@@ -0,0 +1,39 @@
+// FA3 - Respawn Module - Beacon Summon Action
+// Credits and documentation: https://github.com/folkarps/F3/wiki
+
+/* ========================
+This function is executed from fn_respawnBeaconDeploy, or manually by the missionmaker. It must be executed on all machines with JIP persistence.
+It adds an action to the given object, allowing it to act as an FA3 Respawn Beacon, used to summon players of your side from the respawn base.
+Example:
+[_object] remoteExec ["f_fnc_respawnBeaconAction",0,true];
+_object call f_fnc_respawnBeaconAction;
+
+Arguments:
+0. Target (object) - object to add the action to
+=========================== */
+
+params ["_object"];
+
+[
+ _object,
+ "Call reinforcements to rally point",
+ "a3\ui_f_oldman\data\igui\cfg\holdactions\meet_ca.paa",
+ "a3\ui_f_oldman\data\igui\cfg\holdactions\meet_ca.paa",
+ "isNull objectParent _this",
+ "isNull objectParent _this",
+ {
+ private _text = format ["[%1] Searching for ready reinforcements...", str side group _caller];
+ systemChat _text;
+ },
+ {},
+ {
+ _caller call f_fnc_respawnBeaconTeleport;
+ },
+ {},
+ [],
+ 3,
+ 0,
+ false,
+ false,
+ true
+] call BIS_fnc_holdActionAdd;
\ No newline at end of file
diff --git a/f/respawn/fn_respawnBeaconDeploy.sqf b/f/respawn/fn_respawnBeaconDeploy.sqf
index a0942d98..55001ef0 100644
--- a/f/respawn/fn_respawnBeaconDeploy.sqf
+++ b/f/respawn/fn_respawnBeaconDeploy.sqf
@@ -67,10 +67,16 @@ if !(alive _caller) exitWith {};
_smoke setPosASL _position;
_beacon setVariable ["f_beaconSmoke",_smoke,true];
+ private _sphere = "Sign_Sphere100cm_Geometry_F" createVehicle [0,0,0];
+ _sphere setObjectTextureGlobal [0, ""];
+ _sphere setPosASL (_position vectorAdd [0,0,0.5]);
+ [_sphere] remoteExec ["f_fnc_respawnBeaconAction",0,true];
+ _beacon setVariable ["f_beaconSphere",_sphere,true];
+
// If we got this far we can skip any remaining positions
private _varName = format ["f_var_respawnBeacon_%1", _side];
private _oldBeacon = missionNamespace getVariable [_varName, objNull];
- deleteVehicle ((attachedObjects _oldBeacon) + [_oldBeacon getVariable ["f_beaconSmoke",objNull], _oldBeacon]);
+ deleteVehicle ((attachedObjects _oldBeacon) + [_oldBeacon getVariable ["f_beaconSmoke",objNull], _oldBeacon, _oldBeacon getVariable ["f_beaconSphere",objNull]]);
missionNamespace setVariable [_varName, _beacon, true];
break;
};
diff --git a/f/respawn/fn_respawnBeaconTeleport.sqf b/f/respawn/fn_respawnBeaconTeleport.sqf
index bfc72046..f5b219c9 100644
--- a/f/respawn/fn_respawnBeaconTeleport.sqf
+++ b/f/respawn/fn_respawnBeaconTeleport.sqf
@@ -19,32 +19,36 @@ private _varName = format ["f_var_respawnBeacon_%1", _sideString];
private _respawnBeacon = missionNamespace getVariable [_varname, objNull];
if (isNull _respawnBeacon) exitWith {
- systemChat format ["[%1] No available respawn beacon for your side.", _sideString];
+ systemChat format ["[%1] No available rally point for your side.", _sideString];
};
-if (typeOf _respawnBeacon == "OmniDirectionalAntenna_01_olive_F") exitWith {
-
- private _text = format ["[%1] %2 is deploying to the rally point.", _sideString, name _caller];
- [_text] remoteExec ["systemChat"];
-
- private _pos = (getPosASL _respawnBeacon) vectorAdd [0.5,0,0];
- _caller setPosASL _pos;
+private _readyUnits = (playableUnits + switchableUnits) select {(side _x == side group _caller) && {(_x distance f_respawnTerminal) < 100}};
+if (count _readyUnits < 1) exitWith {
+ systemChat format ["[%1] No available reinforcements for your side.", _sideString];
+};
+if (typeOf _respawnBeacon == "OmniDirectionalAntenna_01_olive_F") exitWith {
+ {
+ private _text = format ["[%1] %2 is deploying to the rally point.", _sideString, name _x];
+ [_text] remoteExec ["systemChat"];
+ private _randomNumber = random [0.5, 1, 1.5];
+ private _pos = (getPosASL _respawnBeacon) vectorAdd [_randomNumber, random [-1, 0, 1], 0];
+ _x setPosASL _pos;
+ } forEach _readyUnits;
};
if (_respawnBeacon isKindOf "AllVehicles") exitWith {
-
if (!alive _respawnBeacon) exitWith {
- systemChat "Respawn vehicle has been destroyed! Please wait for a new deployment point.";
+ systemChat "Rally point vehicle has been destroyed! Please wait for a new deployment point.";
};
- if (_respawnBeacon emptyPositions "Cargo" >= 1) then {
- private _text = format ["[%1] %2 is deploying to the rally point vehicle.", _sideString, name _caller];
- [_text] remoteExec ["systemChat"];
-
- _caller moveInCargo _respawnBeacon;
- } else {
- systemChat "Rally point vehicle has no available cargo seats, please try again.";
- };
-
+ {
+ if (_respawnBeacon emptyPositions "Cargo" >= 1) then {
+ private _text = format ["[%1] %2 is deploying to the rally point vehicle.", _sideString, name _x];
+ [_text] remoteExec ["systemChat"];
+ _x moveInCargo _respawnBeacon;
+ } else {
+ breakWith { systemChat "Rally point vehicle has no available cargo seats, please try again." };
+ };
+ } forEach _readyUnits;
};
diff --git a/f/respawn/fn_respawnTerminalAction.sqf b/f/respawn/fn_respawnTerminalAction.sqf
index e1f730f5..918cd83b 100644
--- a/f/respawn/fn_respawnTerminalAction.sqf
+++ b/f/respawn/fn_respawnTerminalAction.sqf
@@ -17,31 +17,6 @@ if (isNil "f_respawnBase") exitWith {
systemChat "FA3 Respawn: Critical: Respawn Base object is not present or not correctly named f_respawnBase.";
};
-[
- f_respawnTerminal,
- "Deploy to side rally point",
- "a3\ui_f_oldman\data\igui\cfg\holdactions\meet_ca.paa",
- "a3\ui_f_oldman\data\igui\cfg\holdactions\meet_ca.paa",
- "isNull objectParent _this",
- "isNull objectParent _this",
- {
- private _text = format ["[%1] Searching for valid rally point...", str side group _caller];
- systemChat _text;
- },
- {},
- {
- _caller call f_fnc_respawnBeaconTeleport;
- },
- {},
- [],
- 2,
- 0,
- false,
- false,
- true
-] call BIS_fnc_holdActionAdd;
-
-
[
f_respawnTerminal,
"Spectate your team",
From fcc5e8cd9e1b33518b73738afe52d64ad5bcc52c Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 17 Jan 2025 14:44:45 +0000
Subject: [PATCH 56/81] Add radius override
---
f/respawn/fn_respawnBeaconAction.sqf | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/f/respawn/fn_respawnBeaconAction.sqf b/f/respawn/fn_respawnBeaconAction.sqf
index 50c7ad18..e8254205 100644
--- a/f/respawn/fn_respawnBeaconAction.sqf
+++ b/f/respawn/fn_respawnBeaconAction.sqf
@@ -10,9 +10,10 @@ _object call f_fnc_respawnBeaconAction;
Arguments:
0. Target (object) - object to add the action to
+1. Radius (number) - Optional - radius for the action. Increase it for large objects as the radius is measured from object centre. Default: 3
=========================== */
-params ["_object"];
+params ["_object",["_radius",3]];
[
_object,
@@ -31,7 +32,7 @@ params ["_object"];
},
{},
[],
- 3,
+ _radius,
0,
false,
false,
From 1666de4f61d7bd464bf4fc2ee20568c23dbdffce Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 17 Jan 2025 14:50:33 +0000
Subject: [PATCH 57/81] Locality/timing
---
f/respawn/fn_respawnBeaconAction.sqf | 2 +-
f/respawn/fn_respawnBeaconTeleport.sqf | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/f/respawn/fn_respawnBeaconAction.sqf b/f/respawn/fn_respawnBeaconAction.sqf
index e8254205..cdfadd40 100644
--- a/f/respawn/fn_respawnBeaconAction.sqf
+++ b/f/respawn/fn_respawnBeaconAction.sqf
@@ -28,7 +28,7 @@ params ["_object",["_radius",3]];
},
{},
{
- _caller call f_fnc_respawnBeaconTeleport;
+ _caller spawn f_fnc_respawnBeaconTeleport;
},
{},
[],
diff --git a/f/respawn/fn_respawnBeaconTeleport.sqf b/f/respawn/fn_respawnBeaconTeleport.sqf
index f5b219c9..9d776874 100644
--- a/f/respawn/fn_respawnBeaconTeleport.sqf
+++ b/f/respawn/fn_respawnBeaconTeleport.sqf
@@ -45,10 +45,11 @@ if (_respawnBeacon isKindOf "AllVehicles") exitWith {
if (_respawnBeacon emptyPositions "Cargo" >= 1) then {
private _text = format ["[%1] %2 is deploying to the rally point vehicle.", _sideString, name _x];
[_text] remoteExec ["systemChat"];
- _x moveInCargo _respawnBeacon;
+ [_x,_respawnBeacon] remoteExec ["moveInCargo"];
} else {
breakWith { systemChat "Rally point vehicle has no available cargo seats, please try again." };
};
+ sleep 0.3;
} forEach _readyUnits;
};
From 74c495e2e87335afe30f18b395071acb9029e348 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 17 Jan 2025 19:32:18 +0000
Subject: [PATCH 58/81] Update briefing.
---
f/respawn/fn_respawnBriefing.sqf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/f/respawn/fn_respawnBriefing.sqf b/f/respawn/fn_respawnBriefing.sqf
index e50c46c0..58f0fb4b 100644
--- a/f/respawn/fn_respawnBriefing.sqf
+++ b/f/respawn/fn_respawnBriefing.sqf
@@ -20,7 +20,7 @@ _str_deploy = "deployment vehicle.";
if (_respawnMode == 0) then {
player createDiaryRecord ["fa3_actions",["FA3 Rally Point","
-The FA3 Respawn system allows team leaders to deploy a rally point for their side. Respawning players can teleport to this rally point.
+The FA3 Respawn system allows team leaders to deploy a rally point for their side. You can use this rally point to summon respawning players.
Placing this rally point will remove any previously-placed rally point for your side. You can only place this rally point if you are the leader of your group. There is a 5-minute cooldown after placing a beacon before another beacon for that side can be placed.
@@ -36,7 +36,7 @@ player createDiaryRecord ["diary", ["FA3 Respawn",format ["
If you have been unconscious for 3 minutes straight, you will have the option to respawn. After a brief timeout, you will respawn at a neutral base location.
-At the base, you will have access to a terminal, which you can use to either spectate your team, or teleport to your side's %2
+At the base, you will have access to a terminal, which you can use to spectate your team, while you wait to be deployed to your side's %2
Your side has %1 respawn tickets at mission start.
",f_param_respawnTickets,_str_deploy]]];
From 05c198bc193035107d90842a2e914945fbf8e098 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 17 Jan 2025 19:44:22 +0000
Subject: [PATCH 59/81] Add transport pickup briefing mode
---
f/respawn/fn_respawnBriefing.sqf | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/f/respawn/fn_respawnBriefing.sqf b/f/respawn/fn_respawnBriefing.sqf
index 58f0fb4b..4b61e578 100644
--- a/f/respawn/fn_respawnBriefing.sqf
+++ b/f/respawn/fn_respawnBriefing.sqf
@@ -7,7 +7,7 @@ Example:
0 spawn f_fnc_respawnBriefing
Arguments:
-0. mode: 0 - deployable beacons, 1 - teleport to vehicle
+0. mode: 0 - deployable beacons, 1 - teleport to vehicle, 2 - respawn and wait for pickup
=========================== */
if !(hasInterface) exitWith {};
if !(isNil "f_var_respawn_briefingDone") exitWith{};
@@ -15,7 +15,7 @@ if !(isNil "f_var_respawn_briefingDone") exitWith{};
params ["_respawnMode"];
waitUntil {scriptDone f_script_briefing};
-_str_deploy = "deployment vehicle.";
+_str_deploy = "to be deployed to your side's deployment vehicle.";
if (_respawnMode == 0) then {
player createDiaryRecord ["fa3_actions",["FA3 Rally Point","
@@ -26,7 +26,11 @@ Placing this rally point will remove any previously-placed rally point for your
Place rally point"
]];
- _str_deploy = "rally point.
Group leaders can place their side's rally point from the FA3 Player Actions briefing menu.";
+ _str_deploy = "to be deployed to your side's rally point.
Group leaders can place their side's rally point from the FA3 Player Actions briefing menu.";
+};
+
+if (_respawnMode == 1) then {
+ _str_deploy = "for pickup by an allied transport";
};
waitUntil {!isNil "f_script_loadoutNotes"};
@@ -36,7 +40,7 @@ player createDiaryRecord ["diary", ["FA3 Respawn",format ["
If you have been unconscious for 3 minutes straight, you will have the option to respawn. After a brief timeout, you will respawn at a neutral base location.
-At the base, you will have access to a terminal, which you can use to spectate your team, while you wait to be deployed to your side's %2
+At the base, you will have access to a terminal, which you can use to spectate your team, while you wait %2
Your side has %1 respawn tickets at mission start.
",f_param_respawnTickets,_str_deploy]]];
From f708d2ecf1b2a5a394620dac9a0b2bf8360eea52 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 17 Jan 2025 19:51:26 +0000
Subject: [PATCH 60/81] Update comment
---
init.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/init.sqf b/init.sqf
index 0c63bec2..a7f9324d 100644
--- a/init.sqf
+++ b/init.sqf
@@ -179,7 +179,7 @@ if isServer then {
[_x, f_param_respawnTickets] call BIS_fnc_respawnTickets;
} forEach [east, west, independent, civilian];
};
-0 spawn f_fnc_respawnBriefing; // 0 - deployable beacons, 1 - teleport to vehicle
+0 spawn f_fnc_respawnBriefing; // 0 - deployable beacons, 1 - teleport to vehicle, 2 - wait for pickup
0 spawn f_fnc_respawnTerminalAction;
// ====================================================================================
From 759cb3dc03fec0cf2d7add9ded6f49121a1eb315 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Fri, 17 Jan 2025 23:01:03 +0000
Subject: [PATCH 61/81] fix briefing mode
---
f/respawn/fn_respawnBriefing.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/respawn/fn_respawnBriefing.sqf b/f/respawn/fn_respawnBriefing.sqf
index 4b61e578..bf27eb5d 100644
--- a/f/respawn/fn_respawnBriefing.sqf
+++ b/f/respawn/fn_respawnBriefing.sqf
@@ -29,7 +29,7 @@ Placing this rally point will remove any previously-placed rally point for your
_str_deploy = "to be deployed to your side's rally point.
Group leaders can place their side's rally point from the FA3 Player Actions briefing menu.";
};
-if (_respawnMode == 1) then {
+if (_respawnMode == 2) then {
_str_deploy = "for pickup by an allied transport";
};
From 62cc5905a5480492e8d398bcf69f85691dd4d6d7 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 19 Jan 2025 14:27:35 +0000
Subject: [PATCH 62/81] Remove dead units from channels
---
f/radio/fn_radioAddHandlers.sqf | 34 +++++++++++++++----------------
f/radio/fn_radioCheckChannels.sqf | 4 ++++
f/respawn/fn_respawnKilled.sqf | 3 ++-
3 files changed, 23 insertions(+), 18 deletions(-)
diff --git a/f/radio/fn_radioAddHandlers.sqf b/f/radio/fn_radioAddHandlers.sqf
index 52825393..be4c4789 100644
--- a/f/radio/fn_radioAddHandlers.sqf
+++ b/f/radio/fn_radioAddHandlers.sqf
@@ -11,7 +11,7 @@ params [["_respawned",false]];
waitUntil {(!isNull player && {player == player}) && !(isNil "f_var_radioChannelsUnified")};
// Add player to the correct channels if they have a backpack
-[player] spawn f_fnc_radioCheckChannels;
+player spawn f_fnc_radioCheckChannels;
// Now bail if they've already been handled, unless they respawned in which case they do need the actions adding
if (player getVariable ["f_var_radioHandlersAdded",false] && !_respawned) exitWith {};
@@ -24,44 +24,44 @@ if _respawned exitWith {};
// Update channels if they drop a backpack
player addEventHandler ["put", {
- params ["_unit", "_container", "_item"];
- [_unit] spawn f_fnc_radioCheckChannels;
+ params ["_unit"];
+ _unit spawn f_fnc_radioCheckChannels;
}];
// Update channels if they take a backpack
player addEventHandler ["take", {
- params ["_unit", "_container", "_item"];
- [_unit] spawn f_fnc_radioCheckChannels;
+ params ["_unit"];
+ _unit spawn f_fnc_radioCheckChannels;
}];
// Update channels if they open their inventory
player addEventHandler ["inventoryOpened", {
- params ["_unit", "_container"];
- [_unit] spawn f_fnc_radioCheckChannels;
+ params ["_unit"];
+ _unit spawn f_fnc_radioCheckChannels;
}];
// Update channels if they close their inventory
player addEventHandler ["inventoryClosed", {
- params ["_unit", "_container"];
- [_unit] spawn f_fnc_radioCheckChannels;
+ params ["_unit"];
+ _unit spawn f_fnc_radioCheckChannels;
}];
// Update channels if they get in a vehicle
player addEventHandler ["getInMan", {
- params ["_unit", "_role", "_vehicle", "_turret"];
- [_unit] spawn f_fnc_radioCheckChannels;
+ params ["_unit"];
+ _unit spawn f_fnc_radioCheckChannels;
}];
// Update channels if they get out of a vehicle
player addEventHandler ["getOutMan", {
- params ["_unit", "_role", "_vehicle", "_turret"];
- [_unit] spawn f_fnc_radioCheckChannels;
+ params ["_unit"];
+ _unit spawn f_fnc_radioCheckChannels;
}];
// Update channels if they switch seats in a vehicle
player addEventHandler ["seatSwitchedMan", {
- params ["_unit1", "_unit2", "_vehicle"];
- [_unit1] spawn f_fnc_radioCheckChannels;
+ params ["_unit1"];
+ _unit1 spawn f_fnc_radioCheckChannels;
}];
// Add respawn protection
@@ -85,7 +85,7 @@ if (isNil "f_var_radioPersistentCheck") then {
[] spawn {
while {f_var_radioPersistentCheck} do {
sleep 10;
- [player] spawn f_fnc_radioCheckChannels;
+ player spawn f_fnc_radioCheckChannels;
};
};
};
@@ -98,4 +98,4 @@ if (f_param_debugMode == 1) then
// Check again!
sleep 1;
-[player] spawn f_fnc_radioCheckChannels;
\ No newline at end of file
+player spawn f_fnc_radioCheckChannels;
\ No newline at end of file
diff --git a/f/radio/fn_radioCheckChannels.sqf b/f/radio/fn_radioCheckChannels.sqf
index 116507cc..dfd6b82c 100644
--- a/f/radio/fn_radioCheckChannels.sqf
+++ b/f/radio/fn_radioCheckChannels.sqf
@@ -96,6 +96,10 @@ for "_i" from 1 to 2 do {
if !(_unit getVariable ["f_var_fam_conscious",true]) then {
_channelsToAddTalk = [];
};
+ if !(alive _unit) then {
+ _channelsToAddTalk = [];
+ _channelsToAddListen = [];
+ };
// Remove channels player shouldn't have access to
for "_i" from 1 to f_var_radioChannelCount do {
diff --git a/f/respawn/fn_respawnKilled.sqf b/f/respawn/fn_respawnKilled.sqf
index c6dfb988..8e83dbe0 100644
--- a/f/respawn/fn_respawnKilled.sqf
+++ b/f/respawn/fn_respawnKilled.sqf
@@ -12,4 +12,5 @@ Arguments: as automatically passed to onPlayerKilled.sqf
_this spawn f_fnc_activateSpectator;
private _unit = _this#0;
_unit setVariable ["f_var_lastTeamColour",assignedTeam _unit,true];
-_unit setVariable ["f_var_unitTraits", getAllUnitTraits _unit, true];
\ No newline at end of file
+_unit setVariable ["f_var_unitTraits", getAllUnitTraits _unit, true];
+_unit spawn f_fnc_radioCheckChannels;
\ No newline at end of file
From 3135cea8349508a236597ed9a54922170f99a6de Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 19 Jan 2025 15:56:01 +0000
Subject: [PATCH 63/81] Fix beacon cooldown
---
f/respawn/fn_respawnBeaconDeploy.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/respawn/fn_respawnBeaconDeploy.sqf b/f/respawn/fn_respawnBeaconDeploy.sqf
index 55001ef0..7fa9936e 100644
--- a/f/respawn/fn_respawnBeaconDeploy.sqf
+++ b/f/respawn/fn_respawnBeaconDeploy.sqf
@@ -21,7 +21,7 @@ if !(_caller == leader _caller) exitWith {
// Check cooldown
private _side = str side group _caller;
private _timerVarName = format ["f_var_lastRespawnBeacon_%1", _side];
-private _cooldown = serverTime - (missionNamespace getVariable [_timerVarName, serverTime]);
+private _cooldown = serverTime - (missionNamespace getVariable [_timerVarName, serverTime - 301]);
if (_cooldown < 300) exitWith {
private _text = format ["[%1] Rally beacon on cooldown: %2", _side, [_cooldown, "MM:SS"] call BIS_fnc_secondsToString];
systemChat _text;
From 471e7c591e548a71e4f383fead216ce73382f5b0 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 19 Jan 2025 16:23:59 +0000
Subject: [PATCH 64/81] text fix
---
f/respawn/fn_respawnBeaconDeploy.sqf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/f/respawn/fn_respawnBeaconDeploy.sqf b/f/respawn/fn_respawnBeaconDeploy.sqf
index 7fa9936e..ea14e1d8 100644
--- a/f/respawn/fn_respawnBeaconDeploy.sqf
+++ b/f/respawn/fn_respawnBeaconDeploy.sqf
@@ -28,7 +28,7 @@ if (_cooldown < 300) exitWith {
};
_caller playActionNow "MedicOther";
-private _text = format ["[%1] %2 is deploying a respawn beacon.", _side, name _caller];
+private _text = format ["[%1] %2 is deploying a rally beacon.", _side, name _caller];
[_text] remoteExec ["systemChat"];
sleep 5;
@@ -85,5 +85,5 @@ if !(alive _caller) exitWith {};
// Cooldown marker
missionNamespace setVariable [_timerVarName, serverTime, true];
-private _text = format ["[%1] %2 deployed a respawn beacon.", _side, name _caller];
+private _text = format ["[%1] %2 deployed a rally beacon.", _side, name _caller];
[_text] remoteExec ["systemChat"];
\ No newline at end of file
From 837e0c22cad27e8b53f3da4b1dd13ede7188771a Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 19 Jan 2025 16:33:44 +0000
Subject: [PATCH 65/81] fix side check
---
f/respawn/fn_respawnBeaconTeleport.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/respawn/fn_respawnBeaconTeleport.sqf b/f/respawn/fn_respawnBeaconTeleport.sqf
index 9d776874..62c6b07a 100644
--- a/f/respawn/fn_respawnBeaconTeleport.sqf
+++ b/f/respawn/fn_respawnBeaconTeleport.sqf
@@ -22,7 +22,7 @@ if (isNull _respawnBeacon) exitWith {
systemChat format ["[%1] No available rally point for your side.", _sideString];
};
-private _readyUnits = (playableUnits + switchableUnits) select {(side _x == side group _caller) && {(_x distance f_respawnTerminal) < 100}};
+private _readyUnits = (playableUnits + switchableUnits) select {(side group _x == side group _caller) && {(_x distance f_respawnTerminal) < 100}};
if (count _readyUnits < 1) exitWith {
systemChat format ["[%1] No available reinforcements for your side.", _sideString];
};
From f41a947c3676f3d2626d7d510d96802a300369c7 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 19 Jan 2025 16:43:13 +0000
Subject: [PATCH 66/81] fix action radius
---
f/respawn/fn_respawnBeaconAction.sqf | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/f/respawn/fn_respawnBeaconAction.sqf b/f/respawn/fn_respawnBeaconAction.sqf
index cdfadd40..950a8186 100644
--- a/f/respawn/fn_respawnBeaconAction.sqf
+++ b/f/respawn/fn_respawnBeaconAction.sqf
@@ -15,13 +15,15 @@ Arguments:
params ["_object",["_radius",3]];
+private _condition = format ["(isNull objectParent _this) && {(_this distance _target) < %1}", _radius];
+
[
_object,
"Call reinforcements to rally point",
"a3\ui_f_oldman\data\igui\cfg\holdactions\meet_ca.paa",
"a3\ui_f_oldman\data\igui\cfg\holdactions\meet_ca.paa",
- "isNull objectParent _this",
- "isNull objectParent _this",
+ _condition,
+ _condition,
{
private _text = format ["[%1] Searching for ready reinforcements...", str side group _caller];
systemChat _text;
@@ -32,8 +34,8 @@ params ["_object",["_radius",3]];
},
{},
[],
- _radius,
- 0,
+ 5,
+ 10,
false,
false,
true
From fc6782f9e741a100a0cfae590bfe949c8acee0a3 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 19 Jan 2025 17:09:31 +0000
Subject: [PATCH 67/81] change animation method
---
f/medical/fn_famAddHealAction.sqf | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/f/medical/fn_famAddHealAction.sqf b/f/medical/fn_famAddHealAction.sqf
index 988df165..7a57d547 100644
--- a/f/medical/fn_famAddHealAction.sqf
+++ b/f/medical/fn_famAddHealAction.sqf
@@ -18,43 +18,43 @@ private _healMedicTime = 8.5; // Action Duration
private _healCodeStart = {
// this is needed to protect against BI bugs that remove all actions.
_caller setVariable ["f_var_fam_flag",true];
-
- // Match medic animation speed to speed modifier.
- if (_caller getUnitTrait 'medic') then {
- _caller setAnimSpeedCoef 0.9;
- } else {
- _caller setAnimSpeedCoef 0.6;
- };
if (stance _caller == "PRONE") then {
// Rifle or Binocular
if ((currentWeapon _caller == binocular _caller) || (currentWeapon _caller == primaryWeapon _caller && {primaryWeapon _caller != ""})) exitWith {
- _caller playMove "ainvppnemstpslaywrfldnon_medicother";
+ _caller playMove "ainvppnemstpslaywrfldnon_medicother";
+ _caller setVariable ["f_var_fam_animation","ainvppnemstpslaywrfldnon_medicother"];
};
// Nothing
if (currentWeapon _caller == "") exitWith {
_caller playMove "ainvppnemstpslaywnondnon_medicother";
+ _caller setVariable ["f_var_fam_animation","ainvppnemstpslaywnondnon_medicother"];
};
// Pistol
if (currentWeapon _caller == handgunWeapon _caller && {primaryWeapon _caller != ""}) exitWith {
_caller playMove "ainvppnemstpslaywpstdnon_medicother";
+ _caller setVariable ["f_var_fam_animation","ainvppnemstpslaywpstdnon_medicother"];
};
} else {
// Rifle or Binocular
if ((currentWeapon _caller == binocular _caller) || (currentWeapon _caller == primaryWeapon _caller && {primaryWeapon _caller != ""})) exitWith {
- _caller playMove "ainvpknlmstpslaywrfldnon_medicother";
+ _caller playMove "ainvpknlmstpslaywrfldnon_medicother";
+ _caller setVariable ["f_var_fam_animation","ainvpknlmstpslaywrfldnon_medicother"];
};
// Nothing
if (currentWeapon _caller == "") exitWith {
_caller playMove "ainvpknlmstpslaywnondnon_medicother";
+ _caller setVariable ["f_var_fam_animation","ainvpknlmstpslaywnondnon_medicother"];
};
// Launcher
if (currentWeapon _caller == secondaryWeapon _caller && {primaryWeapon _caller != ""}) exitWith {
_caller playMove "ainvpknlmstpslaywlnrdnon_medicother";
+ _caller setVariable ["f_var_fam_animation","ainvpknlmstpslaywlnrdnon_medicother"];
};
// Pistol
if (currentWeapon _caller == handgunWeapon _caller && {primaryWeapon _caller != ""}) exitWith {
_caller playMove "ainvpknlmstpslaywpstdnon_medicother";
+ _caller setVariable ["f_var_fam_animation","ainvpknlmstpslaywpstdnon_medicother"];
};
};
// Let the wounded know someone is trying to save them.
@@ -62,7 +62,12 @@ private _healCodeStart = {
};
// Progress Code
-private _healCodeProg = {};
+private _healCodeProg = {
+ private _anim = _caller getVariable ["f_var_fam_animation",""];
+ if ((animationState _caller != _anim) && {_frame < 22} then {
+ _caller playMove _anim;
+ };
+};
// Completed Code
private _healCodeComp = {
From 69b99e42447d3da2393b31e67671d57d6f0131a2 Mon Sep 17 00:00:00 2001
From: costno
Date: Sun, 19 Jan 2025 12:18:23 -0500
Subject: [PATCH 68/81] excess bracket
---
f/medical/fn_famAddHealAction.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/medical/fn_famAddHealAction.sqf b/f/medical/fn_famAddHealAction.sqf
index 7a57d547..479d254b 100644
--- a/f/medical/fn_famAddHealAction.sqf
+++ b/f/medical/fn_famAddHealAction.sqf
@@ -64,7 +64,7 @@ private _healCodeStart = {
// Progress Code
private _healCodeProg = {
private _anim = _caller getVariable ["f_var_fam_animation",""];
- if ((animationState _caller != _anim) && {_frame < 22} then {
+ if (animationState _caller != _anim) && {_frame < 22} then {
_caller playMove _anim;
};
};
From 7e5e2a6133e82b15890a9bbeaad184924e73ce32 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 19 Jan 2025 17:22:05 +0000
Subject: [PATCH 69/81] fix bracket
---
f/medical/fn_famAddHealAction.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/medical/fn_famAddHealAction.sqf b/f/medical/fn_famAddHealAction.sqf
index 479d254b..c4e6bbcb 100644
--- a/f/medical/fn_famAddHealAction.sqf
+++ b/f/medical/fn_famAddHealAction.sqf
@@ -64,7 +64,7 @@ private _healCodeStart = {
// Progress Code
private _healCodeProg = {
private _anim = _caller getVariable ["f_var_fam_animation",""];
- if (animationState _caller != _anim) && {_frame < 22} then {
+ if ((animationState _caller != _anim) && {_frame < 22}) then {
_caller playMove _anim;
};
};
From a55a9eed9774755396bc66018107875a4db20257 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 19 Jan 2025 17:35:44 +0000
Subject: [PATCH 70/81] Change animation method again
---
f/medical/fn_famAddHealAction.sqf | 50 ++-----------------------------
1 file changed, 3 insertions(+), 47 deletions(-)
diff --git a/f/medical/fn_famAddHealAction.sqf b/f/medical/fn_famAddHealAction.sqf
index c4e6bbcb..95d30bb9 100644
--- a/f/medical/fn_famAddHealAction.sqf
+++ b/f/medical/fn_famAddHealAction.sqf
@@ -18,61 +18,17 @@ private _healMedicTime = 8.5; // Action Duration
private _healCodeStart = {
// this is needed to protect against BI bugs that remove all actions.
_caller setVariable ["f_var_fam_flag",true];
-
- if (stance _caller == "PRONE") then {
- // Rifle or Binocular
- if ((currentWeapon _caller == binocular _caller) || (currentWeapon _caller == primaryWeapon _caller && {primaryWeapon _caller != ""})) exitWith {
- _caller playMove "ainvppnemstpslaywrfldnon_medicother";
- _caller setVariable ["f_var_fam_animation","ainvppnemstpslaywrfldnon_medicother"];
- };
- // Nothing
- if (currentWeapon _caller == "") exitWith {
- _caller playMove "ainvppnemstpslaywnondnon_medicother";
- _caller setVariable ["f_var_fam_animation","ainvppnemstpslaywnondnon_medicother"];
- };
- // Pistol
- if (currentWeapon _caller == handgunWeapon _caller && {primaryWeapon _caller != ""}) exitWith {
- _caller playMove "ainvppnemstpslaywpstdnon_medicother";
- _caller setVariable ["f_var_fam_animation","ainvppnemstpslaywpstdnon_medicother"];
- };
- } else {
- // Rifle or Binocular
- if ((currentWeapon _caller == binocular _caller) || (currentWeapon _caller == primaryWeapon _caller && {primaryWeapon _caller != ""})) exitWith {
- _caller playMove "ainvpknlmstpslaywrfldnon_medicother";
- _caller setVariable ["f_var_fam_animation","ainvpknlmstpslaywrfldnon_medicother"];
- };
- // Nothing
- if (currentWeapon _caller == "") exitWith {
- _caller playMove "ainvpknlmstpslaywnondnon_medicother";
- _caller setVariable ["f_var_fam_animation","ainvpknlmstpslaywnondnon_medicother"];
- };
- // Launcher
- if (currentWeapon _caller == secondaryWeapon _caller && {primaryWeapon _caller != ""}) exitWith {
- _caller playMove "ainvpknlmstpslaywlnrdnon_medicother";
- _caller setVariable ["f_var_fam_animation","ainvpknlmstpslaywlnrdnon_medicother"];
- };
- // Pistol
- if (currentWeapon _caller == handgunWeapon _caller && {primaryWeapon _caller != ""}) exitWith {
- _caller playMove "ainvpknlmstpslaywpstdnon_medicother";
- _caller setVariable ["f_var_fam_animation","ainvpknlmstpslaywpstdnon_medicother"];
- };
- };
- // Let the wounded know someone is trying to save them.
- if !(_target getVariable ['f_var_fam_conscious',true]) then {[["Someone is helping you", "PLAIN"]] remoteExec ["titleText",_target];}; // TODO Test?
+ _caller playAction "medicStart";
};
// Progress Code
-private _healCodeProg = {
- private _anim = _caller getVariable ["f_var_fam_animation",""];
- if ((animationState _caller != _anim) && {_frame < 22}) then {
- _caller playMove _anim;
- };
-};
+private _healCodeProg = {};
// Completed Code
private _healCodeComp = {
// this is needed to protect against BI bugs that remove all actions.
_caller setVariable ["f_var_fam_flag",false];
+ _caller playAction "medicStop";
// Medic heals to full only if they have a medikit. TODO CLS Support?
if (_caller getUnitTrait 'Medic' && (_caller call f_fnc_famHasFAK >= 1)) then {
From 0e6696d33352b2e3a59db655b7f6106fa906215d Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 19 Jan 2025 17:37:59 +0000
Subject: [PATCH 71/81] Change interrupt too
---
f/medical/fn_famAddHealAction.sqf | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/f/medical/fn_famAddHealAction.sqf b/f/medical/fn_famAddHealAction.sqf
index 95d30bb9..bf10d087 100644
--- a/f/medical/fn_famAddHealAction.sqf
+++ b/f/medical/fn_famAddHealAction.sqf
@@ -51,13 +51,7 @@ private _healCodeComp = {
private _healCodeInt = {
// this is needed to protect against BI bugs that remove all actions.
_caller setVariable ["f_var_fam_flag",false];
-
- // Exit animation
- if (animationState _caller find "ppne" != -1) then {
- _caller switchMove "AinvPpneMstpSlayWnonDnon_medicOut";
- } else {
- _caller switchMove "AinvPknlMstpSlayWnonDnon_medicOut";
- };
+ _caller playAction "medicStop";
};
// ====================================================================================
From 9fe8cdc9507b9faab6ee87d69819668981575576 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 19 Jan 2025 17:54:02 +0000
Subject: [PATCH 72/81] Change spectator timing
---
f/respawn/fn_respawnKilled.sqf | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/f/respawn/fn_respawnKilled.sqf b/f/respawn/fn_respawnKilled.sqf
index 8e83dbe0..e05425aa 100644
--- a/f/respawn/fn_respawnKilled.sqf
+++ b/f/respawn/fn_respawnKilled.sqf
@@ -9,8 +9,9 @@ onPlayerKilled = "f_fnc_respawnKilled";
Arguments: as automatically passed to onPlayerKilled.sqf
=========================== */
-_this spawn f_fnc_activateSpectator;
private _unit = _this#0;
_unit setVariable ["f_var_lastTeamColour",assignedTeam _unit,true];
_unit setVariable ["f_var_unitTraits", getAllUnitTraits _unit, true];
-_unit spawn f_fnc_radioCheckChannels;
\ No newline at end of file
+_unit spawn f_fnc_radioCheckChannels;
+sleep 3;
+_this spawn f_fnc_activateSpectator;
\ No newline at end of file
From 21b1006c2cb76491e721927e9071316c4cca8379 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Tue, 21 Jan 2025 16:56:38 +0000
Subject: [PATCH 73/81] double plus safety
---
f/missionConditions/f_conditionNotes.sqf | 1 +
1 file changed, 1 insertion(+)
diff --git a/f/missionConditions/f_conditionNotes.sqf b/f/missionConditions/f_conditionNotes.sqf
index 1446f413..29859219 100644
--- a/f/missionConditions/f_conditionNotes.sqf
+++ b/f/missionConditions/f_conditionNotes.sqf
@@ -70,5 +70,6 @@ _diaryText = _diaryText + format ["
Mo
// Insert final result into briefing
+waitUntil {!isNil "f_script_briefing"};
waitUntil {scriptDone f_script_briefing};
player createDiaryRecord ["diary", ["Mission Conditions", _diaryText]];
From 3dae9f801e3d72b4ae7c38e40aed2a2fdab2c1a5 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 2 Feb 2025 00:10:30 +0000
Subject: [PATCH 74/81] var global change (fix for reconnects?)
---
f/medical/fn_famInit.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/medical/fn_famInit.sqf b/f/medical/fn_famInit.sqf
index efebf80b..bca6f8dd 100644
--- a/f/medical/fn_famInit.sqf
+++ b/f/medical/fn_famInit.sqf
@@ -115,4 +115,4 @@ if (isNil "f_var_fam_briefingDone") then {
[] call f_fnc_famBriefing;
};
-player setVariable ["f_var_fam_initDone",true,true];
\ No newline at end of file
+player setVariable ["f_var_fam_initDone",true];
\ No newline at end of file
From 664c4944651f54ba8786c338314c0b2142655353 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 2 Feb 2025 23:01:38 +0000
Subject: [PATCH 75/81] Adjust debug logging
---
f/medical/fn_famInit.sqf | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/f/medical/fn_famInit.sqf b/f/medical/fn_famInit.sqf
index bca6f8dd..731daeea 100644
--- a/f/medical/fn_famInit.sqf
+++ b/f/medical/fn_famInit.sqf
@@ -46,7 +46,9 @@ waitUntil{!isNull player && {player == player}};
if (!hasInterface) exitWith {};
if (player getVariable ["f_var_fam_initDone",false]) exitWith {
- systemChat "FAM init already run!";
+ if (f_param_debugMode == 1) then {
+ systemChat "DEBUG (fn_famInit.sqf): FAM init already run!";
+ };
};
// ====================================================================================
@@ -115,4 +117,7 @@ if (isNil "f_var_fam_briefingDone") then {
[] call f_fnc_famBriefing;
};
-player setVariable ["f_var_fam_initDone",true];
\ No newline at end of file
+player setVariable ["f_var_fam_initDone",true];
+if (f_param_debugMode == 1) then {
+ systemChat "DEBUG (fn_famInit.sqf): FAM init run on local player";
+};
\ No newline at end of file
From 04d49609214d5ce180e47022f25b2b23e59eb20a Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 9 Feb 2025 21:39:50 +0000
Subject: [PATCH 76/81] fix closing respawn display on wakeup
---
f/medical/fn_famWakeUp.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/medical/fn_famWakeUp.sqf b/f/medical/fn_famWakeUp.sqf
index 5e7ffebb..a16f2fbc 100644
--- a/f/medical/fn_famWakeUp.sqf
+++ b/f/medical/fn_famWakeUp.sqf
@@ -23,7 +23,7 @@ for "_i" from 2 to 5 do {
};
_unit setVariable ["f_var_fam_knockOutTime",nil,true];
-(missionNamespace getVariable ["f_var_fam_respawnDisplay", displayNull]) closeDisplay 1;
+(uiNamespace getVariable ["f_var_fam_respawnDisplay", displayNull]) closeDisplay 1;
// check for radio channels
[_unit] spawn f_fnc_radioCheckChannels;
From 16bc5b54974ff06e4f5b2ca8153d923a068bdab9 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 9 Feb 2025 21:40:34 +0000
Subject: [PATCH 77/81] grammar
---
f/respawn/fn_respawnBriefing.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/f/respawn/fn_respawnBriefing.sqf b/f/respawn/fn_respawnBriefing.sqf
index bf27eb5d..765a86a1 100644
--- a/f/respawn/fn_respawnBriefing.sqf
+++ b/f/respawn/fn_respawnBriefing.sqf
@@ -30,7 +30,7 @@ Placing this rally point will remove any previously-placed rally point for your
};
if (_respawnMode == 2) then {
- _str_deploy = "for pickup by an allied transport";
+ _str_deploy = "for pickup by an allied transport.";
};
waitUntil {!isNil "f_script_loadoutNotes"};
From 639ae058545aab17b836e4d011736310429d6902 Mon Sep 17 00:00:00 2001
From: costno
Date: Sun, 23 Feb 2025 21:54:58 -0500
Subject: [PATCH 78/81] Remove downed units from group while downed
Needs testing! A new group is created when a unit is downed. In theory this group is auto deleted when the player then rejoins their original group.
---
f/medical/fn_famInit.sqf | 3 +++
f/medical/fn_famPassOut.sqf | 10 ++++++++++
f/medical/fn_famWakeUp.sqf | 6 ++++++
3 files changed, 19 insertions(+)
diff --git a/f/medical/fn_famInit.sqf b/f/medical/fn_famInit.sqf
index 731daeea..2cba225d 100644
--- a/f/medical/fn_famInit.sqf
+++ b/f/medical/fn_famInit.sqf
@@ -73,6 +73,9 @@ _unit setVariable ["f_var_fam_hasbandage",false];
_unit getVariable ["f_var_fam_flag",false];
_unit setVariable ["f_var_fam_actionsAdded",false];
+// Prevent the group from being deleted if all units get downed.
+group _unit deleteGroupWhenEmpty false;
+
[_unit] spawn f_fnc_famLoop;
// ====================================================================================
diff --git a/f/medical/fn_famPassOut.sqf b/f/medical/fn_famPassOut.sqf
index 701f2b7b..037abb15 100644
--- a/f/medical/fn_famPassOut.sqf
+++ b/f/medical/fn_famPassOut.sqf
@@ -90,6 +90,16 @@ if (local _unit && isPlayer _unit) then
};
+// remove unit from group while downed.
+_wasLeader = false;
+_colorTeam = assignedTeam _unit;
+if (leader group _unit == _unit) then {_wasLeader = true};
+
+_unit setVariable ["f_var_fam_old_group_details",[group _unit, groupId _unit,_colorTeam,_wasLeader]];
+_temp_grp = createGroup side _unit;
+_unit joinAs [_temp_grp,0];
+
+
// Make sure AI won't intentionally shoot downed unit.
_unit setCaptive true;
diff --git a/f/medical/fn_famWakeUp.sqf b/f/medical/fn_famWakeUp.sqf
index a16f2fbc..5bead090 100644
--- a/f/medical/fn_famWakeUp.sqf
+++ b/f/medical/fn_famWakeUp.sqf
@@ -83,6 +83,12 @@ if(local _unit) then
};
};
+//return unit to previous group
+_group_details = _unit getVariable ["f_var_fam_old_group_details",[]];
+_unit joinAs [_group_details#0,_group_details#1];
+_unit assignTeam _group_details#2;
+if (_group_details#3) then {group _unit selectLeader _unit};
+
// exit if they are dead
if (damage _unit >= 1) exitWith {};
// ====================================================================================
From 3ded614136c898a7c5d33609c36a65ea26e52990 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Mon, 24 Feb 2025 16:58:13 +0000
Subject: [PATCH 79/81] Revert "Remove downed units from group while downed"
This reverts commit 639ae058545aab17b836e4d011736310429d6902.
---
f/medical/fn_famInit.sqf | 3 ---
f/medical/fn_famPassOut.sqf | 10 ----------
f/medical/fn_famWakeUp.sqf | 6 ------
3 files changed, 19 deletions(-)
diff --git a/f/medical/fn_famInit.sqf b/f/medical/fn_famInit.sqf
index 2cba225d..731daeea 100644
--- a/f/medical/fn_famInit.sqf
+++ b/f/medical/fn_famInit.sqf
@@ -73,9 +73,6 @@ _unit setVariable ["f_var_fam_hasbandage",false];
_unit getVariable ["f_var_fam_flag",false];
_unit setVariable ["f_var_fam_actionsAdded",false];
-// Prevent the group from being deleted if all units get downed.
-group _unit deleteGroupWhenEmpty false;
-
[_unit] spawn f_fnc_famLoop;
// ====================================================================================
diff --git a/f/medical/fn_famPassOut.sqf b/f/medical/fn_famPassOut.sqf
index 037abb15..701f2b7b 100644
--- a/f/medical/fn_famPassOut.sqf
+++ b/f/medical/fn_famPassOut.sqf
@@ -90,16 +90,6 @@ if (local _unit && isPlayer _unit) then
};
-// remove unit from group while downed.
-_wasLeader = false;
-_colorTeam = assignedTeam _unit;
-if (leader group _unit == _unit) then {_wasLeader = true};
-
-_unit setVariable ["f_var_fam_old_group_details",[group _unit, groupId _unit,_colorTeam,_wasLeader]];
-_temp_grp = createGroup side _unit;
-_unit joinAs [_temp_grp,0];
-
-
// Make sure AI won't intentionally shoot downed unit.
_unit setCaptive true;
diff --git a/f/medical/fn_famWakeUp.sqf b/f/medical/fn_famWakeUp.sqf
index 5bead090..a16f2fbc 100644
--- a/f/medical/fn_famWakeUp.sqf
+++ b/f/medical/fn_famWakeUp.sqf
@@ -83,12 +83,6 @@ if(local _unit) then
};
};
-//return unit to previous group
-_group_details = _unit getVariable ["f_var_fam_old_group_details",[]];
-_unit joinAs [_group_details#0,_group_details#1];
-_unit assignTeam _group_details#2;
-if (_group_details#3) then {group _unit selectLeader _unit};
-
// exit if they are dead
if (damage _unit >= 1) exitWith {};
// ====================================================================================
From 7a10cb9fb7750c4eedd114bc6abbf1ae1a1832b2 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Mon, 24 Feb 2025 17:02:13 +0000
Subject: [PATCH 80/81] Respawn message is now local
---
f/respawn/fn_respawn.sqf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/f/respawn/fn_respawn.sqf b/f/respawn/fn_respawn.sqf
index 9c138f9c..d6a17374 100644
--- a/f/respawn/fn_respawn.sqf
+++ b/f/respawn/fn_respawn.sqf
@@ -17,8 +17,8 @@ waitUntil {local _newUnit};
call f_fnc_terminateSpectator;
private _newTickets = [side group _newUnit] call BIS_fnc_respawnTickets;
-private _respawnText = format ["[%1] %2 respawned, %3 tickets remaining", side group _newUnit, name _newUnit, _newTickets];
-[_respawnText] remoteExec ["systemChat"];
+private _respawnText = format ["[%1] You have respawned. %2 tickets remaining.", side group _newUnit, _newTickets];
+systemChat _respawnText;
_newUnit assignTeam (_oldUnit getVariable ["f_var_lastTeamColour","MAIN"]);
From 173de13be305989e8e7944d53f8dc3ac05748ff1 Mon Sep 17 00:00:00 2001
From: NikkoJT <35894105+NikkoJT@users.noreply.github.com>
Date: Sun, 23 Mar 2025 21:16:37 +0000
Subject: [PATCH 81/81] Adjust display closer
---
f/medical/fn_famWakeUp.sqf | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/f/medical/fn_famWakeUp.sqf b/f/medical/fn_famWakeUp.sqf
index a16f2fbc..5af5c114 100644
--- a/f/medical/fn_famWakeUp.sqf
+++ b/f/medical/fn_famWakeUp.sqf
@@ -23,7 +23,6 @@ for "_i" from 2 to 5 do {
};
_unit setVariable ["f_var_fam_knockOutTime",nil,true];
-(uiNamespace getVariable ["f_var_fam_respawnDisplay", displayNull]) closeDisplay 1;
// check for radio channels
[_unit] spawn f_fnc_radioCheckChannels;
@@ -83,6 +82,10 @@ if(local _unit) then
};
};
+if (_unit == player) then {
+ (uiNamespace getVariable ["f_var_fam_respawnDisplay", displayNull]) closeDisplay 1;
+};
+
// exit if they are dead
if (damage _unit >= 1) exitWith {};
// ====================================================================================