diff --git a/CHANGELOG.md b/CHANGELOG.md index 99a33b1..016505f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,26 +2,15 @@ ## 2026-06-24 -### braf_optics_air +### Aeronaves -- Criado o novo modulo standalone `braf_optics_air` para concentrar o sistema FLIR das aeronaves. -- O novo modulo traz uma interface propria de optics com HUD customizado, funcoes dedicadas e modelos `StarSaphire` para `WFOV`, `MFOV`, `NFOV`, `NFOV 2X` e `NFOV 4X`. -- Essa mudanca permite reutilizar o mesmo sistema entre multiplas aeronaves sem manter copias internas separadas em cada PBO. +- O sistema FLIR aereo foi modernizado com nova interface de camera, HUD proprio e niveis de zoom dedicados para emprego em aeronaves. +- O A-29 recebeu esse novo pacote FLIR, substituindo o arranjo antigo por uma camera mais completa e padronizada. +- Fennec e Caracal com torreta agora usam o mesmo padrao de FLIR aereo, melhorando consistencia de uso entre plataformas. -### braf_air2 +### Resgate SAR -- O A-29 deixou de usar o optics como modulo interno e passou a consumir o sistema centralizado de `braf_optics_air`. -- Foram removidos do `braf_air2` os scripts, funcoes, assets, modelos e referencias antigas ligados ao optics interno do A-29. -- A torreta do A-29 foi atualizada para usar o novo `BRAF_RscOptics_Air_FLIR` e os modelos externos de `braf_optics_air`. -- Esta atualizacao leva para o BRAF um sistema FLIR mais completo, moderno e reutilizavel para substituir esse arranjo antigo. - -### braf_air - -- O novo FLIR standalone foi integrado nas variantes do Fennec e do Caracal com torreta. - -### braf_sar - -- Ajustada a logica do guincho para que a extensao do cabo dure os mesmos 16 segundos do audio do motor do winch. -- Ajustada tambem a velocidade de recolhimento do cabo para seguir a mesma duracao de 16 segundos. -- Os scripts de deploy, descida, subida, corte e recuperacao do rescue seat foram padronizados para uso geral em helicopteros, sem referencia direta a uma aeronave especifica. -- O fluxo atual foi consolidado funcionalmente para Fennec, Pantera e Caracal, preparando o sistema para a futura expansao com novos payloads de resgate. +- O guincho de resgate foi ajustado para que a subida e a descida do cabo acompanhem corretamente o audio do motor do winch. +- O sistema SAR foi padronizado entre Fennec, Pantera e Caracal, mantendo o fluxo de uso de cada helicoptero e deixando o comportamento mais consistente em jogo. +- O Caracal passou a operar com assento, cesta e maca de resgate; o Pantera com assento e maca; o Fennec permanece com assento de resgate. +- Ao cortar o cabo, apenas o payload em uso e perdido; os demais continuam disponiveis quando a aeronave suportar multiplas opcoes de resgate. diff --git a/braf_air/Braf_Helicopters/Braf_Caracal/Caracal_Base.hpp b/braf_air/Braf_Helicopters/Braf_Caracal/Caracal_Base.hpp index 5d6efa1..5cc1c5b 100644 --- a/braf_air/Braf_Helicopters/Braf_Caracal/Caracal_Base.hpp +++ b/braf_air/Braf_Helicopters/Braf_Caracal/Caracal_Base.hpp @@ -1234,32 +1234,44 @@ class BRAF_Caracal_2: BRAF_Caracal_Base radius=20; priority=1; onlyForPlayer=0; - condition="this animationphase 'Hoist_Hide' > 0.9 AND (player in crew this) AND this animationphase 'Door_R_1' > 0.9"; - statement="this execVM ""braf\braf_sar\BRAF_Scripts\DRS.sqf""; this animate ['Hoist_Hide',-0.5]"; + condition="this animationphase 'Hoist_Hide' > 0.9 AND (player in crew this) AND this animationphase 'Door_R_1' > 0.9 AND !(""BRAF_Rescue_Seat"" in (this getVariable ['braf_hoist_spent_payloads', []]))"; + statement="[this, ""deploy"", ""BRAF_Rescue_Seat""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',-0.5]"; + }; + class Deploy_Rescue_Basket: Deploy_Rescue_Seat + { + displayname=" Deploy Rescue Basket "; + condition="this animationphase 'Hoist_Hide' > 0.9 AND (player in crew this) AND this animationphase 'Door_R_1' > 0.9 AND !(""BRAF_Rescue_Basket"" in (this getVariable ['braf_hoist_spent_payloads', []]))"; + statement="[this, ""deploy"", ""BRAF_Rescue_Basket""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',-0.5]"; + }; + class Deploy_Rescue_Stretcher: Deploy_Rescue_Seat + { + displayname=" Deploy Rescue Stretcher "; + condition="this animationphase 'Hoist_Hide' > 0.9 AND (player in crew this) AND this animationphase 'Door_R_1' > 0.9 AND !(""BRAF_Rescue_Stretcher"" in (this getVariable ['braf_hoist_spent_payloads', []]))"; + statement="[this, ""deploy"", ""BRAF_Rescue_Stretcher""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',-0.5]"; }; class Hoist_Down: Deploy_Rescue_Seat { displayname=" Extend Cable Hook "; condition="this animationphase 'Hoist_Hide' < -0.4 AND this animationphase 'Hoist_Hide' > -0.6 AND (player in crew this) AND this animationphase 'Door_R_1' > 0.9"; - statement="this execVM ""braf\braf_sar\BRAF_Scripts\hoist_down.sqf""; this animate ['Hoist_Hide',-1]; this say3d ""Winch"""; + statement="[this, ""down""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',-1]; this say3d ""Winch"""; }; class Hoist_Up: Deploy_Rescue_Seat { displayname=" Recover Cable Hook "; condition="this animationphase 'Hoist_Hide' < -0.9 AND (player in crew this) AND this animationphase 'Door_R_1' > 0.9"; - statement="this execVM ""braf\braf_sar\BRAF_Scripts\hoist_up.sqf""; this animate ['Hoist_Hide',-0.5]; this say3d ""Winch"""; + statement="[this, ""up""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',-0.5]; this say3d ""Winch"""; }; class Recover_Rescue_Seat: Deploy_Rescue_Seat { - displayname=" Retrieve Rescue Seat "; + displayname=" Retrieve Rescue Payload "; condition="(player in crew this) AND this animationphase 'Door_R_1' > 0.9 AND this animationphase 'Hoist_Hide' < -0.4 AND this animationphase 'Hoist_Hide' > -0.6"; - statement="this execVM ""braf\braf_sar\BRAF_Scripts\recover_seat.sqf""; this animate ['Hoist_Hide',1]"; + statement="[this, ""recover""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',1]"; }; class Hoist_Cut: Deploy_Rescue_Seat { displayname=" Cut Hoist Hook Cable "; condition="(player in crew this) AND this animationphase 'Door_R_1' > 0.9 AND this animationphase 'Hoist_Hide' < 0"; - statement="this execVM ""braf\braf_sar\BRAF_Scripts\hoist_cut.sqf""; this animate ['Hoist_Hide',1]"; + statement="[this, ""cut""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',1]"; }; class Open_Door_Left { diff --git a/braf_air/Braf_Helicopters/Braf_Fennec/Fennec_Base.hpp b/braf_air/Braf_Helicopters/Braf_Fennec/Fennec_Base.hpp index a09927b..2b22bdc 100644 --- a/braf_air/Braf_Helicopters/Braf_Fennec/Fennec_Base.hpp +++ b/braf_air/Braf_Helicopters/Braf_Fennec/Fennec_Base.hpp @@ -1685,33 +1685,33 @@ class BRAF_Fennec_SAR_base: BRAF_Fennec_Base radius=20; priority=1; onlyForPlayer=0; - condition="this animationphase 'Hoist_Hide' > 0.9 AND (player in crew this) AND this animationphase 'door_L_2' > 0.9"; - statement="this animate ['Winch_Rot',1]; this execVM ""braf\braf_sar\Braf_Scripts\DRS.sqf""; this animate ['Hoist_Hide',-0.5]"; + condition="this animationphase 'Hoist_Hide' > 0.9 AND (player in crew this) AND this animationphase 'door_L_2' > 0.9 AND !(""BRAF_Rescue_Seat"" in (this getVariable ['braf_hoist_spent_payloads', []]))"; + statement="this animate ['Winch_Rot',1]; [this, ""deploy"", ""BRAF_Rescue_Seat""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',-0.5]"; }; class Hoist_Down: Deploy_Rescue_Seat { displayname=" Extend Cable Hook "; condition="this animationphase 'Hoist_Hide' < -0.4 AND this animationphase 'Hoist_Hide' > -0.6 AND (player in crew this) AND this animationphase 'door_L_2' > 0.9"; - statement="this execVM ""braf\braf_sar\Braf_Scripts\hoist_down.sqf""; this animate ['Hoist_Hide',-1]; this say3d ""Winch"""; + statement="[this, ""down""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',-1]; this say3d ""Winch"""; }; class Hoist_Up: Deploy_Rescue_Seat { displayname=" Recover Hoist Hook "; condition="this animationphase 'Hoist_Hide' < -0.9 AND (player in crew this) AND this animationphase 'door_L_2' > 0.9"; - statement="this execVM ""braf\braf_sar\Braf_Scripts\hoist_up.sqf""; this animate ['Hoist_Hide',-0.5]; this say3d ""Winch"""; + statement="[this, ""up""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',-0.5]; this say3d ""Winch"""; }; class Recover_Rescue_Seat: Deploy_Rescue_Seat { - displayname=" Retrieve Rescue Seat "; + displayname=" Retrieve Rescue Payload "; condition="(player in crew this) AND this animationphase 'door_L_2' > 0.9 AND this animationphase 'Hoist_Hide' < -0.4 AND this animationphase 'Hoist_Hide' > -0.6"; - statement="this execVM ""braf\braf_sar\Braf_Scripts\recover_seat.sqf""; this animate ['Winch_Rot',0]; this animate ['Hoist_Hide',1]"; + statement="[this, ""recover""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Winch_Rot',0]; this animate ['Hoist_Hide',1]"; }; class Hoist_Cut: Deploy_Rescue_Seat { displayname=" Cut Hoist Hook Cable "; condition="(player in crew this) AND this animationphase 'Hoist_Hide' < 0 AND this animationphase 'door_L_2' > 0.9"; - statement="this execVM ""braf\braf_sar\Braf_Scripts\hoist_cut.sqf""; this animate ['Winch_Rot',0]; this animate ['Hoist_Hide',1]"; + statement="[this, ""cut""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Winch_Rot',0]; this animate ['Hoist_Hide',1]"; }; class NVG_ON { diff --git a/braf_air/Braf_Helicopters/Braf_Pantera/Pantera_Base.hpp b/braf_air/Braf_Helicopters/Braf_Pantera/Pantera_Base.hpp index 2811375..2fb1023 100644 --- a/braf_air/Braf_Helicopters/Braf_Pantera/Pantera_Base.hpp +++ b/braf_air/Braf_Helicopters/Braf_Pantera/Pantera_Base.hpp @@ -344,32 +344,38 @@ class BRAF_Pantera_Base: Helicopter_Base_H radius=20; priority=1; onlyForPlayer=0; - condition="this animationphase 'Hoist_Hide' > 0.9 AND (player in crew this) AND this animationphase 'Door_R_1' > 0.9 AND this animationphase 'Civilian_hide' < 0.1"; - statement="this execVM ""braf\braf_sar\Braf_Scripts\DRS.sqf""; this animate ['Hoist_Hide',-0.5]"; + condition="this animationphase 'Hoist_Hide' > 0.9 AND (player in crew this) AND this animationphase 'Door_R_1' > 0.9 AND this animationphase 'Civilian_hide' < 0.1 AND !(""BRAF_Rescue_Seat"" in (this getVariable ['braf_hoist_spent_payloads', []]))"; + statement="[this, ""deploy"", ""BRAF_Rescue_Seat""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',-0.5]"; + }; + class Deploy_Rescue_Stretcher: Deploy_Rescue_Seat + { + displayname=" Deploy Rescue Stretcher "; + condition="this animationphase 'Hoist_Hide' > 0.9 AND (player in crew this) AND this animationphase 'Door_R_1' > 0.9 AND this animationphase 'Civilian_hide' < 0.1 AND !(""BRAF_Rescue_Stretcher"" in (this getVariable ['braf_hoist_spent_payloads', []]))"; + statement="[this, ""deploy"", ""BRAF_Rescue_Stretcher""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',-0.5]"; }; class Hoist_Down: Deploy_Rescue_Seat { displayname=" Extend Cable Hook "; condition="this animationphase 'Hoist_Hide' < -0.4 AND this animationphase 'Hoist_Hide' > -0.6 AND (player in crew this) AND this animationphase 'Door_R_1' > 0.9"; - statement="this execVM ""braf\braf_sar\Braf_Scripts\hoist_down.sqf""; this animate ['Hoist_Hide',-1]; this say3d ""Winch"""; + statement="[this, ""down""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',-1]; this say3d ""Winch"""; }; class Hoist_Up: Deploy_Rescue_Seat { displayname=" Recover Cable Hook "; condition="this animationphase 'Hoist_Hide' < -0.9 AND (player in crew this) AND this animationphase 'Door_R_1' > 0.9"; - statement="this execVM ""braf\braf_sar\Braf_Scripts\hoist_up.sqf""; this animate ['Hoist_Hide',-0.5]; this say3d ""Winch"""; + statement="[this, ""up""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',-0.5]; this say3d ""Winch"""; }; class Recover_Rescue_Seat: Deploy_Rescue_Seat { - displayname=" Retrieve Rescue Seat "; + displayname=" Retrieve Rescue Payload "; condition="(player in crew this) AND this animationphase 'Door_R_1' > 0.9 AND this animationphase 'Hoist_Hide' < -0.4 AND this animationphase 'Hoist_Hide' > -0.6"; - statement="this execVM ""braf\braf_sar\Braf_Scripts\recover_seat.sqf""; this animate ['Hoist_Hide',1]"; + statement="[this, ""recover""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',1]"; }; class Hoist_Cut: Deploy_Rescue_Seat { displayname=" Cut Hoist Hook Cable "; condition="(player in crew this) AND this animationphase 'Door_R_1' > 0.9 AND this animationphase 'Hoist_Hide' < 0"; - statement="this execVM ""braf\braf_sar\Braf_Scripts\hoist_cut.sqf""; this animate ['Hoist_Hide',1]"; + statement="[this, ""cut""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',1]"; }; class Open_Door_Left { @@ -1409,32 +1415,38 @@ class BRAF_Pantera_K2_SAR: BRAF_Pantera_Base radius=20; priority=1; onlyForPlayer=0; - condition="this animationphase 'Hoist_Hide' > 0.9 AND (player in crew this) AND this animationphase 'Door_R_1' > 0.9 AND this animationphase 'Civilian_hide' < 0.1"; - statement="this execVM ""braf\braf_sar\Braf_Scripts\DRS.sqf""; this animate ['Hoist_Hide',-0.5]"; + condition="this animationphase 'Hoist_Hide' > 0.9 AND (player in crew this) AND this animationphase 'Door_R_1' > 0.9 AND this animationphase 'Civilian_hide' < 0.1 AND !(""BRAF_Rescue_Seat"" in (this getVariable ['braf_hoist_spent_payloads', []]))"; + statement="[this, ""deploy"", ""BRAF_Rescue_Seat""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',-0.5]"; + }; + class Deploy_Rescue_Stretcher: Deploy_Rescue_Seat + { + displayname=" Deploy Rescue Stretcher "; + condition="this animationphase 'Hoist_Hide' > 0.9 AND (player in crew this) AND this animationphase 'Door_R_1' > 0.9 AND this animationphase 'Civilian_hide' < 0.1 AND !(""BRAF_Rescue_Stretcher"" in (this getVariable ['braf_hoist_spent_payloads', []]))"; + statement="[this, ""deploy"", ""BRAF_Rescue_Stretcher""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',-0.5]"; }; class Hoist_Down: Deploy_Rescue_Seat { displayname=" Extend Cable Hook "; condition="this animationphase 'Hoist_Hide' < -0.4 AND this animationphase 'Hoist_Hide' > -0.6 AND (player in crew this) AND this animationphase 'Door_R_1' > 0.9"; - statement="this execVM ""braf\braf_sar\Braf_Scripts\hoist_down.sqf""; this animate ['Hoist_Hide',-1]; this say3d ""Winch"""; + statement="[this, ""down""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',-1]; this say3d ""Winch"""; }; class Hoist_Up: Deploy_Rescue_Seat { displayname=" Recover Cable Hook "; condition="this animationphase 'Hoist_Hide' < -0.9 AND (player in crew this) AND this animationphase 'Door_R_1' > 0.9"; - statement="this execVM ""braf\braf_sar\Braf_Scripts\hoist_up.sqf""; this animate ['Hoist_Hide',-0.5]; this say3d ""Winch"""; + statement="[this, ""up""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',-0.5]; this say3d ""Winch"""; }; class Recover_Rescue_Seat: Deploy_Rescue_Seat { - displayname=" Retrieve Rescue Seat "; + displayname=" Retrieve Rescue Payload "; condition="(player in crew this) AND this animationphase 'Door_R_1' > 0.9 AND this animationphase 'Hoist_Hide' < -0.4 AND this animationphase 'Hoist_Hide' > -0.6"; - statement="this execVM ""braf\braf_sar\Braf_Scripts\recover_seat.sqf""; this animate ['Hoist_Hide',1]"; + statement="[this, ""recover""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',1]"; }; class Hoist_Cut: Deploy_Rescue_Seat { displayname=" Cut Hoist Hook Cable "; condition="(player in crew this) AND this animationphase 'Door_R_1' > 0.9 AND this animationphase 'Hoist_Hide' < 0"; - statement="this execVM ""braf\braf_sar\Braf_Scripts\hoist_cut.sqf""; this animate ['Hoist_Hide',1]"; + statement="[this, ""cut""] execVM ""braf\braf_sar\Braf_Scripts\hoist_controller.sqf""; this animate ['Hoist_Hide',1]"; }; class Open_Door_Left { @@ -2267,4 +2279,4 @@ class BRAF_Pantera_K2_Silver: BRAF_Pantera_Base statement="this animate ['Door_R_1',0], this animate ['Door_R_2',0], this animate ['Door_R_rot',0], this say3d ""Doors"""; }; }; -}; \ No newline at end of file +}; diff --git a/braf_sar/Braf_Scripts/DRS.sqf b/braf_sar/Braf_Scripts/DRS.sqf deleted file mode 100644 index 901883d..0000000 --- a/braf_sar/Braf_Scripts/DRS.sqf +++ /dev/null @@ -1,21 +0,0 @@ -// Declaracao de variaveis: -params ["_heli"]; - -// Espera de 1 segundo -sleep 1; - -// Texto que aparece no side channel -_heli vehicleChat "Deploying Rescue Seat"; - -// Criacao e posicionamento do assento -private _rescueSeat = "BRAF_Rescue_Seat" createVehicle [0, 0, 0]; -_rescueSeat setDir (getDir _heli); -_rescueSeat setPosASL (_heli modelToWorld [0, 0, -1.5]); - -// Criacao do cabo -private _hoistRope = ropeCreate [_heli, "rope_start", _rescueSeat, "hoist_point", 0.25]; - -_heli setVariable ["rescueseat", _rescueSeat]; -_heli setVariable ["hoistrope", _hoistRope]; - -_heli; diff --git a/braf_sar/Braf_Scripts/hoist_controller.sqf b/braf_sar/Braf_Scripts/hoist_controller.sqf new file mode 100644 index 0000000..5ae50e4 --- /dev/null +++ b/braf_sar/Braf_Scripts/hoist_controller.sqf @@ -0,0 +1,129 @@ +params ["_heli", ["_action", ""], ["_payloadClass", "BRAF_Rescue_Seat"]]; + +private _initialLength = 0.25; +private _targetLength = 25; +private _recoveryLength = 3.1; +private _duration = 16; + +switch (toLower _action) do { + case "deploy": { + private _spentPayloads = _heli getVariable ["braf_hoist_spent_payloads", []]; + + if (_payloadClass in _spentPayloads) exitWith { + _heli vehicleChat "Rescue Payload Expended"; + }; + + private _oldRope = _heli getVariable ["hoistrope", objNull]; + private _oldPayload = _heli getVariable ["rescueseat", objNull]; + + if (!isNull _oldRope) then { + ropeDestroy _oldRope; + }; + + if (!isNull _oldPayload) then { + deleteVehicle _oldPayload; + }; + + sleep 1; + + _heli vehicleChat "Deploying Rescue Payload"; + + private _payload = _payloadClass createVehicle [0, 0, 0]; + _payload setDir (getDir _heli); + _payload setPosASL (_heli modelToWorld [0, 0, -1.5]); + + private _rope = ropeCreate [_heli, "rope_start", _payload, "hoist_point", _initialLength]; + + _heli setVariable ["rescueseat", _payload]; + _heli setVariable ["hoistrope", _rope]; + _heli setVariable ["braf_hoist_payload_class", _payloadClass]; + }; + + case "down": { + private _rope = _heli getVariable ["hoistrope", objNull]; + + if (isNull _rope) exitWith {}; + + private _currentLength = ropeLength _rope; + private _speed = ((_targetLength - _currentLength) max 0.01) / _duration; + + ropeUnwind [_rope, _speed, _targetLength, false]; + }; + + case "up": { + private _rope = _heli getVariable ["hoistrope", objNull]; + + if (isNull _rope) exitWith {}; + + private _currentLength = ropeLength _rope; + private _speed = ((_currentLength - _initialLength) max 0.01) / _duration; + + ropeUnwind [_rope, _speed, _initialLength, false]; + }; + + case "recover": { + private _payload = _heli getVariable ["rescueseat", objNull]; + private _rope = _heli getVariable ["hoistrope", objNull]; + private _currentPayloadClass = _heli getVariable ["braf_hoist_payload_class", ""]; + + if (isNull _rope) exitWith { + _heli vehicleChat "no rope!"; + }; + + if ((ropeLength _rope) <= _recoveryLength) then { + if (!isNull _payload) then { + { + if (!isNil "_x") then { + _x leaveVehicle _payload; + _x action ["GetOut", _payload]; + sleep 0.1; + _payload lock 0; + [_x, _heli] remoteExec ["moveInCargo", _x]; + _x assignAsCargo _heli; + }; + } forEach crew _payload; + + ropeDestroy _rope; + deleteVehicle _payload; + } else { + ropeDestroy _rope; + }; + + _heli setVariable ["rescueseat", nil]; + _heli setVariable ["hoistrope", nil]; + _heli setVariable ["braf_hoist_payload_class", nil]; + + if (_currentPayloadClass != "") then { + private _spentPayloads = _heli getVariable ["braf_hoist_spent_payloads", []]; + _spentPayloads = _spentPayloads - [_currentPayloadClass]; + _heli setVariable ["braf_hoist_spent_payloads", _spentPayloads]; + }; + + _heli vehicleChat "Rescue Payload In Cabin"; + } else { + _heli vehicleChat "First Raise The Rescue Payload To Cabin Door"; + }; + }; + + case "cut": { + private _rope = _heli getVariable ["hoistrope", objNull]; + private _currentPayloadClass = _heli getVariable ["braf_hoist_payload_class", ""]; + + if (isNull _rope) exitWith { + _heli vehicleChat "no rope!"; + }; + + ropeCut [_rope, 0]; + ropeDestroy _rope; + _heli setVariable ["hoistrope", nil]; + + if (_currentPayloadClass != "") then { + private _spentPayloads = _heli getVariable ["braf_hoist_spent_payloads", []]; + + if !(_currentPayloadClass in _spentPayloads) then { + _spentPayloads pushBack _currentPayloadClass; + _heli setVariable ["braf_hoist_spent_payloads", _spentPayloads]; + }; + }; + }; +}; diff --git a/braf_sar/Braf_Scripts/hoist_cut.sqf b/braf_sar/Braf_Scripts/hoist_cut.sqf deleted file mode 100644 index fd10304..0000000 --- a/braf_sar/Braf_Scripts/hoist_cut.sqf +++ /dev/null @@ -1,13 +0,0 @@ -// Declaracao de variaveis -params ["_heli"]; - -private _rope = _heli getVariable ["hoistrope", objNull]; - -if (isNull _rope) exitWith { - _heli vehicleChat "no rope!"; -}; - -// Corte do cabo -ropeCut [_rope, 0]; -ropeDestroy _rope; -_heli setVariable ["hoistrope", nil]; diff --git a/braf_sar/Braf_Scripts/hoist_down.sqf b/braf_sar/Braf_Scripts/hoist_down.sqf deleted file mode 100644 index b175120..0000000 --- a/braf_sar/Braf_Scripts/hoist_down.sqf +++ /dev/null @@ -1,14 +0,0 @@ -// Declaracao de variaveis: -params ["_heli"]; - -private _rope = _heli getVariable ["hoistrope", objNull]; - -if (isNull _rope) exitWith {}; - -private _targetLength = 25; -private _duration = 16; -private _currentLength = ropeLength _rope; -private _speed = ((_targetLength - _currentLength) max 0.01) / _duration; - -// Extensao do cabo com duracao alinhada ao audio do guincho. -ropeUnwind [_rope, _speed, _targetLength, false]; diff --git a/braf_sar/Braf_Scripts/hoist_up.sqf b/braf_sar/Braf_Scripts/hoist_up.sqf deleted file mode 100644 index beb8d7c..0000000 --- a/braf_sar/Braf_Scripts/hoist_up.sqf +++ /dev/null @@ -1,14 +0,0 @@ -// Declaracao de variaveis -params ["_heli"]; - -private _rope = _heli getVariable ["hoistrope", objNull]; - -if (isNull _rope) exitWith {}; - -private _targetLength = 0.25; -private _duration = 16; -private _currentLength = ropeLength _rope; -private _speed = ((_currentLength - _targetLength) max 0.01) / _duration; - -// Recuperacao do cabo com duracao alinhada ao audio do guincho. -ropeUnwind [_rope, _speed, _targetLength, false]; diff --git a/braf_sar/Braf_Scripts/recover_seat.sqf b/braf_sar/Braf_Scripts/recover_seat.sqf deleted file mode 100644 index 3072ebc..0000000 --- a/braf_sar/Braf_Scripts/recover_seat.sqf +++ /dev/null @@ -1,35 +0,0 @@ -// Declaracao de variaveis -params ["_heli"]; - -private _basket = _heli getVariable ["rescueseat", objNull]; -private _rope = _heli getVariable ["hoistrope", objNull]; - -if (isNull _rope) exitWith { - _heli vehicleChat "no rope!"; -}; - -private _length = ropeLength _rope; - -if (_length <= 3.1) then { - { - if (!isNil "_x") then { - _x leaveVehicle _basket; - _x action ["GetOut", _basket]; - sleep 0.1; - _basket lock 0; - [_x, _heli] remoteExec ["moveInCargo", _x]; - _x assignAsCargo _heli; - }; - } forEach crew _basket; - - ropeDestroy _rope; - deleteVehicle _basket; - _heli setVariable ["rescueseat", nil]; - _heli setVariable ["hoistrope", nil]; - _heli vehicleChat "Basket In Cabin"; -} else { - _heli vehicleChat "First Raise The Basket To Cabin Door"; -}; - -// ropeCut [_heli getVariable "hoistrope", 0]; -// deleteVehicle (_heli getVariable "rescueseat"); diff --git a/braf_sar/SAR_Base.hpp b/braf_sar/SAR_Base.hpp index 1df5ff8..44b1361 100644 --- a/braf_sar/SAR_Base.hpp +++ b/braf_sar/SAR_Base.hpp @@ -173,6 +173,20 @@ class BRAF_Rescue_Seat: Items_base_F }; }; }; +class BRAF_Rescue_Basket: BRAF_Rescue_Seat +{ + author="BRAF Team"; + displayName="Rescue Basket"; + _generalMacro="BRAF_Rescue_Basket"; + model="braf\braf_sar\BRAF_rescue_seat.p3d"; +}; +class BRAF_Rescue_Stretcher: BRAF_Rescue_Seat +{ + author="BRAF Team"; + displayName="Rescue Stretcher"; + _generalMacro="BRAF_Rescue_Stretcher"; + model="braf\braf_sar\BRAF_rescue_seat.p3d"; +}; class BRAF_Esquilo_EFS: BRAF_Rescue_Seat { author="BRAF Team"; @@ -214,4 +228,4 @@ class BRAF_Pantera_EFS: BRAF_Rescue_Seat cargoAction[]={""}; class UserActions {}; -}; \ No newline at end of file +}; diff --git a/braf_sar/config.cpp b/braf_sar/config.cpp index 0aca2a3..44a7b42 100644 --- a/braf_sar/config.cpp +++ b/braf_sar/config.cpp @@ -15,7 +15,10 @@ class CfgPatches requiredVersion = 0.1; units[] = { - "BRAF_Rescue_Seat"}; + "BRAF_Rescue_Seat", + "BRAF_Rescue_Basket", + "BRAF_Rescue_Stretcher" + }; weapons[] = {}; }; }; @@ -23,4 +26,4 @@ class CfgVehicles { class Items_base_F; #include "SAR_Base.hpp" -}; \ No newline at end of file +};