1
0
mirror of https://github.com/acemod/ACE3.git synced 2024-08-30 18:23:18 +00:00

Merge branch 'master' of github.com:KoffeinFlummi/ACE3 into aceSettings

This commit is contained in:
Nicolás Badano 2015-02-03 17:48:24 -03:00
commit 18fa6f9850
70 changed files with 1023 additions and 1054 deletions

@ -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};
};
};

@ -28,7 +28,7 @@ class CfgWeapons {
class arifle_MX_Base_F: Rifle_Base_F {
aiDispersionCoefY = 18.0;
aiDispersionCoefX = 12.0;
modes[] += {"AGM_Burst_far"};
modes[] += {"ACE_Burst_far"};
class Single: Mode_SemiAuto {
minRange = 120; // 2;
@ -43,7 +43,7 @@ class CfgWeapons {
burst = "3 + round random 5"; //3;
};
class AGM_Burst_far: fullauto_medium {
class ACE_Burst_far: fullauto_medium {
aiRateOfFire = 2.0;
aiRateOfFireDistance = 500;
minRange = 400;
@ -86,7 +86,7 @@ class CfgWeapons {
burst = "3 + round random 5"; //3;
};
class AGM_Burst_far: fullauto_medium {
class ACE_Burst_far: fullauto_medium {
aiRateOfFire = 2.0;
aiRateOfFireDistance = 400;
minRange = 300;
@ -146,8 +146,8 @@ class CfgWeapons {
aiDispersionCoefY = 24.0;
aiDispersionCoefX = 21.0;
// Shit is still broken
//modes[] += {"AGM_Burst_far"};
modes[] = {"Single","manual","close","short","medium","far_optic1","far_optic2","AGM_Burst_far"};
//modes[] += {"ACE_Burst_far"};
modes[] = {"Single","manual","close","short","medium","far_optic1","far_optic2","ACE_Burst_far"};
class Single: Mode_SemiAuto {
minRange = 120; // 2;
@ -155,7 +155,7 @@ class CfgWeapons {
class close;
class medium;
class AGM_Burst_far: medium {
class ACE_Burst_far: medium {
aiRateOfFire = 6.0;
aiRateOfFireDistance = 900;
minRange = 500;
@ -182,7 +182,7 @@ class CfgWeapons {
class arifle_Katiba_Base_F: Rifle_Base_F {
aiDispersionCoefY = 18.0;
aiDispersionCoefX = 12.0;
modes[] += {"AGM_Burst_far"};
modes[] += {"ACE_Burst_far"};
class Single: Mode_SemiAuto {
minRange = 120; // 2;
@ -197,7 +197,7 @@ class CfgWeapons {
burst = "3 + round random 5"; //3;
};
class AGM_Burst_far: fullauto_medium {
class ACE_Burst_far: fullauto_medium {
aiRateOfFire = 2.0;
aiRateOfFireDistance = 500;
minRange = 400;
@ -242,7 +242,7 @@ class CfgWeapons {
burst = "3 + round random 5"; //3;
};
class AGM_Burst_far: fullauto_medium {
class ACE_Burst_far: fullauto_medium {
aiRateOfFire = 2.0;
aiRateOfFireDistance = 400;
minRange = 300;
@ -270,7 +270,7 @@ class CfgWeapons {
class mk20_base_F: Rifle_Base_F {
aiDispersionCoefY = 18.0;
aiDispersionCoefX = 12.0;
modes[] += {"AGM_Burst_far"};
modes[] += {"ACE_Burst_far"};
class Single: Mode_SemiAuto {
minRange = 120; // 2;
@ -289,7 +289,7 @@ class CfgWeapons {
burst = "3 + round random 5"; // 3;
};
class AGM_Burst_far: fullauto_medium {
class ACE_Burst_far: fullauto_medium {
aiRateOfFire = 2.0;
aiRateOfFireDistance = 500;
minRange = 400;
@ -343,7 +343,7 @@ class CfgWeapons {
burst = "3 + round random 5"; //3;
};
class AGM_Burst_far: fullauto_medium {
class ACE_Burst_far: fullauto_medium {
aiRateOfFire = 2.0;
aiRateOfFireDistance = 400;
minRange = 300;
@ -360,7 +360,7 @@ class CfgWeapons {
class Tavor_base_F: Rifle_Base_F {
aiDispersionCoefY = 18.0;
aiDispersionCoefX = 12.0;
modes[] += {"AGM_Burst_far"};
modes[] += {"ACE_Burst_far"};
class Single: Mode_SemiAuto {
minRange = 120; //2;
@ -380,7 +380,7 @@ class CfgWeapons {
burst = "3 + round random 5"; // 3;
};
class AGM_Burst_far: fullauto_medium {
class ACE_Burst_far: fullauto_medium {
aiRateOfFire = 2.0;
aiRateOfFireDistance = 400;
minRange = 300;
@ -428,7 +428,7 @@ class CfgWeapons {
burst = "3 + round random 5"; // 3;
};
class AGM_Burst_far: fullauto_medium {
class ACE_Burst_far: fullauto_medium {
aiRateOfFire = 2.0;
aiRateOfFireDistance = 400;
minRange = 300;
@ -517,10 +517,10 @@ class CfgWeapons {
class LMG_Mk200_F: Rifle_Long_Base_F {
aiDispersionCoefY = 24.0;
aiDispersionCoefX = 21.0;
modes[] += {"AGM_Burst_far"};
modes[] += {"ACE_Burst_far"};
class medium;
class AGM_Burst_far: medium {
class ACE_Burst_far: medium {
aiRateOfFire = 6.0;
aiRateOfFireDistance = 900;
minRange = 500;
@ -546,7 +546,7 @@ class CfgWeapons {
class LMG_Zafir_F: Rifle_Long_Base_F {
aiDispersionCoefY = 23.0;
aiDispersionCoefX = 19.0;
modes[] += {"AGM_Burst_far"};
modes[] += {"ACE_Burst_far"};
class Single: Mode_SemiAuto {
minRange = 120; // 2;
@ -554,7 +554,7 @@ class CfgWeapons {
class close;
class medium;
class AGM_Burst_far: medium {
class ACE_Burst_far: medium {
aiRateOfFire = 6.0;
aiRateOfFireDistance = 900;
minRange = 500;

@ -1,21 +1,18 @@
/*
Name: XEH_postInit.sqf
Author(s):
Garth de Wet (LH)
Description:
Initialises explosive behaviour.
Parameters:
None
Returns:
None
Example:
None
*/
* Author: Garth 'L-H' de Wet
* Initialises the player object for the explosive system.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* None
*
* Public: No
*/
#include "script_component.hpp"
if !(hasInterface) exitWith {};
GVAR(PlacedCount) = 0;

@ -1,21 +1,18 @@
/*
Name: XEH_preInit.sqf
Author(s):
Garth de Wet (LH)
Description:
Prepares the functions
Parameters:
None
Returns:
None
Example:
None
*/
* Author: Garth 'L-H' de Wet
* Initialises the explosives system
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* None
*
* Public: No
*/
#include "script_component.hpp"
ADDON = false;

@ -1,24 +1,21 @@
/*
Name: ACE_Explosives_fnc_addClacker
Author(s):
Garth de Wet (LH)
Description:
Adds an explosive as a clacker item to the passed unit if the unit has a ACE_Clacker item.
Parameters:
0: OBJECT - unit
1: OBJECT - Explosive
2: STRING - Magazine
3: ARRAY - Extra vars
Returns:
Nothing
Example:
[_unit, _explosive, "SatchelCharge_Remote_Mag", [ConfigFile >> "CfgACE_Triggers" >> "Command"]] call ACE_Explosives_fnc_AddClacker;
*/
* Author: Garth 'L-H' de Wet
* Adds an explosive as a clacker item to the passed unit if the unit has the required item.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Explosive <OBJECT>
* 2: Magazine classname <STRING>
* 3: Extra variables <ARRAY>
*
* Return Value:
* None
*
* Example:
* [player, _explosive, "SatchelCharge_Remote_Mag", [ConfigFile >> "CfgACE_Triggers" >> "Command"]] call ACE_Explosives_fnc_addClacker;
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_unit", "_explosive", "_clacker", "_config", "_magazineClass", "_requiredItems", "_hasRequired"];
_unit = _this select 0;

@ -1,20 +1,18 @@
/*
Name: ACE_Explosives_fnc_canDefuse
Author: Garth de Wet (LH)
Description:
Checks if a unit can defuse an explosive
Parameters:
0: OBJECT - unit
Returns:
Nothing
Example:
[player] call ACE_Explosives_fnc_CanDefuse;
*/
* Author: Garth 'L-H' de Wet
* Whether a unit can perform the defuse action
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Able to defuse <BOOL>
*
* Example:
* if ([player] call ACE_Explosives_fnc_canDefuse) then {hint "Can Defuse";};
*
* Public: Yes
*/
#include "script_component.hpp"
private "_unit";
_unit = _this select 0;
@ -24,7 +22,7 @@ _isSpecialist = [_unit] call EFUNC(Common,isEOD);
if (GVAR(RequireSpecialist) && {!_isSpecialist}) exitWith {false};
_timeBombCore = nearestObject [_unit, "TimeBombCore"];
_mineBase = nearestObject [_unit, "MineBase"];
_mineBase = nearestObject [_unit, "MineBase"];
_distCore = _unit distance _timeBombCore;
_distBase = _unit distance _mineBase;

@ -1,20 +1,18 @@
/*
Name: ACE_Explosives_fnc_canDetonate
Author: Garth de Wet (LH)
Description:
Checks if a unit can detonate an explosive
Parameters:
0: OBJECT - unit
Returns:
BOOLEAN - if the unit has explosives and detonators.
Example:
[player] call ACE_Explosives_fnc_canDetonate;
*/
* Author: Garth 'L-H' de Wet
* Whether the unit is able to detonate explosives
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Able to detonate <BOOL>
*
* Example:
* if ([player] call ACE_Explosives_fnc_canDetonate) then { hint "Can Detonate"; };
*
* Public: Yes
*/
#include "script_component.hpp"
private "_unit";
_unit = _this select 0;

@ -1,21 +1,19 @@
/*
Name: ACE_Explosives_fnc_defuseExplosive
Author: Garth de Wet (LH)
Description:
Defuses an Explosive
Parameters:
0: OBJECT - unit
1: OBJECT - Explosive
Returns:
Nothing
Example:
[player, ACE_Interaction_Target] call ACE_Explosives_fnc_defuseExplosive;
*/
* Author: Garth 'L-H' de Wet
* Causes the unit to defuse the passed explosive.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Explosive <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player, ACE_Interaction_Target] call ACE_Explosives_fnc_defuseExplosive;
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_unit", "_explosive"];
_unit = _this select 0;

@ -1,26 +1,23 @@
/*
Name: ACE_Explosives_fnc_detonateExplosive
Author(s):
Garth de Wet (LH)
Description:
Detonates a remote Explosive.
Parameters:
0: OBJECT - Unit detonating explosive
1: NUMBER - Max range (-1 to ignore)
2: ARRAY - Explosive
0: OBJECT - Explosive
1: NUMBER - Fuse Time
Returns:
Nothing
Example:
// Clacker
[player, 100, [Explosive, 1]] call ACE_Explosives_fnc_detonateExplosive;
*/
* Author: Garth 'L-H' de Wet
* Causes the unit to detonate the passed explosive.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Max range (-1 to ignore) <NUMBER>
* 2: Explosive <ARRAY>
* 0: Explosive <OBJECT>
* 1: Fuse time <NUMBER>
*
* Return Value:
* None
*
* Example:
* [player, 100, [Explosive, 1]] call ACE_Explosives_fnc_detonateExplosive; // has to be within range
* [player, -1, [Explosive, 1]] call ACE_Explosives_fnc_detonateExplosive; // range ignored.
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_item","_result", "_ignoreRange", "_unit", "_range"];
_unit = _this select 0;
@ -44,8 +41,11 @@ if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhe
_exp setPosASL _pos;
};
};
_item spawn {
sleep (_this select 1);
(_this select 0) setDamage 1;
};
[{
_explosive = _this;
if (!isNull _explosive) then {
_explosive setDamage 1;
};
}, _item select 0, _item select 1, 0] call EFUNC(common,waitAndExecute);
_result

@ -1,21 +1,18 @@
/*
Name: ACE_Explosives_fnc_getDetonators
Author(s):
Garth de Wet (LH)
Description:
Gets all the detonators of a specific unit
Parameters:
0: OBJECT - Unit to get detonators of
Returns:
ARRAY - Configs of all detonators.
Example:
_detonators = [player] call ACE_Explosives_fnc_getDetonators;
*/
* Author: Garth 'L-H' de Wet
* Returns all the detonators of the unit
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Configs of all detonators <ARRAY>
*
* Example:
* _detonators = [player] call ACE_Explosives_fnc_getDetonators;
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_unit", "_items", "_result", "_config"];
_unit = _this select 0;

@ -1,22 +1,20 @@
/*
Name: ACE_Explosives_fnc_getPlacedExplosives
Author: Garth de Wet (LH)
Description:
Gets all placed explosives, whether Clacker based or not.
Parameters:
0: OBJECT - unit
1: STRING - (OPTIONAL) Trigger classname for filter.
Returns:
Array: Explosives.
Example:
_allExplosives = [player] call ACE_Explosives_fnc_getPlacedExplosives;
_deadmanExplosives = [player, "DeadManSwitch"] call ACE_Explosives_fnc_getPlacedExplosives;
*/
* Author: Garth 'L-H' de Wet
* Gets all placed explosives by unit, optionally filtered by specific trigger type.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Trigger classname - filter (optional) <STRING>
*
* Return Value:
* Explosives <ARRAY>
*
* Example:
* _allExplosives = [player] call ACE_Explosives_fnc_getPlacedExplosives;
* _deadmanExplosives = [player, "DeadManSwitch"] call ACE_Explosives_fnc_getPlacedExplosives;
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_unit", "_clackerList", "_adjustedList", "_list", "_filter"];
_unit = _this select 0;

@ -1,21 +1,18 @@
/*
Name: ACE_Explosives_fnc_HandleScrollWheel
Author(s):
L-H
Description:
Handles rotating of Explosives
Parameters:
Number: Scroll amount
Returns:
Boolean: Handled or not.
Example:
1.2 call ACE_Explosives_fnc_HandleScrollWheel;
*/
* Author: Garth 'L-H' de Wet
* Handles rotating of Explosives
*
* Arguments:
* Amount scrolled <NUMBER>
*
* Return Value:
* Handled <BOOL>
*
* Example:
* 1.2 call ACE_Explosives_fnc_HandleScrollWheel;
*
* Public: No
*/
#include "script_component.hpp"
private ["_obj"];
if (isNull(GVAR(Setup)) || {ACE_Modifier == 0} || !GVAR(pfeh_running)) exitWith {false};

@ -1,20 +1,18 @@
/*
Name: ACE_Explosives_fnc_hasExplosives
Author: Garth de Wet (LH)
Description:
Whether the passed unit has any explosives on them.
Parameters:
0: OBJECT - unit
Returns:
BOOLEAN - True if the unit has explosives.
Example:
_hasExplosives = [player] call ACE_Explosives_fnc_hasExplosives;
*/
* Author: Garth 'L-H' de Wet
* Whether the passed unit has any explosives on them.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* The unit has explosives <BOOL>
*
* Example:
* _hasExplosives = [player] call ACE_Explosives_fnc_hasExplosives;
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_unit", "_result", "_magazines"];
_result = false;

@ -1,19 +1,17 @@
/*
Name: ACE_Explosives_fnc_hasPlacedExplosives
Author: Garth de Wet (LH)
Description:
Whether the passed unit has placed any explosives or has a clacker that was used when explosives were placed.
Parameters:
0: OBJECT - unit
Returns:
BOOLEAN - True if the unit has explosives.
Example:
_hasPLacedExplosives = [player] call ACE_Explosives_fnc_hasPlacedExplosives;
*/
* Author: Garth 'L-H' de Wet
* Whether the passed unit has placed any explosives or has a clacker that was used when explosives were placed.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Configs of all detonators <ARRAY>
*
* Example:
* _hasPlacedExplosives = [player] call ACE_Explosives_fnc_hasPlacedExplosives;
*
* Public: Yes
*/
#include "script_component.hpp"
(count (_this call FUNC(getPlacedExplosives)) > 0)

@ -1,20 +1,18 @@
/*
Name: ACE_Explosives_fnc_module
Author: Garth de Wet (LH)
Description:
Initialises the explosives module
Parameters:
Things
Returns:
Nothing
Example:
*/
* Author: Garth 'L-H' de Wet
* Initialises the explosives module
*
* Arguments:
* Module things.
*
* Return Value:
* None
*
* Example:
* Called By BIS.
*
* Public: No
*/
#include "script_component.hpp"
if !(isServer) exitWith {};
_logic = _this select 0;

@ -1,21 +1,19 @@
/*
Name: ACE_Explosives_fnc_openDetonateUI
Author: Garth de Wet (LH)
Description:
Opens the UI for explosive detonation selection
Parameters:
0: OBJECT - unit
0: STRING - Classname of detonator
Returns:
Nothing
Example:
[player, "ACE_M26_Clacker"] call ACE_Explosives_fnc_openDetonateUI;
*/
* Author: Garth 'L-H' de Wet
* Opens the UI for explosive detonation selection
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Trigger classname <STRING>
*
* Return Value:
* None
*
* Example:
* [player, "ACE_M26_Clacker"] call ACE_Explosives_fnc_openDetonateUI;
*
* Public: No
*/
#include "script_component.hpp"
private ["_unit","_result", "_item"];
call EFUNC(interaction,hideMenu);

@ -1,20 +1,18 @@
/*
Name: ACE_Explosives_fnc_openPlaceUI
Author: Garth de Wet (LH)
Description:
Opens the UI for explosive placement selection
Parameters:
0: OBJECT - unit
Returns:
Nothing
Example:
[player] call ACE_Explosives_fnc_openPlaceUI;
*/
* Author: Garth 'L-H' de Wet
* Opens the UI for explosive placement selection
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player] call ACE_Explosives_fnc_openPlaceUI;
*
* Public: No
*/
#include "script_component.hpp"
private ["_unit","_mags", "_item", "_index", "_actions"];
_unit = _this select 0;

@ -1,20 +1,18 @@
/*
Name: ACE_Explosives_fnc_openTimerSetUI
Author: Garth de Wet (LH)
Description:
Opens the UI for timer setting of an explosive
Parameters:
0: String - Magazine
Returns:
Nothing
Example:
[player] call ACE_Explosives_fnc_openTimerSetUI;
*/
* Author: Garth 'L-H' de Wet
* Opens the UI for timer setting of an explosive
*
* Arguments:
* 0: Magazine <STRING>
*
* Return Value:
* None
*
* Example:
* ["SatchelCharge_Remote_Mag"] call ACE_Explosives_fnc_openTimerSetUI;
*
* Public: No
*/
#include "script_component.hpp"
private ["_mag"];
_mag = _this select 0;

@ -1,20 +1,18 @@
/*
Name: ACE_Explosives_fnc_openTransmitterUI
Author: Garth de Wet (LH)
Description:
Opens the UI for selecting the transmitter
Parameters:
0: OBJECT - Unit
Returns:
Nothing
Example:
[player] call ACE_Explosives_fnc_openTransmitterUI;
*/
* Author: Garth 'L-H' de Wet
* Opens the UI for selecting the transmitter
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [player] call ACE_Explosives_fnc_openTransmitterUI;
*
* Public: No
*/
#include "script_component.hpp"
private ["_items", "_unit", "_count", "_actions", "_config"];
_unit = _this select 0;

@ -1,20 +1,18 @@
/*
Name: ACE_Explosives_fnc_openTriggerSelectionUI
Author: Garth de Wet (LH)
Description:
Opens the UI for explosive trigger selection
Parameters:
0: String - explosive magazine
Returns:
Nothing
Example:
[lbData [8866, lbCurSel 8866]] call ACE_Explosives_fnc_openTriggerSelectionUI;
*/
* Author: Garth 'L-H' de Wet
* Opens the UI for explosive trigger selection
*
* Arguments:
* 0: Explosive Magazine <STRING>
*
* Return Value:
* None
*
* Example:
* [lbData [8866, lbCurSel 8866]] call ACE_Explosives_fnc_openTriggerSelectionUI;
*
* Public: No
*/
#include "script_component.hpp"
private ["_magazine", "_hasRequiredItems","_triggerTypes", "_actions", "_detonators", "_required", "_magTriggers"];
_magazine = _this select 0;

@ -1,26 +1,25 @@
/*
Name: ACE_Explosives_fnc_PlaceExplosive
Author(s):
Garth de Wet (LH)
Description:
Places an explosive at the requested position
Parameters:
0: OBJECT - unit
1: POSITION - Position to place explosive
2: NUMBER - Rotation
3: STRING - Magazine class
4: Config - Config of trigger
5: ARRAY - variables required for the trigger type
Returns:
OBJECT: Placed explosive
Example:
_explosive = [player, player modelToWorld [0,0.5, 0.1], 134, "SatchelCharge_Remote_Mag", "Command", []] call ACE_Explosives_fnc_PlaceExplosive;
*/
* Author: Garth 'L-H' de Wet
* Places an explosive at the requested position
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Position to place explosive <POSITION>
* 2: Rotation <NUMBER>
* 3: Magazine class <STRING>
* 4: Config of trigger <CONFIG>
* 5: Variables required for the trigger type <ARRAY>
* 6: Should direction be set <BOOL>
*
* Return Value:
* Placed explosive <OBJECT>
*
* Example:
* _explosive = [player, player modelToWorld [0,0.5, 0.1], 134,
* "SatchelCharge_Remote_Mag", "Command", []] call ACE_Explosives_fnc_placeExplosive;
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_pos", "_dir", "_magazineClass", "_ammo", "_triggerSpecificVars", "_unit", "_triggerConfig", "_explosive"];
_unit = _this select 0;

@ -1,21 +1,19 @@
/*
Name: ACE_Explosives_fnc_Place_Approve
Author(s):
Garth de Wet (LH)
Description:
Approves placement of the explosive, releases the placement object for it to settle in a location suitable for the explosive to be created.
Parameters:
Nothing
Returns:
Nothing
Example:
call ACE_Explosives_fnc_Place_Approve;
*/
* Author: Garth 'L-H' de Wet
* Approves placement of the explosive, releases the placement object for it
* to settle in a location suitable for the explosive to be created.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ACE_Explosives_fnc_place_Approve;
*
* Public: No
*/
#include "script_component.hpp"
if (GVAR(pfeh_running)) then {
[QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler);

@ -1,21 +1,18 @@
/*
Name: ACE_Explosives_fnc_Place_Cancel
Author(s):
Garth de Wet (LH)
Description:
Cancels placement of the explosive
Parameters:
Nothing
Returns:
Nothing
Example:
call ACE_Explosives_fnc_Place_Cancel;
*/
* Author: Garth 'L-H' de Wet
* Cancels placement of the explosive
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ACE_Explosives_fnc_place_Cancel;
*
* Public: Yes
*/
#include "script_component.hpp"
if (GVAR(pfeh_running)) then {
[QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler);

@ -1,21 +1,19 @@
/*
Name: ACE_Explosives_fnc_selectTrigger
Author: Garth de Wet (LH)
Description:
Selects a trigger for an explosive.
Parameters:
0: String - Magazine
1: String - trigger index in ACE_triggers of magazine class
Returns:
Nothing
Example:
["SatchelCharge_Remote_Mag","Timer"] call ACE_Explosives_fnc_selectTrigger;
*/
* Author: Garth 'L-H' de Wet
* Selects a trigger for an explosive.
*
* Arguments:
* 0: Magazine <STRING>
* 1: Trigger mode <STRING>
*
* Return Value:
* None
*
* Example:
* ["SatchelCharge_Remote_Mag","Timer"] call ACE_Explosives_fnc_selectTrigger;
*
* Public: No
*/
#include "script_component.hpp"
private ["_magazine","_trigger"];
closeDialog 0;

@ -1,26 +1,23 @@
/*
Name: ACE_Explosives_fnc_SetPos
Author(s):
Garth de Wet (LH)
Description:
Sets the Dir and pitch
Parameters:
0: OBJECT - Object
1: NUMBER - Direction
2: NUMBER - Pitch
Returns:
Nothing
Example:
[_explosive, 150, 90] call ACE_Explosives_fnc_SetPos;
*/
* Author: Garth 'L-H' de Wet
* Sets the Dir and pitch of passed object
*
* Arguments:
* 0: Explosive <OBJECT>
* 1: Direction <NUMBER>
* 2: Pitch <NUMBER>
*
* Return Value:
* None
*
* Example:
* [_explosive, 150, 90] call ACE_Explosives_fnc_SetPos;
*
* Public: Yes
*/
#include "script_component.hpp"
private "_ex";
_ex=_this select 0;
_ex = _this select 0;
_ex setDir (_this select 1);
if ((_this select 2) != 0) then {
[_ex, _this select 2, 0] call CALLSTACK(BIS_fnc_setPitchBank);

@ -1,24 +1,21 @@
/*
Name: ACE_Explosives_fnc_SetupExplosive
Author(s):
Garth de Wet (LH)
Description:
Starts the setup process for the passed explosive.
Parameters:
0: OBJECT - Unit placing explosive.
1: STRING - Classname of explosive to place. (CfgMagazine class)
2: Config - Trigger Config
3: NUMBER - (optional) timer
Returns:
Nothing
Example:
[player, "SatchelCharge_Remote_Mag", "Command"] call ACE_Explosives_fnc_SetupExplosive;
*/
* Author: Garth 'L-H' de Wet
* Starts the setup process for the passed explosive. Player only.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Classname of explosive to place. (CfgMagazine class) <STRING>
* 2: Trigger Config <CONFIG>
* 3: Timer (optional) <NUMBER>
*
* Return Value:
* None
*
* Example:
* [player, "SatchelCharge_Remote_Mag", "Command"] call ACE_Explosives_fnc_SetupExplosive;
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_unit", "_class", "_config", "_timer"];
_unit = _this select 0;

@ -1,21 +1,19 @@
/*
Name: ACE_Explosives_fnc_StartDefuse
Author: Garth de Wet (LH)
Description:
Starts defusing an explosive
Parameters:
0: OBJECT - Unit to defuse explosive
1: OBJECT - Target explosive
Returns:
Nothing
Example:
[player, ACE_Interaction_Target] call ACE_Explosives_fnc_StartDefuse;
*/
* Author: Garth 'L-H' de Wet
* Starts defusing an explosive
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Target explosive <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [player, ACE_Interaction_Target] call ACE_Explosives_fnc_StartDefuse;
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_unit","_target"];
_unit = _this select 0;

@ -1,20 +1,19 @@
/*
Author(s):
Garth de Wet (LH)
Description:
Starts a timer for an explosive.
Parameters:
0: OBJECT - Explosive
1: NUMBER - time till detonation
Returns:
Nothing
Example:
[_explosive, 10] call ACE_Explosives_fnc_startTimer;
*/
* Author: Garth 'L-H' de Wet
* Starts a timer for an explosive.
*
* Arguments:
* 0: Explosive <OBJECT>
* 1: Time till detonate <NUMBER>
*
* Return Value:
* None
*
* Example:
* [_explosive, 10] call ACE_Explosives_fnc_startTimer;
*
* Public: Yes
*/
#include "script_component.hpp"
EXPLODE_2_PVT(_this,_explosive,_delay);
@ -24,4 +23,4 @@ EXPLODE_2_PVT(_this,_explosive,_delay);
if (!isNull _explosive) then {
[_explosive, -1, [_explosive, 0], true] call FUNC(detonateExplosive);
};
}, _explosive, _delay, 0] call EFUNC(common,waitAndExecute);
}, _explosive, _delay, 0] call EFUNC(common,waitAndExecute);

@ -1,21 +1,18 @@
/*
Name: ACE_Explosives_fnc_TriggerType
Author(s):
Garth de Wet (LH)
Description:
Gets the types of triggers associated with the explosive
Parameters:
0: String - Explosive magazine
Returns:
ARRAY
Example:
_supports = ["SatchelCharge_Remote_Mag"] call ACE_Explosives_fnc_TriggerType;
*/
* Author: Garth 'L-H' de Wet
* Gets the types of triggers associated with the explosive
*
* Arguments:
* 0: Explosive magazine <STRING>
*
* Return Value:
* Supported triggers as CfgACE_Triggers config entries <ARRAY>
*
* Example:
* _supports = ["SatchelCharge_Remote_Mag"] call ACE_Explosives_fnc_TriggerType
*
* Public: Yes
*/
#include "script_component.hpp"
private "_result";
_result = [];

@ -1,18 +1,19 @@
/*
Name: XEH_postInit.sqf
Author: Garth de Wet (LH)
Description:
Sets up the glasses mod for usage. Initialises variables and event handlers.
Shouldn't be called by a user/modder ever. Done by the engine.
Parameters:
Nothing
Returns:
Nothing
*/
* Author: Garth 'L-H' de Wet
* Sets up the glasses mod for usage. Initialises variables and event handlers.
* Shouldn't be called by a user/modder ever. Done by the engine.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* None
*
* Public: No
*/
#include "script_component.hpp"
if (!hasInterface) exitWith {};
@ -57,7 +58,7 @@ player addEventHandler ["Explosion", {
call FUNC(ApplyDirtEffect);
if (GETBROKEN) exitWith {};
if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {};
if !(ace_player call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);};
if !([ace_player] call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);};
_effects = GETGLASSES(ace_player);
_effects set [BROKEN, true];
SETGLASSES(ace_player,_effects);
@ -94,8 +95,8 @@ player AddEventHandler ["Put", {call FUNC(checkGlasses);}];
if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)};
if (ace_player call FUNC(isGogglesVisible)) then {
(_this select 0) call FUNC(applyGlassesEffect);
if ([ace_player] call FUNC(isGogglesVisible)) then {
[_this select 0] call FUNC(applyGlassesEffect);
} else {
call FUNC(removeGlassesEffect);
};

@ -1,3 +1,18 @@
/*
* Author: Garth 'L-H' de Wet
* Initialises Goggles.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* None
*
* Public: No
*/
#include "script_component.hpp"
ADDON = false;

@ -1,20 +1,18 @@
/*
ApplyDirtEffect
Author: Garth de Wet (LH)
Description:
Adds dirt effect to the glasses.
Parameters:
Nothing
Returns:
BOOLEAN - True if succeeded false if not
Example:
call FUNC(ApplyDirtEffect);
*/
* Author: Garth 'L-H' de Wet
* Adds dirt effect to the glasses.
*
* Arguments:
* None
*
* Return Value:
* Succeeded <BOOL>
*
* Example:
* _applied = call ace_goggles_fnc_ApplyDirtEffect;
*
* Public: Yes
*/
#include "script_component.hpp"
if (cameraOn != ace_player || {call FUNC(externalCamera)}) exitWith{false};
@ -23,7 +21,7 @@ _effects = GETGLASSES(ace_player);
_effects set [DIRT, true];
SETGLASSES(ace_player,_effects);
if (ace_player call FUNC(isGogglesVisible)) then{
if ([ace_player] call FUNC(isGogglesVisible)) then{
_dirtImage = getText(ConfigFile >> "CfgGlasses" >> (goggles ace_player) >> "ACE_OverlayDirt");
if (_dirtImage != "") then {
100 cutRsc["RscACE_GogglesEffects", "PLAIN",0.1, false];

@ -1,23 +1,21 @@
/*
Name: fnc_applyDust.sqf
Author: Garth de Wet (LH)
Description:
Applies dust to screen.
Parameters:
Nothing
Returns:
Nothing
Example 1:
call FUNC(ApplyDust);
*/
* Author: Garth 'L-H' de Wet
* Applies dust to screen.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ace_goggles_fnc_ApplyDust;
*
* Public: Yes
*/
#include "script_component.hpp"
if (call FUNC(ExternalCamera)) exitWith {};
if (ace_player call FUNC(isGogglesVisible)) exitWith {
if ([ace_player] call FUNC(isGogglesVisible)) exitWith {
100 cutRsc["RscACE_GogglesEffects", "PLAIN",2,false];
(uiNamespace getVariable ["ACE_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText format[getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_DustPath"), GETDUSTT(DAMOUNT)+1];
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,1));

@ -1,26 +1,24 @@
/*
Name: fnc_ApplyGlassesEffect.sqf
Author: Garth de Wet (LH)
Description:
Sets screen tint for glasses.
Sets screen overlay for glasses. (broken/fixed)
Sets dirt/rain overlay for glasses.
Parameters:
0: STRING - Glasses class name to be applied.
Returns:
Nothing
Example:
(goggles ace_player) call FUNC(ApplyGlassesEffect);
*/
* Author: Garth 'L-H' de Wet
* Sets screen tint for glasses.
* Sets screen overlay for glasses. (broken/fixed)
* Sets dirt/rain overlay for glasses.
*
* Arguments:
* 0: Glasses classname to be applied <STRING>
*
* Return Value:
* None
*
* Example:
* [goggles ace_player] call ace_goggles_fnc_ApplyGlassesEffect;
*
* Public: No
*/
#include "script_component.hpp"
private["_postProcessColour", "_postProcessTintAmount", "_glassesClassname", "_glassImagePath"];
_glassesClassname = _this;
_glassesClassname = _this select 0;
_postProcessColour = getArray(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_Color");
_postProcessTintAmount = getNumber(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_TintAmount");

@ -1,10 +1,19 @@
/*
Author: Garth de Wet (LH)
Description:
Performs rain checks and checks to see whether glasses effects have been applied or not.
Checks for external camera and removes effects.
*/
* Author: Garth 'L-H' de Wet
* Performs rain checks and checks to see whether glasses effects have been applied or not.
* Checks for external camera and removes effects.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* None
*
* Public: No
*/
#include "script_component.hpp"
if (!alive ace_player) exitWith {};
if (true) then {
@ -15,7 +24,7 @@ if (true) then {
};
};
call FUNC(checkGlasses);
if !(ace_player call FUNC(isGogglesVisible)) exitWith {
if !([ace_player] call FUNC(isGogglesVisible)) exitWith {
if (GVAR(EffectsActive)) then {
call FUNC(removeGlassesEffect);
};
@ -26,9 +35,9 @@ if (true) then {
};
};
if !(GVAR(EffectsActive)) then {
(goggles ace_player) call FUNC(applyGlassesEffect);
[goggles ace_player] call FUNC(applyGlassesEffect);
} else {
if ((goggles ace_player) call FUNC(isDivingGoggles) && {underwater ace_player}) then {
if ([goggles ace_player] call FUNC(isDivingGoggles) && {underwater ace_player}) then {
call FUNC(removeRainEffect);
call FUNC(removeDirtEffect);
call FUNC(removeDustEffect);

@ -1,21 +1,19 @@
/*
Name: fnc_clearGlasses.sqf
Author: Garth de Wet (LH)
Description:
Clears all dirt, rain, dust from glasses.
Removes glasses effect (PP, overlay) and then puts it back.
Parameters:
Nothing
Returns:
Nothing
Example:
call FUNC(ClearGlasses);
*/
* Author: Garth 'L-H' de Wet
* Clears all dirt, rain, dust from glasses.
* Removes glasses effect (PP, overlay) and then puts it back.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ace_goggles_fnc_ClearGlasses;
*
* Public: Yes
*/
#include "script_component.hpp"
private "_broken";

@ -1,22 +1,19 @@
/*
fnc_DustHandler.sqf
Author: Garth de Wet (LH)
Description:
Determines whether to place dust on the goggles, based on calibre of weapon fired and other requirements.
Parameters:
0: Object - unit - eventhandler was attached to. (Used)
1: String - weapon - Weapon fired (Used)
Returns:
Nothing
Example:
ace_player addEventHandler ["Fired", {[_this select 0, _this select 1] call FUNC(DustHandler;}];
See http://community.bistudio.com/wiki/ArmA_3:_Event_Handlers#Fired
*/
* Author: Garth 'L-H' de Wet
* Determines whether to place dust on the goggles, based on calibre of weapon fired and other requirements.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Weapon <STRING>
*
* Return Value:
* None
*
* Example:
*ace_player addEventHandler ["Fired", {[_this select 0, _this select 1] call ace_goggles_fnc_dustHandler;}];
*
* Public: No
*/
#include "script_component.hpp"
private ["_bullets", "_position", "_surface", "_found", "_weapon", "_cloudType", "_unit"];
EXPLODE_2_PVT(_this,_unit,_weapon);

@ -1,22 +1,18 @@
/*
fnc_ExternalCamera.sqf
Author: Garth de Wet (LH)
Description:
Returns if the camera is external or not.
Parameters:
Nothing
Returns:
Boolean - whether the camera is in external view or not.
If the "showInThirdPerson" option is checked, this will always return false.
Example:
call FUNC(ExternalCamera);
*/
* Author: Garth 'L-H' de Wet
* Returns if the camera is external or not.
*
* Arguments:
* None
*
* Return Value:
* Whether the camera is in external view or not. If the "showInThirdPerson" option is checked, this will always return false. <BOOL>
*
* Example:
* call ace_goggles_fnc_removeRainEffect;
*
* Public: Yes
*/
#include "script_component.hpp"
if (GVAR(showInThirdPerson)) exitWith { false };

@ -1,20 +1,18 @@
/*
fnc_getExplosionIndex.sqf
Author: Garth de Wet (LH)
Description:
Turns 0-1 damage into a rating system of 0-3
Parameters:
0: NUMBER - The amount of damage
Returns:
NUMBER (the rating) [0-3]
Example:
_rating = 0.05 call FUNC(GetExplosionIndex);
*/
* Author: Garth 'L-H' de Wet
* Turns 0-1 damage of explosion Event into a rating system of 0-3
*
* Arguments:
* 0: The amount of damage <NUMBER>
*
* Return Value:
* The rating [0-3] <NUMBER>
*
* Example:
* _rating = 0.05 call ace_goggles_fnc_getExplosionIndex;
*
* Public: No
*/
private ["_effectIndex"];
_effectIndex = switch true do {

@ -1,23 +1,21 @@
/*
fnc_isDivingGoggles.sqf
Author: Garth de Wet (LH)
Description:
Determines whether current goggles worn by passed unit is diving goggles or a variant of them.
Parameters:
0: String - Glasses classname
Returns:
Boolean - whether diving goggles are worn
Example:
(goggles ace_player) call FUNC(isDivingGoggles);
*/
* Author: Garth 'L-H' de Wet
* Determines whether passed goggles is diving goggles or a variant of them.
*
* Arguments:
* 0: Glasses classname <STRING>
*
* Return Value:
* Whether diving goggles are worn <BOOL>
*
* Example:
* [(goggles ace_player)] call ace_goggles_fnc_isDivingGoggles;
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_result", "_glasses"];
_glasses = _this;
_glasses = _this select 0;
_result = _glasses == "G_Diving";
if (_result) exitWith {true};
_result = [configFile >> "CfgGlasses" >> _glasses, configFile >> "CfgGlasses" >> "G_Diving"] call CBA_fnc_inheritsFrom;

@ -1,23 +1,21 @@
/*
fnc_isGogglesVisible.sqf
Author: Garth de Wet (LH)
Description:
Determines if goggles are visible on passed unit (Also checks if unit is in vehicle and cameraView is set to GUNNER)
Parameters:
0: Object - unit to check for visible goggles
Returns:
BOOL - Whether the goggles are visible or not.
Example:
_visible = ace_player call FUNC(isGogglesVisible);
*/
* Author: Garth 'L-H' de Wet
* Determines if goggles are visible on passed unit (Also checks if unit is in vehicle and cameraView is set to GUNNER)
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Whether goggles are visible <BOOL>
*
* Example:
* _visible = [ace_player] call ace_goggles_fnc_isGogglesVisible;
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_currentGlasses", "_result", "_unit"];
_unit = _this;
_unit = _this select 0;
_currentGlasses = goggles _unit;
_result = false;
@ -27,12 +25,12 @@ if ((vehicle _unit) != _unit) exitWith {(cameraView != "GUNNER")};
if (_currentGlasses != "") then {
_position =(getPosASLW _unit);
if (surfaceIsWater _position && {((_position select 2) < 0.25)}) exitWith {
_result = (_currentGlasses call FUNC(isDivingGoggles));
_result = ([_currentGlasses] call FUNC(isDivingGoggles));
};
if (getNumber (ConfigFile >> "CfgGlasses" >> _currentGlasses >> "ACE_Resistance") == 0) exitWith {
_result = false;
};
_result = !(_currentGlasses call FUNC(isDivingGoggles));
_result = !([_currentGlasses] call FUNC(isDivingGoggles));
};
_result

@ -1,24 +1,22 @@
/*
fnc_isInRotorWash.sqf
Author: Garth de Wet (LH)
Description:
Checks for nearby helicopters (within 15m)
Parameters:
0: Object - Unit
1: NUMBER - (optional) Radius to check for helicopter Default: 15
Returns:
Array:
0 - boolean - If in rotorwash
1 - number - Amount of rotor wash.
Example:
if (([ace_player, 10] call FUNC(isInRotorWash)) select 0) then { hint "Rotor wash"; };
if (([ace_player] call FUNC(isInRotorWash)) select 0) then { hint "Rotor wash"; };
*/
* Author: Garth 'L-H' de Wet
* Checks for nearby running helicopters (within 15m)
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Radius to check for helicopter Default: 15 (optional) <NUMBER>
*
* Return Value:
* <ARRAY>:
* 0: In rotorwash <BOOL>
* 1: Amount of rotor wash. <NUMBER>
*
* Example:
* if (([ace_player, 10] call ace_goggles_fnc_isInRotorWash) select 0) then { hint "Rotor wash"; };
* if (([ace_player] call ace_goggles_fnc_isInRotorWash) select 0) then { hint "Rotor wash"; };
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_heli", "_unit", "_result", "_radius"];
_unit = _this select 0;

@ -1,20 +1,18 @@
/*
fnc_onEachFrame.sqf
Author: Garth de Wet (LH)
Description:
Runs every frame checking for helicopters.
Parameters:
Nothing
Returns:
Nothing
Example:
["ACE_Goggles_RotorWash", "OnEachFrame", "call FUNC(OnEachFrame);"] call BIS_fnc_addStackedEventHandler;
*/
* Author: Garth 'L-H' de Wet
* Checks whether the player is in the downwash of a helicopter and handles applying effects of that.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* ["ACE_Goggles_RotorWash", "OnEachFrame", "call ace_goggles_fnc_OnEachFrame;"] call BIS_fnc_addStackedEventHandler;
*
* Public: No
*/
#include "script_component.hpp"
if (isNull(ace_player)) exitWith {};
GVAR(FrameEvent) set [0, !(GVAR(FrameEvent) select 0)];
@ -44,7 +42,7 @@ if ((headgear ace_player) != "") then {
_safe = (getNumber (ConfigFile >> "CfgWeapons" >> (headgear ace_player) >> "ACE_Protection") == 1);
};
if !(_safe) then {
if !(ace_player call FUNC(isGogglesVisible)) exitWith{};
if !([ace_player] call FUNC(isGogglesVisible)) exitWith{};
if (GETDUSTT(DAMOUNT) < 2) then {
if (!GETDUSTT(DACTIVE)) then {
SETDUST(DACTIVE,true);

@ -1,20 +1,18 @@
/*
fnc_rainEffect.sqf
Author: Garth de Wet (LH)
Description:
Parameters:
Nothing
Returns:
Nothing
Example:
[] call FUNC(RainEffect);
*/
* Author: Garth 'L-H' de Wet
* Handles rain effects being created on glasses.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ace_goggles_fnc_rainEffect;
*
* Public: No
*/
#include "script_component.hpp"
private ["_fnc_underCover"];
if (isNull(ace_player) || {!(alive ace_player)}) exitWith {};

@ -1,20 +1,18 @@
/*
fnc_removeDirtEffect.sqf
Author: Garth de Wet (LH)
Description:
Removes dirt from the glasses.
Parameters:
Nothing
Returns:
Nothing
Example:
call FUNC(RemoveDirtEffect);
*/
* Author: Garth 'L-H' de Wet
* Removes dirt from the glasses.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ace_goggles_fnc_removeDirtEffect;
*
* Public: Yes
*/
#include "script_component.hpp"
if (!isNull(GETUVAR(GVAR(DisplayEffects),displayNull))) then {
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText "";

@ -1,20 +1,18 @@
/*
fnc_removeDustEffect.sqf
Author: Garth de Wet (LH)
Description:
Removes dust from the glasses.
Parameters:
Nothing
Returns:
Nothing
Example:
call FUNC(RemoveDustEffect);
*/
* Author: Garth 'L-H' de Wet
* Removes dust from the glasses.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ace_goggles_fnc_removeDustEffect;
*
* Public: Yes
*/
#include "script_component.hpp"
if (!isNull(GETUVAR(GVAR(DisplayEffects),displayNull))) then {
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10662) ctrlSetText "";

@ -1,21 +1,19 @@
/*
RemoveGlassesEffect
Author: Garth de Wet (LH)
Description:
Removes the glasses effect from the screen, removes dirt effect, removes rain effect,
removes dust effect. Does not reset array (glasses will still be broken, dirty, ect.)
Parameters:
Nothing
Returns:
Nothing
Example:
call FUNC(RemoveGlassesEffect);
*/
* Author: Garth 'L-H' de Wet
* Removes the glasses effect from the screen, removes dirt effect, removes rain effect,
* removes dust effect. Does not reset array (glasses will still be broken, dirty, ect.)
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ace_goggles_fnc_removeGlassesEffect;
*
* Public: Yes
*/
#include "script_component.hpp"
GVAR(EffectsActive) = false;
GVAR(PostProcess) ppEffectEnable false;

@ -1,20 +1,18 @@
/*
RemoveRainEffect
Author: Garth de Wet (LH)
Description:
Removes rain effects from the screen. Resets the rain array.
Parameters:
Nothing
Returns:
Nothing
Example:
call FUNC(RemoveRainEffect);
*/
* Author: Garth 'L-H' de Wet
* Removes rain effects from the screen.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ace_goggles_fnc_removeRainEffect;
*
* Public: Yes
*/
#include "script_component.hpp"
if (!isNull (GVAR(RainDrops))) then {
deleteVehicle (GVAR(RainDrops));

@ -0,0 +1 @@
z\ace\addons\parachute

@ -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));
};
};

@ -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 RscPicture;
class RscTitles {
class AGM_Altimeter {
class ACE_Altimeter {
idd = 9935;
enableSimulation = 1;
movingEnable = 0;
fadeIn=0;
fadeOut=1;
duration = 10e10;
onLoad = "uiNamespace setVariable ['AGM_Altimeter', _this select 0];";
onLoad = "uiNamespace setVariable ['ACE_Altimeter', _this select 0];";
class controls {
class AltimeterImage: RscPicture {
idc = 1200;
text = "AGM_Parachute\UI\watch_altimeter.paa";
text = PATHTOF(UI\watch_altimeter.paa);
x = 0.118437 * safezoneW + safezoneX;
y = 0.621 * safezoneH + safezoneY;
w = 0.20625 * safezoneW;
@ -48,4 +48,4 @@ class RscTitles {
};
};
};
};
};

@ -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"

@ -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;

@ -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";};
};

@ -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);

@ -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];

@ -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);
};

@ -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);

@ -0,0 +1 @@
#include "\z\ace\addons\parachute\script_component.hpp"

@ -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"?>
<!-- Edited with tabler - 2014-12-11 -->
<Project name="AGM">
<Project name="ACE">
<Package name="Parachute">
<Key ID="STR_AGM_Parachute_showAltimeter">
<Key ID="STR_ACE_Parachute_showAltimeter">
<English>Altimeter</English>
<French>Altimètre</French>
<German>Höhenmesser</German>
@ -12,7 +12,7 @@
<Hungarian>Magasságmérő</Hungarian>
<Russian>Высотомер</Russian>
</Key>
<Key ID="STR_AGM_Parachute_AltimeterDisplayName">
<Key ID="STR_ACE_Parachute_AltimeterDisplayName">
<English>Altimeter Watch</English>
<French>Montre altimètre</French>
<German>Höhenmesser</German>
@ -22,7 +22,7 @@
<Hungarian>Magasságmérő</Hungarian>
<Russian>Часы с высотомером</Russian>
</Key>
<Key ID="STR_AGM_Parachute_AltimeterDescription">
<Key ID="STR_ACE_Parachute_AltimeterDescription">
<English>Used to show height, descent rate and the time.</English>
<French>Affiche la hauteur, le taux de descente et l'heure.</French>
<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>
<Russian>Используется для определения высоты, скорости снижения и времени.</Russian>
</Key>
<Key ID="STR_AGM_Parachute_NonSteerableParachute">
<Key ID="STR_ACE_Parachute_NonSteerableParachute">
<English>Non-Steerable Parachute</English>
<German>Ungelenkter Fallschirm</German>
<Spanish>Paracaídas no dirigible</Spanish>