mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #125 from KoffeinFlummi/agmParachutePort
Agm parachute port
This commit is contained in:
commit
91d2a8c343
@ -1,33 +0,0 @@
|
|||||||
/*
|
|
||||||
Name: AGM_Parachute_fnc_init
|
|
||||||
|
|
||||||
Author: Garth de Wet (LH)
|
|
||||||
|
|
||||||
Description:
|
|
||||||
Auto called by Arma.
|
|
||||||
Initialises the parachute system.
|
|
||||||
|
|
||||||
Parameters:
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Nothing
|
|
||||||
|
|
||||||
Example:
|
|
||||||
call AGM_Parachute_fnc_init;
|
|
||||||
*/
|
|
||||||
[] spawn {
|
|
||||||
AGM_Parachuting_PFH = false;
|
|
||||||
while {true} do {
|
|
||||||
sleep 1;
|
|
||||||
// I believe this doesn't work for Zeus.
|
|
||||||
// vehicle _player
|
|
||||||
if (!AGM_Parachuting_PFH && {(vehicle AGM_player) isKindOf "ParachuteBase"}) then {
|
|
||||||
AGM_Parachuting_PFH = true;
|
|
||||||
["AGM_ParachuteFix", "OnEachFrame", {call AGM_Parachute_fnc_onEachFrame;}] call BIS_fnc_addStackedEventHandler;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// don't show speed and height when in expert mode
|
|
||||||
["Parachute", {if (!cadetMode) then {_dlg = _this select 0; {(_dlg displayCtrl _x) ctrlShow false} forEach [121, 122, 1004, 1005, 1006, 1014];};}] call AGM_Core_fnc_addInfoDisplayEventHandler; //@todo addEventHandler infoDisplayChanged with select 1 == "Parachute"
|
|
||||||
["Soldier", {if (!cadetMode) then {_dlg = _this select 0; {_ctrl = (_dlg displayCtrl _x); _ctrl ctrlSetPosition [0,0,0,0]; _ctrl ctrlCommit 0;} forEach [380, 382]};}] call AGM_Core_fnc_addInfoDisplayEventHandler; //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"
|
|
@ -1,90 +0,0 @@
|
|||||||
class CfgPatches {
|
|
||||||
class AGM_Parachute {
|
|
||||||
units[] = {"AGM_NonSteerableParachute"};
|
|
||||||
weapons[] = {"AGM_Altimeter"};
|
|
||||||
requiredVersion = 0.60;
|
|
||||||
requiredAddons[] = {AGM_Core};
|
|
||||||
version = "0.95";
|
|
||||||
versionStr = "0.95";
|
|
||||||
versionAr[] = {0,95,0};
|
|
||||||
author[] = {"Garth 'LH' de Wet"};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
class CfgFunctions {
|
|
||||||
class AGM_Parachute {
|
|
||||||
class AGM_Parachute {
|
|
||||||
file = "\AGM_Parachute\functions";
|
|
||||||
class onEachFrame;
|
|
||||||
class doLanding;
|
|
||||||
class hideAltimeter;
|
|
||||||
class showAltimeter;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
class Extended_PostInit_EventHandlers {
|
|
||||||
class AGM_Parachute {
|
|
||||||
clientInit = "call compile preprocessFileLineNumbers '\AGM_Parachute\clientInit.sqf';";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
class AGM_Core_Default_Keys {
|
|
||||||
class showAltimeterNew {
|
|
||||||
displayName = "$STR_AGM_Parachute_showAltimeter";
|
|
||||||
condition = "'AGM_Altimeter' in assignedItems _player";
|
|
||||||
statement = "if (isNull (missionNamespace getVariable ['AGM_Parachute_AltimeterFnc', scriptNull])) then {[_player] call AGM_Parachute_fnc_showAltimeter} else {call AGM_Parachute_fnc_hideAltimeter}";
|
|
||||||
exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Medical_canTreat", "AGM_Interaction_isNotEscorting"};
|
|
||||||
key = 24;
|
|
||||||
shift = 0;
|
|
||||||
control = 0;
|
|
||||||
alt = 0;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
#include "RscTitles.hpp"
|
|
||||||
|
|
||||||
class CfgWeapons {
|
|
||||||
class ItemWatch;
|
|
||||||
class AGM_Altimeter:ItemWatch {
|
|
||||||
author = "$STR_AGM_Core_AGMTeam";
|
|
||||||
descriptionShort = "$STR_AGM_Parachute_AltimeterDescription";
|
|
||||||
displayName = "$STR_AGM_Parachute_AltimeterDisplayName";
|
|
||||||
picture = "\AGM_Parachute\UI\watch_altimeter.paa";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
class CfgVehicles {
|
|
||||||
class Box_NATO_Support_F;
|
|
||||||
class AGM_Box_Misc: Box_NATO_Support_F {
|
|
||||||
class TransportItems {
|
|
||||||
class _xx_AGM_Altimeter {
|
|
||||||
name = "AGM_Altimeter";
|
|
||||||
count = 6;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
class TransportBackpacks {
|
|
||||||
class _xx_AGM_NonSteerableParachute {
|
|
||||||
backpack = "AGM_NonSteerableParachute";
|
|
||||||
count = 4;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
class B_Parachute;
|
|
||||||
class AGM_NonSteerableParachute: B_Parachute {
|
|
||||||
author = "$STR_AGM_Core_AGMTeam";
|
|
||||||
scope = 2;
|
|
||||||
displayName = "$STR_AGM_Parachute_NonSteerableParachute";
|
|
||||||
//picture = "\A3\Characters_F\data\ui\icon_b_parachute_ca.paa"; // @todo
|
|
||||||
//model = "\A3\Weapons_F\Ammoboxes\Bags\Backpack_Parachute"; // @todo
|
|
||||||
backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable
|
|
||||||
ParachuteClass = "NonSteerable_Parachute_F";
|
|
||||||
maximumLoad = 0;
|
|
||||||
mass = 100;
|
|
||||||
};
|
|
||||||
|
|
||||||
class B_Soldier_05_f; class B_Pilot_F: B_Soldier_05_f {backpack = "AGM_NonSteerableParachute";};
|
|
||||||
class I_Soldier_04_F; class I_pilot_F: I_Soldier_04_F {backpack = "AGM_NonSteerableParachute";};
|
|
||||||
class O_helipilot_F; class O_Pilot_F: O_helipilot_F {backpack = "AGM_NonSteerableParachute";};
|
|
||||||
};
|
|
@ -1,25 +0,0 @@
|
|||||||
/*
|
|
||||||
Name: AGM_Parachute_fnc_doLanding
|
|
||||||
|
|
||||||
Author: Garth de Wet (LH)
|
|
||||||
|
|
||||||
Description:
|
|
||||||
Performs the landing animation fix
|
|
||||||
|
|
||||||
Parameters:
|
|
||||||
0: OBJECT - unit
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Nothing
|
|
||||||
|
|
||||||
Example:
|
|
||||||
[player] call AGM_Parachute_fnc_doLanding;
|
|
||||||
*/
|
|
||||||
_unit = _this select 0;
|
|
||||||
["AGM_ParachuteFix", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
|
|
||||||
AGM_Parachuting_PFH = false;
|
|
||||||
[_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call AGM_Core_fnc_doAnimation;
|
|
||||||
[_unit] spawn {
|
|
||||||
sleep 1;
|
|
||||||
(_this select 0) playActionNow "Crouch";
|
|
||||||
};
|
|
@ -1,18 +0,0 @@
|
|||||||
/*
|
|
||||||
Name: AGM_Parachute_fnc_hideAltimeter
|
|
||||||
|
|
||||||
Author: Garth de Wet (LH)
|
|
||||||
|
|
||||||
Description:
|
|
||||||
Removes the altimeter from the screen.
|
|
||||||
|
|
||||||
Parameters:
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Nothing
|
|
||||||
|
|
||||||
Example:
|
|
||||||
call AGM_Parachute_fnc_hideAltimeter
|
|
||||||
*/
|
|
||||||
terminate AGM_Parachute_AltimeterFnc;
|
|
||||||
(["AGM_Altimeter"] call BIS_fnc_rscLayer) cutText ["","PLAIN",0,true];
|
|
@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
Name: AGM_Parachute_fnc_onEachFrame
|
|
||||||
|
|
||||||
Author: Garth de Wet (LH)
|
|
||||||
|
|
||||||
Description:
|
|
||||||
Checks if a unit can defuse an explosive
|
|
||||||
|
|
||||||
Parameters:
|
|
||||||
0: OBJECT - unit
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Nothing
|
|
||||||
|
|
||||||
Example:
|
|
||||||
call AGM_Parachute_fnc_onEachFrame;
|
|
||||||
*/
|
|
||||||
private "_player";
|
|
||||||
_player = AGM_player;
|
|
||||||
if (isNull _player) exitWith {["AGM_ParachuteFix", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler;AGM_Parachuting_PFH = false;};
|
|
||||||
if !((vehicle _player) isKindOf "ParachuteBase") exitWith {};
|
|
||||||
if (isTouchingGround _player) exitWith {};
|
|
||||||
|
|
||||||
private ["_pos", "_intersects"];
|
|
||||||
_pos = getPosASL (Vehicle _player);
|
|
||||||
|
|
||||||
if ((lineIntersects [_pos, _pos vectorAdd [0,0,-0.5], vehicle _player, _player]) || {((ASLtoATL _pos) select 2) < 0.75}) then {
|
|
||||||
// I believe this will not work for Zeus units.
|
|
||||||
deleteVehicle (vehicle _player);
|
|
||||||
[_player] call AGM_Parachute_fnc_doLanding;
|
|
||||||
};
|
|
@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
Name: AGM_Parachute_fnc_showAltimeter
|
|
||||||
|
|
||||||
Author: Garth de Wet (LH)
|
|
||||||
|
|
||||||
Description:
|
|
||||||
Displays the altimeter on screen.
|
|
||||||
|
|
||||||
Parameters:
|
|
||||||
0: OBJECT - unit to track for the altimeter
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Nothing
|
|
||||||
|
|
||||||
Example:
|
|
||||||
[player] call AGM_Parachute_fnc_showAltimeter
|
|
||||||
*/
|
|
||||||
private ["_unit"];
|
|
||||||
_unit = _this select 0;
|
|
||||||
(["AGM_Altimeter"] call BIS_fnc_rscLayer) cutRsc ["AGM_Altimeter", "PLAIN",0,true];
|
|
||||||
if (isNull (uiNamespace getVariable ["AGM_Altimeter", displayNull])) exitWith {};
|
|
||||||
|
|
||||||
AGM_Parachute_AltimeterFnc = [uiNamespace getVariable ["AGM_Altimeter", displayNull], _unit] spawn {
|
|
||||||
private ["_height", "_hour", "_minute", "_descentRate"];
|
|
||||||
_unit = _this select 1;
|
|
||||||
_height = floor ((getPosASL _unit) select 2);
|
|
||||||
_oldHeight = _height;
|
|
||||||
_descentRate = 0;
|
|
||||||
_hour = floor daytime;
|
|
||||||
_minute = floor ((daytime - _hour) * 60);
|
|
||||||
disableSerialization;
|
|
||||||
private ["_HeightText", "_DecendRate", "_TimeText", "_prevTime", "_curTime"];
|
|
||||||
_HeightText = (_this select 0) displayCtrl 1100;
|
|
||||||
_DecendRate = (_this select 0) displayCtrl 1000;
|
|
||||||
_TimeText = (_this select 0) displayCtrl 1001;
|
|
||||||
_curTime = time;
|
|
||||||
_prevTime = _curTime;
|
|
||||||
while {true} do {
|
|
||||||
_TimeText ctrlSetText (format ["%1:%2",[_hour, 2] call AGM_Core_fnc_numberToDigitsString,[_minute, 2] call AGM_Core_fnc_numberToDigitsString]);
|
|
||||||
_HeightText ctrlSetText (format ["%1", floor(_height)]);
|
|
||||||
_DecendRate ctrlSetText (format ["%1", _descentRate max 0]);
|
|
||||||
sleep 0.2;
|
|
||||||
_height = (getPosASL _unit) select 2;
|
|
||||||
_curTime = time;
|
|
||||||
_descentRate = floor ((_oldHeight - _height) / (_curTime - _prevTime));
|
|
||||||
_oldHeight = _height;
|
|
||||||
_prevTime = _curTime;
|
|
||||||
|
|
||||||
// close altimeter, @todo _unit can change due to team switch, zeus!
|
|
||||||
if !("AGM_Altimeter" in assignedItems _unit) exitWith {call AGM_Parachute_fnc_hideAltimeter};
|
|
||||||
};
|
|
||||||
};
|
|
1
addons/parachute/$PBOPREFIX$
Normal file
1
addons/parachute/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
|||||||
|
z\ace\addons\parachute
|
10
addons/parachute/CfgEventHandlers.hpp
Normal file
10
addons/parachute/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
class Extended_PreInit_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class Extended_PostInit_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||||
|
};
|
||||||
|
};
|
11
addons/parachute/README.md
Normal file
11
addons/parachute/README.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
ace_parachute
|
||||||
|
===========
|
||||||
|
|
||||||
|
Improves parachutes and adds an altimeter.
|
||||||
|
|
||||||
|
## Maintainers
|
||||||
|
|
||||||
|
The people responsible for merging changes to this component or answering potential questions.
|
||||||
|
|
||||||
|
- [CorruptedHeart](https://github.com/CorruptedHeart)
|
||||||
|
- [esteldunedain](https://github.com/esteldunedain)
|
@ -1,18 +1,18 @@
|
|||||||
class RscText;
|
class RscText;
|
||||||
class RscPicture;
|
class RscPicture;
|
||||||
class RscTitles {
|
class RscTitles {
|
||||||
class AGM_Altimeter {
|
class ACE_Altimeter {
|
||||||
idd = 9935;
|
idd = 9935;
|
||||||
enableSimulation = 1;
|
enableSimulation = 1;
|
||||||
movingEnable = 0;
|
movingEnable = 0;
|
||||||
fadeIn=0;
|
fadeIn=0;
|
||||||
fadeOut=1;
|
fadeOut=1;
|
||||||
duration = 10e10;
|
duration = 10e10;
|
||||||
onLoad = "uiNamespace setVariable ['AGM_Altimeter', _this select 0];";
|
onLoad = "uiNamespace setVariable ['ACE_Altimeter', _this select 0];";
|
||||||
class controls {
|
class controls {
|
||||||
class AltimeterImage: RscPicture {
|
class AltimeterImage: RscPicture {
|
||||||
idc = 1200;
|
idc = 1200;
|
||||||
text = "AGM_Parachute\UI\watch_altimeter.paa";
|
text = PATHTOF(UI\watch_altimeter.paa);
|
||||||
x = 0.118437 * safezoneW + safezoneX;
|
x = 0.118437 * safezoneW + safezoneX;
|
||||||
y = 0.621 * safezoneH + safezoneY;
|
y = 0.621 * safezoneH + safezoneY;
|
||||||
w = 0.20625 * safezoneW;
|
w = 0.20625 * safezoneW;
|
43
addons/parachute/XEH_postInit.sqf
Normal file
43
addons/parachute/XEH_postInit.sqf
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
* Author: Garth 'L-H' de Wet
|
||||||
|
* Initialises the parachute system.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
|
["ACE3", localize "STR_ACE_Parachute_showAltimeter",
|
||||||
|
{
|
||||||
|
// Conditions: canInteract
|
||||||
|
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
||||||
|
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
||||||
|
if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false};
|
||||||
|
if (!(missionNamespace getVariable [QGVAR(AltimeterActive), false])) then {
|
||||||
|
[ace_player] call FUNC(showAltimeter);
|
||||||
|
} else {
|
||||||
|
call FUNC(hideAltimeter);
|
||||||
|
};
|
||||||
|
true
|
||||||
|
}, [24, false, false, false], false, "keydown"] call CALLSTACK(cba_fnc_registerKeybind);
|
||||||
|
|
||||||
|
GVAR(PFH) = false;
|
||||||
|
["playerVehicleChanged",{
|
||||||
|
if (!GVAR(PFH) && {(vehicle ACE_player) isKindOf "ParachuteBase"}) then {
|
||||||
|
GVAR(PFH) = true;
|
||||||
|
[FUNC(onEachFrame), 0.1, []] call CALLSTACK(cba_fnc_addPerFrameHandler);
|
||||||
|
};
|
||||||
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
|
// don't show speed and height when in expert mode
|
||||||
|
["Parachute", {if (!cadetMode) then {_dlg = _this select 0; {(_dlg displayCtrl _x) ctrlShow false} forEach [121, 122, 1004, 1005, 1006, 1014];};}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Parachute"
|
||||||
|
["Soldier", {if (!cadetMode) then {_dlg = _this select 0; {_ctrl = (_dlg displayCtrl _x); _ctrl ctrlSetPosition [0,0,0,0]; _ctrl ctrlCommit 0;} forEach [380, 382]};}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"
|
25
addons/parachute/XEH_preInit.sqf
Normal file
25
addons/parachute/XEH_preInit.sqf
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Author: Garth 'L-H' de Wet
|
||||||
|
* Initialises the parachute system.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
ADDON = false;
|
||||||
|
|
||||||
|
PREP(doLanding);
|
||||||
|
PREP(hideAltimeter);
|
||||||
|
PREP(onEachFrame);
|
||||||
|
PREP(showAltimeter);
|
||||||
|
|
||||||
|
ADDON = true;
|
61
addons/parachute/config.cpp
Normal file
61
addons/parachute/config.cpp
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
class CfgPatches {
|
||||||
|
class ACE_Parachute {
|
||||||
|
units[] = {"ACE_NonSteerableParachute"};
|
||||||
|
weapons[] = {"ACE_Altimeter"};
|
||||||
|
requiredVersion = REQUIRED_VERSION;
|
||||||
|
requiredAddons[] = {"ace_common"};
|
||||||
|
VERSION_CONFIG;
|
||||||
|
author[] = {"Garth 'LH' de Wet"};
|
||||||
|
authorUrl = "http://garth.snakebiteink.co.za/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "CfgEventHandlers.hpp"
|
||||||
|
#include "RscTitles.hpp"
|
||||||
|
|
||||||
|
class CfgWeapons {
|
||||||
|
class ItemWatch;
|
||||||
|
class ACE_Altimeter:ItemWatch {
|
||||||
|
author = "$STR_ACE_Common_ACETeam";
|
||||||
|
descriptionShort = "$STR_ACE_Parachute_AltimeterDescription";
|
||||||
|
displayName = "$STR_ACE_Parachute_AltimeterDisplayName";
|
||||||
|
picture = PATHTOF(UI\watch_altimeter.paa);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class CfgVehicles {
|
||||||
|
class Box_NATO_Support_F;
|
||||||
|
class ACE_Box_Misc: Box_NATO_Support_F {
|
||||||
|
class TransportItems {
|
||||||
|
class _xx_ACE_Altimeter {
|
||||||
|
name = "ACE_Altimeter";
|
||||||
|
count = 6;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class TransportBackpacks {
|
||||||
|
class _xx_ACE_NonSteerableParachute {
|
||||||
|
backpack = "ACE_NonSteerableParachute";
|
||||||
|
count = 4;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class B_Parachute;
|
||||||
|
class ACE_NonSteerableParachute: B_Parachute {
|
||||||
|
author = "$STR_ACE_Common_ACETeam";
|
||||||
|
scope = 2;
|
||||||
|
displayName = "$STR_ACE_Parachute_NonSteerableParachute";
|
||||||
|
//picture = "\A3\Characters_F\data\ui\icon_b_parachute_ca.paa"; // @todo
|
||||||
|
//model = "\A3\Weapons_F\Ammoboxes\Bags\Backpack_Parachute"; // @todo
|
||||||
|
backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable
|
||||||
|
ParachuteClass = "NonSteerable_Parachute_F";
|
||||||
|
maximumLoad = 0;
|
||||||
|
mass = 100;
|
||||||
|
};
|
||||||
|
|
||||||
|
class B_Soldier_05_f; class B_Pilot_F: B_Soldier_05_f {backpack = "ACE_NonSteerableParachute";};
|
||||||
|
class I_Soldier_04_F; class I_pilot_F: I_Soldier_04_F {backpack = "ACE_NonSteerableParachute";};
|
||||||
|
class O_helipilot_F; class O_Pilot_F: O_helipilot_F {backpack = "ACE_NonSteerableParachute";};
|
||||||
|
};
|
26
addons/parachute/functions/fnc_doLanding.sqf
Normal file
26
addons/parachute/functions/fnc_doLanding.sqf
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* Author: Garth 'L-H' de Wet
|
||||||
|
* Performs the landing animation fix
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: unit <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [player] call ACE_Parachute_fnc_doLanding;
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
private ["_unit"];
|
||||||
|
_unit = _this select 0;
|
||||||
|
GVAR(PFH) = false;
|
||||||
|
[_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call EFUNC(common,doAnimation);
|
||||||
|
[{
|
||||||
|
if (time >= ((_this select 0) select 0) + 1) then {
|
||||||
|
((_this select 0) select 1) playActionNow "Crouch";
|
||||||
|
[(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
||||||
|
};
|
||||||
|
}, 1, [time,_unit]] call CALLSTACK(cba_fnc_addPerFrameHandler);
|
18
addons/parachute/functions/fnc_hideAltimeter.sqf
Normal file
18
addons/parachute/functions/fnc_hideAltimeter.sqf
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* Author: Garth 'L-H' de Wet
|
||||||
|
* Removes the altimeter from the screen.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* call ACE_Parachute_fnc_hideAltimeter
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
GVAR(AltimeterActive) = false;
|
||||||
|
(["ACE_Altimeter"] call BIS_fnc_rscLayer) cutText ["","PLAIN",0,true];
|
33
addons/parachute/functions/fnc_onEachFrame.sqf
Normal file
33
addons/parachute/functions/fnc_onEachFrame.sqf
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Author: Garth 'L-H' de Wet
|
||||||
|
* Checks whether the unit should preform landing.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* call ACE_Parachute_fnc_onEachFrame;
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
private "_player";
|
||||||
|
_player = ACE_player;
|
||||||
|
if (!GVAR(PFH)) exitWith {[(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler);};
|
||||||
|
if (isNull _player) exitWith {[(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler);GVAR(PFH) = false;};
|
||||||
|
if !((vehicle _player) isKindOf "ParachuteBase") exitWith {[(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler);GVAR(PFH) = false;};
|
||||||
|
if (isTouchingGround _player) exitWith {[(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler);GVAR(PFH) = false;};
|
||||||
|
|
||||||
|
private ["_pos"];
|
||||||
|
_pos = getPosASL (vehicle _player);
|
||||||
|
|
||||||
|
if ((lineIntersects [_pos, _pos vectorAdd [0,0,-0.5], vehicle _player, _player]) || {((ASLtoATL _pos) select 2) < 0.75}) then {
|
||||||
|
[(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
||||||
|
GVAR(PFH) = false;
|
||||||
|
// I believe this will not work for Zeus units.
|
||||||
|
deleteVehicle (vehicle _player);
|
||||||
|
[_player] call FUNC(doLanding);
|
||||||
|
};
|
46
addons/parachute/functions/fnc_showAltimeter.sqf
Normal file
46
addons/parachute/functions/fnc_showAltimeter.sqf
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* Author: Garth 'L-H' de Wet
|
||||||
|
* Displays the altimeter on screen.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: unit <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [player] call ACE_Parachute_fnc_showAltimeter
|
||||||
|
*
|
||||||
|
* Public: Yes
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
private ["_unit"];
|
||||||
|
_unit = _this select 0;
|
||||||
|
(["ACE_Altimeter"] call BIS_fnc_rscLayer) cutRsc ["ACE_Altimeter", "PLAIN",0,true];
|
||||||
|
if (isNull (uiNamespace getVariable ["ACE_Altimeter", displayNull])) exitWith {};
|
||||||
|
|
||||||
|
GVAR(AltimeterActive) = true;
|
||||||
|
[{
|
||||||
|
if (!GVAR(AltimeterActive)) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler);};
|
||||||
|
disableSerialization;
|
||||||
|
EXPLODE_4_PVT(_this select 0,_display,_unit,_oldHeight,_prevTime);
|
||||||
|
if !("ACE_Altimeter" in assignedItems _unit) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler);call FUNC(hideAltimeter);};
|
||||||
|
|
||||||
|
private ["_height", "_hour", "_minute", "_descentRate","_HeightText", "_DecendRate", "_TimeText", "_curTime"];
|
||||||
|
_HeightText = _display displayCtrl 1100;
|
||||||
|
_DecendRate = _display displayCtrl 1000;
|
||||||
|
_TimeText = _display displayCtrl 1001;
|
||||||
|
_hour = floor daytime;
|
||||||
|
_minute = floor ((daytime - _hour) * 60);
|
||||||
|
|
||||||
|
_height = (getPosASL _unit) select 2;
|
||||||
|
_curTime = time;
|
||||||
|
_descentRate = floor ((_oldHeight - _height) / (_curTime - _prevTime));
|
||||||
|
|
||||||
|
_TimeText ctrlSetText (format ["%1:%2",[_hour, 2] call EFUNC(common,numberToDigitsString),[_minute, 2] call EFUNC(common,numberToDigitsString)]);
|
||||||
|
_HeightText ctrlSetText (format ["%1", floor(_height)]);
|
||||||
|
_DecendRate ctrlSetText (format ["%1", _descentRate max 0]);
|
||||||
|
|
||||||
|
(_this select 0) set [2, _height];
|
||||||
|
(_this select 0) set [3, _curTime];
|
||||||
|
}, 0.2, [uiNamespace getVariable ["ACE_Altimeter", displayNull], _unit,floor ((getPosASL _unit) select 2), time]] call CALLSTACK(cba_fnc_addPerFrameEventHandler);
|
1
addons/parachute/functions/script_component.hpp
Normal file
1
addons/parachute/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "\z\ace\addons\parachute\script_component.hpp"
|
12
addons/parachute/script_component.hpp
Normal file
12
addons/parachute/script_component.hpp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#define COMPONENT parachute
|
||||||
|
#include "\z\ace\addons\main\script_mod.hpp"
|
||||||
|
|
||||||
|
#ifdef DEBUG_ENABLED_PARACHUTE
|
||||||
|
#define DEBUG_MODE_FULL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_SETTINGS_PARACHUTE
|
||||||
|
#define DEBUG_SETTINGS DEBUG_SETTINGS_PARACHUTE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "\z\ace\addons\main\script_macros.hpp"
|
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Edited with tabler - 2014-12-11 -->
|
<!-- Edited with tabler - 2014-12-11 -->
|
||||||
<Project name="AGM">
|
<Project name="ACE">
|
||||||
<Package name="Parachute">
|
<Package name="Parachute">
|
||||||
<Key ID="STR_AGM_Parachute_showAltimeter">
|
<Key ID="STR_ACE_Parachute_showAltimeter">
|
||||||
<English>Altimeter</English>
|
<English>Altimeter</English>
|
||||||
<French>Altimètre</French>
|
<French>Altimètre</French>
|
||||||
<German>Höhenmesser</German>
|
<German>Höhenmesser</German>
|
||||||
@ -12,7 +12,7 @@
|
|||||||
<Hungarian>Magasságmérő</Hungarian>
|
<Hungarian>Magasságmérő</Hungarian>
|
||||||
<Russian>Высотомер</Russian>
|
<Russian>Высотомер</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_AGM_Parachute_AltimeterDisplayName">
|
<Key ID="STR_ACE_Parachute_AltimeterDisplayName">
|
||||||
<English>Altimeter Watch</English>
|
<English>Altimeter Watch</English>
|
||||||
<French>Montre altimètre</French>
|
<French>Montre altimètre</French>
|
||||||
<German>Höhenmesser</German>
|
<German>Höhenmesser</German>
|
||||||
@ -22,7 +22,7 @@
|
|||||||
<Hungarian>Magasságmérő</Hungarian>
|
<Hungarian>Magasságmérő</Hungarian>
|
||||||
<Russian>Часы с высотомером</Russian>
|
<Russian>Часы с высотомером</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_AGM_Parachute_AltimeterDescription">
|
<Key ID="STR_ACE_Parachute_AltimeterDescription">
|
||||||
<English>Used to show height, descent rate and the time.</English>
|
<English>Used to show height, descent rate and the time.</English>
|
||||||
<French>Affiche la hauteur, le taux de descente et l'heure.</French>
|
<French>Affiche la hauteur, le taux de descente et l'heure.</French>
|
||||||
<German>Zeigt Höhe, Fallgeschwindigkeit und Uhrzeit.</German>
|
<German>Zeigt Höhe, Fallgeschwindigkeit und Uhrzeit.</German>
|
||||||
@ -32,7 +32,7 @@
|
|||||||
<Hungarian>Mutatja a magasságot, zuhanás sebességét és az időt.</Hungarian>
|
<Hungarian>Mutatja a magasságot, zuhanás sebességét és az időt.</Hungarian>
|
||||||
<Russian>Используется для определения высоты, скорости снижения и времени.</Russian>
|
<Russian>Используется для определения высоты, скорости снижения и времени.</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_AGM_Parachute_NonSteerableParachute">
|
<Key ID="STR_ACE_Parachute_NonSteerableParachute">
|
||||||
<English>Non-Steerable Parachute</English>
|
<English>Non-Steerable Parachute</English>
|
||||||
<German>Ungelenkter Fallschirm</German>
|
<German>Ungelenkter Fallschirm</German>
|
||||||
<Spanish>Paracaídas no dirigible</Spanish>
|
<Spanish>Paracaídas no dirigible</Spanish>
|
Loading…
Reference in New Issue
Block a user