diff --git a/README.md b/README.md index ddece2a48d..77548f7ea4 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@

Requires the latest version of CBA A3 | BIF thread

-**ACE 3** is a join effort by the teams behind **ACE 2**, **AGM**, **CSE** and **RHS** to improve the realism and authenticity of Arma 3. +**ACE 3** is a join effort by the teams behind **ACE 2**, **AGM** and **CSE** to improve the realism and authenticity of Arma 3. This mod is entirely **open-source**, and everyone is free to propose changes or maintain their own, customized version as long as they make their changes open to the public in accordance with the GNU General Public License (for more information check the license file attached to this project). @@ -32,7 +32,7 @@ More information on the purpose of the different components of ACE and which one * Realistic ballistics including wind and humidity * Backblast simulation * Weapon resting and bipod deployment -* A fire control system for armored vehicles and helicopters +* A fire control system for armored vehicles and helicopters ***and more...*** For a full list of current features, check [the official wiki](https://github.com/KoffeinFlummi/ACE3/wiki). diff --git a/ace_fcs.dll b/ace_fcs.dll index 9907d9e1a0..7c222dc1d7 100644 Binary files a/ace_fcs.dll and b/ace_fcs.dll differ diff --git a/addons/aircraft/CfgVehicles.hpp b/addons/aircraft/CfgVehicles.hpp index 5f419506c0..e9fb90e61e 100644 --- a/addons/aircraft/CfgVehicles.hpp +++ b/addons/aircraft/CfgVehicles.hpp @@ -217,9 +217,8 @@ class CfgVehicles { };*/ }; - class I_Heli_Transport_02_F: Heli_Transport_02_base_F {}; - - class I_Heli_light_03_base_F: Helicopter_Base_F { + class Heli_light_03_base_F: Helicopter_Base_F {}; + class I_Heli_light_03_base_F: Heli_light_03_base_F { lockDetectionSystem = 0; incomingMissileDetectionSystem = 16; driverCanEject = 1; @@ -242,15 +241,15 @@ class CfgVehicles { }; }; - class I_Heli_light_03_F: I_Heli_light_03_base_F { + class I_Heli_light_03_F: Heli_light_03_base_F { class Turrets: Turrets { class MainTurret: MainTurret {}; }; }; - class I_Heli_light_03_unarmed_base_F: I_Heli_light_03_base_F {}; + class Heli_light_03_unarmed_base_F: Heli_light_03_base_F {}; - class I_Heli_light_03_unarmed_F: I_Heli_light_03_unarmed_base_F {}; + class I_Heli_light_03_unarmed_F: Heli_light_03_unarmed_base_F {}; class Plane_CAS_01_base_F: Plane_Base_F { lockDetectionSystem = 12; @@ -303,7 +302,8 @@ class CfgVehicles { };*/ }; - class B_Heli_Transport_03_base_F: Helicopter_Base_H { + class Heli_Transport_03_base_F: Helicopter_Base_H {}; + class B_Heli_Transport_03_base_F: Heli_Transport_03_base_F { lockDetectionSystem = 12; incomingMissileDetectionSystem = 16; driverCanEject = 1; @@ -317,7 +317,7 @@ class CfgVehicles { }; }; - class B_Heli_Transport_03_unarmed_base_F: B_Heli_Transport_03_base_F { + class B_Heli_Transport_03_unarmed_base_F: Heli_Transport_03_base_F { class Turrets: Turrets { class CopilotTurret: CopilotTurret { canEject = 1; diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 97c9b9c906..144194b96f 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -147,6 +147,7 @@ PREP(removeCameraEventHandler); PREP(removeCustomEventHandler); PREP(removeMapMarkerCreatedEventHandler); PREP(removeScrollWheelEventHandler); +PREP(removeSpecificMagazine); PREP(requestCallback); PREP(resetAllDefaults); PREP(restoreVariablesJIP); diff --git a/addons/common/functions/fnc_removeSpecificMagazine.sqf b/addons/common/functions/fnc_removeSpecificMagazine.sqf new file mode 100644 index 0000000000..7f29cf979c --- /dev/null +++ b/addons/common/functions/fnc_removeSpecificMagazine.sqf @@ -0,0 +1,69 @@ +/* + * Author: CAA-Picard + * Removes a magazine from the unit that has an specific ammo count + * + * Argument: + * 0: Player + * 1: Magazine + * 2: Ammo count + * + * Return value: + * None + */ +#include "script_component.hpp" + +EXPLODE_3_PVT(_this,_player,_magazineType,_ammoCount); + +private ["_magazines","_index","_isRemoved"]; +_isRemoved = false; + +// Check uniform +_magazines = [magazinesAmmoCargo uniformContainer _player, {_this select 0 == _magazineType}] call FUNC(filter); +_index = _magazines find [_magazineType,_ammoCount]; +if (_index > -1) exitWith { + { + _player removeItemFromUniform (_x select 0); + } forEach _magazines; + + { + if (!_isRemoved && (_x isEqualTo [_magazineType,_ammoCount])) then { + _isRemoved = true; + } else { + (uniformContainer _player) addMagazineAmmoCargo [_x select 0, 1, _x select 1]; + }; + } forEach _magazines; +}; + +// Check vest +_magazines = [magazinesAmmoCargo vestContainer _player, {_this select 0 == _magazineType}] call FUNC(filter); +_index = _magazines find [_magazineType,_ammoCount]; +if (_index > -1) exitWith { + { + _player removeItemFromVest (_x select 0); + } forEach _magazines; + + { + if (!_isRemoved && (_x isEqualTo [_magazineType,_ammoCount])) then { + _isRemoved = true; + } else { + (vestContainer _player) addMagazineAmmoCargo [_x select 0, 1, _x select 1]; + }; + } forEach _magazines; +}; + +// Check backpack +_magazines = [magazinesAmmoCargo backpackContainer _player, {_this select 0 == _magazineType}] call FUNC(filter); +_index = _magazines find [_magazineType,_ammoCount]; +if (_index > -1) exitWith { + { + _player removeItemFromBackpack (_x select 0); + } forEach _magazines; + + { + if (!_isRemoved && (_x isEqualTo [_magazineType,_ammoCount])) then { + _isRemoved = true; + } else { + (backpackContainer _player) addMagazineAmmoCargo [_x select 0, 1, _x select 1]; + }; + } forEach _magazines; +}; diff --git a/addons/fcs/CfgVehicles.hpp b/addons/fcs/CfgVehicles.hpp index 4cc010f917..45f07ddbda 100644 --- a/addons/fcs/CfgVehicles.hpp +++ b/addons/fcs/CfgVehicles.hpp @@ -28,7 +28,7 @@ class CfgVehicles { displayName = $STR_ACE_FCS_ResetFCS; enableInside = 1; condition = QUOTE(call FUNC(canResetFCS)); - statement = QUOTE([ARR_2(_vehicle,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset);); + statement = QUOTE([ARR_2(vehicle _player,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset);); showDisabled = 0; priority = 1; icon = ""; @@ -42,7 +42,7 @@ class CfgVehicles { displayName = $STR_ACE_FCS_ResetFCS; enableInside = 1; condition = QUOTE(call FUNC(canResetFCS)); - statement = QUOTE([ARR_2(_vehicle,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset);); + statement = QUOTE([ARR_2(vehicle _player,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset);); showDisabled = 0; priority = 1; icon = ""; @@ -492,13 +492,13 @@ class CfgVehicles { };*/ }; - class I_Heli_light_03_base_F: Helicopter_Base_F { + class Heli_light_03_base_F; + class I_Heli_light_03_base_F: Heli_light_03_base_F { /*class Turrets: Turrets { class MainTurret: MainTurret {}; };*/ }; - - class I_Heli_light_03_F: I_Heli_light_03_base_F { + class I_Heli_light_03_F: Heli_light_03_base_F { /*class Turrets: Turrets { class MainTurret: MainTurret {}; };*/ diff --git a/addons/fcs/functions/fnc_firedEH.sqf b/addons/fcs/functions/fnc_firedEH.sqf index f17693d33e..67c7e1d301 100644 --- a/addons/fcs/functions/fnc_firedEH.sqf +++ b/addons/fcs/functions/fnc_firedEH.sqf @@ -12,7 +12,7 @@ #include "script_component.hpp" -private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile"]; +private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile","_velocityCorrection"]; _vehicle = _this select 0; _weapon = _this select 1; @@ -30,7 +30,7 @@ if !([_gunner] call EFUNC(common,isPlayer)) exitWith {}; private ["_FCSMagazines", "_FCSElevation", "_offset"]; -_FCSMagazines = _vehicle getVariable format ["%1_%2", QGVAR(Magazines), _turret]; +_FCSMagazines = _vehicle getVariable [(format ["%1_%2", QGVAR(Magazines), _turret]), []]; _FCSElevation = _vehicle getVariable format ["%1_%2", QGVAR(Elevation), _turret]; if !(_magazine in _FCSMagazines) exitWith {}; @@ -43,8 +43,12 @@ _offset = 0; }; } forEach _FCSMagazines; -[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, 0] call EFUNC(common,changeProjectileDirection); +// Correct velocity for weapons that have initVelocity +// @todo: Take into account negative initVelocities +_velocityCorrection = (vectorMagnitude velocity _projectile) - + getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); +[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, _velocityCorrection] call EFUNC(common,changeProjectileDirection); // Air burst missile // handle locally only diff --git a/addons/fcs/initKeybinds.sqf b/addons/fcs/initKeybinds.sqf index dd1a94b78e..f573a7e9d9 100644 --- a/addons/fcs/initKeybinds.sqf +++ b/addons/fcs/initKeybinds.sqf @@ -1,81 +1,63 @@ // by commy2 -["ACE3", - localize "STR_ACE_FCS_LaseTarget", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false}; +["ACE3", QGVAR(lazeTarget), localize "STR_ACE_FCS_LaseTarget", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false}; - // prevent holding down - if (GETGVAR(isDownStateKey1,false)) exitWith {false}; - GVAR(isDownStateKey1) = true; + if (GETGVAR(isDownStateKey1,false)) exitWith {false}; + GVAR(isDownStateKey1) = true; - // Statement - [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyDown); - // Return false so it doesn't block the rest weapon action - false - }, - [15, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyDown); + // Return false so it doesn't block the rest weapon action + false +}, +{ + // prevent holding down + GVAR(isDownStateKey1) = false; -["ACE3", - localize "STR_ACE_FCS_LaseTarget", - { - // prevent holding down - GVAR(isDownStateKey1) = false; + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false}; - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false}; + // Statement + [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyUp); + false +}, +[15, [false, false, false]], false] call cba_fnc_addKeybind; //Tab Key - // Statement - [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyUp); - false - }, - [15, [false, false, false]], - false, - "keyup" -] call cba_fnc_registerKeybind; +["ACE3", QGVAR(adjustRangeUp), localize "STR_ACE_FCS_AdjustRangeUp", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; -["ACE3", - localize "STR_ACE_FCS_AdjustRangeUp", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; + // Statement + [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange); + true +}, +{false}, +[201, [false, false, false]], false] call cba_fnc_addKeybind; //PageUp Key - // Statement - [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange); - true - }, - [201, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; +["ACE3", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; -["ACE3", - localize "STR_ACE_FCS_AdjustRangeDown", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; - - // Statement - [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange); - true - }, - [209, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange); + true +}, +{false}, +[209, [false, false, false]], false] call cba_fnc_addKeybind; //PageDown Key diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index 4c7160bdb3..d73ac0a850 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -17,17 +17,19 @@ #include "script_component.hpp" if (!hasInterface) exitWith {}; -["ACE3", localize "STR_ACE_Goggles_WipeGlasses", +["ACE3", QGVAR(wipeGlasses), localize "STR_ACE_Goggles_WipeGlasses", { - if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith { - call FUNC(clearGlasses); - true - }; - false -}, [20, true, true, false], false, "keydown"] call CALLSTACK(cba_fnc_registerKeybind); + if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith { + call FUNC(clearGlasses); + true + }; + false +}, +{false}, +[20, true, true, false], false] call CALLSTACK(cba_fnc_addKeybind); if isNil(QGVAR(UsePP)) then { - GVAR(UsePP) = true; + GVAR(UsePP) = true; }; GVAR(PostProcess) = ppEffectCreate ["ColorCorrections", 1995]; @@ -47,78 +49,78 @@ GVAR(RainActive) = false; GVAR(RainLastLevel) = 0; FUNC(CheckGlasses) = { - if (GVAR(Current) != (goggles ace_player)) then { - GVAR(Current) = (goggles ace_player); - ["GlassesChanged",[GVAR(Current)]] call EFUNC(common,localEvent); - }; + if (GVAR(Current) != (goggles ace_player)) then { + GVAR(Current) = (goggles ace_player); + ["GlassesChanged",[GVAR(Current)]] call EFUNC(common,localEvent); + }; }; player addEventHandler ["Explosion", { - if (alive ace_player) then { - 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);}; - _effects = GETGLASSES(ace_player); - _effects set [BROKEN, true]; - SETGLASSES(ace_player,_effects); - if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then { - if (call FUNC(ExternalCamera)) exitWith {}; - if (isNull(GLASSDISPLAY)) then { - 150 cutRsc["RscACE_Goggles", "PLAIN",1, false]; - }; - (GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked"); + if (alive ace_player) then { + 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);}; + _effects = GETGLASSES(ace_player); + _effects set [BROKEN, true]; + SETGLASSES(ace_player,_effects); + if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then { + if (call FUNC(ExternalCamera)) exitWith {}; + if (isNull(GLASSDISPLAY)) then { + 150 cutRsc["RscACE_Goggles", "PLAIN",1, false]; + }; + (GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked"); + }; + ["GlassesCracked",[ace_player]] call EFUNC(common,localEvent); }; - ["GlassesCracked",[ace_player]] call EFUNC(common,localEvent); - }; }]; player addEventHandler ["Killed",{ - GVAR(PostProcessEyes) ppEffectEnable false; - SETGLASSES(ace_player,GLASSESDEFAULT); - call FUNC(removeGlassesEffect); - GVAR(EffectsActive)=false; - ace_player setVariable ["ACE_EyesDamaged", false]; - if (GVAR(EyesDamageScript) != -1) then { - [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler); - }; - if (GVAR(DustHandler) != -1) then { - [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(DustHandler) = -1; - }; + GVAR(PostProcessEyes) ppEffectEnable false; + SETGLASSES(ace_player,GLASSESDEFAULT); + call FUNC(removeGlassesEffect); + GVAR(EffectsActive)=false; + ace_player setVariable ["ACE_EyesDamaged", false]; + if (GVAR(EyesDamageScript) != -1) then { + [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler); + }; + if (GVAR(DustHandler) != -1) then { + [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(DustHandler) = -1; + }; }]; player addEventHandler ["Fired",{[_this select 0, _this select 1] call FUNC(dustHandler);}]; player AddEventHandler ["Take",{call FUNC(checkGlasses);}]; player AddEventHandler ["Put", {call FUNC(checkGlasses);}]; ["GlassesChanged",{ - SETGLASSES(ace_player,GLASSESDEFAULT); + SETGLASSES(ace_player,GLASSESDEFAULT); - if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)}; + if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)}; - if ([ace_player] call FUNC(isGogglesVisible)) then { - [_this select 0] call FUNC(applyGlassesEffect); - } else { - call FUNC(removeGlassesEffect); - }; + if ([ace_player] call FUNC(isGogglesVisible)) then { + [_this select 0] call FUNC(applyGlassesEffect); + } else { + call FUNC(removeGlassesEffect); + }; }] call EFUNC(common,addEventHandler); ["GlassesCracked",{ - if (_this select 0 != ace_player) exitWith {}; - ace_player setVariable ["ACE_EyesDamaged", true]; - if (GVAR(EyesDamageScript) != -1) then { - [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler); - }; - GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]]; - GVAR(PostProcessEyes) ppEffectCommit 0; - GVAR(PostProcessEyes) ppEffectEnable true; - GVAR(EyesDamageScript) = [{ - GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]]; - GVAR(PostProcessEyes) ppEffectCommit 5; + if (_this select 0 != ace_player) exitWith {}; + ace_player setVariable ["ACE_EyesDamaged", true]; + if (GVAR(EyesDamageScript) != -1) then { + [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler); + }; + GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 0; + GVAR(PostProcessEyes) ppEffectEnable true; GVAR(EyesDamageScript) = [{ - GVAR(PostProcessEyes) ppEffectEnable false; - ace_player setVariable ["ACE_EyesDamaged", false]; - GVAR(EyesDamageScript) = -1; - }, [], 5, 1] call EFUNC(common,waitAndExecute); - }, [], 25, 5] call EFUNC(common,waitAndExecute); + GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 5; + GVAR(EyesDamageScript) = [{ + GVAR(PostProcessEyes) ppEffectEnable false; + ace_player setVariable ["ACE_EyesDamaged", false]; + GVAR(EyesDamageScript) = -1; + }, [], 5, 1] call EFUNC(common,waitAndExecute); + }, [], 25, 5] call EFUNC(common,waitAndExecute); }] call EFUNC(common,addEventHandler); call FUNC(checkGlasses); [FUNC(CheckGoggles), 1, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index 0b6bb16ffb..89f4e05bb4 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -10,19 +10,16 @@ GVAR(flashbangPPEffectCC) = ppEffectCreate ["ColorCorrections", 4265]; GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; // Add keybinds -["ACE3", - localize "STR_ACE_Grenades_SwitchGrenadeMode", - { - // Conditions: canInteract - _exceptions = [QEGVAR(captives,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call EFUNC(common,canUseWeapon))) exitWith {false}; +["ACE3", QGVAR(switchGrenadeMode), localize "STR_ACE_Grenades_SwitchGrenadeMode", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(captives,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call EFUNC(common,canUseWeapon))) exitWith {false}; - // Statement - [] call FUNC(nextMode); - }, - [9, [false, false, false]], //8 key - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [] call FUNC(nextMode); +}, +{false}, +[9, [false, false, false]], false] call cba_fnc_addKeybind; //8 Key diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index c068a15882..b804ea970f 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -6,30 +6,12 @@ _fnc = { }; addMissionEventHandler ["Draw3D", _fnc]; -["ACE3", -"Interact Key", +["ACE3", QGVAR(InteractKey), "Interact Key", {_this call FUNC(keyDown)}, -[219, [false, false, false]], -false, -"keydown"] call cba_fnc_registerKeybind; - -["ACE3", -"Interact Key", {_this call FUNC(keyUp)}, -[219, [false, false, false]], -false, -"keyUp"] call cba_fnc_registerKeybind; +[219, [false, false, false]], false] call cba_fnc_addKeybind; //Left Windows Key -["ACE3", -"Self Actions Key", +["ACE3", QGVAR(SelfInteractKey), "Self Actions Key", {_this call FUNC(keyDownSelfAction)}, -[219, [false, true, false]], -false, -"keydown"] call cba_fnc_registerKeybind; - -["ACE3", -"Self Actions Key", {_this call FUNC(keyUpSelfAction)}, -[219, [false, true, false]], -false, -"keyUp"] call cba_fnc_registerKeybind; \ No newline at end of file +[219, [false, true, false]], false] call cba_fnc_addKeybind; //Left Windows Key + Ctrl/Strg diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index c4f44bdcff..3cf95fe1a4 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -481,8 +481,8 @@ class CfgVehicles { class ACE_Actions { class ACE_MainActions { displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; + selection = "gunnerview"; + distance = 2; condition = "true"; }; }; @@ -494,8 +494,8 @@ class CfgVehicles { class ACE_Actions { class ACE_MainActions { displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; + selection = "gunnerview"; + distance = 2; condition = "true"; }; }; diff --git a/addons/interaction/XEH_clientInit.sqf b/addons/interaction/XEH_clientInit.sqf index 85232d1fcd..89001b0039 100644 --- a/addons/interaction/XEH_clientInit.sqf +++ b/addons/interaction/XEH_clientInit.sqf @@ -16,92 +16,89 @@ GVAR(isOpeningDoor) = false; // Add keybinds -["ACE3", - localize "STR_ACE_Interaction_OpenDoor", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(!GVAR(isOpeningDoor) && - {[2] call FUNC(getDoor) select 1 != ''} - ) exitWith {false}; +["ACE3", QGVAR(openDoor), localize "STR_ACE_Interaction_OpenDoor", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(!GVAR(isOpeningDoor) && + {[2] call FUNC(getDoor) select 1 != ''} + ) exitWith {false}; - // Statement - call EFUNC(interaction,openDoor); - true - }, - [57, [false, true, false]], - false, - "keydown" + // Statement + call EFUNC(interaction,openDoor); + true +}, +{}, +[57, [false, true, false]], false] call cba_fnc_addKeybind; + +["ACE3", +localize "STR_ACE_Interaction_OpenDoor", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(GVAR(isOpeningDoor)) exitWith {false}; + + // Statement + GVAR(isOpeningDoor) = false; + true +}, +[57, [false, true, false]], +false, +"keyup" ] call cba_fnc_registerKeybind; ["ACE3", - localize "STR_ACE_Interaction_OpenDoor", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(GVAR(isOpeningDoor)) exitWith {false}; +localize "STR_ACE_Interaction_TapShoulder", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false}; - // Statement - GVAR(isOpeningDoor) = false; - true - }, - [57, [false, true, false]], - false, - "keyup" + // Statement + [ACE_player, cursorTarget] call FUNC(tapShoulder); + true +}, +[20, [true, false, false]], +false, +"keydown" ] call cba_fnc_registerKeybind; ["ACE3", - localize "STR_ACE_Interaction_TapShoulder", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false}; +localize "STR_ACE_Interaction_ModifierKey", +{ + // Conditions: canInteract + _exceptions = ["ACE_Drag_isNotDragging"]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Statement - [ACE_player, cursorTarget] call FUNC(tapShoulder); - true - }, - [20, [true, false, false]], - false, - "keydown" + // Statement + ACE_Modifier = 1; + // Return false so it doesn't block other actions + false +}, +[29, [false, false, false]], +false, +"keydown" ] call cba_fnc_registerKeybind; ["ACE3", - localize "STR_ACE_Interaction_ModifierKey", - { - // Conditions: canInteract - _exceptions = ["ACE_Drag_isNotDragging"]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; +localize "STR_ACE_Interaction_ModifierKey", +{ + // Conditions: canInteract + _exceptions = ["ACE_Drag_isNotDragging"]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Statement - ACE_Modifier = 1; - // Return false so it doesn't block other actions - false - }, - [29, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; - -["ACE3", - localize "STR_ACE_Interaction_ModifierKey", - { - // Conditions: canInteract - _exceptions = ["ACE_Drag_isNotDragging"]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - - // Statement - ACE_Modifier = 0; - // Return false so it doesn't block other actions - false - }, - [29, [false, false, false]], - false, - "keyup" + // Statement + ACE_Modifier = 0; + // Return false so it doesn't block other actions + false +}, +[29, [false, false, false]], +false, +"keyup" ] call cba_fnc_registerKeybind; diff --git a/addons/magazines/CfgEventHandlers.hpp b/addons/magazines/CfgEventHandlers.hpp new file mode 100644 index 0000000000..b5577d09b7 --- /dev/null +++ b/addons/magazines/CfgEventHandlers.hpp @@ -0,0 +1,13 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_FiredBIS_EventHandlers { + class AllVehicles { + class ADDON { + firedBIS = QUOTE(_this call FUNC(forceMagazineMuzzleVelocity)); + }; + }; +}; diff --git a/addons/magazines/CfgMagazines.hpp b/addons/magazines/CfgMagazines.hpp index 86cb6d9e1b..1c0242bd6d 100644 --- a/addons/magazines/CfgMagazines.hpp +++ b/addons/magazines/CfgMagazines.hpp @@ -22,6 +22,7 @@ class CfgMagazines { descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_mag_SDDescription"; picture = "\A3\weapons_f\data\ui\m_30stanag_caseless_green_CA.paa"; initSpeed = 320; + GVAR(forceMagazineMuzzleVelocity) = 1; }; class ACE_30Rnd_65x39_caseless_mag_AP: 30Rnd_65x39_caseless_mag { @@ -57,6 +58,7 @@ class CfgMagazines { displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_SDNameShort"; descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_SDDescription"; initSpeed = 320; + GVAR(forceMagazineMuzzleVelocity) = 1; }; class ACE_30Rnd_65x39_caseless_green_mag_AP: 30Rnd_65x39_caseless_green { @@ -88,6 +90,7 @@ class CfgMagazines { displayNameShort = "$STR_ACE_30Rnd_556x45_mag_SDNameShort"; descriptionShort = "$STR_ACE_30Rnd_556x45_mag_SDDescription"; initSpeed = 320; + GVAR(forceMagazineMuzzleVelocity) = 1; picture = "\A3\weapons_f\data\ui\m_30stanag_green_ca.paa"; }; @@ -127,6 +130,7 @@ class CfgMagazines { displayNameShort = "$STR_ACE_20Rnd_762x51_mag_SDNameShort"; descriptionShort = "$STR_ACE_20Rnd_762x51_mag_SDDescription"; initSpeed = 320; + GVAR(forceMagazineMuzzleVelocity) = 1; }; class ACE_20Rnd_762x51_Mag_AP: 20Rnd_762x51_Mag { diff --git a/addons/magazines/CfgWeapons.hpp b/addons/magazines/CfgWeapons.hpp index d54cf28e52..2b24d578fe 100644 --- a/addons/magazines/CfgWeapons.hpp +++ b/addons/magazines/CfgWeapons.hpp @@ -1,5 +1,5 @@ - class SlotInfo; +class MuzzleSlot; class CfgWeapons { @@ -20,7 +20,7 @@ class CfgWeapons { }; class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { + class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_H"}; }; }; @@ -59,7 +59,7 @@ class CfgWeapons { }; class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { + class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_H"}; }; }; @@ -74,7 +74,7 @@ class CfgWeapons { class EBR_base_F: Rifle_Long_Base_F { class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { + class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_B"}; }; }; @@ -82,7 +82,7 @@ class CfgWeapons { class DMR_01_base_F: Rifle_Long_Base_F { class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { + class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_B"}; }; }; @@ -90,7 +90,7 @@ class CfgWeapons { class LMG_Mk200_F: Rifle_Long_Base_F { class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { + class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_H"}; }; }; @@ -98,7 +98,7 @@ class CfgWeapons { class LMG_Zafir_F: Rifle_Long_Base_F { class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { + class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_B"}; }; }; @@ -115,7 +115,7 @@ class CfgWeapons { }; class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { + class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_L"}; }; }; @@ -129,7 +129,7 @@ class CfgWeapons { }; class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { + class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_L"}; }; }; @@ -148,7 +148,7 @@ class CfgWeapons { class pdw2000_base_F: Rifle_Base_F { class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { + class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_smg_02"}; }; }; @@ -156,7 +156,7 @@ class CfgWeapons { class SMG_01_Base: Rifle_Base_F { class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { + class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_smg_01"}; }; }; @@ -164,7 +164,7 @@ class CfgWeapons { class SMG_02_base_F: Rifle_Base_F { class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { + class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_smg_02"}; }; }; @@ -180,7 +180,7 @@ class CfgWeapons { class hgun_P07_F: Pistol_Base_F { class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { + class MuzzleSlot: MuzzleSlot { linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE"; compatibleItems[] += {"ACE_muzzle_mzls_smg_02"}; }; @@ -189,7 +189,7 @@ class CfgWeapons { class hgun_Rook40_F: Pistol_Base_F { class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { + class MuzzleSlot: MuzzleSlot { linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE"; compatibleItems[] += {"ACE_muzzle_mzls_smg_02"}; }; @@ -198,7 +198,7 @@ class CfgWeapons { class hgun_ACPC2_F: Pistol_Base_F { class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { + class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_smg_01"}; }; }; @@ -206,7 +206,7 @@ class CfgWeapons { class hgun_Pistol_heavy_01_F: Pistol_Base_F { class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { + class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_smg_01"}; }; }; diff --git a/addons/magazines/XEH_preInit.sqf b/addons/magazines/XEH_preInit.sqf new file mode 100644 index 0000000000..8e611f370a --- /dev/null +++ b/addons/magazines/XEH_preInit.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(forceMagazineMuzzleVelocity); + +ADDON = true; diff --git a/addons/magazines/config.cpp b/addons/magazines/config.cpp index c757d62f5c..58c1dfa467 100644 --- a/addons/magazines/config.cpp +++ b/addons/magazines/config.cpp @@ -12,6 +12,8 @@ class CfgPatches { }; }; +#include "CfgEventHandlers.hpp" + #include "CfgAmmo.hpp" #include "CfgMagazines.hpp" #include "CfgVehicles.hpp" diff --git a/addons/magazines/functions/fnc_forceMagazineMuzzleVelocity.sqf b/addons/magazines/functions/fnc_forceMagazineMuzzleVelocity.sqf new file mode 100644 index 0000000000..414dbb40e8 --- /dev/null +++ b/addons/magazines/functions/fnc_forceMagazineMuzzleVelocity.sqf @@ -0,0 +1,41 @@ +/* + * Author: commy2 + * + * DESCRIPTION. + * + * Arguments: + * firedBIS + * + * Return Value: + * None + */ + +#include "script_component.hpp" + +private ["_weapon", "_magazine", "_projectile"]; + +_weapon = _this select 1; +_magazine = _this select 5; +_projectile = _this select 6; + +if (getNumber (configFile >> "CfgMagazines" >> _magazine >> QGVAR(forceMagazineMuzzleVelocity)) != 1) exitWith { + //hint str (speed _projectile / 3.6); +}; + +private ["_initSpeedWeapon", "_initSpeedMagazine"]; + +_initSpeedWeapon = getNumber (configFile >> "CfgWeapons" >> _weapon >> "initSpeed"); +_initSpeedMagazine = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); + +//systemChat format ["W: %1m/s, M: %2m/s", _initSpeedWeapon, _initSpeedMagazine]; + +// force magazine initSpeed + +private ["_credit", "_debit"]; + +_credit = vectorMagnitude velocity _projectile; +_debit = _credit + (_initSpeedMagazine - _initSpeedWeapon); + +_projectile setVelocity ((velocity _projectile) vectorMultiply (_debit / _credit)); + +//hint str (speed _projectile / 3.6); diff --git a/addons/magazines/functions/script_component.hpp b/addons/magazines/functions/script_component.hpp new file mode 100644 index 0000000000..2849ae3632 --- /dev/null +++ b/addons/magazines/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\magazines\script_component.hpp" \ No newline at end of file diff --git a/addons/main/config.cpp b/addons/main/config.cpp index 3b8c600e22..44e9c6f33e 100644 --- a/addons/main/config.cpp +++ b/addons/main/config.cpp @@ -1,539 +1,540 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { - "a3_air_f", - "a3_air_f_beta", - "a3_air_f_beta_heli_attack_01", - "a3_air_f_beta_heli_attack_02", - "a3_air_f_beta_heli_transport_01", - "a3_air_f_beta_heli_transport_02", - "a3_air_f_beta_parachute_01", - "a3_air_f_beta_parachute_02", - "a3_air_f_epb_heli_light_03", - "a3_air_f_epc_plane_cas_01", - "a3_air_f_epc_plane_cas_02", - "a3_air_f_epc_plane_fighter_03", - "a3_air_f_gamma_plane_fighter_03", - "a3_air_f_gamma_uav_01", - "a3_air_f_gamma_uav_02", - "a3_air_f_heli", - "a3_air_f_heli_heli_attack_01", - "a3_air_f_heli_heli_attack_02", - "a3_air_f_heli_heli_light_01", - "a3_air_f_heli_heli_light_02", - "a3_air_f_heli_heli_light_03", - "a3_air_f_heli_heli_transport_01", - "a3_air_f_heli_heli_transport_02", - "a3_air_f_heli_heli_transport_03", - "a3_air_f_heli_heli_transport_04", - "a3_air_f_heli_light_01", - "a3_air_f_heli_light_02", - "a3_animals_f", - "a3_animals_f_animconfig", - "a3_animals_f_chicken", - "a3_animals_f_dog", - "a3_animals_f_fishes", - "a3_animals_f_goat", - "a3_animals_f_kestrel", - "a3_animals_f_rabbit", - "a3_animals_f_seagull", - "a3_animals_f_sheep", - "a3_animals_f_snakes", - "a3_animals_f_turtle", - "a3_anims_f", - "a3_anims_f_config_sdr", - "a3_anims_f_epa", - "a3_anims_f_epc", - "a3_anims_f_heli", - "a3_anims_f_kart", - "a3_armor_f", - "a3_armor_f_amv", - "a3_armor_f_apc_wheeled_03", - "a3_armor_f_beta", - "a3_armor_f_beta_apc_tracked_02", - "a3_armor_f_epb_apc_tracked_03", - "a3_armor_f_epb_mbt_03", - "a3_armor_f_epc_mbt_01", - "a3_armor_f_marid", - "a3_armor_f_panther", - "a3_armor_f_slammer", - "a3_armor_f_t100k", - "a3_baseconfig_f", - "a3_boat_f", - "a3_boat_f_beta_boat_armed_01", - "a3_boat_f_beta_boat_transport_01", - "a3_boat_f_boat_armed_01", - "a3_boat_f_boat_transport_01", - "a3_boat_f_civilian_boat", - "a3_boat_f_epc_submarine_01_f", - "a3_boat_f_gamma_boat_transport_01", - "a3_boat_f_heli_boat_armed_01", - "a3_boat_f_heli_sdv_01", - "a3_boat_f_sdv_01", - "a3_boat_f_trawler", - "a3_cargoposes_f", - "a3_cargoposes_f_heli", - "a3_characters_f", - "a3_characters_f_beta", - "a3_characters_f_blufor", - "a3_characters_f_bootcamp", - "a3_characters_f_bootcamp_common", - "a3_characters_f_civil", - "a3_characters_f_common", - "a3_characters_f_epa", - "a3_characters_f_epb", - "a3_characters_f_epb_heads", - "a3_characters_f_epc", - "a3_characters_f_gamma", - "a3_characters_f_heads", - "a3_characters_f_indep", - "a3_characters_f_kart", - "a3_characters_f_opfor", - "a3_characters_f_proxies", - "a3_data_f", - "a3_data_f_bootcamp", - "a3_data_f_curator", - "a3_data_f_curator_characters", - "a3_data_f_curator_eagle", - "a3_data_f_curator_intel", - "a3_data_f_curator_misc", - "a3_data_f_curator_respawn", - "a3_data_f_curator_virtual", - "a3_data_f_heli", - "a3_data_f_hook", - "a3_data_f_kart", - "a3_data_f_kart_particleeffects", - "a3_data_f_particleeffects", - "a3_dubbing_radio_f", - "a3_editor_f", - "a3_functions_f", - "a3_functions_f_bootcamp", - "a3_functions_f_curator", - "a3_functions_f_epa", - "a3_functions_f_epc", - "a3_functions_f_heli", - "a3_language_f", - "a3_language_f_beta", - "a3_language_f_bootcamp", - "a3_language_f_curator", - "a3_language_f_epa", - "a3_language_f_epb", - "a3_language_f_epc", - "a3_language_f_gamma", - "a3_language_f_heli", - "a3_language_f_kart", - "a3_languagemissions_f", - "a3_languagemissions_f_beta", - "a3_languagemissions_f_gamma", - "a3_languagemissions_f_kart", - "a3_map_altis", - "a3_map_altis_scenes", - "a3_map_data", - "a3_map_stratis", - "a3_map_stratis_scenes", - "a3_map_vr_scenes", - "a3_misc_f", - "a3_misc_f_helpers", - "a3_missions_f", - "a3_missions_f_beta", - "a3_missions_f_bootcamp", - "a3_missions_f_curator", - "a3_missions_f_epa", - "a3_missions_f_epb", - "a3_missions_f_epc", - "a3_missions_f_gamma", - "a3_missions_f_heli", - "a3_missions_f_kart", - "a3_modules_f", - "a3_modules_f_beta", - "a3_modules_f_beta_firingdrills", - "a3_modules_f_bootcamp", - "a3_modules_f_bootcamp_misc", - "a3_modules_f_curator", - "a3_modules_f_curator_animals", - "a3_modules_f_curator_cas", - "a3_modules_f_curator_chemlights", - "a3_modules_f_curator_curator", - "a3_modules_f_curator_effects", - "a3_modules_f_curator_environment", - "a3_modules_f_curator_flares", - "a3_modules_f_curator_intel", - "a3_modules_f_curator_lightning", - "a3_modules_f_curator_mines", - "a3_modules_f_curator_misc", - "a3_modules_f_curator_multiplayer", - "a3_modules_f_curator_objectives", - "a3_modules_f_curator_ordnance", - "a3_modules_f_curator_respawn", - "a3_modules_f_curator_smokeshells", - "a3_modules_f_dyno", - "a3_modules_f_effects", - "a3_modules_f_epb", - "a3_modules_f_epb_misc", - "a3_modules_f_events", - "a3_modules_f_groupmodifiers", - "a3_modules_f_hc", - "a3_modules_f_heli", - "a3_modules_f_heli_spawnai", - "a3_modules_f_intel", - "a3_modules_f_kart", - "a3_modules_f_kart_timetrials", - "a3_modules_f_livefeed", - "a3_modules_f_marta", - "a3_modules_f_misc", - "a3_modules_f_multiplayer", - "a3_modules_f_objectmodifiers", - "a3_modules_f_sites", - "a3_modules_f_skirmish", - "a3_modules_f_strategicmap", - "a3_modules_f_supports", - "a3_modules_f_uav", - "a3_music_f", - "a3_music_f_bootcamp", - "a3_music_f_epa", - "a3_music_f_epb", - "a3_music_f_epc", - "a3_music_f_heli", - "a3_plants_f_bush", - "a3_roads_f", - "a3_rocks_f", - "a3_signs_f", - "a3_signs_f_ad", - "a3_soft_f", - "a3_soft_f_beta_quadbike", - "a3_soft_f_bootcamp_offroad_01", - "a3_soft_f_bootcamp_quadbike", - "a3_soft_f_bootcamp_truck", - "a3_soft_f_car", - "a3_soft_f_crusher_ugv", - "a3_soft_f_epc_truck_03", - "a3_soft_f_gamma_hemtt", - "a3_soft_f_gamma_offroad", - "a3_soft_f_gamma_quadbike", - "a3_soft_f_gamma_truckheavy", - "a3_soft_f_heli_car", - "a3_soft_f_heli_crusher_ugv", - "a3_soft_f_heli_mrap_01", - "a3_soft_f_heli_mrap_02", - "a3_soft_f_heli_mrap_03", - "a3_soft_f_heli_quadbike", - "a3_soft_f_heli_suv", - "a3_soft_f_heli_truck", - "a3_soft_f_hemtt", - "a3_soft_f_kart_kart_01", - "a3_soft_f_mrap_01", - "a3_soft_f_mrap_02", - "a3_soft_f_mrap_03", - "a3_soft_f_offroad_01", - "a3_soft_f_quadbike", - "a3_soft_f_suv", - "a3_soft_f_truck", - "a3_soft_f_truckheavy", - "a3_sounds_f", - "a3_sounds_f_bootcamp", - "a3_sounds_f_epb", - "a3_sounds_f_epc", - "a3_static_f", - "a3_static_f_beta_mortar_01", - "a3_static_f_gamma", - "a3_static_f_gamma_aa", - "a3_static_f_gamma_at", - "a3_static_f_gamma_mortar_01", - "a3_static_f_mortar_01", - "a3_structures_f", - "a3_structures_f_bootcamp_civ_camping", - "a3_structures_f_bootcamp_civ_sportsgrounds", - "a3_structures_f_bootcamp_ind_cargo", - "a3_structures_f_bootcamp_items_electronics", - "a3_structures_f_bootcamp_items_food", - "a3_structures_f_bootcamp_items_sport", - "a3_structures_f_bootcamp_system", - "a3_structures_f_bootcamp_training", - "a3_structures_f_bootcamp_vr_blocks", - "a3_structures_f_bootcamp_vr_coverobjects", - "a3_structures_f_bootcamp_vr_helpers", - "a3_structures_f_bridges", - "a3_structures_f_civ", - "a3_structures_f_civ_accessories", - "a3_structures_f_civ_ancient", - "a3_structures_f_civ_belltowers", - "a3_structures_f_civ_calvaries", - "a3_structures_f_civ_camping", - "a3_structures_f_civ_chapels", - "a3_structures_f_civ_constructions", - "a3_structures_f_civ_dead", - "a3_structures_f_civ_garbage", - "a3_structures_f_civ_graffiti", - "a3_structures_f_civ_infoboards", - "a3_structures_f_civ_kiosks", - "a3_structures_f_civ_lamps", - "a3_structures_f_civ_market", - "a3_structures_f_civ_offices", - "a3_structures_f_civ_pavements", - "a3_structures_f_civ_playground", - "a3_structures_f_civ_sportsgrounds", - "a3_structures_f_civ_statues", - "a3_structures_f_civ_tourism", - "a3_structures_f_dominants", - "a3_structures_f_dominants_amphitheater", - "a3_structures_f_dominants_castle", - "a3_structures_f_dominants_church", - "a3_structures_f_dominants_hospital", - "a3_structures_f_dominants_lighthouse", - "a3_structures_f_dominants_wip", - "a3_structures_f_epa_civ_camping", - "a3_structures_f_epa_civ_constructions", - "a3_structures_f_epa_items_electronics", - "a3_structures_f_epa_items_food", - "a3_structures_f_epa_items_medical", - "a3_structures_f_epa_items_tools", - "a3_structures_f_epa_items_vessels", - "a3_structures_f_epa_mil_scrapyard", - "a3_structures_f_epa_walls", - "a3_structures_f_epb_civ_accessories", - "a3_structures_f_epb_civ_camping", - "a3_structures_f_epb_civ_dead", - "a3_structures_f_epb_civ_garbage", - "a3_structures_f_epb_civ_graffiti", - "a3_structures_f_epb_civ_playground", - "a3_structures_f_epb_furniture", - "a3_structures_f_epb_items_documents", - "a3_structures_f_epb_items_luggage", - "a3_structures_f_epb_items_military", - "a3_structures_f_epb_items_vessels", - "a3_structures_f_epb_naval_fishing", - "a3_structures_f_epc_civ_accessories", - "a3_structures_f_epc_civ_camping", - "a3_structures_f_epc_civ_garbage", - "a3_structures_f_epc_civ_infoboards", - "a3_structures_f_epc_civ_kiosks", - "a3_structures_f_epc_civ_playground", - "a3_structures_f_epc_civ_tourism", - "a3_structures_f_epc_dominants_ghosthotel", - "a3_structures_f_epc_dominants_stadium", - "a3_structures_f_epc_furniture", - "a3_structures_f_epc_items_documents", - "a3_structures_f_epc_items_electronics", - "a3_structures_f_epc_walls", - "a3_structures_f_furniture", - "a3_structures_f_heli_civ_accessories", - "a3_structures_f_heli_civ_constructions", - "a3_structures_f_heli_civ_garbage", - "a3_structures_f_heli_civ_market", - "a3_structures_f_heli_furniture", - "a3_structures_f_heli_ind_airport", - "a3_structures_f_heli_ind_cargo", - "a3_structures_f_heli_ind_machines", - "a3_structures_f_heli_items_airport", - "a3_structures_f_heli_items_electronics", - "a3_structures_f_heli_items_food", - "a3_structures_f_heli_items_luggage", - "a3_structures_f_heli_items_sport", - "a3_structures_f_heli_items_tools", - "a3_structures_f_heli_vr_helpers", - "a3_structures_f_households", - "a3_structures_f_households_addons", - "a3_structures_f_households_house_big01", - "a3_structures_f_households_house_big02", - "a3_structures_f_households_house_shop01", - "a3_structures_f_households_house_shop02", - "a3_structures_f_households_house_small01", - "a3_structures_f_households_house_small02", - "a3_structures_f_households_house_small03", - "a3_structures_f_households_slum", - "a3_structures_f_households_stone_big", - "a3_structures_f_households_stone_shed", - "a3_structures_f_households_stone_small", - "a3_structures_f_households_wip", - "a3_structures_f_ind", - "a3_structures_f_ind_airport", - "a3_structures_f_ind_cargo", - "a3_structures_f_ind_carservice", - "a3_structures_f_ind_concretemixingplant", - "a3_structures_f_ind_crane", - "a3_structures_f_ind_dieselpowerplant", - "a3_structures_f_ind_factory", - "a3_structures_f_ind_fuelstation", - "a3_structures_f_ind_fuelstation_small", - "a3_structures_f_ind_pipes", - "a3_structures_f_ind_powerlines", - "a3_structures_f_ind_reservoirtank", - "a3_structures_f_ind_shed", - "a3_structures_f_ind_solarpowerplant", - "a3_structures_f_ind_tank", - "a3_structures_f_ind_transmitter_tower", - "a3_structures_f_ind_wavepowerplant", - "a3_structures_f_ind_windmill", - "a3_structures_f_ind_windpowerplant", - "a3_structures_f_items", - "a3_structures_f_items_cans", - "a3_structures_f_items_documents", - "a3_structures_f_items_electronics", - "a3_structures_f_items_gadgets", - "a3_structures_f_items_luggage", - "a3_structures_f_items_medical", - "a3_structures_f_items_military", - "a3_structures_f_items_stationery", - "a3_structures_f_items_tools", - "a3_structures_f_items_valuables", - "a3_structures_f_items_vessels", - "a3_structures_f_kart_civ_sportsgrounds", - "a3_structures_f_kart_mil_flags", - "a3_structures_f_kart_signs_companies", - "a3_structures_f_mil", - "a3_structures_f_mil_bagbunker", - "a3_structures_f_mil_bagfence", - "a3_structures_f_mil_barracks", - "a3_structures_f_mil_bunker", - "a3_structures_f_mil_cargo", - "a3_structures_f_mil_flags", - "a3_structures_f_mil_fortification", - "a3_structures_f_mil_helipads", - "a3_structures_f_mil_offices", - "a3_structures_f_mil_radar", - "a3_structures_f_mil_scrapyard", - "a3_structures_f_mil_shelters", - "a3_structures_f_mil_tenthangar", - "a3_structures_f_naval", - "a3_structures_f_naval_buoys", - "a3_structures_f_naval_fishing", - "a3_structures_f_naval_piers", - "a3_structures_f_naval_rowboats", - "a3_structures_f_research", - "a3_structures_f_signs_companies", - "a3_structures_f_system", - "a3_structures_f_training", - "a3_structures_f_training_invisibletarget", - "a3_structures_f_walls", - "a3_structures_f_wrecks", - "a3_supplies_f_heli", - "a3_supplies_f_heli_bladders", - "a3_supplies_f_heli_cargonets", - "a3_supplies_f_heli_fuel", - "a3_supplies_f_heli_slingload", - "a3_uav_f_characters_f_gamma", - "a3_uav_f_weapons_f_gamma_ammoboxes", - "a3_ui_f", - "a3_ui_f_bootcamp", - "a3_ui_f_curator", - "a3_ui_f_heli", - "a3_ui_f_kart", - "a3_uifonts_f", - "a3_weapons_f", - "a3_weapons_f_aaf", - "a3_weapons_f_acc", - "a3_weapons_f_ammoboxes", - "a3_weapons_f_beta", - "a3_weapons_f_beta_acc", - "a3_weapons_f_beta_ammoboxes", - "a3_weapons_f_beta_ebr", - "a3_weapons_f_beta_rifles_khaybar", - "a3_weapons_f_beta_rifles_mx", - "a3_weapons_f_beta_rifles_trg20", - "a3_weapons_f_bootcamp", - "a3_weapons_f_bootcamp_ammoboxes", - "a3_weapons_f_bootcamp_longrangerifles_gm6", - "a3_weapons_f_bootcamp_longrangerifles_m320", - "a3_weapons_f_csat", - "a3_weapons_f_dummyweapons", - "a3_weapons_f_ebr", - "a3_weapons_f_epa", - "a3_weapons_f_epa_acc", - "a3_weapons_f_epa_ammoboxes", - "a3_weapons_f_epa_ebr", - "a3_weapons_f_epa_longrangerifles_dmr_01", - "a3_weapons_f_epa_longrangerifles_gm6", - "a3_weapons_f_epa_rifles_mx", - "a3_weapons_f_epb", - "a3_weapons_f_epb_acc", - "a3_weapons_f_epb_ammoboxes", - "a3_weapons_f_epb_longrangerifles_gm3", - "a3_weapons_f_epb_longrangerifles_m320", - "a3_weapons_f_epb_rifles_mx_black", - "a3_weapons_f_epc", - "a3_weapons_f_explosives", - "a3_weapons_f_fia", - "a3_weapons_f_gamma", - "a3_weapons_f_gamma_acc", - "a3_weapons_f_gamma_ammoboxes", - "a3_weapons_f_gamma_items", - "a3_weapons_f_headgear", - "a3_weapons_f_itemholders", - "a3_weapons_f_items", - "a3_weapons_f_kart", - "a3_weapons_f_kart_pistols_pistol_signal_f", - "a3_weapons_f_launchers_law", - "a3_weapons_f_launchers_nlaw", - "a3_weapons_f_launchers_titan", - "a3_weapons_f_longrangerifles_gm6", - "a3_weapons_f_longrangerifles_m320", - "a3_weapons_f_machineguns_m200", - "a3_weapons_f_machineguns_zafir", - "a3_weapons_f_nato", - "a3_weapons_f_pistols_acpc2", - "a3_weapons_f_pistols_p07", - "a3_weapons_f_pistols_pdw2000", - "a3_weapons_f_pistols_pistol_heavy_01", - "a3_weapons_f_pistols_pistol_heavy_02", - "a3_weapons_f_pistols_rook40", - "a3_weapons_f_rifles_khaybar", - "a3_weapons_f_rifles_mk20", - "a3_weapons_f_rifles_mx", - "a3_weapons_f_rifles_sdar", - "a3_weapons_f_rifles_smg_02", - "a3_weapons_f_rifles_trg20", - "a3_weapons_f_rifles_vector", - "a3_weapons_f_uniforms", - "a3_weapons_f_vests", - "a3data", - "extended_eventhandlers", "CBA_UI", "CBA_XEH", "CBA_XEH_A3" + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "a3_air_f", + "a3_air_f_beta", + "a3_air_f_beta_heli_attack_01", + "a3_air_f_beta_heli_attack_02", + "a3_air_f_beta_heli_transport_01", + "a3_air_f_beta_heli_transport_02", + "a3_air_f_beta_parachute_01", + "a3_air_f_beta_parachute_02", + "a3_air_f_epb_heli_light_03", + "a3_air_f_epc_plane_cas_01", + "a3_air_f_epc_plane_cas_02", + "a3_air_f_epc_plane_fighter_03", + "a3_air_f_gamma_plane_fighter_03", + "a3_air_f_gamma_uav_01", + "a3_air_f_gamma_uav_02", + "a3_air_f_heli", + "a3_air_f_heli_heli_attack_01", + "a3_air_f_heli_heli_attack_02", + "a3_air_f_heli_heli_light_01", + "a3_air_f_heli_heli_light_02", + "a3_air_f_heli_heli_light_03", + "a3_air_f_heli_heli_transport_01", + "a3_air_f_heli_heli_transport_02", + "a3_air_f_heli_heli_transport_03", + "a3_air_f_heli_heli_transport_04", + "a3_air_f_heli_light_01", + "a3_air_f_heli_light_02", + "a3_animals_f", + "a3_animals_f_animconfig", + "a3_animals_f_chicken", + "a3_animals_f_dog", + "a3_animals_f_fishes", + "a3_animals_f_goat", + "a3_animals_f_kestrel", + "a3_animals_f_rabbit", + "a3_animals_f_seagull", + "a3_animals_f_sheep", + "a3_animals_f_snakes", + "a3_animals_f_turtle", + "a3_anims_f", + "a3_anims_f_config_sdr", + "a3_anims_f_epa", + "a3_anims_f_epc", + "a3_anims_f_heli", + "a3_anims_f_kart", + "a3_armor_f", + "a3_armor_f_amv", + "a3_armor_f_apc_wheeled_03", + "a3_armor_f_beta", + "a3_armor_f_beta_apc_tracked_02", + "a3_armor_f_epb_apc_tracked_03", + "a3_armor_f_epb_mbt_03", + "a3_armor_f_epc_mbt_01", + "a3_armor_f_marid", + "a3_armor_f_panther", + "a3_armor_f_slammer", + "a3_armor_f_t100k", + "a3_baseconfig_f", + "a3_boat_f", + "a3_boat_f_beta_boat_armed_01", + "a3_boat_f_beta_boat_transport_01", + "a3_boat_f_boat_armed_01", + "a3_boat_f_boat_transport_01", + "a3_boat_f_civilian_boat", + "a3_boat_f_epc_submarine_01_f", + "a3_boat_f_gamma_boat_transport_01", + "a3_boat_f_heli_boat_armed_01", + "a3_boat_f_heli_sdv_01", + "a3_boat_f_sdv_01", + "a3_boat_f_trawler", + "a3_cargoposes_f", + "a3_cargoposes_f_heli", + "a3_characters_f", + "a3_characters_f_beta", + "a3_characters_f_blufor", + "a3_characters_f_bootcamp", + "a3_characters_f_bootcamp_common", + "a3_characters_f_civil", + "a3_characters_f_common", + "a3_characters_f_epa", + "a3_characters_f_epb", + "a3_characters_f_epb_heads", + "a3_characters_f_epc", + "a3_characters_f_gamma", + "a3_characters_f_heads", + "a3_characters_f_indep", + "a3_characters_f_kart", + "a3_characters_f_opfor", + "a3_characters_f_proxies", + "a3_data_f", + "a3_data_f_bootcamp", + "a3_data_f_curator", + "a3_data_f_curator_characters", + "a3_data_f_curator_eagle", + "a3_data_f_curator_intel", + "a3_data_f_curator_misc", + "a3_data_f_curator_respawn", + "a3_data_f_curator_virtual", + "a3_data_f_heli", + "a3_data_f_hook", + "a3_data_f_kart", + "a3_data_f_kart_particleeffects", + "a3_data_f_particleeffects", + "a3_dubbing_radio_f", + "a3_editor_f", + "a3_functions_f", + "a3_functions_f_bootcamp", + "a3_functions_f_curator", + "a3_functions_f_epa", + "a3_functions_f_epc", + "a3_functions_f_heli", + "a3_language_f", + "a3_language_f_beta", + "a3_language_f_bootcamp", + "a3_language_f_curator", + "a3_language_f_epa", + "a3_language_f_epb", + "a3_language_f_epc", + "a3_language_f_gamma", + "a3_language_f_heli", + "a3_language_f_kart", + "a3_languagemissions_f", + "a3_languagemissions_f_beta", + "a3_languagemissions_f_gamma", + "a3_languagemissions_f_kart", + "a3_map_altis", + "a3_map_altis_scenes", + "a3_map_data", + "a3_map_stratis", + "a3_map_stratis_scenes", + "a3_map_vr_scenes", + "a3_misc_f", + "a3_misc_f_helpers", + "a3_missions_f", + "a3_missions_f_beta", + "a3_missions_f_bootcamp", + "a3_missions_f_curator", + "a3_missions_f_epa", + "a3_missions_f_epb", + "a3_missions_f_epc", + "a3_missions_f_gamma", + "a3_missions_f_heli", + "a3_missions_f_kart", + "a3_modules_f", + "a3_modules_f_beta", + "a3_modules_f_beta_firingdrills", + "a3_modules_f_bootcamp", + "a3_modules_f_bootcamp_misc", + "a3_modules_f_curator", + "a3_modules_f_curator_animals", + "a3_modules_f_curator_cas", + "a3_modules_f_curator_chemlights", + "a3_modules_f_curator_curator", + "a3_modules_f_curator_effects", + "a3_modules_f_curator_environment", + "a3_modules_f_curator_flares", + "a3_modules_f_curator_intel", + "a3_modules_f_curator_lightning", + "a3_modules_f_curator_mines", + "a3_modules_f_curator_misc", + "a3_modules_f_curator_multiplayer", + "a3_modules_f_curator_objectives", + "a3_modules_f_curator_ordnance", + "a3_modules_f_curator_respawn", + "a3_modules_f_curator_smokeshells", + "a3_modules_f_dyno", + "a3_modules_f_effects", + "a3_modules_f_epb", + "a3_modules_f_epb_misc", + "a3_modules_f_events", + "a3_modules_f_groupmodifiers", + "a3_modules_f_hc", + "a3_modules_f_heli", + "a3_modules_f_heli_spawnai", + "a3_modules_f_intel", + "a3_modules_f_kart", + "a3_modules_f_kart_timetrials", + "a3_modules_f_livefeed", + "a3_modules_f_marta", + "a3_modules_f_misc", + "a3_modules_f_multiplayer", + "a3_modules_f_objectmodifiers", + "a3_modules_f_sites", + "a3_modules_f_skirmish", + "a3_modules_f_strategicmap", + "a3_modules_f_supports", + "a3_modules_f_uav", + "a3_music_f", + "a3_music_f_bootcamp", + "a3_music_f_epa", + "a3_music_f_epb", + "a3_music_f_epc", + "a3_music_f_heli", + "a3_plants_f_bush", + "a3_roads_f", + "a3_rocks_f", + "a3_signs_f", + "a3_signs_f_ad", + "a3_soft_f", + "a3_soft_f_beta_quadbike", + "a3_soft_f_bootcamp_offroad_01", + "a3_soft_f_bootcamp_quadbike", + "a3_soft_f_bootcamp_truck", + "a3_soft_f_car", + "a3_soft_f_crusher_ugv", + "a3_soft_f_epc_truck_03", + "a3_soft_f_gamma_hemtt", + "a3_soft_f_gamma_offroad", + "a3_soft_f_gamma_quadbike", + "a3_soft_f_gamma_truckheavy", + "a3_soft_f_heli_car", + "a3_soft_f_heli_crusher_ugv", + "a3_soft_f_heli_mrap_01", + "a3_soft_f_heli_mrap_02", + "a3_soft_f_heli_mrap_03", + "a3_soft_f_heli_quadbike", + "a3_soft_f_heli_suv", + "a3_soft_f_heli_truck", + "a3_soft_f_hemtt", + "a3_soft_f_kart_kart_01", + "a3_soft_f_mrap_01", + "a3_soft_f_mrap_02", + "a3_soft_f_mrap_03", + "a3_soft_f_offroad_01", + "a3_soft_f_quadbike", + "a3_soft_f_suv", + "a3_soft_f_truck", + "a3_soft_f_truckheavy", + "a3_sounds_f", + "a3_sounds_f_bootcamp", + "a3_sounds_f_epb", + "a3_sounds_f_epc", + "a3_static_f", + "a3_static_f_beta_mortar_01", + "a3_static_f_gamma", + "a3_static_f_gamma_aa", + "a3_static_f_gamma_at", + "a3_static_f_gamma_mortar_01", + "a3_static_f_mortar_01", + "a3_structures_f", + "a3_structures_f_bootcamp_civ_camping", + "a3_structures_f_bootcamp_civ_sportsgrounds", + "a3_structures_f_bootcamp_ind_cargo", + "a3_structures_f_bootcamp_items_electronics", + "a3_structures_f_bootcamp_items_food", + "a3_structures_f_bootcamp_items_sport", + "a3_structures_f_bootcamp_system", + "a3_structures_f_bootcamp_training", + "a3_structures_f_bootcamp_vr_blocks", + "a3_structures_f_bootcamp_vr_coverobjects", + "a3_structures_f_bootcamp_vr_helpers", + "a3_structures_f_bridges", + "a3_structures_f_civ", + "a3_structures_f_civ_accessories", + "a3_structures_f_civ_ancient", + "a3_structures_f_civ_belltowers", + "a3_structures_f_civ_calvaries", + "a3_structures_f_civ_camping", + "a3_structures_f_civ_chapels", + "a3_structures_f_civ_constructions", + "a3_structures_f_civ_dead", + "a3_structures_f_civ_garbage", + "a3_structures_f_civ_graffiti", + "a3_structures_f_civ_infoboards", + "a3_structures_f_civ_kiosks", + "a3_structures_f_civ_lamps", + "a3_structures_f_civ_market", + "a3_structures_f_civ_offices", + "a3_structures_f_civ_pavements", + "a3_structures_f_civ_playground", + "a3_structures_f_civ_sportsgrounds", + "a3_structures_f_civ_statues", + "a3_structures_f_civ_tourism", + "a3_structures_f_dominants", + "a3_structures_f_dominants_amphitheater", + "a3_structures_f_dominants_castle", + "a3_structures_f_dominants_church", + "a3_structures_f_dominants_hospital", + "a3_structures_f_dominants_lighthouse", + "a3_structures_f_dominants_wip", + "a3_structures_f_epa_civ_camping", + "a3_structures_f_epa_civ_constructions", + "a3_structures_f_epa_items_electronics", + "a3_structures_f_epa_items_food", + "a3_structures_f_epa_items_medical", + "a3_structures_f_epa_items_tools", + "a3_structures_f_epa_items_vessels", + "a3_structures_f_epa_mil_scrapyard", + "a3_structures_f_epa_walls", + "a3_structures_f_epb_civ_accessories", + "a3_structures_f_epb_civ_camping", + "a3_structures_f_epb_civ_dead", + "a3_structures_f_epb_civ_garbage", + "a3_structures_f_epb_civ_graffiti", + "a3_structures_f_epb_civ_playground", + "a3_structures_f_epb_furniture", + "a3_structures_f_epb_items_documents", + "a3_structures_f_epb_items_luggage", + "a3_structures_f_epb_items_military", + "a3_structures_f_epb_items_vessels", + "a3_structures_f_epb_naval_fishing", + "a3_structures_f_epc_civ_accessories", + "a3_structures_f_epc_civ_camping", + "a3_structures_f_epc_civ_garbage", + "a3_structures_f_epc_civ_infoboards", + "a3_structures_f_epc_civ_kiosks", + "a3_structures_f_epc_civ_playground", + "a3_structures_f_epc_civ_tourism", + "a3_structures_f_epc_dominants_ghosthotel", + "a3_structures_f_epc_dominants_stadium", + "a3_structures_f_epc_furniture", + "a3_structures_f_epc_items_documents", + "a3_structures_f_epc_items_electronics", + "a3_structures_f_epc_walls", + "a3_structures_f_furniture", + "a3_structures_f_heli_civ_accessories", + "a3_structures_f_heli_civ_constructions", + "a3_structures_f_heli_civ_garbage", + "a3_structures_f_heli_civ_market", + "a3_structures_f_heli_furniture", + "a3_structures_f_heli_ind_airport", + "a3_structures_f_heli_ind_cargo", + "a3_structures_f_heli_ind_machines", + "a3_structures_f_heli_items_airport", + "a3_structures_f_heli_items_electronics", + "a3_structures_f_heli_items_food", + "a3_structures_f_heli_items_luggage", + "a3_structures_f_heli_items_sport", + "a3_structures_f_heli_items_tools", + "a3_structures_f_heli_vr_helpers", + "a3_structures_f_households", + "a3_structures_f_households_addons", + "a3_structures_f_households_house_big01", + "a3_structures_f_households_house_big02", + "a3_structures_f_households_house_shop01", + "a3_structures_f_households_house_shop02", + "a3_structures_f_households_house_small01", + "a3_structures_f_households_house_small02", + "a3_structures_f_households_house_small03", + "a3_structures_f_households_slum", + "a3_structures_f_households_stone_big", + "a3_structures_f_households_stone_shed", + "a3_structures_f_households_stone_small", + "a3_structures_f_households_wip", + "a3_structures_f_ind", + "a3_structures_f_ind_airport", + "a3_structures_f_ind_cargo", + "a3_structures_f_ind_carservice", + "a3_structures_f_ind_concretemixingplant", + "a3_structures_f_ind_crane", + "a3_structures_f_ind_dieselpowerplant", + "a3_structures_f_ind_factory", + "a3_structures_f_ind_fuelstation", + "a3_structures_f_ind_fuelstation_small", + "a3_structures_f_ind_pipes", + "a3_structures_f_ind_powerlines", + "a3_structures_f_ind_reservoirtank", + "a3_structures_f_ind_shed", + "a3_structures_f_ind_solarpowerplant", + "a3_structures_f_ind_tank", + "a3_structures_f_ind_transmitter_tower", + "a3_structures_f_ind_wavepowerplant", + "a3_structures_f_ind_windmill", + "a3_structures_f_ind_windpowerplant", + "a3_structures_f_items", + "a3_structures_f_items_cans", + "a3_structures_f_items_documents", + "a3_structures_f_items_electronics", + "a3_structures_f_items_gadgets", + "a3_structures_f_items_luggage", + "a3_structures_f_items_medical", + "a3_structures_f_items_military", + "a3_structures_f_items_stationery", + "a3_structures_f_items_tools", + "a3_structures_f_items_valuables", + "a3_structures_f_items_vessels", + "a3_structures_f_kart_civ_sportsgrounds", + "a3_structures_f_kart_mil_flags", + "a3_structures_f_kart_signs_companies", + "a3_structures_f_mil", + "a3_structures_f_mil_bagbunker", + "a3_structures_f_mil_bagfence", + "a3_structures_f_mil_barracks", + "a3_structures_f_mil_bunker", + "a3_structures_f_mil_cargo", + "a3_structures_f_mil_flags", + "a3_structures_f_mil_fortification", + "a3_structures_f_mil_helipads", + "a3_structures_f_mil_offices", + "a3_structures_f_mil_radar", + "a3_structures_f_mil_scrapyard", + "a3_structures_f_mil_shelters", + "a3_structures_f_mil_tenthangar", + "a3_structures_f_naval", + "a3_structures_f_naval_buoys", + "a3_structures_f_naval_fishing", + "a3_structures_f_naval_piers", + "a3_structures_f_naval_rowboats", + "a3_structures_f_research", + "a3_structures_f_signs_companies", + "a3_structures_f_system", + "a3_structures_f_training", + "a3_structures_f_training_invisibletarget", + "a3_structures_f_walls", + "a3_structures_f_wrecks", + "a3_supplies_f_heli", + "a3_supplies_f_heli_bladders", + "a3_supplies_f_heli_cargonets", + "a3_supplies_f_heli_fuel", + "a3_supplies_f_heli_slingload", + "a3_uav_f_characters_f_gamma", + "a3_uav_f_weapons_f_gamma_ammoboxes", + "a3_ui_f", + "a3_ui_f_bootcamp", + "a3_ui_f_curator", + "a3_ui_f_heli", + "a3_ui_f_kart", + "a3_uifonts_f", + "a3_weapons_f", + "a3_weapons_f_aaf", + "a3_weapons_f_acc", + "a3_weapons_f_ammoboxes", + "a3_weapons_f_beta", + "a3_weapons_f_beta_acc", + "a3_weapons_f_beta_ammoboxes", + "a3_weapons_f_beta_ebr", + "a3_weapons_f_beta_rifles_khaybar", + "a3_weapons_f_beta_rifles_mx", + "a3_weapons_f_beta_rifles_trg20", + "a3_weapons_f_bootcamp", + "a3_weapons_f_bootcamp_ammoboxes", + "a3_weapons_f_bootcamp_longrangerifles_gm6", + "a3_weapons_f_bootcamp_longrangerifles_m320", + "a3_weapons_f_csat", + "a3_weapons_f_dummyweapons", + "a3_weapons_f_ebr", + "a3_weapons_f_epa", + "a3_weapons_f_epa_acc", + "a3_weapons_f_epa_ammoboxes", + "a3_weapons_f_epa_ebr", + "a3_weapons_f_epa_longrangerifles_dmr_01", + "a3_weapons_f_epa_longrangerifles_gm6", + "a3_weapons_f_epa_rifles_mx", + "a3_weapons_f_epb", + "a3_weapons_f_epb_acc", + "a3_weapons_f_epb_ammoboxes", + "a3_weapons_f_epb_longrangerifles_gm3", + "a3_weapons_f_epb_longrangerifles_m320", + "a3_weapons_f_epb_rifles_mx_black", + "a3_weapons_f_epc", + "a3_weapons_f_explosives", + "a3_weapons_f_fia", + "a3_weapons_f_gamma", + "a3_weapons_f_gamma_acc", + "a3_weapons_f_gamma_ammoboxes", + "a3_weapons_f_gamma_items", + "a3_weapons_f_headgear", + "a3_weapons_f_itemholders", + "a3_weapons_f_items", + "a3_weapons_f_kart", + "a3_weapons_f_kart_pistols_pistol_signal_f", + "a3_weapons_f_launchers_law", + "a3_weapons_f_launchers_nlaw", + "a3_weapons_f_launchers_titan", + "a3_weapons_f_longrangerifles_gm6", + "a3_weapons_f_longrangerifles_m320", + "a3_weapons_f_machineguns_m200", + "a3_weapons_f_machineguns_zafir", + "a3_weapons_f_nato", + "a3_weapons_f_pistols_acpc2", + "a3_weapons_f_pistols_p07", + "a3_weapons_f_pistols_pdw2000", + "a3_weapons_f_pistols_pistol_heavy_01", + "a3_weapons_f_pistols_pistol_heavy_02", + "a3_weapons_f_pistols_rook40", + "a3_weapons_f_rifles_khaybar", + "a3_weapons_f_rifles_mk20", + "a3_weapons_f_rifles_mx", + "a3_weapons_f_rifles_sdar", + "a3_weapons_f_rifles_smg_02", + "a3_weapons_f_rifles_trg20", + "a3_weapons_f_rifles_vector", + "a3_weapons_f_uniforms", + "a3_weapons_f_vests", + "a3data", + "map_vr", + "extended_eventhandlers", "CBA_UI", "CBA_XEH", "CBA_XEH_A3" + }; + author[] = {"ACE Team"}; + authorUrl = ""; + versionDesc = "A.C.E."; + versionAct = "['MAIN',_this] execVM '\z\ace\addons\main\about.sqf';"; + VERSION_CONFIG; }; - author[] = {"ACE Team"}; - authorUrl = ""; - versionDesc = "A.C.E."; - versionAct = "['MAIN',_this] execVM '\z\ace\addons\main\about.sqf';"; - VERSION_CONFIG; - }; }; class CfgMods { - class PREFIX { - dir = "@ACE"; - name = "Core - Advanced Combat Environment"; - picture = "A3\Ui_f\data\Logos\arma3_expansion_alpha_ca"; - hidePicture = "true"; - hideName = "true"; - actionName = "Website"; - action = "http://ace.dev-heaven.net"; - description = "Bugtracker: "; - }; + class PREFIX { + dir = "@ACE"; + name = "Core - Advanced Combat Environment"; + picture = "A3\Ui_f\data\Logos\arma3_expansion_alpha_ca"; + hidePicture = "true"; + hideName = "true"; + actionName = "Website"; + action = "http://ace.dev-heaven.net"; + description = "Bugtracker: "; + }; }; class CfgSettings { - class CBA { - class Versioning { - class PREFIX { - level = DEFAULT_VERSIONING_LEVEL; - handler = "ace_common_fnc_mismatch"; - class Dependencies { - CBA[]={"cba_main", {1,0,0}, "true"}; - XEH[]={"cba_xeh", {1,0,0}, "true"}; + class CBA { + class Versioning { + class PREFIX { + level = DEFAULT_VERSIONING_LEVEL; + handler = "ace_common_fnc_mismatch"; + class Dependencies { + CBA[]={"cba_main", {1,0,0}, "true"}; + XEH[]={"cba_xeh", {1,0,0}, "true"}; + }; + }; }; - }; - }; -/* + /* class Registry { - class PREFIX { + class PREFIX { removed[] = {}; - }; }; -*/ - }; + }; + */ + }; }; #include "CfgModuleCategories.hpp" diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 293e91cb35..d23a02225f 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -14,7 +14,6 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"]; ["medical_woundUpdateRequest", FUNC(onWoundUpdateRequest)] call ace_common_fnc_addEventHandler; // Initialize all effects -// @todo: make this a macro? _fnc_createEffect = { private ["_type", "_layer", "_default"]; _type = _this select 0; @@ -112,7 +111,6 @@ GVAR(effectTimeBlood) = time; }; // Bleeding Indicator - // @todo: redo this after initial release if (damage ACE_player > 0.1 and GVAR(effectTimeBlood) + 6 < time) then { GVAR(effectTimeBlood) = time; [500 * damage ACE_player] call BIS_fnc_bloodEffect; diff --git a/addons/medical/functions/fnc_actioncheckBloodPressure.sqf b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf similarity index 57% rename from addons/medical/functions/fnc_actioncheckBloodPressure.sqf rename to addons/medical/functions/fnc_actionCheckBloodPressure.sqf index 136501fa52..7db155483e 100644 --- a/addons/medical/functions/fnc_actioncheckBloodPressure.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf @@ -1,21 +1,18 @@ /* - * Author: Glowbal - * Action for checking the blood pressure of the patient - * - * Arguments: - * 0: The medic - * 1: The patient - * - * Return Value: - * NONE - * - * Public: No - */ - +* Author: Glowbal +* Action for checking the blood pressure of the patient +* +* Arguments: +* 0: The medic +* 1: The patient +* +* Return Value: +* NONE +* +* Public: No +*/ #include "script_component.hpp" - private ["_caller","_target"]; _caller = _this select 0; _target = _this select 1; - [[_caller, _target], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_actionCheckPulse.sqf b/addons/medical/functions/fnc_actionCheckPulse.sqf index 70c0bf7e03..9fa79b2183 100644 --- a/addons/medical/functions/fnc_actionCheckPulse.sqf +++ b/addons/medical/functions/fnc_actionCheckPulse.sqf @@ -1,21 +1,18 @@ /* - * Author: Glowbal - * Action for checking the pulse or heart rate of the patient - * - * Arguments: - * 0: The medic - * 1: The patient - * - * Return Value: - * NONE - * - * Public: No - */ - - #include "script_component.hpp" - +* Author: Glowbal +* Action for checking the pulse or heart rate of the patient +* +* Arguments: +* 0: The medic +* 1: The patient +* +* Return Value: +* NONE +* +* Public: No +*/ +#include "script_component.hpp" private ["_caller","_target","_title","_content"]; _caller = _this select 0; _target = _this select 1; - [[_caller, _target], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf index 54a94ad21f..037e0105e9 100644 --- a/addons/movement/XEH_postInit.sqf +++ b/addons/movement/XEH_postInit.sqf @@ -18,20 +18,17 @@ }] call EFUNC(common,addEventHandler); -["ACE3", - localize "STR_ACE_Movement_Climb", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if (ACE_player != (vehicle ACE_player)) exitWith {false}; +["ACE3", QGVAR(climb), localize "STR_ACE_Movement_Climb", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if (ACE_player != (vehicle ACE_player)) exitWith {false}; - // Statement - [ACE_player] call FUNC(climb); - true - }, - [47, [false, true, false]], //DIK_V + CTRL//STRG - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player] call FUNC(climb); + true +}, +{false}, +[47, [false, true, false]], false] call cba_fnc_addKeybind; //DIK_V + CTRL//STRG diff --git a/addons/nametags/XEH_postInit.sqf b/addons/nametags/XEH_postInit.sqf index 1ad0e38879..2de39f5807 100644 --- a/addons/nametags/XEH_postInit.sqf +++ b/addons/nametags/XEH_postInit.sqf @@ -7,23 +7,20 @@ if (!hasInterface) exitWith {}; // Add keybinds -["ACE3", - localize "STR_ACE_NameTags_ShowNames", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; +["ACE3", QGVAR(showNameTags), localize "STR_ACE_NameTags_ShowNames", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Statement - GVAR(ShowNamesTime) = time; - if (call FUNC(canShow)) then{ call FUNC(doShow); }; - // Return false so it doesn't block other actions - false - }, - [29, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + GVAR(ShowNamesTime) = time; + if (call FUNC(canShow)) then{ call FUNC(doShow); }; + // Return false so it doesn't block other actions + false +}, +{false}, +[29, [false, false, false]], false] call cba_fnc_addKeybind; //LeftControl Key // Draw handle diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf index 7513b1df16..0707104fad 100644 --- a/addons/nightvision/XEH_postInitClient.sqf +++ b/addons/nightvision/XEH_postInitClient.sqf @@ -37,8 +37,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; ["playerTurretChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); // Add keybinds -["ACE3", -localize "STR_ACE_NightVision_IncreaseNVGBrightness", +["ACE3", QGVAR(IncreaseNVGBrightness), localize "STR_ACE_NightVision_IncreaseNVGBrightness", { // Conditions: canInteract _exceptions = [QEGVAR(captives,isNotEscorting)]; @@ -50,13 +49,10 @@ localize "STR_ACE_NightVision_IncreaseNVGBrightness", [ACE_player, 1] call FUNC(changeNVGBrightness); true }, -[201, [false, false, true]], //PageUp + ALT -false, -"keydown" -] call cba_fnc_registerKeybind; +{false}, +[201, [false, false, true]], false] call cba_fnc_addKeybind; //PageUp + ALT -["ACE3", -localize "STR_ACE_NightVision_DecreaseNVGBrightness", +["ACE3", QGVAR(DecreaseNVGBrightness), localize "STR_ACE_NightVision_DecreaseNVGBrightness", { // Conditions: canInteract _exceptions = [QEGVAR(captives,isNotEscorting)]; @@ -68,7 +64,5 @@ localize "STR_ACE_NightVision_DecreaseNVGBrightness", [ACE_player, -1] call FUNC(changeNVGBrightness); true }, -[209, [false, false, true]], //PageDown + ALT -false, -"keydown" -] call cba_fnc_registerKeybind; +{false}, +[209, [false, false, true]], false] call cba_fnc_addKeybind; //PageDown + ALT diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf index 6d0014c2a2..a1b3dec206 100644 --- a/addons/overheating/XEH_postInit.sqf +++ b/addons/overheating/XEH_postInit.sqf @@ -4,22 +4,19 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", - localize "STR_ACE_Overheating_UnjamWeapon", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon) && - {currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])} - ) exitWith {false}; +["ACE3", QGVAR(unjamWeapon), localize "STR_ACE_Overheating_UnjamWeapon", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon) && + {currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])} + ) exitWith {false}; - // Statement - [ACE_player, currentMuzzle ACE_player, false] call FUNC(clearJam); - true - }, - [19, [true, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, currentMuzzle ACE_player, false] call FUNC(clearJam); + true +}, +{false}, +[19, [true, false, false]], false] call cba_fnc_addKeybind; //R Key diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index a15e125edd..71e35910b9 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -16,26 +16,28 @@ #include "script_component.hpp" if (!hasInterface) exitWith {}; -["ACE3", localize "STR_ACE_Parachute_showAltimeter", +["ACE3", QGVAR(showAltimeter), 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); + // 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 +}, +{false}, +[24, false, false, false], false] call CALLSTACK(cba_fnc_addKeybind); 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); - }; + 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 diff --git a/addons/parachute/config.cpp b/addons/parachute/config.cpp index 924c8ccb2c..78ca51fb97 100644 --- a/addons/parachute/config.cpp +++ b/addons/parachute/config.cpp @@ -49,7 +49,7 @@ class CfgVehicles { 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 + // backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable //Bis broke this in 1.40 ParachuteClass = "NonSteerable_Parachute_F"; maximumLoad = 0; mass = 100; diff --git a/addons/realisticnames/config.cpp b/addons/realisticnames/config.cpp index ea1318686b..e7a7984721 100644 --- a/addons/realisticnames/config.cpp +++ b/addons/realisticnames/config.cpp @@ -223,43 +223,46 @@ class CfgVehicles { class B_Truck_01_Repair_F: B_Truck_01_mover_F { displayName = "$STR_ACE_RealisticNames_Truck_01_Repair_Name"; }; - - class Truck_02_base_F; - class O_Truck_02_transport_F: Truck_02_base_F { + class Truck_02_transport_base_F; + class O_Truck_02_transport_F: Truck_02_transport_base_F { displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name"; }; + class Truck_02_base_F; class O_Truck_02_covered_F: Truck_02_base_F { displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name"; }; - class O_Truck_02_ammo_F: Truck_02_base_F { + class Truck_02_Ammo_base_F; + class O_Truck_02_ammo_F: Truck_02_Ammo_base_F { displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name"; }; - class O_Truck_02_fuel_F: Truck_02_base_F { + class Truck_02_fuel_base_F; + class O_Truck_02_fuel_F: Truck_02_fuel_base_F { displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name"; }; - class O_Truck_02_box_F: Truck_02_base_F { + class Truck_02_box_base_F; + class O_Truck_02_box_F: Truck_02_box_base_F { displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name"; }; - class O_Truck_02_medical_F: O_Truck_02_box_F { + class Truck_02_medical_base_F; + class O_Truck_02_medical_F: Truck_02_medical_base_F { displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name"; }; - - class I_Truck_02_transport_F: Truck_02_base_F { + class I_Truck_02_transport_F: Truck_02_transport_base_F { displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name"; }; class I_Truck_02_covered_F: Truck_02_base_F { displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name"; }; - class I_Truck_02_ammo_F: Truck_02_base_F { + class I_Truck_02_ammo_F: Truck_02_Ammo_base_F { displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name"; }; - class I_Truck_02_fuel_F: Truck_02_base_F { + class I_Truck_02_fuel_F: Truck_02_fuel_base_F { displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name"; }; - class I_Truck_02_box_F: Truck_02_base_F { + class I_Truck_02_box_F: Truck_02_box_base_F { displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name"; }; - class I_Truck_02_medical_F: I_Truck_02_box_F { + class I_Truck_02_medical_F: Truck_02_medical_base_F { displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name"; }; @@ -306,13 +309,12 @@ class CfgVehicles { displayName = "$STR_ACE_RealisticNames_Heli_Light_01_civil_Name"; }; - class B_Heli_Transport_03_base_F; - class B_Heli_Transport_03_F: B_Heli_Transport_03_base_F { + class Heli_Transport_03_base_F; + class B_Heli_Transport_03_F: Heli_Transport_03_base_F { displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_Name"; }; - - class B_Heli_Transport_03_unarmed_base_F: B_Heli_Transport_03_base_F {}; - class B_Heli_Transport_03_unarmed_F: B_Heli_Transport_03_unarmed_base_F { + class Heli_Transport_03_unarmed_base_F; + class B_Heli_Transport_03_unarmed_F: Heli_Transport_03_unarmed_base_F { displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_unarmed_Name"; }; @@ -320,17 +322,18 @@ class CfgVehicles { class O_Heli_Light_02_F: Heli_Light_02_base_F { displayName = "$STR_ACE_RealisticNames_Heli_Light_02_Name"; }; - class O_Heli_Light_02_unarmed_F: Heli_Light_02_base_F { + class Heli_Light_02_unarmed_base_F; + class O_Heli_Light_02_unarmed_F: Heli_Light_02_unarmed_base_F { displayName = "$STR_ACE_RealisticNames_Heli_Light_02_unarmed_Name"; }; - class I_Heli_light_03_base_F; - class I_Heli_light_03_F: I_Heli_light_03_base_F { + class Heli_light_03_base_F; + class I_Heli_light_03_F: Heli_light_03_base_F { displayName = "$STR_ACE_RealisticNames_Heli_light_03_Name"; }; - class I_Heli_light_03_unarmed_base_F; - class I_Heli_light_03_unarmed_F: I_Heli_light_03_unarmed_base_F { + class Heli_light_03_unarmed_base_F; + class I_Heli_light_03_unarmed_F: Heli_light_03_unarmed_base_F { displayName = "$STR_ACE_RealisticNames_Heli_light_03_unarmed_Name"; }; diff --git a/addons/reload/CfgEventHandlers.hpp b/addons/reload/CfgEventHandlers.hpp index 8de6a01f06..754ff0db87 100644 --- a/addons/reload/CfgEventHandlers.hpp +++ b/addons/reload/CfgEventHandlers.hpp @@ -14,7 +14,7 @@ class Extended_PostInit_EventHandlers { class Extended_Take_EventHandlers { class CAManBase { class ACE_AmmoIndicatorReload { - clientTake = QUOTE(if (_this select 0 == ACE_player && {(_this select 1) in [ARR_3(uniformContainer (_this select 0), vestContainer (_this select 0), backpackContainer (_this select 0))]} && {_this select 2 == currentMagazine (_this select 0)}) then {[ARR_3(_this select 0, vehicle (_this select 0), true)] call FUNC(checkAmmo)};); + clientTake = QUOTE(if (_this select 0 == ACE_player && {(_this select 1) in [ARR_3(uniformContainer (_this select 0), vestContainer (_this select 0), backpackContainer (_this select 0))]} && {_this select 2 == currentMagazine (_this select 0)}) then {[ARR_2(_this select 0, vehicle (_this select 0))] call FUNC(displayAmmo)};); }; }; }; diff --git a/addons/reload/CfgMagazines.hpp b/addons/reload/CfgMagazines.hpp new file mode 100644 index 0000000000..6811a49494 --- /dev/null +++ b/addons/reload/CfgMagazines.hpp @@ -0,0 +1,12 @@ +class CfgMagazines { + + class CA_Magazine; + class 150Rnd_762x51_Box : CA_Magazine { + ACE_isBelt = 1; + }; + + class 100Rnd_65x39_caseless_mag; + class 200Rnd_65x39_cased_Box : 100Rnd_65x39_caseless_mag { + ACE_isBelt = 1; + }; +}; \ No newline at end of file diff --git a/addons/reload/CfgVehicles.hpp b/addons/reload/CfgVehicles.hpp new file mode 100644 index 0000000000..84333a1a09 --- /dev/null +++ b/addons/reload/CfgVehicles.hpp @@ -0,0 +1,35 @@ +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_Actions { + class ACE_Weapon { + class ACE_LinkBelt { + displayName = "$STR_ACE_Reload_LinkBelt"; + distance = 2.0; + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canLinkBelt)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(startLinkingBelt)); + }; + class ACE_CheckAmmo { + displayName = "$STR_ACE_Reload_checkAmmo"; + distance = 2.0; + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canCheckAmmo)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(checkAmmo)); + }; + }; + }; + }; + + class LandVehicle; + class StaticWeapon: LandVehicle { + class ACE_Actions { + class ACE_MainActions { + class ACE_CheckAmmo { + displayName = "$STR_ACE_Reload_checkAmmo"; + distance = 2.0; + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canCheckAmmo)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(checkAmmo)); + }; + }; + }; + }; +}; diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf index d40e5e0442..6ea3e01326 100644 --- a/addons/reload/XEH_postInit.sqf +++ b/addons/reload/XEH_postInit.sqf @@ -4,21 +4,63 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", - localize "STR_ACE_Reload_checkAmmo", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon) || - {(vehicle ACE_player) isKindOf 'StaticWeapon'}) exitWith {false}; +["ACE3", QGVAR(checkAmmo), localize "STR_ACE_Reload_checkAmmo", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon) || + {(vehicle ACE_player) isKindOf 'StaticWeapon'}) exitWith {false}; - // Statement - [ACE_player, vehicle ACE_player, false] call FUNC(checkAmmo); - true - }, - [19, [false, true, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player] call FUNC(checkAmmo); + true +}, +{false}, +[19, [false, true, false]], false] call cba_fnc_addKeybind; + + +// Listen for attempts to link ammo +["linkedAmmo", { + EXPLODE_3_PVT(_this,_receiver,_giver,_magazine); + diag_log "linkedAmmo"; + diag_log _this; + + private ["_magazineCfg","_magazineType"]; + _magazineType = currentMagazine _receiver; + _magazineCfg = configFile >> "CfgMagazines" >> _magazineType; + + // Return the magazine if it's the wrong type + if (_magazineType != (_magazine select 0)) exitWith { + ["returnedAmmo", [_giver], [_giver,_receiver,_magazine]] call EFUNC(common,targetEvent); + }; + + private ["_ammoCount","_ammoMissing","_ammoAdded","_ammoRemaining"]; + _ammoCount = _receiver ammo currentWeapon _receiver; + _ammoMissing = getNumber (_magazineCfg >> "count") - _ammoCount; + + // Return the magazine if the belt is full or empty + if ((_ammoCount == 0) || _ammoMissing == 0) exitWith { + ["returnedAmmo", [_giver], [_giver,_receiver,_magazine]] call EFUNC(common,targetEvent); + }; + + // Add the ammo + _ammoAdded = _ammoMissing min (_magazine select 1); + _receiver setAmmo [currentWeapon _receiver, _ammoCount + _ammoAdded]; + + if ((_magazine select 1) - _ammoAdded > 0) then { + ["returnedAmmo", [_giver], [_giver,_receiver,[_magazineType,(_magazine select 1) - _ammoAdded]]] call EFUNC(common,targetEvent); + }; + +}] call EFUNC(common,addEventhandler); + + +// Listen for returned magazines +["returnedAmmo", { + EXPLODE_3_PVT(_this,_receiver,_giver,_magazine); + diag_log "returnedAmmo"; + diag_log _this; + + _receiver addMagazine _magazine; +}] call EFUNC(common,addEventhandler); diff --git a/addons/reload/XEH_preInit.sqf b/addons/reload/XEH_preInit.sqf index b5c8e45d35..278abf7bd2 100644 --- a/addons/reload/XEH_preInit.sqf +++ b/addons/reload/XEH_preInit.sqf @@ -2,6 +2,10 @@ ADDON = false; +PREP(canCheckAmmo); +PREP(canLinkBelt); PREP(checkAmmo); +PREP(displayAmmo); +PREP(startLinkingBelt); ADDON = true; diff --git a/addons/reload/config.cpp b/addons/reload/config.cpp index 6e0c14049d..932fe89840 100644 --- a/addons/reload/config.cpp +++ b/addons/reload/config.cpp @@ -5,13 +5,17 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common"}; - author[] = {"commy2","KoffeinFlummi"}; + requiredAddons[] = {"ace_interaction"}; + author[] = {"commy2","KoffeinFlummi","CAA-Picard"}; authorUrl = "https://github.com/commy2/"; VERSION_CONFIG; }; }; +#include "CfgVehicles.hpp" + +#include "CfgMagazines.hpp" + #include "CfgEventHandlers.hpp" #include "CfgActions.hpp" diff --git a/addons/reload/functions/fnc_canCheckAmmo.sqf b/addons/reload/functions/fnc_canCheckAmmo.sqf new file mode 100644 index 0000000000..3e83281b43 --- /dev/null +++ b/addons/reload/functions/fnc_canCheckAmmo.sqf @@ -0,0 +1,35 @@ +/* + * Author: CAA-Picard + * Check if the player can check the ammo of the target. + * + * Argument: + * 0: Player + * 1: Target + * + * Return value: + * Can link belt + */ +#include "script_component.hpp" + +EXPLODE_2_PVT(_this,_player,_target); + +// Return true for static weapons if they have been fired once +if (_target isKindOf "StaticWeapon") exitWith { + (currentMagazine _target) != "" +}; + +// Return false for all other vehicles +if !(_target isKindOf "CAManBase") exitWith {false}; + +// For men +if (currentWeapon _target == "") exitWith {false}; + +// Check if their current magazine is a belt +_magazineType = currentMagazine _target; +_magazineCfg = configFile >> "CfgMagazines" >> _magazineType; +if (getNumber (_magazineCfg >> "ACE_isBelt") == 1) exitWith {true}; + +// Check for rocket launchers +if (currentWeapon _target == secondaryWeapon _target) exitWith {true}; + +false diff --git a/addons/reload/functions/fnc_canLinkBelt.sqf b/addons/reload/functions/fnc_canLinkBelt.sqf new file mode 100644 index 0000000000..b06a69fafa --- /dev/null +++ b/addons/reload/functions/fnc_canLinkBelt.sqf @@ -0,0 +1,39 @@ +/* + * Author: CAA-Picard + * Check if the target has an MG equiped with belt system that the player can link + * + * Argument: + * 0: Player + * 1: Target + * + * Return value: + * Can link belt + */ +#include "script_component.hpp" + +EXPLODE_2_PVT(_this,_player,_target); + +if (vehicle _target != _target) exitWith {false}; + +private ["_magazineCfg","_magazineType"]; +_magazineType = currentMagazine _target; +_magazineCfg = configFile >> "CfgMagazines" >> _magazineType; +if (getNumber (_magazineCfg >> "ACE_isBelt") == 0) exitWith {false}; + +// Check if the ammo is not empty or full +private "_ammoCount"; +_ammoCount = _target ammo currentWeapon _target; + +// Exit if the belt is full or empty +if ((_ammoCount == 0) || (getNumber (_magazineCfg >> "count") - _ammoCount) == 0) exitWith {false}; + +// Check if the player has any of the same magazines +// Calculate max ammo +private "_maxAmmo"; +_maxAmmo = 0; + +{ + _maxAmmo = _maxAmmo max (_x select 1); +} forEach ([magazinesAmmo _player, {_this select 0 == _magazineType}] call EFUNC(common,filter)); + +_maxAmmo > 0 diff --git a/addons/reload/functions/fnc_checkAmmo.sqf b/addons/reload/functions/fnc_checkAmmo.sqf index fab1ebf333..7c24ff1ff3 100644 --- a/addons/reload/functions/fnc_checkAmmo.sqf +++ b/addons/reload/functions/fnc_checkAmmo.sqf @@ -1,13 +1,11 @@ /* - * Author: commy2 - * + * Author: commy2 and CAA-Picard * Count the ammo of the currently loaded magazine or count rifle grenades. Play animation and display message. - * + * * Argument: - * 0: The player (Object) - * 1: The vehicle (Object) - * 2: Skip the animation? Used after reloading (Bool) - * + * 0: Player + * 1: Target. Optional, if not suplied the player counts his personal or static weapon ammo + * * Return value: * Nothing */ @@ -15,87 +13,24 @@ #define COUNT_BARS 12 -private ["_unit", "_vehicle"]; +EXPLODE_1_PVT(_this,_unit); -_unit = _this select 0; -_vehicle = _this select 1; +private ["_target"]; +_target = vehicle _unit; -if (_unit != _vehicle && !(_vehicle isKindOf "StaticWeapon")) then { - _vehicle = _unit; +if (count _this > 1) then { + _target = _this select 1; +} else { + + // If the unit is on foot, count it's own ammo + if (_unit == _target) exitWith {}; + + // If it's mounted on a movile weapon, count it's own ammo + if !(_target isKindOf "StaticWeapon") then { + _target = _unit; + }; }; -[_vehicle, currentWeapon _vehicle, currentMuzzle _vehicle, currentMagazine _vehicle, _this select 2] spawn { - _vehicle = _this select 0; - _weapon = _this select 1; - _muzzle = _this select 2; - _magazine = _this select 3; - _skipDelay = _this select 4; +_unit playActionNow "Gear"; - if (currentWeapon _vehicle == "") exitWith {}; - if (typeName _muzzle != "STRING") then {_muzzle = _weapon}; - - _showNumber = false; - _ammo = 0; - _maxRounds = 1; - _count = 0; - - // not grenade launcher - if (_muzzle == _weapon) then { - _maxRounds = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count") max 1; - - _ammo = _vehicle ammo _weapon; - if (_maxRounds >= COUNT_BARS) then { - _count = round (COUNT_BARS * _ammo / _maxRounds); - - if (_ammo > 0) then {_count = _count max 1}; - if (_ammo < _maxRounds) then {_count = _count min (COUNT_BARS - 1)}; - } else { - _count = _ammo; - }; - - // grenade launcher - } else { - _showNumber = true; - - _count = if (_magazine != "") then { - {_x == _magazine} count (magazines _vehicle + [_magazine]) - } else { - {_x in getArray (configFile >> "CfgWeapons" >> _weapon >> _muzzle >> "Magazines")} count magazines _vehicle - }; - }; - - if !(_skipDelay) then { - _vehicle playActionNow "Gear"; - sleep 1 - }; - - _text = if (_showNumber) then { - parseText format ["%1x", _count] - } else { - _color = [ - 2 * (1 - _ammo / _maxRounds) min 1, - 2 * _ammo / _maxRounds min 1, - 00 - ]; - - _string = ""; - for "_a" from 1 to _count do { - _string = _string + "|"; - }; - _text = [_string, _color] call EFUNC(common,stringToColoredText); - - _string = ""; - for "_a" from (_count + 1) to (_maxRounds min COUNT_BARS) do { - _string = _string + "|"; - }; - - composeText [ - _text, - [_string, [0.5, 0.5, 0.5]] call EFUNC(common,stringToColoredText) - ] - }; - - _picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture"); - - [_text, _picture] call EFUNC(common,displayTextPicture); -}; +[FUNC(displayAmmo), [_target], 1, 0.1] call EFUNC(common,waitAndExecute); diff --git a/addons/reload/functions/fnc_displayAmmo.sqf b/addons/reload/functions/fnc_displayAmmo.sqf new file mode 100644 index 0000000000..07e1a4593a --- /dev/null +++ b/addons/reload/functions/fnc_displayAmmo.sqf @@ -0,0 +1,94 @@ +/* + * Author: commy2 and CAA-Picard + * Display the ammo of the currently loaded magazine of the target or count rifle grenades. + * + * Argument: + * 0: Target + * + * Return value: + * Nothing + */ +#include "script_component.hpp" + +#define COUNT_BARS 12 + +EXPLODE_1_PVT(_this,_target); + +private ["_weapon","_muzzle","_magazine","_showNumber","_ammo","_maxRounds","_count","_text","_color","_picture"]; + +_weapon = currentWeapon _target; +_muzzle = currentMuzzle _target; +_magazine = currentMagazine _target; + +// currentWeapon returns "" for static weapons before they are shot once +if (_target isKindOf "StaticWeapon") then { + if (_weapon == "") then { + if (count (weapons _target) == 1) then { + _weapon = (weapons _target) select 0; + _muzzle = _weapon; + }; + }; +}; + +if (_weapon == "") exitWith {}; +if (typeName _muzzle != "STRING") then {_muzzle = _weapon}; + +_showNumber = false; +_ammo = 0; +_maxRounds = 1; +_count = 0; + +// not grenade launcher +if (_muzzle == _weapon) then { + _maxRounds = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count") max 1; + + _ammo = _target ammo _weapon; + if (_maxRounds >= COUNT_BARS) then { + _count = round (COUNT_BARS * _ammo / _maxRounds); + + if (_ammo > 0) then {_count = _count max 1}; + if (_ammo < _maxRounds) then {_count = _count min (COUNT_BARS - 1)}; + } else { + _count = _ammo; + }; + +// grenade launcher +} else { + _showNumber = true; + + _count = if (_magazine != "") then { + {_x == _magazine} count (magazines _target + [_magazine]) + } else { + {_x in getArray (configFile >> "CfgWeapons" >> _weapon >> _muzzle >> "Magazines")} count magazines _target + }; +}; + +_text = if (_showNumber) then { + parseText format ["%1x", _count] +} else { + _color = [ + 2 * (1 - _ammo / _maxRounds) min 1, + 2 * _ammo / _maxRounds min 1, + 00 + ]; + + _string = ""; + for "_a" from 1 to _count do { + _string = _string + "|"; + }; + _text = [_string, _color] call EFUNC(common,stringToColoredText); + + _string = ""; + for "_a" from (_count + 1) to (_maxRounds min COUNT_BARS) do { + _string = _string + "|"; + }; + + composeText [ + _text, + [_string, [0.5, 0.5, 0.5]] call EFUNC(common,stringToColoredText) + ] +}; + +_picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture"); + +[_text, _picture] call EFUNC(common,displayTextPicture); diff --git a/addons/reload/functions/fnc_startLinkingBelt.sqf b/addons/reload/functions/fnc_startLinkingBelt.sqf new file mode 100644 index 0000000000..3b35a5a72a --- /dev/null +++ b/addons/reload/functions/fnc_startLinkingBelt.sqf @@ -0,0 +1,69 @@ +/* + * Author: CAA-Picard + * Start linking the belt + * + * Argument: + * 0: Player + * 1: Target + * + * Return value: + * None + */ +#include "script_component.hpp" + +EXPLODE_2_PVT(_this,_player,_target); + +if (vehicle _target != _target) exitWith {false}; + +private ["_magazineCfg","_magazineType"]; +_magazineType = currentMagazine _target; +_magazineCfg = configFile >> "CfgMagazines" >> _magazineType; +if (getNumber (_magazineCfg >> "ACE_isBelt") == 0) exitWith {false}; + +// Check if the ammo is not empty or full +private "_ammoCount"; +_ammoCount = _target ammo currentWeapon _target; + +// Exit if the belt is full or empty +if ((_ammoCount == 0) || (getNumber (_magazineCfg >> "count") - _ammoCount) == 0) exitWith {false}; + +// Check if the player has any of the same same magazines +// Calculate max ammo it can link +private "_maxAmmo"; +_maxAmmo = 0; + +{ + _maxAmmo = _maxAmmo max (_x select 1); +} forEach ([magazinesAmmo _player, {_this select 0 == _magazineType}] call EFUNC(common,filter)); + +if (_maxAmmo == 0) exitWith {}; + + +// Condition to call each frame +_condition = { + EXPLODE_2_PVT((_this select 0),_player,_target); + ([_player, _target] call EFUNC(common,canInteract)) && ((_player distance _target) < 3) && ((speed _target) < 1) +}; + +_onFinish = { + EXPLODE_3_PVT((_this select 0),_player,_target,_magazine); + + // Raise event on remote unit + ["linkedAmmo", [_target], [_target, _player, _magazine]] call EFUNC(common,targetEvent); +}; + +_onFailure = { + EXPLODE_3_PVT((_this select 0),_player,_target,_magazine); + [_caller, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); + + // Add back the magazine with the former ammo count + _player addMagazine _magazine; +}; + +[_player, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation); + +// Remove the magazine with maximum remaining ammo +[_player, _magazineType, _maxAmmo] call EFUNC(common,removeSpecificMagazine); + +// Call progress bar +[4, [_player, _target, [_magazineType, _maxAmmo]], _onFinish, _onFailure, (localize "STR_ACE_Reload_LinkingBelt"), _condition] call EFUNC(common,progressBar); diff --git a/addons/reload/stringtable.xml b/addons/reload/stringtable.xml index 1f39b0e743..18af718873 100644 --- a/addons/reload/stringtable.xml +++ b/addons/reload/stringtable.xml @@ -26,5 +26,11 @@ Munições Боеприпасы + + Link belt + + + Linking belt... + diff --git a/addons/resting/XEH_postInit.sqf b/addons/resting/XEH_postInit.sqf index 0d999bab86..18c3409e38 100644 --- a/addons/resting/XEH_postInit.sqf +++ b/addons/resting/XEH_postInit.sqf @@ -4,24 +4,21 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", - localize "STR_ACE_Resting_RestWeapon", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon) && - {inputAction 'reloadMagazine' == 0} && - {!weaponLowered ACE_player} && - {speed ACE_player < 1}) exitWith {false}; +["ACE3", QGVAR(RestWeapon), localize "STR_ACE_Resting_RestWeapon", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon) && + {inputAction 'reloadMagazine' == 0} && + {!weaponLowered ACE_player} && + {speed ACE_player < 1}) exitWith {false}; - // Statement - [ACE_player, vehicle ACE_player, currentWeapon ACE_player] call FUNC(restWeapon); - // Return false so it doesn't block other actions - false - }, - [15, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, vehicle ACE_player, currentWeapon ACE_player] call FUNC(restWeapon); + // Return false so it doesn't block other actions + false +}, +{false}, +[15, [false, false, false]], false] call cba_fnc_addKeybind; diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index 8ae1155d53..549195b188 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -2,24 +2,21 @@ #include "script_component.hpp" //["Soldier", {_player = ACE_player; if (currentWeapon _player in (_player getVariable [QGVAR(safedWeapons), []])) then {[false] call FUNC(setSafeModeVisual)}] call EFUNC(common,addInfoDisplayEventHandler); - //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier" +//@todo addEventHandler infoDisplayChanged with select 1 == "Soldier" // Add keybinds -["ACE3", - localize "STR_ACE_SafeMode_SafeMode", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(safeMode), localize "STR_ACE_SafeMode_SafeMode", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety); - true - }, - [41, [false, true, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety); + true +}, +{false}, +[41, [false, true, false]], false] call cba_fnc_addKeybind; diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index 8de7ff8af0..a884292416 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -33,78 +33,66 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", - localize "STR_ACE_Scopes_AdjustUp", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - [ACE_player] call FUNC(inventoryCheck); - if !([ACE_player, 0, 0.1] call FUNC(canAdjustScope)) exitWith {false}; +["ACE3", QGVAR(AdjustUp), localize "STR_ACE_Scopes_AdjustUp", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + [ACE_player] call FUNC(inventoryCheck); + if !([ACE_player, 0, 0.1] call FUNC(canAdjustScope)) exitWith {false}; - // Statement - [ACE_player, 0, 0.1] call FUNC(adjustScope); - true - }, - [201, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, 0, 0.1] call FUNC(adjustScope); + true +}, +{false}, +[201, [false, false, false]], false] call cba_fnc_addKeybind; -["ACE3", - localize "STR_ACE_Scopes_AdjustDown", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - [ACE_player] call FUNC(inventoryCheck); - if !([ACE_player, 0, -0.1] call FUNC(canAdjustScope)) exitWith {false}; +["ACE3", QGVAR(AdjustDown), localize "STR_ACE_Scopes_AdjustDown", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + [ACE_player] call FUNC(inventoryCheck); + if !([ACE_player, 0, -0.1] call FUNC(canAdjustScope)) exitWith {false}; - // Statement - [ACE_player, 0, -0.1] call FUNC(adjustScope); - true - }, - [209, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, 0, -0.1] call FUNC(adjustScope); + true +}, +{false}, +[209, [false, false, false]], false] call cba_fnc_addKeybind; -["ACE3", - localize "STR_ACE_Scopes_AdjustLeft", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - [ACE_player] call FUNC(inventoryCheck); - if !([ACE_player, -0.1, 0] call FUNC(canAdjustScope)) exitWith {false}; +["ACE3", QGVAR(AdjustLeft), localize "STR_ACE_Scopes_AdjustLeft", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + [ACE_player] call FUNC(inventoryCheck); + if !([ACE_player, -0.1, 0] call FUNC(canAdjustScope)) exitWith {false}; - // Statement - [ACE_player, -0.1, 0] call FUNC(adjustScope); - true - }, - [209, [false, true, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, -0.1, 0] call FUNC(adjustScope); + true +}, +{false}, +[209, [false, true, false]], false] call cba_fnc_addKeybind; -["ACE3", - localize "STR_ACE_Scopes_AdjustRight", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - [ACE_player] call FUNC(inventoryCheck); - if !([ACE_player, 0.1, 0] call FUNC(canAdjustScope)) exitWith {false}; +["ACE3", QGVAR(AdjustRight), localize "STR_ACE_Scopes_AdjustRight", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + [ACE_player] call FUNC(inventoryCheck); + if !([ACE_player, 0.1, 0] call FUNC(canAdjustScope)) exitWith {false}; - // Statement - [ACE_player, 0.1, 0] call FUNC(adjustScope); - true - }, - [201, [false, true, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, 0.1, 0] call FUNC(adjustScope); + true +}, +{false}, +[201, [false, true, false]], false] call cba_fnc_addKeybind; diff --git a/addons/smallarms/CfgWeapons.hpp b/addons/smallarms/CfgWeapons.hpp index 8c42847bd8..c0f4b4daef 100644 --- a/addons/smallarms/CfgWeapons.hpp +++ b/addons/smallarms/CfgWeapons.hpp @@ -1,6 +1,7 @@ class Mode_SemiAuto; class Mode_Burst; class Mode_FullAuto; +class MuzzleSlot; // config inheritance of weapon slot info v1.32 class SlotInfo; @@ -21,7 +22,7 @@ class CfgWeapons { class RifleCore; class Rifle: RifleCore { class WeaponSlotsInfo { - class MuzzleSlot: SlotInfo {}; + class MuzzleSlot: MuzzleSlot {}; class CowsSlot: CowsSlot {}; class PointerSlot: PointerSlot {}; }; diff --git a/addons/vector/initKeybinds.sqf b/addons/vector/initKeybinds.sqf index f81c280905..a41c13c757 100644 --- a/addons/vector/initKeybinds.sqf +++ b/addons/vector/initKeybinds.sqf @@ -1,83 +1,62 @@ // by commy2 -["ACE3", - localize "STR_ACE_Vector_AzimuthKey", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false}; +["ACE3", QGVAR(AzimuthKey), localize "STR_ACE_Vector_AzimuthKey", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false}; - // prevent holding down - if (GETGVAR(isDownStateKey1,false)) exitWith {false}; - GVAR(isDownStateKey1) = true; + // prevent holding down + if (GETGVAR(isDownStateKey1,false)) exitWith {false}; + GVAR(isDownStateKey1) = true; - // Statement - ["azimuth"] call FUNC(onKeyDown); - true - }, - [15, [false, false, false]], - false, - "keydown" -] call CBA_fnc_registerKeybind; + // Statement + ["azimuth"] call FUNC(onKeyDown); + true +}, +{ + // prevent holding down + GVAR(isDownStateKey1) = false; -["ACE3", - localize "STR_ACE_Vector_AzimuthKey", - { - // prevent holding down - GVAR(isDownStateKey1) = false; + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Statement + ["azimuth"] call FUNC(onKeyUp); + true +}, +[15, [false, false, false]], false, 0] call CBA_fnc_addKeybind; //Tab Key - // Statement - ["azimuth"] call FUNC(onKeyUp); - true - }, - [15, [false, false, false]], - false, - "keyup" -] call CBA_fnc_registerKeybind; -["ACE3", - localize "STR_ACE_Vector_DistanceKey", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false}; +["ACE3", QGVAR(DistanceKey), localize "STR_ACE_Vector_DistanceKey", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false}; - // prevent holding down - if (GETGVAR(isDownStateKey2,false)) exitWith {false}; - GVAR(isDownStateKey2) = true; + // prevent holding down + if (GETGVAR(isDownStateKey2,false)) exitWith {false}; + GVAR(isDownStateKey2) = true; - // Statement - ["distance"] call FUNC(onKeyDown); - true - }, - [19, [false, false, false]], - false, - "keydown" -] call CBA_fnc_registerKeybind; + // Statement + ["distance"] call FUNC(onKeyDown); + true +}, +{ + // prevent holding down + GVAR(isDownStateKey2) = false; -["ACE3", - localize "STR_ACE_Vector_DistanceKey", - { - // prevent holding down - GVAR(isDownStateKey2) = false; + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - - // Statement - ["distance"] call FUNC(onKeyUp); - true - }, - [19, [false, false, false]], - false, - "keyup" -] call CBA_fnc_registerKeybind; + // Statement + ["distance"] call FUNC(onKeyUp); + true +}, +[19, [false, false, false]], false] call CBA_fnc_addKeybind; //R Key diff --git a/addons/vehicles/CfgAmmo.hpp b/addons/vehicles/CfgAmmo.hpp index 60a3d0835b..96dd290625 100644 --- a/addons/vehicles/CfgAmmo.hpp +++ b/addons/vehicles/CfgAmmo.hpp @@ -1,7 +1,8 @@ class CfgAmmo { - class MissileBase; - class M_Mo_120mm_AT: MissileBase { + + class Missile_AGM_02_F; + class M_Mo_120mm_AT: Missile_AGM_02_F { cost = 400000; // Stop it from aiming at FUCKING RABBITS. weaponLockSystem = 2; }; @@ -11,6 +12,7 @@ class CfgAmmo { weaponLockSystem = 4; }; + class MissileBase; class M_Mo_82mm_AT: MissileBase { cost = 400000; weaponLockSystem = 2; diff --git a/addons/vehicles/XEH_postInit.sqf b/addons/vehicles/XEH_postInit.sqf index efff70306f..18d9e2f580 100644 --- a/addons/vehicles/XEH_postInit.sqf +++ b/addons/vehicles/XEH_postInit.sqf @@ -4,22 +4,19 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", - localize "STR_ACE_SpeedLimiter", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(ACE_player == driver vehicle ACE_player && - {vehicle ACE_player isKindOf 'Car' || - {vehicle ACE_player isKindOf 'Tank'}}) exitWith {false}; +["ACE3", QGVAR(speedLimiter), localize "STR_ACE_SpeedLimiter", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player == driver vehicle ACE_player && + {vehicle ACE_player isKindOf 'Car' || + {vehicle ACE_player isKindOf 'Tank'}}) exitWith {false}; - // Statement - [ACE_player, vehicle ACE_player] call FUNC(speedLimiter); - true - }, - [211, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, vehicle ACE_player] call FUNC(speedLimiter); + true +}, +{false}, +[211, [false, false, false]], false] call cba_fnc_addKeybind; //DELETE Key diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index 3414f64c52..c268f49b3c 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -4,254 +4,212 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", - localize "STR_ACE_WeaponSelect_SelectPistol", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(SelectPistol), localize "STR_ACE_WeaponSelect_SelectPistol", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, handgunWeapon ACE_player] call FUNC(selectWeaponMode); - true - }, - [2, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, handgunWeapon ACE_player] call FUNC(selectWeaponMode); + true +}, +{false}, +[2, [false, false, false]], false] call cba_fnc_addKeybind; //1 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectRifle", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(SelectRifle), localize "STR_ACE_WeaponSelect_SelectRifle", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMode); - true - }, - [3, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMode); + true +}, +{false}, +[3, [false, false, false]], false] call cba_fnc_addKeybind; //2 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectLauncher", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(SelectRifleMuzzle), localize "STR_ACE_WeaponSelect_SelectRifleMuzzle", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, secondaryWeapon ACE_player] call FUNC(selectWeaponMode); - true - }, - [5, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMuzzle); + true +}, +{false}, +[4, [false, false, false]], false] call cba_fnc_addKeybind; //3 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectRifleMuzzle", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(SelectLauncher), localize "STR_ACE_WeaponSelect_SelectLauncher", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMuzzle); - true - }, - [4, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, secondaryWeapon ACE_player] call FUNC(selectWeaponMode); + true +}, +{false}, +[5, [false, false, false]], false] call cba_fnc_addKeybind; //4 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectBinocular", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(SelectBinocular), localize "STR_ACE_WeaponSelect_SelectBinocular", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, binocular ACE_player] call FUNC(selectWeaponMode); - true - }, - [6, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, binocular ACE_player] call FUNC(selectWeaponMode); + true +}, +{false}, +[6, [false, false, false]], false] call cba_fnc_addKeybind; //5 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectGrenadeFrag", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(SelectGrenadeFrag), localize "STR_ACE_WeaponSelect_SelectGrenadeFrag", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player] call FUNC(selectGrenadeFrag); - true - }, - [7, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player] call FUNC(selectGrenadeFrag); + true +}, +{false}, +[7, [false, false, false]], false] call cba_fnc_addKeybind; //6 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectGrenadeOther", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(SelectGrenadeOther), localize "STR_ACE_WeaponSelect_SelectGrenadeOther", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player] call FUNC(selectGrenadeOther); - true - }, - [8, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player] call FUNC(selectGrenadeOther); + true +}, +{false}, +[8, [false, false, false]], false] call cba_fnc_addKeybind; //7 Key -["ACE3", - localize "STR_ACE_WeaponSelect_HolsterWeapon", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(HolsterWeapon), localize "STR_ACE_WeaponSelect_HolsterWeapon", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player] call FUNC(putWeaponAway); - true - }, - [11, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player] call FUNC(putWeaponAway); + true +}, +{false}, +[11, [false, false, false]], false] call cba_fnc_addKeybind; //0 Key -["ACE3", - localize "STR_ACE_WeaponSelect_EngineOn", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false}; +["ACE3", QGVAR(EngineOn), localize "STR_ACE_WeaponSelect_EngineOn", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false}; - // Statement - (vehicle ACE_player) engineOn true; - true - }, - [3, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + (vehicle ACE_player) engineOn true; + true +}, +{false}, +[3, [false, false, false]], false] call cba_fnc_addKeybind; //2 Key -["ACE3", - localize "STR_ACE_WeaponSelect_EngineOff", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {isEngineOn vehicle ACE_player}) exitWith {false}; +["ACE3", QGVAR(EngineOff), localize "STR_ACE_WeaponSelect_EngineOff", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {isEngineOn vehicle ACE_player}) exitWith {false}; - // Statement - (vehicle ACE_player) engineOn false; - true - }, - [2, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + (vehicle ACE_player) engineOn false; + true +}, +{false}, +[2, [false, false, false]], false] call cba_fnc_addKeybind; //1 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectMainGun", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(ACE_player != vehicle ACE_player) exitWith {false}; +["ACE3", QGVAR(SelectMainGun), localize "STR_ACE_WeaponSelect_SelectMainGun", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player) exitWith {false}; - // Statement - [ACE_player, vehicle ACE_player, 0] call FUNC(selectWeaponVehicle); - true - }, - [4, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, vehicle ACE_player, 0] call FUNC(selectWeaponVehicle); + true +}, +{false}, +[4, [false, false, false]], false] call cba_fnc_addKeybind; //3 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectMachineGun", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(ACE_player != vehicle ACE_player) exitWith {false}; +["ACE3", QGVAR(SelectMachineGun), localize "STR_ACE_WeaponSelect_SelectMachineGun", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player) exitWith {false}; - // Statement - [ACE_player, vehicle ACE_player, 1] call FUNC(selectWeaponVehicle); - true - }, - [5, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, vehicle ACE_player, 1] call FUNC(selectWeaponVehicle); + true +}, +{false}, +[5, [false, false, false]], false] call cba_fnc_addKeybind; //4 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectMissiles", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(ACE_player != vehicle ACE_player) exitWith {false}; +["ACE3", QGVAR(SelectMissiles), localize "STR_ACE_WeaponSelect_SelectMissiles", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player) exitWith {false}; - // Statement - [ACE_player, vehicle ACE_player, 2] call FUNC(selectWeaponVehicle); - true - }, - [6, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, vehicle ACE_player, 2] call FUNC(selectWeaponVehicle); + true +}, +{false}, +[6, [false, false, false]], false] call cba_fnc_addKeybind; //5 Key -["ACE3", - localize "STR_ACE_WeaponSelect_FireSmokeLauncher", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(ACE_player != vehicle ACE_player && {ACE_player == commander vehicle ACE_player}) exitWith {false}; +["ACE3", QGVAR(FireSmokeLauncher), localize "STR_ACE_WeaponSelect_FireSmokeLauncher", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player && {ACE_player == commander vehicle ACE_player}) exitWith {false}; - // Statement - [vehicle ACE_player] call FUNC(fireSmokeLauncher); - true - }, - [10, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [vehicle ACE_player] call FUNC(fireSmokeLauncher); + true +}, +{false}, +[10, [false, false, false]], false] call cba_fnc_addKeybind; //9 Key diff --git a/extensions/ace_fcs.cpp b/extensions/ace_fcs.cpp index 0b6788e7d1..81c515e0aa 100644 --- a/extensions/ace_fcs.cpp +++ b/extensions/ace_fcs.cpp @@ -21,7 +21,6 @@ #include #define MAXELEVATION 20 -#define SIMULATIONSTEP 0.05 #define MAXITERATIONS 120 #define PRECISION 0.1 #define RADIANS(X) (X / (180 / M_PI)) @@ -45,7 +44,7 @@ std::vector splitString(std::string input) { } double traceBullet(double initSpeed, double airFriction, double angle, double angleTarget, double distance) { - double velX, velY, posX, posY, posTargetX, posTargetY, velMag; + double velX, velY, posX, posY, lastPosX, lastPosY, posTargetX, posTargetY, velMag; velX = cos(RADIANS(angle)) * initSpeed; velY = sin(RADIANS(angle)) * initSpeed; posX = 0; @@ -53,18 +52,24 @@ double traceBullet(double initSpeed, double airFriction, double angle, double an posTargetX = cos(RADIANS(angleTarget)) * distance; posTargetY = sin(RADIANS(angleTarget)) * distance; + double simulationStep = 0.05; + int i = 0; while (i < MAXITERATIONS) { + lastPosX = posX; + lastPosY = posY; + simulationStep = 0.1 - 0.049 * (posX / posTargetX); velMag = sqrt(pow(velX, 2) + pow(velY, 2)); - velX += SIMULATIONSTEP * (velX * velMag * airFriction); - velY += SIMULATIONSTEP * (velY * velMag * airFriction - 9.81); - posX += velX * SIMULATIONSTEP; - posY += velY * SIMULATIONSTEP; + velX += simulationStep * (velX * velMag * airFriction); + velY += simulationStep * (velY * velMag * airFriction - 9.81); + posX += velX * simulationStep; + posY += velY * simulationStep; if (posX >= posTargetX) { break; } i++; } - return posY - posTargetY; + double coef = (posTargetX - lastPosX) / (posX - lastPosX); + return (lastPosY + (posY - lastPosY) * coef) - posTargetY; } double getSolution(double initSpeed, double airFriction, double angleTarget, double distance) {