fix(fennec): finalize native EFS buoyancy
Use the integrated Fennec EFS mesh with native water physics, stateful deployment, and the Geometry LOD buoyancy property. Remove the obsolete external cleanup path and document the confirmed sinking fix.
This commit is contained in:
@@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-07-13
|
||||||
|
|
||||||
|
### Aeronaves
|
||||||
|
|
||||||
|
- O EFS naval do Fennec passou a usar o mesh integrado ao P3D e a flutuacao nativa do Arma 3, sem criar um objeto externo.
|
||||||
|
- Corrigido o afundamento imediato apos o acionamento do EFS: a causa era a ausencia da named property `buoyancy=1` no Geometry LOD do P3D do Fennec.
|
||||||
|
|
||||||
## 2026-06-24
|
## 2026-06-24
|
||||||
|
|
||||||
### Aeronaves
|
### Aeronaves
|
||||||
|
|||||||
Binary file not shown.
@@ -415,16 +415,28 @@ class BRAF_Fennec_Base: Helicopter_Base_H
|
|||||||
condition="this animationphase 'NVG_Hide' < 0.1 AND (player in crew this)";
|
condition="this animationphase 'NVG_Hide' < 0.1 AND (player in crew this)";
|
||||||
statement="this animate ['NVG_Hide',1]";
|
statement="this animate ['NVG_Hide',1]";
|
||||||
};
|
};
|
||||||
class Deploy_EFS
|
class Arm_EFS
|
||||||
{
|
{
|
||||||
displayname="<t color='#b31d00'> Deploy EFS </t>";
|
displayname="<t color='#ffaa00'> Arm EFS </t>";
|
||||||
position="cabin";
|
position="cabin";
|
||||||
showWindow=1;
|
showWindow=1;
|
||||||
radius=10;
|
radius=10;
|
||||||
priority=1;
|
priority=1;
|
||||||
onlyForPlayer=0;
|
onlyForPlayer=0;
|
||||||
condition="getText (configOf this >> 'faction') == 'BRAF_NAVY' AND this animationphase 'EFS_Hide' < 0.1 AND (player in crew this)";
|
condition="getNumber (configOf this >> 'canFloat') == 1 AND this animationphase 'EFS_Cover_Hide' > 0.9 AND (player in crew this) AND ((this getVariable ['braf_efs_state','SAFE']) == 'SAFE')";
|
||||||
statement="this execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf""";
|
statement="[this, ""arm""] execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf""";
|
||||||
|
};
|
||||||
|
class Disarm_EFS: Arm_EFS
|
||||||
|
{
|
||||||
|
displayname="<t color='#ffaa00'> Disarm EFS </t>";
|
||||||
|
condition="getNumber (configOf this >> 'canFloat') == 1 AND this animationphase 'EFS_Cover_Hide' > 0.9 AND (player in crew this) AND ((this getVariable ['braf_efs_state','SAFE']) == 'ARMED')";
|
||||||
|
statement="[this, ""disarm""] execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf""";
|
||||||
|
};
|
||||||
|
class Deploy_Floats: Arm_EFS
|
||||||
|
{
|
||||||
|
displayname="<t color='#b31d00'> Deploy Floats </t>";
|
||||||
|
condition="getNumber (configOf this >> 'canFloat') == 1 AND this animationphase 'EFS_Cover_Hide' > 0.9 AND (player in crew this) AND ((this getVariable ['braf_efs_state','SAFE']) == 'ARMED')";
|
||||||
|
statement="[this, ""deployfloats""] execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf""";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
class Armory
|
class Armory
|
||||||
@@ -811,7 +823,7 @@ class BRAF_Fennec_Base: Helicopter_Base_H
|
|||||||
#include "Fennec_sounds.hpp"
|
#include "Fennec_sounds.hpp"
|
||||||
class EventHandlers: EventHandlers
|
class EventHandlers: EventHandlers
|
||||||
{
|
{
|
||||||
init="if (local (_this select 0)) then {[(_this select 0), """", [], false] call bis_fnc_initVehicle;};";
|
init="if (local (_this select 0)) then {[(_this select 0), """", [], false] call bis_fnc_initVehicle; [(_this select 0), ""Init""] execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf"";};";
|
||||||
};
|
};
|
||||||
ace_cargo_space=2;
|
ace_cargo_space=2;
|
||||||
class TextureSources
|
class TextureSources
|
||||||
@@ -1139,6 +1151,18 @@ class BRAF_Fennec_dynamicLoadout_base: BRAF_Fennec_Base
|
|||||||
animPeriod=0;
|
animPeriod=0;
|
||||||
initPhase=1;
|
initPhase=1;
|
||||||
};
|
};
|
||||||
|
class EFS_Cover_Hide
|
||||||
|
{
|
||||||
|
source="user";
|
||||||
|
animPeriod=0;
|
||||||
|
initPhase=0;
|
||||||
|
};
|
||||||
|
class EFS_Hide
|
||||||
|
{
|
||||||
|
source="user";
|
||||||
|
animPeriod=0;
|
||||||
|
initPhase=0;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
class Turrets: Turrets
|
class Turrets: Turrets
|
||||||
{
|
{
|
||||||
@@ -1396,16 +1420,28 @@ class BRAF_Fennec_dynamicLoadout_base: BRAF_Fennec_Base
|
|||||||
condition="this animationphase 'NVG_Hide' < 0.1 AND (player in crew this)";
|
condition="this animationphase 'NVG_Hide' < 0.1 AND (player in crew this)";
|
||||||
statement="this animate ['NVG_Hide',1]";
|
statement="this animate ['NVG_Hide',1]";
|
||||||
};
|
};
|
||||||
class Deploy_EFS
|
class Arm_EFS
|
||||||
{
|
{
|
||||||
displayname="<t color='#b31d00'> Deploy EFS </t>";
|
displayname="<t color='#ffaa00'> Arm EFS </t>";
|
||||||
position="cabin";
|
position="cabin";
|
||||||
showWindow=1;
|
showWindow=1;
|
||||||
radius=10;
|
radius=10;
|
||||||
priority=1;
|
priority=1;
|
||||||
onlyForPlayer=0;
|
onlyForPlayer=0;
|
||||||
condition="getText (configOf this >> 'faction') == 'BRAF_NAVY' AND this animationphase 'EFS_Hide' < 0.1 AND (player in crew this)";
|
condition="getNumber (configOf this >> 'canFloat') == 1 AND this animationphase 'EFS_Cover_Hide' > 0.9 AND (player in crew this) AND ((this getVariable ['braf_efs_state','SAFE']) == 'SAFE')";
|
||||||
statement="this execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf""";
|
statement="[this, ""arm""] execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf""";
|
||||||
|
};
|
||||||
|
class Disarm_EFS: Arm_EFS
|
||||||
|
{
|
||||||
|
displayname="<t color='#ffaa00'> Disarm EFS </t>";
|
||||||
|
condition="getNumber (configOf this >> 'canFloat') == 1 AND this animationphase 'EFS_Cover_Hide' > 0.9 AND (player in crew this) AND ((this getVariable ['braf_efs_state','SAFE']) == 'ARMED')";
|
||||||
|
statement="[this, ""disarm""] execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf""";
|
||||||
|
};
|
||||||
|
class Deploy_Floats: Arm_EFS
|
||||||
|
{
|
||||||
|
displayname="<t color='#b31d00'> Deploy Floats </t>";
|
||||||
|
condition="getNumber (configOf this >> 'canFloat') == 1 AND this animationphase 'EFS_Cover_Hide' > 0.9 AND (player in crew this) AND ((this getVariable ['braf_efs_state','SAFE']) == 'ARMED')";
|
||||||
|
statement="[this, ""deployfloats""] execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf""";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -1485,7 +1521,18 @@ class BRAF_Fennec_SAR_base: BRAF_Fennec_Base
|
|||||||
source="user";
|
source="user";
|
||||||
animPeriod=1;
|
animPeriod=1;
|
||||||
initPhase=0;
|
initPhase=0;
|
||||||
//sound="BRAF_Door";
|
};
|
||||||
|
class EFS_Cover_Hide
|
||||||
|
{
|
||||||
|
source="user";
|
||||||
|
animPeriod=0;
|
||||||
|
initPhase=0;
|
||||||
|
};
|
||||||
|
class EFS_Hide
|
||||||
|
{
|
||||||
|
source="user";
|
||||||
|
animPeriod=0;
|
||||||
|
initPhase=0;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
class Turrets: Turrets
|
class Turrets: Turrets
|
||||||
@@ -1764,16 +1811,28 @@ class BRAF_Fennec_SAR_base: BRAF_Fennec_Base
|
|||||||
condition="this animationphase 'NVG_Hide' < 0.1 AND (player in crew this)";
|
condition="this animationphase 'NVG_Hide' < 0.1 AND (player in crew this)";
|
||||||
statement="this animate ['NVG_Hide',1]";
|
statement="this animate ['NVG_Hide',1]";
|
||||||
};
|
};
|
||||||
class Deploy_EFS
|
class Arm_EFS
|
||||||
{
|
{
|
||||||
displayname="<t color='#b31d00'> Deploy EFS </t>";
|
displayname="<t color='#ffaa00'> Arm EFS </t>";
|
||||||
position="cabin";
|
position="cabin";
|
||||||
showWindow=1;
|
showWindow=1;
|
||||||
radius=10;
|
radius=10;
|
||||||
priority=1;
|
priority=1;
|
||||||
onlyForPlayer=0;
|
onlyForPlayer=0;
|
||||||
condition="getText (configOf this >> 'faction') == 'BRAF_NAVY' AND this animationphase 'EFS_Hide' < 0.1 AND (player in crew this)";
|
condition="getNumber (configOf this >> 'canFloat') == 1 AND this animationphase 'EFS_Cover_Hide' > 0.9 AND (player in crew this) AND ((this getVariable ['braf_efs_state','SAFE']) == 'SAFE')";
|
||||||
statement="this execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf""";
|
statement="[this, ""arm""] execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf""";
|
||||||
|
};
|
||||||
|
class Disarm_EFS: Arm_EFS
|
||||||
|
{
|
||||||
|
displayname="<t color='#ffaa00'> Disarm EFS </t>";
|
||||||
|
condition="getNumber (configOf this >> 'canFloat') == 1 AND this animationphase 'EFS_Cover_Hide' > 0.9 AND (player in crew this) AND ((this getVariable ['braf_efs_state','SAFE']) == 'ARMED')";
|
||||||
|
statement="[this, ""disarm""] execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf""";
|
||||||
|
};
|
||||||
|
class Deploy_Floats: Arm_EFS
|
||||||
|
{
|
||||||
|
displayname="<t color='#b31d00'> Deploy Floats </t>";
|
||||||
|
condition="getNumber (configOf this >> 'canFloat') == 1 AND this animationphase 'EFS_Cover_Hide' > 0.9 AND (player in crew this) AND ((this getVariable ['braf_efs_state','SAFE']) == 'ARMED')";
|
||||||
|
statement="[this, ""deployfloats""] execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf""";
|
||||||
};
|
};
|
||||||
class Open_Door_Right
|
class Open_Door_Right
|
||||||
{
|
{
|
||||||
@@ -1844,6 +1903,18 @@ class BRAF_Fennec_unarmed_base: BRAF_Fennec_Base
|
|||||||
source="user";
|
source="user";
|
||||||
animPeriod=1;
|
animPeriod=1;
|
||||||
initPhase=1;
|
initPhase=1;
|
||||||
|
};
|
||||||
|
class EFS_Cover_Hide
|
||||||
|
{
|
||||||
|
source="user";
|
||||||
|
animPeriod=0;
|
||||||
|
initPhase=0;
|
||||||
|
};
|
||||||
|
class EFS_Hide
|
||||||
|
{
|
||||||
|
source="user";
|
||||||
|
animPeriod=0;
|
||||||
|
initPhase=0;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
class UserActions
|
class UserActions
|
||||||
@@ -1865,16 +1936,28 @@ class BRAF_Fennec_unarmed_base: BRAF_Fennec_Base
|
|||||||
condition="this animationphase 'NVG_Hide' < 0.1 AND (player in crew this)";
|
condition="this animationphase 'NVG_Hide' < 0.1 AND (player in crew this)";
|
||||||
statement="this animate ['NVG_Hide',1]";
|
statement="this animate ['NVG_Hide',1]";
|
||||||
};
|
};
|
||||||
class Deploy_EFS
|
class Arm_EFS
|
||||||
{
|
{
|
||||||
displayname="<t color='#b31d00'> Deploy EFS </t>";
|
displayname="<t color='#ffaa00'> Arm EFS </t>";
|
||||||
position="cabin";
|
position="cabin";
|
||||||
showWindow=1;
|
showWindow=1;
|
||||||
radius=10;
|
radius=10;
|
||||||
priority=1;
|
priority=1;
|
||||||
onlyForPlayer=0;
|
onlyForPlayer=0;
|
||||||
condition="getText (configOf this >> 'faction') == 'BRAF_NAVY' AND this animationphase 'EFS_Hide' < 0.1 AND (player in crew this)";
|
condition="getNumber (configOf this >> 'canFloat') == 1 AND this animationphase 'EFS_Cover_Hide' > 0.9 AND (player in crew this) AND ((this getVariable ['braf_efs_state','SAFE']) == 'SAFE')";
|
||||||
statement="this execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf""";
|
statement="[this, ""arm""] execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf""";
|
||||||
|
};
|
||||||
|
class Disarm_EFS: Arm_EFS
|
||||||
|
{
|
||||||
|
displayname="<t color='#ffaa00'> Disarm EFS </t>";
|
||||||
|
condition="getNumber (configOf this >> 'canFloat') == 1 AND this animationphase 'EFS_Cover_Hide' > 0.9 AND (player in crew this) AND ((this getVariable ['braf_efs_state','SAFE']) == 'ARMED')";
|
||||||
|
statement="[this, ""disarm""] execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf""";
|
||||||
|
};
|
||||||
|
class Deploy_Floats: Arm_EFS
|
||||||
|
{
|
||||||
|
displayname="<t color='#b31d00'> Deploy Floats </t>";
|
||||||
|
condition="getNumber (configOf this >> 'canFloat') == 1 AND this animationphase 'EFS_Cover_Hide' > 0.9 AND (player in crew this) AND ((this getVariable ['braf_efs_state','SAFE']) == 'ARMED')";
|
||||||
|
statement="[this, ""deployfloats""] execVM ""braf\braf_sar\Braf_Scripts\EFS_Esquilo.sqf""";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -1957,7 +2040,15 @@ class BRAF_Fennec_Unarmed_MB: BRAF_Fennec_unarmed_base
|
|||||||
_generalMacro="BRAF_Fennec_Unarmed_MB";
|
_generalMacro="BRAF_Fennec_Unarmed_MB";
|
||||||
faction="BRAF_NAVY";
|
faction="BRAF_NAVY";
|
||||||
canFloat=1;
|
canFloat=1;
|
||||||
waterLeakiness=10;
|
waterAngularDampingCoef=0;
|
||||||
|
waterDamageEngine=0.2;
|
||||||
|
waterEffect="HeliWater";
|
||||||
|
waterLeakiness=100;
|
||||||
|
waterLinearDampingCoefX=0;
|
||||||
|
waterLinearDampingCoefY=0;
|
||||||
|
waterPPInVehicle=1;
|
||||||
|
waterResistance=1;
|
||||||
|
waterResistanceCoef=0.5;
|
||||||
crew="braf_characters_aviation_navy_pilot";
|
crew="braf_characters_aviation_navy_pilot";
|
||||||
editorPreview="\braf\braf_insignia\editorpreview\air\BRAF_Fennec_Unarmed_MB.jpg";
|
editorPreview="\braf\braf_insignia\editorpreview\air\BRAF_Fennec_Unarmed_MB.jpg";
|
||||||
scope=2;
|
scope=2;
|
||||||
@@ -2012,6 +2103,16 @@ class BRAF_Fennec_Resort: BRAF_Fennec_cargo_base
|
|||||||
editorPreview="\braf\braf_insignia\editorpreview\brazilian_civ\Air\BRAF_Fennec_Resort.jpg";
|
editorPreview="\braf\braf_insignia\editorpreview\brazilian_civ\Air\BRAF_Fennec_Resort.jpg";
|
||||||
scope=2;
|
scope=2;
|
||||||
faction="BRAF_CIV";
|
faction="BRAF_CIV";
|
||||||
|
canFloat=1;
|
||||||
|
waterAngularDampingCoef=0;
|
||||||
|
waterDamageEngine=0.2;
|
||||||
|
waterEffect="HeliWater";
|
||||||
|
waterLeakiness=100;
|
||||||
|
waterLinearDampingCoefX=0;
|
||||||
|
waterLinearDampingCoefY=0;
|
||||||
|
waterPPInVehicle=1;
|
||||||
|
waterResistance=1;
|
||||||
|
waterResistanceCoef=0.5;
|
||||||
side=3;
|
side=3;
|
||||||
scopeCurator=2;
|
scopeCurator=2;
|
||||||
scopeArsenal=2;
|
scopeArsenal=2;
|
||||||
@@ -2026,6 +2127,11 @@ class BRAF_Fennec_Resort: BRAF_Fennec_cargo_base
|
|||||||
{
|
{
|
||||||
"Resort",1
|
"Resort",1
|
||||||
};
|
};
|
||||||
|
animationList[]=
|
||||||
|
{
|
||||||
|
"EFS_Cover_Hide",1,
|
||||||
|
"EFS_Hide",0
|
||||||
|
};
|
||||||
};
|
};
|
||||||
class BRAF_Fennec_80s: BRAF_Fennec_unarmed_base
|
class BRAF_Fennec_80s: BRAF_Fennec_unarmed_base
|
||||||
{
|
{
|
||||||
@@ -2064,7 +2170,15 @@ class BRAF_Fennec_Armed_MB: BRAF_Fennec_dynamicLoadout_base
|
|||||||
_generalMacro="BRAF_Fennec_Armed_MB";
|
_generalMacro="BRAF_Fennec_Armed_MB";
|
||||||
faction="BRAF_NAVY";
|
faction="BRAF_NAVY";
|
||||||
canFloat=1;
|
canFloat=1;
|
||||||
waterLeakiness=10;
|
waterAngularDampingCoef=0;
|
||||||
|
waterDamageEngine=0.2;
|
||||||
|
waterEffect="HeliWater";
|
||||||
|
waterLeakiness=100;
|
||||||
|
waterLinearDampingCoefX=0;
|
||||||
|
waterLinearDampingCoefY=0;
|
||||||
|
waterPPInVehicle=1;
|
||||||
|
waterResistance=1;
|
||||||
|
waterResistanceCoef=0.5;
|
||||||
crew="braf_characters_aviation_navy_pilot";
|
crew="braf_characters_aviation_navy_pilot";
|
||||||
editorPreview="\braf\braf_insignia\editorpreview\air\BRAF_Fennec_Armed_MB.jpg";
|
editorPreview="\braf\braf_insignia\editorpreview\air\BRAF_Fennec_Armed_MB.jpg";
|
||||||
scope=2;
|
scope=2;
|
||||||
@@ -2132,7 +2246,15 @@ class BRAF_Fennec_Cargo_MB: BRAF_Fennec_cargo_base
|
|||||||
_generalMacro="BRAF_Fennec_Cargo_MB";
|
_generalMacro="BRAF_Fennec_Cargo_MB";
|
||||||
faction="BRAF_NAVY";
|
faction="BRAF_NAVY";
|
||||||
canFloat=1;
|
canFloat=1;
|
||||||
waterLeakiness=10;
|
waterAngularDampingCoef=0;
|
||||||
|
waterDamageEngine=0.2;
|
||||||
|
waterEffect="HeliWater";
|
||||||
|
waterLeakiness=100;
|
||||||
|
waterLinearDampingCoefX=0;
|
||||||
|
waterLinearDampingCoefY=0;
|
||||||
|
waterPPInVehicle=1;
|
||||||
|
waterResistance=1;
|
||||||
|
waterResistanceCoef=0.5;
|
||||||
crew="braf_characters_aviation_navy_pilot";
|
crew="braf_characters_aviation_navy_pilot";
|
||||||
editorPreview="\braf\braf_insignia\editorpreview\air\BRAF_Fennec_Cargo_MB.jpg";
|
editorPreview="\braf\braf_insignia\editorpreview\air\BRAF_Fennec_Cargo_MB.jpg";
|
||||||
scope=2;
|
scope=2;
|
||||||
@@ -2202,7 +2324,15 @@ class BRAF_Fennec_SAR_MB: BRAF_Fennec_SAR_base
|
|||||||
crew="braf_characters_aviation_navy_pilot";
|
crew="braf_characters_aviation_navy_pilot";
|
||||||
faction="BRAF_NAVY";
|
faction="BRAF_NAVY";
|
||||||
canFloat=1;
|
canFloat=1;
|
||||||
waterLeakiness=10;
|
waterAngularDampingCoef=0;
|
||||||
|
waterDamageEngine=0.2;
|
||||||
|
waterEffect="HeliWater";
|
||||||
|
waterLeakiness=100;
|
||||||
|
waterLinearDampingCoefX=0;
|
||||||
|
waterLinearDampingCoefY=0;
|
||||||
|
waterPPInVehicle=1;
|
||||||
|
waterResistance=1;
|
||||||
|
waterResistanceCoef=0.5;
|
||||||
scope=2;
|
scope=2;
|
||||||
side=2;
|
side=2;
|
||||||
scopeCurator=2;
|
scopeCurator=2;
|
||||||
|
|||||||
@@ -912,4 +912,4 @@ class CfgModels
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Binary file not shown.
@@ -1,10 +0,0 @@
|
|||||||
params ["_heli"];
|
|
||||||
|
|
||||||
private _efs = _heli getVariable ["efs", objNull];
|
|
||||||
if (!isNull _efs) then {
|
|
||||||
deleteVehicle _efs;
|
|
||||||
};
|
|
||||||
|
|
||||||
_heli animate ["EFS_Hide", 0];
|
|
||||||
_heli setVariable ["efs", objNull, true];
|
|
||||||
_heli setVariable ["braf_efs_deployed", false, true];
|
|
||||||
@@ -1,72 +1,147 @@
|
|||||||
params ["_heli"];
|
params ["_heli", ["_action", "deploy"]];
|
||||||
|
|
||||||
private _currentEfs = _heli getVariable ["efs", objNull];
|
if (isNull _heli) exitWith {};
|
||||||
if (!isNull _currentEfs) exitWith {
|
|
||||||
_heli vehicleChat "Emergency Floating System already deployed.";
|
private _canFloat = getNumber (configFile >> "CfgVehicles" >> typeOf _heli >> "canFloat") > 0;
|
||||||
|
if (!_canFloat) exitWith {};
|
||||||
|
|
||||||
|
private _actionLower = toLower _action;
|
||||||
|
private _legacyDeploy = (count _this) < 2;
|
||||||
|
private _state = _heli getVariable ["braf_efs_state", "SAFE"];
|
||||||
|
|
||||||
|
if (_actionLower == "deploy") then {
|
||||||
|
_actionLower = "deployfloats";
|
||||||
};
|
};
|
||||||
|
|
||||||
sleep 1;
|
private _getConfiguredLeakiness = {
|
||||||
_heli vehicleChat "Deploying Emergency Floating System!";
|
params ["_vehicle"];
|
||||||
_heli say3D "EFS";
|
|
||||||
_heli animate ["EFS_Cover_Hide", 1];
|
|
||||||
_heli animate ["EFS_Hide", 1];
|
|
||||||
|
|
||||||
private _efs = "BRAF_Esquilo_EFS" createVehicle [0, 0, 0];
|
private _leakiness = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "waterLeakiness");
|
||||||
_efs setDir (getDir _heli);
|
if (_leakiness < 0) then {
|
||||||
_efs setPosASL (_heli modelToWorld [0, 0, 0]);
|
_leakiness = 0;
|
||||||
_efs attachTo [_heli, [0, 0, 0], "efs_spawn"];
|
};
|
||||||
|
|
||||||
_heli setVariable ["efs", _efs, true];
|
_leakiness
|
||||||
_heli setVariable ["braf_efs_deployed", true, true];
|
|
||||||
|
|
||||||
if ((_heli getVariable ["braf_efs_engine_lock_eh", -1]) < 0) then {
|
|
||||||
private _engineLockEh = _heli addEventHandler ["Engine", {
|
|
||||||
params ["_vehicle", "_engineState"];
|
|
||||||
|
|
||||||
if (_engineState && {_vehicle getVariable ["braf_efs_water_landed", false]}) then {
|
|
||||||
_vehicle engineOn false;
|
|
||||||
_vehicle vehicleChat "Engine restart disabled after EFS water landing.";
|
|
||||||
};
|
|
||||||
}];
|
|
||||||
|
|
||||||
_heli setVariable ["braf_efs_engine_lock_eh", _engineLockEh];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(_heli getVariable ["braf_efs_water_monitor", false])) then {
|
private _getEfsCenterASL = {
|
||||||
_heli setVariable ["braf_efs_water_monitor", true, true];
|
params ["_vehicle"];
|
||||||
|
|
||||||
[_heli] spawn {
|
_vehicle modelToWorldWorld (_vehicle selectionPosition ["EFS_center", "Memory"])
|
||||||
params ["_heli"];
|
};
|
||||||
|
|
||||||
private _waterContact = false;
|
private _getWaterSurfaceASL = {
|
||||||
while {
|
params ["_vehicle"];
|
||||||
!isNull _heli
|
|
||||||
&& {_heli getVariable ["braf_efs_deployed", false]}
|
private _vehicleASL = getPosASL _vehicle;
|
||||||
&& {!(_heli getVariable ["braf_efs_water_landed", false])}
|
private _vehicleASLW = getPosASLW _vehicle;
|
||||||
&& {!_waterContact}
|
|
||||||
} do {
|
(_vehicleASL select 2) - (_vehicleASLW select 2)
|
||||||
private _efsProbe = _heli getVariable ["efs", objNull];
|
};
|
||||||
private _waterProbeASL = if (isNull _efsProbe) then {getPosASL _heli} else {getPosASL _efsProbe};
|
|
||||||
_waterContact = (surfaceIsWater (getPosWorld _heli))
|
private _installEngineLock = {
|
||||||
&& {(isTouchingGround _heli) || {(_waterProbeASL select 2) < 0.75}};
|
params ["_vehicle"];
|
||||||
|
|
||||||
sleep 0.25;
|
if ((_vehicle getVariable ["braf_efs_engine_lock_eh", -1]) < 0) then {
|
||||||
};
|
private _engineLockEh = _vehicle addEventHandler ["Engine", {
|
||||||
|
params ["_vehicle", "_engineState"];
|
||||||
_heli setVariable ["braf_efs_water_monitor", false, true];
|
|
||||||
|
if (_engineState && {_vehicle getVariable ["braf_efs_water_landed", false]}) then {
|
||||||
if (isNull _heli || {!_waterContact}) exitWith {};
|
_vehicle engineOn false;
|
||||||
|
};
|
||||||
_heli setVariable ["braf_efs_water_landed", true, true];
|
}];
|
||||||
_heli engineOn false;
|
|
||||||
_heli vehicleChat "EFS water landing complete. Engine restart disabled.";
|
_vehicle setVariable ["braf_efs_engine_lock_eh", _engineLockEh];
|
||||||
|
};
|
||||||
while {!isNull _heli && {_heli getVariable ["braf_efs_water_landed", false]}} do {
|
};
|
||||||
if (isEngineOn _heli) then {
|
|
||||||
_heli engineOn false;
|
private _startWaterMonitor = {
|
||||||
};
|
params ["_vehicle"];
|
||||||
|
|
||||||
sleep 0.5;
|
if (_vehicle getVariable ["braf_efs_water_monitor", false]) exitWith {};
|
||||||
};
|
|
||||||
};
|
_vehicle setVariable ["braf_efs_water_monitor", true, true];
|
||||||
|
|
||||||
|
[_vehicle, _getEfsCenterASL, _getWaterSurfaceASL] spawn {
|
||||||
|
params ["_heli", "_getEfsCenterASL", "_getWaterSurfaceASL"];
|
||||||
|
|
||||||
|
while {
|
||||||
|
!isNull _heli
|
||||||
|
&& {_heli getVariable ["braf_efs_deployed", false]}
|
||||||
|
&& {(_heli getVariable ["braf_efs_state", "SAFE"]) in ["DEPLOYED", "WATER_LANDED"]}
|
||||||
|
} do {
|
||||||
|
private _currentState = _heli getVariable ["braf_efs_state", "SAFE"];
|
||||||
|
|
||||||
|
if (_currentState == "DEPLOYED" && {surfaceIsWater (getPosWorld _heli)}) then {
|
||||||
|
private _probeASL = [_heli] call _getEfsCenterASL;
|
||||||
|
private _waterSurfaceASL = [_heli] call _getWaterSurfaceASL;
|
||||||
|
private _probeDepth = (_probeASL select 2) - _waterSurfaceASL;
|
||||||
|
|
||||||
|
if (_probeDepth <= 0.25) then {
|
||||||
|
_heli setVariable ["braf_efs_state", "WATER_LANDED", true];
|
||||||
|
_heli setVariable ["braf_efs_water_landed", true, true];
|
||||||
|
_heli engineOn false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
if (_heli getVariable ["braf_efs_water_landed", false] && {isEngineOn _heli}) then {
|
||||||
|
_heli engineOn false;
|
||||||
|
};
|
||||||
|
|
||||||
|
sleep 0.25;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!isNull _heli) then {
|
||||||
|
_heli setVariable ["braf_efs_water_monitor", false, true];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
switch (_actionLower) do {
|
||||||
|
case "init": {
|
||||||
|
_heli setVariable ["braf_efs_state", "SAFE", true];
|
||||||
|
_heli setVariable ["braf_efs_deployed", false, true];
|
||||||
|
_heli setVariable ["braf_efs_water_landed", false, true];
|
||||||
|
_heli setVariable ["braf_efs_water_monitor", false, true];
|
||||||
|
_heli setVariable ["braf_efs_water_leakiness", [_heli] call _getConfiguredLeakiness];
|
||||||
|
_heli animateSource ["EFS_Hide", 0, true];
|
||||||
|
_heli setWaterFillPercentage 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
case "arm": {
|
||||||
|
if (_state != "SAFE") exitWith {};
|
||||||
|
|
||||||
|
_heli setVariable ["braf_efs_state", "ARMED", true];
|
||||||
|
_heli setVariable ["braf_efs_deployed", false, true];
|
||||||
|
_heli setVariable ["braf_efs_water_landed", false, true];
|
||||||
|
};
|
||||||
|
|
||||||
|
case "disarm": {
|
||||||
|
if (_state != "ARMED") exitWith {};
|
||||||
|
|
||||||
|
_heli setVariable ["braf_efs_state", "SAFE", true];
|
||||||
|
_heli setVariable ["braf_efs_deployed", false, true];
|
||||||
|
_heli setVariable ["braf_efs_water_landed", false, true];
|
||||||
|
_heli setWaterFillPercentage 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
case "deployfloats": {
|
||||||
|
if (!_legacyDeploy && {_state != "ARMED"}) exitWith {};
|
||||||
|
|
||||||
|
if (_state in ["DEPLOYED", "WATER_LANDED"]) exitWith {};
|
||||||
|
|
||||||
|
_heli setVariable ["braf_efs_state", "DEPLOYED", true];
|
||||||
|
_heli setVariable ["braf_efs_deployed", true, true];
|
||||||
|
_heli setVariable ["braf_efs_water_landed", false, true];
|
||||||
|
_heli say3D "EFS";
|
||||||
|
_heli animateSource ["EFS_Cover_Hide", 1, true];
|
||||||
|
_heli animateSource ["EFS_Hide", 1, true];
|
||||||
|
_heli setWaterLeakiness 0;
|
||||||
|
_heli setWaterFillPercentage 0;
|
||||||
|
|
||||||
|
[_heli] call _installEngineLock;
|
||||||
|
[_heli] call _startWaterMonitor;
|
||||||
|
};
|
||||||
|
|
||||||
|
default {};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user