diff --git a/.gitignore b/.gitignore index 76f95dcd10..f05646fb8a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ release/* texHeaders.bin *.swp *.swo +*.biprivatekey diff --git a/AUTHORS.txt b/AUTHORS.txt index 1932ff017b..89f6924d17 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -17,7 +17,7 @@ Janus Kieran NouberNou PabstMirror -Ruthberg +Ruthberg tpM ViperMaul VKing @@ -30,9 +30,12 @@ ACCtomeek Adanteh aeroson Aggr094 +Alganthe Anthariel BlackQwar Brakoviejo +Brisse +Clon1998 Codingboy Crusty eRazeri @@ -40,14 +43,16 @@ evromalarkey Falke75 Ferenczi Ferenzi -Filip Basara (Logo) +Filip Basara FreeZbe geraldbolso1899 Ghost GieNkoV gpgpgpgp Grzegorz +Gianmarco Varriale (TeamNuke) Hamburger SV +Harakhti havena Hawkins jokoho48 @@ -59,14 +64,17 @@ MarcBook meat Michail Nikolaev nic547 +nomisum oscarmolinadev pokertour rakowozz Raspu86 Riccardo Petricca Robert Boklahánics -simon84 +ramius86 +simon84 Sniperwolf572 +Tachi Tonic Tourorist Valentin Torikian @@ -76,4 +84,11 @@ ruPaladin BlackPixxel Asgar Serran Kavinsky - +Coren +OnkelDisMaster +Dimaslg +VyMajoris(W-Cephei) +Bla1337 +nikolauska +adam3adam +Professor diff --git a/LICENSE b/LICENSE index 0f013a10b9..01832682d7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2014 Felix "KoffeinFlummi" Wiegand +Copyright (C) 2015 Felix "KoffeinFlummi" Wiegand This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,6 +22,10 @@ source code of the individual modules. When publishing a derivative of this product you may not use a name that might create the impression that your version is an official release. +Some folders of this project may contain a seperate LICENSE file. Should +that be the case, everything in that folder and all subfolders is subject +to that license instead. + ============================================================================ Full Gnu General Public License Text diff --git a/README.md b/README.md index dd464966f2..4ed84011bf 100644 --- a/README.md +++ b/README.md @@ -1,48 +1,83 @@

- +

- ACE version + ACE version - - ACE download + + ACE download - ACE issues + ACE issues + + + BIF thread - ACE license + ACE license

-

Requires the latest version of CBA A3 | BIF thread

+

Requires the latest version of CBA A3. Visit us on Facebook | YouTube | Twitter | Reddit

**ACE3** is a joint effort by the teams behind **ACE2**, **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). +The project is entirely **open-source** and all contributions are welcome. Feel free to maintain your own custom version, so long as the changes you make are open to the public in accordance with the GNU General Public License ([GPLv2](https://github.com/acemod/ACE3/blob/master/LICENSE)). -The mod is **built modularly** — almost any PBO can be removed, thus a team can maintain its own tailored version of ACE, which excludes a select number of components that they don't like, or which conflict with other add-ons. Components themselves, like e.g. the medical system, also include various customization options, allowing mission designers to tweak the overall experience. +The mod is **built modularly**, so almost any included PBO can be easily removed from the configuration. This way, a team can maintain its own tailored version of ACE by simply excluding any components they don't need, or those possibly in conflict with other add-ons. Modules themselves, e.g. the medical system, also include various customization options, allowing mission designers to tweak the overall experience. -### Features -* Improved medical system -* Logistics system including cargo transport and vehicle maintenance -* Explosives system including different trigger types -* Captivity system -* Realistic names for vehicles and weapons -* Realistic ballistics including wind and humidity -* Backblast simulation -* A fire control system for armored vehicles and helicopters - ***and more...*** +### Core features +* Brand new 3D interaction/action system +* Performance and reliability framework +* Focus on modularity and customization +* New flexible client and server settings & configuration +* Improved medical system with various levels (basic/advanced) focus on gameplay/realism +* Proper & consistent network-synced weather +* Wind and weather-based ballistics +* Captivity system +* Explosives system, including different trigger types +* Map screen improvements – marker placement and map tools +* Advanced missile guidance and laser designation -#### Guides & How-Tos -If you installed ACE3, but have trouble understanding how it all works, or where to start — see [Getting Started](https://github.com/acemod/ACE3/blob/master/documentation/user/getting-started.md). +#### Additional features +* Carrying and dragging +* Realistic names for vehicles and weapons +* A fire control system (FCS) for armored vehicles and helicopters +* Realistic ballistics/FCS calculated in C/C++ extensions +* Backblast area and overpressure simulation +* Disposable launchers +* Realistic G-forces +* Vehicle locking +* Realistic night and thermal vision modes +* Magazine repacking +* Realistic weapon overheating mechanic +* Combat deafness (temporary loss of hearing) simulation +* Improved ragdoll physics +* Improved interactions for AARs and ammo bearers +* Adjustable sniper scopes +* No idle animation with lowered weapon +* No talking player avatar +* Jumping over obstacles, climbing over walls and cutting down fences +* Vector, MicroDAGR and Kestrel devices
+***and much more...*** + +### Guides & how-tos +If you installed ACE3 but have trouble understanding how it all works, or where to start, read this first: +* [Getting started](http://ace3mod.com/wiki/user/getting-started.html) #### Contributing -If you want to help put with the ongoing development, you can do so by looking for possible bugs or by contributing new features. To contribute something to ACE, simply fork this repository and submit your pull requests for review by other collaborators. In the process, please add yourself to the author array of any .pbo you will be editing and the AUTHORS.txt file; including a valid email address. +You can help out with the ongoing development by looking for potential bugs in our code base, or by contributing new features. To contribute something to ACE, simply fork this repository and submit your pull requests for review by other collaborators. Remember to add yourself to the author array of any PBO you will be editing and the [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) file; including a valid email address. -To report a bug, propose a feature, or suggest a change to the existing one — please, use our [Issue Tracker](https://github.com/acemod/ACE3/issues). +Please, use our [Issue Tracker](https://github.com/acemod/ACE3/issues) to report a bug, propose a feature, or suggest changes to the existing ones. See also: +* [How to report an issue](http://ace3mod.com/wiki/user/how-to-report-an-issue.html) +* [How to make a feature request](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html) -#### Testing & Building -If you want to help us test the latest development changes, feel free to download our master branch, using either git — if familiar with the process — or directly, by following [this link](https://github.com/acemod/ACE3/archive/master.zip). - -To find out how to set up your development environment and build a version of ACE for testing, follow [these instructions](https://github.com/acemod/ACE3/blob/master/documentation/development/setting-up-the-development-environment.md). +#### Testing & building +To help us test the latest development changes, download our master branch ([directly](https://github.com/acemod/ACE3/archive/master.zip), or [with git](https://help.github.com/articles/fetching-a-remote/)), then assemble a test build: +* [Setting up the development environment](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html) – step-by-step instructions on how to properly setup and build a version of ACE for testing purposes. diff --git a/ace_advanced_ballistics.dll b/ace_advanced_ballistics.dll index 568e7c16db..8f1c62484f 100644 Binary files a/ace_advanced_ballistics.dll and b/ace_advanced_ballistics.dll differ diff --git a/ace_break_line.dll b/ace_break_line.dll new file mode 100644 index 0000000000..a13e1a8da9 Binary files /dev/null and b/ace_break_line.dll differ diff --git a/ace_fcs.dll b/ace_fcs.dll index 3385e53463..71fbba7d92 100644 Binary files a/ace_fcs.dll and b/ace_fcs.dll differ diff --git a/addons/advanced_ballistics/ACE_Settings.hpp b/addons/advanced_ballistics/ACE_Settings.hpp index d1462b144f..67bc51511e 100644 --- a/addons/advanced_ballistics/ACE_Settings.hpp +++ b/addons/advanced_ballistics/ACE_Settings.hpp @@ -57,7 +57,7 @@ class ACE_Settings { }; class GVAR(simulationRadius) { displayName = "Simulation Radius"; - description = "Defines the radius (in meters) in which advanced ballistics are applied"; + description = "Defines the radius around the player (in meters) at which advanced ballistics are applied to projectiles"; typeName = "SCALAR"; value = 3000; }; diff --git a/addons/advanced_ballistics/CfgVehicles.hpp b/addons/advanced_ballistics/CfgVehicles.hpp index 8e6e40e21e..fda4b9a8ff 100644 --- a/addons/advanced_ballistics/CfgVehicles.hpp +++ b/addons/advanced_ballistics/CfgVehicles.hpp @@ -69,7 +69,7 @@ class CfgVehicles { }; class simulationRadius { displayName = "Simulation Radius"; - description = "Defines the radius (in meters) in which advanced ballistics are applied"; + description = "Defines the radius around the player (in meters) at which advanced ballistics are applied to projectiles"; typeName = "NUMBER"; defaultValue = 3000; }; diff --git a/addons/advanced_ballistics/XEH_postInit.sqf b/addons/advanced_ballistics/XEH_postInit.sqf index 783a5be569..8efdd6799b 100644 --- a/addons/advanced_ballistics/XEH_postInit.sqf +++ b/addons/advanced_ballistics/XEH_postInit.sqf @@ -20,26 +20,19 @@ GVAR(WindInfoStart) = time; GVAR(Protractor) = false; GVAR(ProtractorStart) = time; -// Those are only used in the pure sqf version (extension free PFH) -GVAR(SimulationPrecision) = 2; -GVAR(WindEnabled) = true; -GVAR(SpinDriftEnabled) = true; -GVAR(CoriolisEnabled) = true; -GVAR(EoetvoesEnabled) = true; -GVAR(AdvancedAirDragEnabled) = true; -GVAR(TransonicRegionEnabled) = true; -GVAR(AtmosphericDensitySimulationEnabled) = true; - GVAR(currentGrid) = 0; GVAR(INIT_MESSAGE_ENABLED) = false; -GVAR(extensionAvailable) = "ace_advanced_ballistics" callExtension "version" == "1.0"; +GVAR(extensionAvailable) = true; +/* @TODO: Remove this until versioning is in sync with cmake/build versioning +GVAR(extensionVersion) = ("ace_advanced_ballistics" callExtension "version"); +GVAR(extensionAvailable) = (GVAR(extensionVersion) == EXTENSION_REQUIRED_VERSION); if (!GVAR(extensionAvailable)) exitWith { - if ("ace_advanced_ballistics" callExtension "version" == "") then { + if (GVAR(extensionVersion) == "") then { diag_log text "[ACE] ERROR: ace_advanced_ballistics.dll is missing"; } else { diag_log text "[ACE] ERROR: ace_advanced_ballistics.dll is incompatible"; }; }; - +*/ [] call FUNC(initializeTerrainExtension); diff --git a/addons/advanced_ballistics/XEH_preInit.sqf b/addons/advanced_ballistics/XEH_preInit.sqf index b58a2b88e8..1d19a9c492 100644 --- a/addons/advanced_ballistics/XEH_preInit.sqf +++ b/addons/advanced_ballistics/XEH_preInit.sqf @@ -2,7 +2,6 @@ ADDON = false; -PREP(calculateAirDensity); PREP(calculateAmmoTemperatureVelocityShift); PREP(calculateAtmosphericCorrection); PREP(calculateBarrelLengthVelocityShift); diff --git a/addons/advanced_ballistics/config.cpp b/addons/advanced_ballistics/config.cpp index 32f1406a07..1a2187783b 100644 --- a/addons/advanced_ballistics/config.cpp +++ b/addons/advanced_ballistics/config.cpp @@ -15,4 +15,8 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "RscTitles.hpp" -#include "ACE_Settings.hpp" \ No newline at end of file +#include "ACE_Settings.hpp" + +class ACE_Extensions { + extensions[] += {"ace_advanced_ballistics"}; +}; diff --git a/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf b/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf index 02e849399e..b0166109f5 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf @@ -24,7 +24,7 @@ _pressure = _this select 2; // in hPa _relativeHumidity = _this select 3; // as ratio 0-1 _atmosphereModel = _this select 4; // "ICAO" or "ASM" -_airDensity = [_temperature, _pressure, _relativeHumidity] call FUNC(calculateAirDensity); +_airDensity = [_temperature, _pressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); if (_atmosphereModel == "ICAO") then { (STD_AIR_DENSITY_ICAO / _airDensity) * _ballisticCoefficient diff --git a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf index 2fbe558651..5fbdf2f12a 100644 --- a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf +++ b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf @@ -22,9 +22,9 @@ if (GVAR(Protractor)) exitWith { 1 cutText ["", "PLAIN"]; true }; -if (weaponLowered ACE_player) exitWith { true }; -if (vehicle ACE_player != ACE_player) exitWith { true }; -if (currentWeapon ACE_player != primaryWeapon ACE_player) exitWith { true }; +if (weaponLowered ACE_player) exitWith { false }; +if (vehicle ACE_player != ACE_player) exitWith { false }; +if (currentWeapon ACE_player != primaryWeapon ACE_player) exitWith { false }; 2 cutText ["", "PLAIN"]; EGVAR(weather,WindInfo) = false; diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index d628f012ee..e63b1d7dfc 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -19,7 +19,7 @@ */ #include "script_component.hpp" -private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_index", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_atmosphereModel", "_bulletMass", "_bulletLength", "_bulletTranslation", "_airFriction", "_dragModel", "_velocityBoundaryData", "_muzzleVelocity", "_muzzleVelocityCoef", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_bulletWeight", "_barrelTwist", "_twistDirection", "_stabilityFactor", "_transonicStabilityCoef", "_ACE_Elevation", "_ACE_Windage", "_ID"]; +private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_index", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_atmosphereModel", "_bulletMass", "_bulletLength", "_airFriction", "_dragModel", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_twistDirection", "_stabilityFactor", "_transonicStabilityCoef", "_ballisticCoefficients", "_velocityBoundaries"]; _unit = _this select 0; _weapon = _this select 1; _mode = _this select 3; @@ -35,49 +35,34 @@ if (!([_unit] call EFUNC(common,isPlayer))) exitWith {}; if (underwater _unit) exitWith {}; if (!(_ammo isKindOf "BulletBase")) exitWith {}; if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {}; -if (GVAR(onlyActiveForLocalPlayers) && _unit != ACE_player) then { _abort = true; }; -//if (!GVAR(vehicleGunnerEnabled) && !(_unit isKindOf "Man")) then { _abort = true; }; // TODO: We currently do not have firedEHs on vehicles -if (GVAR(disabledInFullAutoMode) && getNumber(configFile >> "cfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) then { _abort = true; }; - -if (_abort && alwaysSimulateForSnipers) then { - // The shooter is non local - if (currentWeapon _unit == primaryWeapon _unit && count primaryWeaponItems _unit > 2) then { - _opticsName = (primaryWeaponItems _unit) select 2; - _opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); - _abort = _opticType != 2; // We only abort if the non local shooter is not a sniper +if (GVAR(onlyActiveForLocalPlayers) && !(local _unit)) then { + if (GVAR(alwaysSimulateForSnipers)) then { + // The shooter is non local + if (currentWeapon _unit == primaryWeapon _unit && count primaryWeaponItems _unit > 2) then { + _opticsName = (primaryWeaponItems _unit) select 2; + _opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); + _abort = _opticType != 2; // We only abort if the non local shooter is not a sniper + }; + } else { + _abort = true; }; }; +//if (!GVAR(vehicleGunnerEnabled) && !(_unit isKindOf "Man")) then { _abort = true; }; // We currently do not have firedEHs on vehicles +if (GVAR(disabledInFullAutoMode) && getNumber(configFile >> "cfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) then { _abort = true; }; + if (_abort || !(GVAR(extensionAvailable))) exitWith { [_bullet, getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction")] call EFUNC(winddeflection,updateTrajectoryPFH); }; _airFriction = getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction"); -_muzzleVelocity = getNumber(configFile >> "cfgMagazines" >> _magazine >> "initSpeed"); -_muzzleVelocityCoef = getNumber(configFile >> "cfgWeapons" >> _weapon >> "initSpeed"); -if (_muzzleVelocityCoef > 0) then { - _muzzleVelocity = _muzzleVelocityCoef; -}; -if (_muzzleVelocityCoef < 0) then { - _muzzleVelocity = _muzzleVelocity * (-1 * _muzzleVelocityCoef); -}; -_muzzleAccessory = ""; -switch (currentWeapon _unit) do { - case primaryWeapon _unit: { _muzzleAccessory = (primaryWeaponItems _unit) select 0; }; - case handgunWeapon _unit: { _muzzleAccessory = (handgunItems _unit) select 0; }; -}; - -if (_muzzleAccessory != "" && isNumber(configFile >> "cfgWeapons" >> _muzzleAccessory >> "ItemInfo" >> "MagazineCoef" >> "initSpeed")) then { - _initSpeedCoef = getNumber(configFile >> "cfgWeapons" >> _muzzleAccessory >> "ItemInfo" >> "MagazineCoef" >> "initSpeed"); - _muzzleVelocity = _muzzleVelocity * _initSpeedCoef; -}; +_bulletVelocity = velocity _bullet; +_muzzleVelocity = vectorMagnitude _bulletVelocity; if (GVAR(barrelLengthInfluenceEnabled)) then { _muzzleVelocityShift = [_ammo, _weapon, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); if (_muzzleVelocityShift != 0) then { - _bulletVelocity = velocity _bullet; - _bulletSpeed = vectorMagnitude _bulletVelocity; - _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift * (_bulletSpeed / _muzzleVelocity))); + _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); _bullet setVelocity _bulletVelocity; _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift; }; @@ -87,20 +72,23 @@ if (GVAR(ammoTemperatureEnabled)) then { _temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2); _muzzleVelocityShift = [_ammo, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift); if (_muzzleVelocityShift != 0) then { - _bulletVelocity = velocity _bullet; - _bulletSpeed = vectorMagnitude _bulletVelocity; - _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift * (_bulletSpeed / _muzzleVelocity))); + _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); _bullet setVelocity _bulletVelocity; _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift; }; }; -// TODO: Make _bulletTraceVisible global and toggle it with events _bulletTraceVisible = false; -if (GVAR(bulletTraceEnabled) && currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then { - _opticsName = (primaryWeaponItems ACE_player) select 2; - _opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); - _bulletTraceVisible = (_opticType == 2 || currentWeapon ACE_player in ["ACE_Vector", "Binocular", "Rangefinder", "Laserdesignator"]) && cameraView == "GUNNER"; +if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then { + if (currentWeapon ACE_player in ["ACE_Vector", "Binocular", "Rangefinder", "Laserdesignator"]) then { + _bulletTraceVisible = true; + } else { + if (currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then { + _opticsName = (primaryWeaponItems ACE_player) select 2; + _opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); + _bulletTraceVisible = _opticType == 2; + }; + }; }; _caliber = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_caliber"); @@ -111,7 +99,7 @@ _stabilityFactor = 1.5; if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { _temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2); - _barometricPressure = 1013.25 * exp(-(EGVAR(weather,Altitude) + ((getPosASL _bullet) select 2)) / 7990) - 10 * overcast; + _barometricPressure = ((getPosASL _bullet) select 2) call EFUNC(weather,calculateBarometricPressure); _stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call FUNC(calculateStabilityFactor); }; @@ -132,251 +120,47 @@ _dragModel = 1; _ballisticCoefficients = []; _velocityBoundaries = []; _atmosphereModel = "ICAO"; -if (GVAR(AdvancedAirDragEnabled)) then { - if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_dragModel")) then { - _dragModel = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_dragModel"); - if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then { - _dragModel = 1; - }; - }; - if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ballisticCoefficients")) then { - _ballisticCoefficients = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ballisticCoefficients"); - }; - if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_velocityBoundaries")) then { - _velocityBoundaries = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_velocityBoundaries"); - }; - if (isText(configFile >> "cfgAmmo" >> _ammo >> "ACE_standardAtmosphere")) then { - _atmosphereModel = getText(configFile >> "cfgAmmo" >> _ammo >> "ACE_standardAtmosphere"); +if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_dragModel")) then { + _dragModel = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_dragModel"); + if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then { + _dragModel = 1; }; }; +if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ballisticCoefficients")) then { + _ballisticCoefficients = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ballisticCoefficients"); +}; +if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_velocityBoundaries")) then { + _velocityBoundaries = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_velocityBoundaries"); +}; +if (isText(configFile >> "cfgAmmo" >> _ammo >> "ACE_standardAtmosphere")) then { + _atmosphereModel = getText(configFile >> "cfgAmmo" >> _ammo >> "ACE_standardAtmosphere"); +}; -#ifdef USE_ADVANCEDBALLISTICS_DLL - GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000; +GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000; - "ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _bullet, EGVAR(weather,Latitude), EGVAR(weather,currentTemperature), EGVAR(weather,Altitude), EGVAR(weather,currentHumidity), overcast, floor(time), time - floor(time)]; +"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _bullet, EGVAR(weather,Latitude), EGVAR(weather,currentTemperature), EGVAR(weather,Altitude), EGVAR(weather,currentHumidity), overcast, floor(time), time - floor(time)]; - [{ - private ["_index", "_bullet", "_caliber", "_bulletTraceVisible", "_bulletVelocity", "_bulletPosition"]; - EXPLODE_4_PVT(_this select 0,_bullet,_caliber,_bulletTraceVisible,_index); - - if (!alive _bullet) exitWith { - [_this select 1] call cba_fnc_removePerFrameHandler; - }; - - _bulletVelocity = velocity _bullet; - _bulletPosition = getPosASL _bullet; - - if (_bulletTraceVisible && vectorMagnitude _bulletVelocity > 600) then { - drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.4*_caliber,0.2*_caliber],[[0,0,0,0.6],[0,0,0,0.4]],[1,0],0,0,"","",""]; - }; - - call compile ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, floor(time), time - floor(time)]); - - }, GVAR(simulationInterval), [_bullet, _caliber, _bulletTraceVisible, GVAR(currentbulletID)]] call CBA_fnc_addPerFrameHandler; -#else - _index = count GVAR(bulletDatabase); - if (count GVAR(bulletDatabaseFreeIndices) > 0) then { - _index = GVAR(bulletDatabaseFreeIndices) select 0; - GVAR(bulletDatabaseFreeIndices) = GVAR(bulletDatabaseFreeIndices) - [_index]; +[{ + private ["_args", "_index", "_bullet", "_caliber", "_bulletTraceVisible", "_bulletVelocity", "_bulletPosition"]; + _args = _this select 0; + _bullet = _args select 0; + _caliber = _args select 1; + _bulletTraceVisible = _args select 2; + _index = _args select 3; + + _bulletVelocity = velocity _bullet; + _bulletPosition = getPosASL _bullet; + + _bulletSpeed = vectorMagnitude _bulletVelocity; + + if (!alive _bullet || _bulletSpeed < 100) exitWith { + [_this select 1] call cba_fnc_removePerFrameHandler; + }; + + if (_bulletTraceVisible && _bulletSpeed > 600) then { + drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.4*_caliber,0.2*_caliber],[[0,0,0,0.6],[0,0,0,0.4]],[1,0],0,0,"","",""]; }; - GVAR(bulletDatabase) set[_index, [_bullet, _caliber, _airFriction, _muzzleVelocity, _stabilityFactor, _transonicStabilityCoef, _twistDirection, _unit, _bulletTraceVisible, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _index]]; - GVAR(bulletDatabaseStartTime) set[_index, time]; - GVAR(bulletDatabaseSpeed) set[_index, 0]; - GVAR(bulletDatabaseFrames) set[_index, 1]; - GVAR(bulletDatabaseLastFrame) set[_index, time]; - GVAR(bulletDatabaseHDeflect) set[_index, 0]; - GVAR(bulletDatabaseSpinDrift) set[_index, 0]; + call compile ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, floor(time), time - floor(time)]); - if ((GVAR(bulletDatabaseOccupiedIndices) pushBack _index) == 0) then { - [{ - private ["_bulletDatabaseEntry", "_bullet", "_caliber", "_muzzleVelocity", "_frames", "_speed", "_airFriction", "_airFrictionRef", "_dragModel", "_atmosphereModel", "_ballisticCoefficient", "_ballisticCoefficients", "_velocityBoundaries", "_airDensity", "_stabilityFactor", "_transonicStabilityCoef", "_twistDirection", "_unit", "_bulletTraceVisible", "_index", "_temperature", "_humidity", "_deltaT", "_TOF", "_bulletPosition", "_bulletVelocity", "_bulletSpeed", "_trueVelocity", "_trueSpeed", "_bulletSpeedAvg", "_wind", "_drag", "_dragRef", "_vect", "_accel", "_accelRef", "_centripetalAccel", "_pressure", "_pressureDeviation", "_windSourceObstacle", "_windSourceTerrain", "_height", "_roughnessLength"]; - - { - _bulletDatabaseEntry = (GVAR(bulletDatabase) select _x); - if (!alive (_bulletDatabaseEntry select 0)) then { - _index = _bulletDatabaseEntry select 13; - GVAR(bulletDatabaseOccupiedIndices) = GVAR(bulletDatabaseOccupiedIndices) - [_index]; - GVAR(bulletDatabaseFreeIndices) pushBack _index; - }; - true - } count GVAR(bulletDatabaseOccupiedIndices); - - if (count GVAR(bulletDatabaseOccupiedIndices) == 0) exitWith { - GVAR(bulletDatabase) = []; - GVAR(bulletDatabaseStartTime) = []; - GVAR(bulletDatabaseSpeed) = []; - GVAR(bulletDatabaseFrames) = []; - GVAR(bulletDatabaseLastFrame) = []; - GVAR(bulletDatabaseHDeflect) = []; - GVAR(bulletDatabaseSpinDrift) = []; - GVAR(bulletDatabaseOccupiedIndices) = []; - GVAR(bulletDatabaseFreeIndices) = []; - [_this select 1] call cba_fnc_removePerFrameHandler; - }; - - { - _bulletDatabaseEntry = GVAR(bulletDatabase) select _x; - _bullet = _bulletDatabaseEntry select 0; - _caliber = _bulletDatabaseEntry select 1; - _airFriction = _bulletDatabaseEntry select 2; - _muzzleVelocity = _bulletDatabaseEntry select 3; - _stabilityFactor = _bulletDatabaseEntry select 4; - _transonicStabilityCoef = _bulletDatabaseEntry select 5; - _twistDirection = _bulletDatabaseEntry select 6; - _unit = _bulletDatabaseEntry select 7; - _bulletTraceVisible = _bulletDatabaseEntry select 8; - _ballisticCoefficients = _bulletDatabaseEntry select 9; - _velocityBoundaries = _bulletDatabaseEntry select 10; - _atmosphereModel = _bulletDatabaseEntry select 11; - _dragModel = _bulletDatabaseEntry select 12; - _index = _bulletDatabaseEntry select 13; - - _TOF = time - (GVAR(bulletDatabaseStartTime) select _index); - - _bulletVelocity = velocity _bullet; - _bulletPosition = getPosASL _bullet; - - _bulletSpeed = vectorMagnitude _bulletVelocity; - _bulletDir = (_bulletVelocity select 0) atan2 (_bulletVelocity select 1); - - _speed = (GVAR(bulletDatabaseSpeed) select _index); - GVAR(bulletDatabaseSpeed) set[_index, _speed + _bulletSpeed]; - - _frames = (GVAR(bulletDatabaseFrames) select _index); - GVAR(bulletDatabaseFrames) set[_index, _frames + 1]; - - _bulletSpeedAvg = (_speed / _frames); - - if ((GVAR(SimulationPrecision) < 2) || {_frames % GVAR(SimulationPrecision) == _index % GVAR(SimulationPrecision)}) then { - _deltaT = time - (GVAR(bulletDatabaseLastFrame) select _index); - GVAR(bulletDatabaseLastFrame) set[_index, time]; - - _trueVelocity = _bulletVelocity; - _trueSpeed = _bulletSpeed; - _wind = [0, 0, 0]; - if (GVAR(WindEnabled) && (vectorMagnitude ACE_wind) > 0) then { - _windSourceObstacle = _bulletPosition vectorDiff ((vectorNormalized ACE_wind) vectorMultiply 10); - _windSourceTerrain = _bulletPosition vectorDiff ((vectorNormalized ACE_wind) vectorMultiply 100); - - if (!(lineIntersects [_bulletPosition, _windSourceObstacle]) && !(terrainIntersectASL [_bulletPosition, _windSourceTerrain])) then { - _wind = ACE_wind; - _height = ASLToATL(_bulletPosition) select 2; - _height = 0 max _height min 20; - if (_height < 20) then { - _roughnessLength = _bulletPosition call FUNC(calculateRoughnessLength); - _wind = _wind vectorMultiply (ln(_height / _roughnessLength) / ln(20 / _roughnessLength)); - }; - - _trueVelocity = _bulletVelocity vectorDiff _wind; - _trueSpeed = vectorMagnitude _trueVelocity; - }; - }; - - _airFrictionRef = _airFriction; - if (GVAR(AdvancedAirDragEnabled) && (count _ballisticCoefficients) == (count _velocityBoundaries) + 1) then { - _dragRef = _deltaT * _airFrictionRef * _bulletSpeed * _bulletSpeed; - _accelRef = (vectorNormalized _bulletVelocity) vectorMultiply (_dragRef); - _bulletVelocity = _bulletVelocity vectorDiff _accelRef; - - _ballisticCoefficient = (_ballisticCoefficients select 0); - for "_i" from (count _velocityBoundaries) - 1 to 0 step -1 do { - if (_bulletSpeed < (_velocityBoundaries select _i)) exitWith { - _ballisticCoefficient = (_ballisticCoefficients select (_i + 1)); - }; - }; - - if (GVAR(AtmosphericDensitySimulationEnabled)) then { - _pressure = 1013.25 * exp(-(EGVAR(weather,Altitude) + (_bulletPosition select 2)) / 7990) - 10 * overcast; - _temperature = GET_TEMPERATURE_AT_HEIGHT(_bulletPosition select 2); - _humidity = EGVAR(weather,currentHumidity); - _airDensity = STD_AIR_DENSITY_ICAO; - if (_humidity > 0) then { - private ["_pSat", "_vaporPressure", "_partialPressure"]; - // Saturation vapor pressure calculated according to: http://wahiduddin.net/calc/density_algorithms.htm - _pSat = 6.1078 * 10 ^ ((7.5 * _temperature) / (_temperature + 237.3)); - _vaporPressure = _humidity * _pSat; - _partialPressure = (_pressure * 100)- _vaporPressure; - - _airDensity = (_partialPressure * DRY_AIR_MOLAR_MASS + _vaporPressure * WATER_VAPOR_MOLAR_MASS) / (UNIVERSAL_GAS_CONSTANT * KELVIN(_temperature)); - } else { - _airDensity = (_pressure * 100) / (SPECIFIC_GAS_CONSTANT_DRY_AIR * KELVIN(_temperature)); - }; - if (_atmosphereModel == "ICAO") then { - _ballisticCoefficient = (STD_AIR_DENSITY_ICAO / _airDensity) * _ballisticCoefficient; - } else { - _ballisticCoefficient = (STD_AIR_DENSITY_ASM / _airDensity) * _ballisticCoefficient; - }; - }; - - _drag = _deltaT * ([_dragModel, _ballisticCoefficient, _trueSpeed] call FUNC(calculateRetardation)); - _accel = (vectorNormalized _trueVelocity) vectorMultiply (_drag); - _bulletVelocity = _bulletVelocity vectorDiff _accel; - } else { - if (GVAR(AtmosphericDensitySimulationEnabled)) then { - _pressureDeviation = 1013.25 * exp(-(EGVAR(weather,Altitude) + (_bulletPosition select 2)) / 7990) - 1013.25 - 10 * overcast; - _temperature = GET_TEMPERATURE_AT_HEIGHT(_bulletPosition select 2); - _humidity = EGVAR(weather,currentHumidity); - _airFriction = _airFriction + ((_temperature - 15) * 0.0000015 + _humidity * 0.0000040 + _pressureDeviation * -0.0000009); - }; - - if (_airFriction != _airFrictionRef || vectorMagnitude _wind > 0) then { - _dragRef = _deltaT * _airFrictionRef * _bulletSpeed * _bulletSpeed; - _accelRef = (vectorNormalized _bulletVelocity) vectorMultiply (_dragRef); - _bulletVelocity = _bulletVelocity vectorDiff _accelRef; - - _drag = _deltaT * _airFriction * _trueSpeed * _trueSpeed; - _accel = (vectorNormalized _trueVelocity) vectorMultiply (_drag); - _bulletVelocity = _bulletVelocity vectorAdd _accel; - }; - }; - - if (GVAR(CoriolisEnabled) && _bulletSpeedAvg > 0) then { - _horizontalDeflection = 0.0000729 * (_unit distanceSqr _bullet) * sin(EGVAR(weather,Latitude)) / _bulletSpeedAvg; - _horizontalDeflectionPartial = _horizontalDeflection - (GVAR(bulletDatabaseHDeflect) select _index); - GVAR(bulletDatabaseHDeflect) set[_index, _horizontalDeflection]; - _vect = [sin(_bulletDir + 90) * _horizontalDeflectionPartial, cos(_bulletDir + 90) * _horizontalDeflectionPartial, 0]; - - _bulletPosition = _bulletPosition vectorAdd _vect; - }; - - /* - // Negligible effect on the trajectory - if (GVAR(EoetvoesEnabled)) then { - _centripetalAccel = 2 * 0.0000729 * (_muzzleVelocity / -32.2) * cos(EGVAR(weather,Latitude)) * sin(_bulletDir); - _accel = [0, 0, -(_centripetalAccel * _deltaT)]; - - _bulletVelocity = _bulletVelocity vectorAdd _accel; - }; - //*/ - - if (GVAR(SpinDriftEnabled)) then { - _spinDrift = _twistDirection * 0.0254 * 1.25 * (_stabilityFactor + 1.2) * _TOF ^ 1.83; - _spinDriftPartial = _spinDrift - (GVAR(bulletDatabaseSpinDrift) select _index); - GVAR(bulletDatabaseSpinDrift) set[_index, _spinDrift]; - _vect = [sin(_bulletDir + 90) * _spinDriftPartial, cos(_bulletDir + 90) * _spinDriftPartial, 0]; - - _bulletPosition = _bulletPosition vectorAdd _vect; - }; - }; - - if (GVAR(TransonicRegionEnabled) && _transonicStabilityCoef < 1) then { - if (_bulletSpeed < 345 && _bulletSpeedAvg > 340 && _bulletSpeed > 335) then { - _accel = [(random 0.8) - 0.4, (random 0.8) - 0.4, (random 0.8) - 0.4]; - _accel = _accel vectorMultiply (1 - _transonicStabilityCoef); - _bulletVelocity = _bulletVelocity vectorAdd _accel; - }; - }; - - if (_bulletTraceVisible && _bulletSpeed > 600 && _bullet distanceSqr _unit > 400) then { - drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.4*_caliber,0.2*_caliber],[[0,0,0,0.6],[0,0,0,0.4]],[1,0],0,0,"","",""]; - }; - - _bullet setVelocity _bulletVelocity; - _bullet setPosASL _bulletPosition; - true - } count GVAR(bulletDatabaseOccupiedIndices); - - }, GVAR(simulationInterval), []] call CBA_fnc_addPerFrameHandler; - }; -#endif +}, GVAR(simulationInterval), [_bullet, _caliber, _bulletTraceVisible, GVAR(currentbulletID)]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf index 6791d26350..3930526433 100644 --- a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf +++ b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf @@ -13,6 +13,7 @@ #include "script_component.hpp" if (!hasInterface) exitWith {}; +if (!GVAR(enabled)) exitWith {}; if (!GVAR(extensionAvailable)) exitWith {}; private ["_initStartTime", "_mapSize", "_mapGrids", "_gridCells", "_x", "_y", "_gridCenter", "_gridHeight", "_gridNumObjects", "_gridSurfaceIsWater"]; diff --git a/addons/advanced_ballistics/initKeybinds.sqf b/addons/advanced_ballistics/initKeybinds.sqf index 5649fb943e..cddf47877a 100644 --- a/addons/advanced_ballistics/initKeybinds.sqf +++ b/addons/advanced_ballistics/initKeybinds.sqf @@ -1,11 +1,10 @@ -["ACE3", QGVAR(ProtractorKey), localize "STR_ACE_AdvancedBallistics_ProtractorKey", +["ACE3 Equipment", QGVAR(ProtractorKey), localize "STR_ACE_AdvancedBallistics_ProtractorKey", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Statement [] call FUNC(displayProtractor); - false }, {false}, [37, [true, true, false]], false, 0] call CBA_fnc_addKeybind; // (CTRL + SHIFT + K) diff --git a/addons/advanced_ballistics/script_component.hpp b/addons/advanced_ballistics/script_component.hpp index 273afa2f49..3334bb3207 100644 --- a/addons/advanced_ballistics/script_component.hpp +++ b/addons/advanced_ballistics/script_component.hpp @@ -1,8 +1,6 @@ #define COMPONENT advanced_ballistics #include "\z\ace\addons\main\script_mod.hpp" -#define USE_ADVANCEDBALLISTICS_DLL - #ifdef DEBUG_ENABLED_ADVANCEDBALLISTICS #define DEBUG_MODE_FULL #endif @@ -24,3 +22,5 @@ #define STD_AIR_DENSITY_ICAO 1.22498 #define STD_AIR_DENSITY_ASM 1.20885 #define GET_TEMPERATURE_AT_HEIGHT(h) (EGVAR(weather,currentTemperature) - 0.0065 * (h)) + +#define EXTENSION_REQUIRED_VERSION "1.0" diff --git a/addons/advanced_ballistics/stringtable.xml b/addons/advanced_ballistics/stringtable.xml index 29560ce149..a908bab88c 100644 --- a/addons/advanced_ballistics/stringtable.xml +++ b/addons/advanced_ballistics/stringtable.xml @@ -1,14 +1,27 @@  - Show Wind Info Pokaż inf. o wietrze + Mostra indicazioni del vento + Показать информацию о ветре + Afficher les info sur le vent + Mostrar información del viento + Windinformationen anzeigen + Széladatok mutatása + Zobrazit informace o větru Show Protractor Pokaż kątomierz + Mostra il rapportatore + Показать транспортир + Afficher le rapporteur + Mostrar transportador + Winkelmesser anzeigen + Szögmérő mutatása + Zobrazit úhloměr - \ No newline at end of file + diff --git a/addons/aircraft/CfgAmmo.hpp b/addons/aircraft/CfgAmmo.hpp index f29c1d56d6..8aa5d3173e 100644 --- a/addons/aircraft/CfgAmmo.hpp +++ b/addons/aircraft/CfgAmmo.hpp @@ -2,7 +2,7 @@ class CfgAmmo { class BulletBase; class B_20mm : BulletBase { - hit = 80; + hit = 80; indirectHit = 12; indirectHitRange = 2; //2; caliber = 1.4; @@ -13,17 +13,17 @@ class CfgAmmo { tracerEndTime = 3.5; CraterEffects = "ExploAmmoCrater"; - explosionEffects = "ExploAmmoExplosion"; + explosionEffects = "ExploAmmoExplosion"; model = "\A3\Weapons_f\Data\bullettracer\tracer_red"; }; - class ACE_20mm_HEDP : B_20mm {}; + class ACE_20mm_HE : B_20mm {}; class ACE_20mm_AP : B_20mm { hit = 50; indirectHit = 12; indirectHitRange = 0.3; //2; explosive = 0; CraterEffects = ""; - explosionEffects = ""; + explosionEffects = ""; }; // adjust minigun caliber and deflection to other ammo diff --git a/addons/aircraft/CfgMagazines.hpp b/addons/aircraft/CfgMagazines.hpp index 2445182163..b09bac6943 100644 --- a/addons/aircraft/CfgMagazines.hpp +++ b/addons/aircraft/CfgMagazines.hpp @@ -10,7 +10,7 @@ class CfgMagazines { // an extended magazine for the comanche class 300Rnd_20mm_shells; class ACE_500Rnd_20mm_shells_Comanche: 300Rnd_20mm_shells { - ammo = "ACE_20mm_HEDP"; + ammo = "ACE_20mm_HE"; count = 500; }; }; diff --git a/addons/aircraft/Heli_Attack_01_base_F.hpp b/addons/aircraft/Heli_Attack_01_base_F.hpp index 7276b3e402..14ca7ef7cd 100644 --- a/addons/aircraft/Heli_Attack_01_base_F.hpp +++ b/addons/aircraft/Heli_Attack_01_base_F.hpp @@ -891,6 +891,25 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { class OpticsIn { + class WideUnstabalized + { + opticsDisplayName = "WU"; + initAngleX = 0; + minAngleX = -35; + maxAngleX = 10; + initAngleY = 0; + minAngleY = -100; + maxAngleY = 100; + initFov = 0.466; + minFov = 0.466; + maxFov = 0.466; + visionMode[] = {"Normal","Ti"}; + thermalMode[] = {0,1}; + gunnerOpticsColor[] = {0,0,0,1}; + directionStabilized = 0; + horizontallyStabilized = 1; + gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_wide_F"; + }; class Wide { opticsDisplayName = "W"; @@ -907,7 +926,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { thermalMode[] = {0,1}; gunnerOpticsColor[] = {0,0,0,1}; directionStabilized = 1; - horizontallyStabilized = 1; + horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_wide_F"; }; class Medium: Wide @@ -918,7 +937,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { maxFov = 0.093; gunnerOpticsColor[] = {0,0,0,1}; directionStabilized = 1; - horizontallyStabilized = 1; + horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_medium_F"; }; class Narrow: Wide @@ -929,7 +948,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { maxFov = 0.029; gunnerOpticsColor[] = {0,0,0,1}; directionStabilized = 1; - horizontallyStabilized = 1; + horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_narrow_F"; }; @@ -941,7 +960,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { maxFov = 0.01; gunnerOpticsColor[] = {0,0,0,1}; directionStabilized = 1; - horizontallyStabilized = 1; + horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_narrow_F"; }; diff --git a/addons/aircraft/config.cpp b/addons/aircraft/config.cpp index 2dc390f915..2ce2d0dc10 100644 --- a/addons/aircraft/config.cpp +++ b/addons/aircraft/config.cpp @@ -2,7 +2,7 @@ class CfgPatches { class ADDON { - units[] = {"ACE_Comanche_Test"}; + units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; diff --git a/addons/aircraft/stringtable.xml b/addons/aircraft/stringtable.xml index 1ec3d09ae6..1dd01e08ab 100644 --- a/addons/aircraft/stringtable.xml +++ b/addons/aircraft/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -29,21 +29,25 @@ Open Cargo Door Laderampe öffnen Abrir compuerta de carga - Ourvir rampe cargo + Ourvir la rampe Otwórz drzwi ładowni Otevřít nákladní prostor - Rámpát kinyitni + Rakodórámpa nyitása Открыть грузовой отсек + Apri la porta del cargo + Abrir porta de carga Close Cargo Door Laderampe schließen Cerrar compuerta de carga - Fermer rampe cargo + Fermer la rampe Zamknij drzwi ładowni Zavřít nákladní prostor - Rámpát zárni + Rakodórámpa zárása Закрыть грузовой отсек + Chiudi la porta del cargo + Fechar porta de carga diff --git a/addons/apl/$PBOPREFIX$ b/addons/apl/$PBOPREFIX$ new file mode 100644 index 0000000000..f2a70e80ff --- /dev/null +++ b/addons/apl/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\apl \ No newline at end of file diff --git a/addons/apl/CfgEventHandlers.hpp b/addons/apl/CfgEventHandlers.hpp new file mode 100644 index 0000000000..5bacc02434 --- /dev/null +++ b/addons/apl/CfgEventHandlers.hpp @@ -0,0 +1,7 @@ +/* +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; +*/ \ No newline at end of file diff --git a/addons/apl/LICENSE b/addons/apl/LICENSE new file mode 100644 index 0000000000..2274430c9b --- /dev/null +++ b/addons/apl/LICENSE @@ -0,0 +1,110 @@ +ARMA PUBLIC LICENSE +https://www.bistudio.com/community/licenses/arma-public-license + +Brief summary of this Licence + +PLEASE, NOTE THAT THIS SUMMARY HAS NO LEGAL EFFECT AND IS ONLY OF AN INFORMATORY NATURE DESIGNED FOR YOU TO GET THE BASIC INFORMATION ABOUT THE CONTENT OF THIS LICENCE. THE ONLY LEGALLY BINDING PROVISIONS ARE THOSE IN THE ORIGINAL AND FULL TEXT OF THIS LICENCE. + +With this licence you are free to adapt (i.e. modify, rework or update) and share (i.e. copy, distribute or transmit) the material under the following conditions: + + Attribution - You must attribute the material in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the material). + Noncommercial - You may not use this material for any commercial purposes. + Arma Only - You may not convert or adapt this material to be used in other games than Arma. + +By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Arma Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. + +Section 1 - Definitions + + Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. + Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. + ArmaOnly means primarily intended for or directed towards the use in any of existing and future Arma games, including but not limited to Arma: Cold War Assault, Arma, Arma 2 and Arma 3 and its official sequels and expansion packs. + Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. + Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. + Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. + Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. + Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. + Licensor means the individual(s) or entity(ies) granting rights under this Public License. + NonCommercial means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange. + Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. + Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. + You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. + +Section 2 – Scope + + License grant + Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: + reproduce and Share the Licensed Material, in whole or in part, for NonCommercial and ArmaOnly purposes only; and + produce, reproduce, and Share Adapted Material for NonCommercial and ArmaOnly purposes only. + Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. + Term. The term of this Public License is specified in Section 6(a). + Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. + Downstream recipients. + Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. + No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. + No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(a)(i). + Other rights + Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. + Patent and trademark rights are not licensed under this Public License. + To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial and ArmaOnly purposes. + +Section 3 – License Conditions + +Your exercise of the Licensed Rights is expressly made subject to the following conditions. + + Attribution + + If You Share the Licensed Material (including in modified form), You must: + retain the following if it is supplied by the Licensor with the Licensed Material: + identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); + a copyright notice; + a notice that refers to this Public License; + a notice that refers to the disclaimer of warranties; + a URI or hyperlink to the Licensed Material to the extent reasonably practicable; + indicate if You modified the Licensed Material and retain an indication of any previous modifications; and + indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. + You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. + If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(a) to the extent reasonably practicable. + If You Share Adapted Material You produce, the Adapter’s License You apply must not prevent recipients of the Adapted Material from complying with this Public License. + +Section 4 – Sui Generis Database Rights + +Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: + + for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial and ArmaOnly purposes only; + if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and + You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. + +Section 5 – Disclaimer of Warranties and Limitation of Liability + + Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. + To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. + The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. + +Section 6 – Term and Termination + + This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. + + Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: + automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or + upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. + For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. + Sections 1, 5, 6, 7, and 8 survive termination of this Public License. + +Section 7 – Other Terms and Conditions + + The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. + Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. + +Section 8 – Interpretation + + For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. + To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. + No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. + Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. + +Bohemia Interactive Notices + + Bohemia Interactive a.s. is not a party to this License, and makes no warranty whatsoever in connection with the Licensed Material. Bohemia Interactive a.s. will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, Bohemia Interactive a.s. may elect to apply the Public License to material it publishes and in those instances it becomes the "Licensor". + Except for the limited purpose of indicating to the public that the Licensed Material is shared under this Public License, Bohemia Interactive a.s. does not authorize the use by either party of the trademarks "Arma", "Bohemia Interactive" or any related trademark or logo of Arma or Bohemia Interactive without the prior written consent of Bohemia Interactive a.s. diff --git a/addons/frag/functions/fnc_clearTraces.sqf b/addons/apl/XEH_preInit.sqf similarity index 50% rename from addons/frag/functions/fnc_clearTraces.sqf rename to addons/apl/XEH_preInit.sqf index b301094044..6899f59bd9 100644 --- a/addons/frag/functions/fnc_clearTraces.sqf +++ b/addons/apl/XEH_preInit.sqf @@ -1,2 +1,5 @@ -#include "script_component.hpp" -GVAR(traces) = []; \ No newline at end of file +#include "script_component.hpp" + +ADDON = false; + +ADDON = true; diff --git a/addons/apl/bodybag.p3d b/addons/apl/bodybag.p3d new file mode 100644 index 0000000000..5b3622f978 Binary files /dev/null and b/addons/apl/bodybag.p3d differ diff --git a/addons/apl/config.cpp b/addons/apl/config.cpp new file mode 100644 index 0000000000..fff902d962 --- /dev/null +++ b/addons/apl/config.cpp @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_main"}; + author[] = {"Bohemia Interactive"}; + authorUrl = "http://ace3mod.com"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" diff --git a/addons/medical/data/bodybag.rvmat b/addons/apl/data/bodybag.rvmat similarity index 95% rename from addons/medical/data/bodybag.rvmat rename to addons/apl/data/bodybag.rvmat index 2a1869ad55..ad84469940 100644 --- a/addons/medical/data/bodybag.rvmat +++ b/addons/apl/data/bodybag.rvmat @@ -8,7 +8,7 @@ PixelShaderID="Super"; VertexShaderID="Super"; class Stage1 { - texture="z\ace\addons\medical\data\bodybag_nohq.paa"; + texture="z\ace\addons\apl\data\bodybag_nohq.paa"; uvSource="tex"; class uvTransform { @@ -80,7 +80,7 @@ class Stage6 }; class Stage7 { - texture="z\ace\addons\medical\data\env_co.paa"; + texture="z\ace\addons\apl\data\env_co.paa"; uvSource="tex"; class uvTransform { diff --git a/addons/medical/data/bodybag_co.paa b/addons/apl/data/bodybag_co.paa similarity index 100% rename from addons/medical/data/bodybag_co.paa rename to addons/apl/data/bodybag_co.paa diff --git a/addons/medical/data/bodybag_nohq.paa b/addons/apl/data/bodybag_nohq.paa similarity index 100% rename from addons/medical/data/bodybag_nohq.paa rename to addons/apl/data/bodybag_nohq.paa diff --git a/addons/medical/data/env_co.paa b/addons/apl/data/env_co.paa similarity index 100% rename from addons/medical/data/env_co.paa rename to addons/apl/data/env_co.paa diff --git a/addons/apl/functions/script_component.hpp b/addons/apl/functions/script_component.hpp new file mode 100644 index 0000000000..a25cdfebcc --- /dev/null +++ b/addons/apl/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\apl\script_component.hpp" \ No newline at end of file diff --git a/addons/apl/script_component.hpp b/addons/apl/script_component.hpp new file mode 100644 index 0000000000..ac20a25e21 --- /dev/null +++ b/addons/apl/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT APL +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_APL + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_APL + #define DEBUG_SETTINGS DEBUG_SETTINGS_APL +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/atragmx/RscTitles.hpp b/addons/atragmx/RscTitles.hpp index 8c0a647839..4ae08c20aa 100644 --- a/addons/atragmx/RscTitles.hpp +++ b/addons/atragmx/RscTitles.hpp @@ -128,45 +128,11 @@ class ATragMX_RscListBox { class ATragMX_RscListNBox: ATragMX_RscListBox { idc=-1; type=102; - columns[]={0.0, 0.225, 0.475, 0.725}; + columns[]={0.0, 0.225, 0.475, 0.7}; drawSideArrows=0; idcLeft=-1; idcRight=-1; }; -class ATragMX_RscControlsGroup { - type=15; - idc=-1; - style=16; - x=0; - y=0; - w=1; - h=1; - shadow=0; - class VScrollbar { - color[]={1,1,1,0.6}; - width=0.021; - autoScrollSpeed=-1; - autoScrollDelay=5; - autoScrollRewind=0; - shadow=0; - }; - class HScrollbar { - color[]={1,1,1,0.6}; - height=0.028; - shadow=0; - }; - class ScrollBar { - color[]={1,1,1,0.6}; - colorActive[]={1,1,1,1}; - colorDisabled[]={1,1,1,0.3}; - thumb="#(argb,8,8,3)color(1,1,1,1)"; - arrowEmpty="#(argb,8,8,3)color(1,1,1,1)"; - arrowFull="#(argb,8,8,3)color(1,1,1,1)"; - border="#(argb,8,8,3)color(1,1,1,1)"; - }; - class Controls { - }; -}; class ATragMX_RscLineBreak { idc=-1; type=98; @@ -230,12 +196,12 @@ class ATragMX_Display { w=0.03; h=0.03; colorBackground[]={0,0,0,0.0}; - action=QUOTE(((GVAR(currentGun) select GVAR(currentTarget)) + (count GVAR(gunList)) - 1) % (count GVAR(gunList)) call FUNC(change_gun)); + action=QUOTE(-1 call FUNC(cycle_gun_list)); }; class BOTTOM: TOP { idc=-1; y=0.265*safezoneH+safezoneY+0.955; - action=QUOTE(((GVAR(currentGun) select GVAR(currentTarget)) + (count GVAR(gunList)) + 1) % (count GVAR(gunList)) call FUNC(change_gun)); + action=QUOTE(+1 call FUNC(cycle_gun_list)); }; class LEFT: ATragMX_RscButton { idc=-1; @@ -244,12 +210,12 @@ class ATragMX_Display { w=0.05; h=0.03; colorBackground[]={0,0,0,0}; - action=QUOTE(call FUNC(parse_input); GVAR(currentTarget) = (4 + GVAR(currentTarget) - 1) % 4; call FUNC(update_target_selection)); + action=QUOTE(((4 + GVAR(currentTarget) - 1) % 4) call FUNC(change_target_slot)); }; class RIGHT: LEFT { idc=-1; x=0.55*safezoneW+safezoneX+0.2725; - action=QUOTE(call FUNC(parse_input); GVAR(currentTarget) = (4 + GVAR(currentTarget) + 1) % 4; call FUNC(update_target_selection)); + action=QUOTE(((4 + GVAR(currentTarget) + 1) % 4) call FUNC(change_target_slot)); }; class TOP_LEFT: ATragMX_RscButton { idc=-1; @@ -263,7 +229,31 @@ class ATragMX_Display { idc=-1; x=0.55*safezoneW+safezoneX+0.315; }; - + + class TEXT_GUN_FRAME: ATragMX_RscText { + idc=1001; + style=64; + x=0.550*safezoneW+safezoneX+0.11; + y=0.265*safezoneH+safezoneY+0.25; + w=0.0925; + h=0.205; + text=""; + }; + class TEXT_ATMOSPHERE_FRAME: TEXT_GUN_FRAME { + idc=1002; + x=0.550*safezoneW+safezoneX+0.205; + }; + class TEXT_TARGET_FRAME: TEXT_GUN_FRAME { + idc=1003; + x=0.550*safezoneW+safezoneX+0.3; + }; + class TEXT_RESULT_FRAME: TEXT_GUN_FRAME { + idc=1004; + x=0.550*safezoneW+safezoneX+0.11; + y=0.265*safezoneH+safezoneY+0.46; + w=0.2825; + h=0.15; + }; class TEXT_GUN_PROFILE: ATragMX_RscText { idc=1000; x=0.550*safezoneW+safezoneX+0.11; @@ -316,6 +306,7 @@ class ATragMX_Display { colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="Gun"; + action=QUOTE(call FUNC(toggle_gun_ammo_data)); }; class TEXT_BORE_HEIGHT: TEXT_GUN_PROFILE { idc=10; @@ -323,12 +314,12 @@ class ATragMX_Display { y=0.265*safezoneH+safezoneY+0.285; text="BH"; }; - class TEXT_BORE_HEIGHT_INPUT: ATragMX_RscEdit { + class TEXT_BORE_HEIGHT_OUTPUT: TEXT_BORE_HEIGHT { idc=100; + style=ST_RIGHT; w=0.058; x=0.550*safezoneW+safezoneX+0.145; y=0.265*safezoneH+safezoneY+0.285; - onKeyUp=QUOTE(if (_this select 1 == 28) then {call FUNC(calculate_target_solution)}); }; class TEXT_BULLET_MASS: TEXT_BORE_HEIGHT { idc=11; @@ -336,7 +327,7 @@ class ATragMX_Display { y=0.265*safezoneH+safezoneY+0.320; text="BW"; }; - class TEXT_BULLET_MASS_INPUT: TEXT_BORE_HEIGHT_INPUT { + class TEXT_BULLET_MASS_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=110; y=0.265*safezoneH+safezoneY+0.320; }; @@ -345,7 +336,7 @@ class ATragMX_Display { y=0.265*safezoneH+safezoneY+0.355; text="C1"; }; - class TEXT_AIR_FRICTION_INPUT: TEXT_BORE_HEIGHT_INPUT { + class TEXT_AIR_FRICTION_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=120; y=0.265*safezoneH+safezoneY+0.355; }; @@ -359,7 +350,7 @@ class ATragMX_Display { colorFocused[]={0.15,0.21,0.23,0.2}; text="MV"; }; - class TEXT_MUZZLE_VELOCITY_INPUT: TEXT_BORE_HEIGHT_INPUT { + class TEXT_MUZZLE_VELOCITY_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=130; y=0.265*safezoneH+safezoneY+0.390; }; @@ -368,35 +359,35 @@ class ATragMX_Display { y=0.265*safezoneH+safezoneY+0.425; text="ZR"; }; - class TEXT_ZERO_RANGE_INPUT: TEXT_BORE_HEIGHT_INPUT { + class TEXT_ZERO_RANGE_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=140; y=0.265*safezoneH+safezoneY+0.425; - onKeyUp=QUOTE(if (_this select 1 == 28) then {call FUNC(update_zero_range)}); }; class TEXT_ATMOSPHERE: TEXT_GUN { idc=4001; x=0.550*safezoneW+safezoneX+0.205; text="Atmsphr"; + action=QUOTE(0 call FUNC(toggle_atmo_env_data)); }; class TEXT_TEMPERATURE: TEXT_BULLET_MASS { idc=20; x=0.550*safezoneW+safezoneX+0.20; text="Tmp"; }; - class TEXT_TEMPERATURE_INPUT: ATragMX_RscEdit { + class TEXT_TEMPERATURE_OUTPUT: TEXT_TEMPERATURE { idc=200; + style=ST_RIGHT; w=0.050; x=0.550*safezoneW+safezoneX+0.245; y=0.265*safezoneH+safezoneY+0.320; text=""; - onKeyUp=QUOTE(if (_this select 1 == 28) then {call FUNC(calculate_target_solution)}); }; class TEXT_BAROMETRIC_PRESSURE: TEXT_AIR_FRICTION { idc=21; x=0.550*safezoneW+safezoneX+0.20; text="BP"; }; - class TEXT_BAROMETRIC_PRESSURE_INPUT: TEXT_TEMPERATURE_INPUT { + class TEXT_BAROMETRIC_PRESSURE_OUTPUT: TEXT_TEMPERATURE_OUTPUT { idc=210; y=0.265*safezoneH+safezoneY+0.355; }; @@ -406,10 +397,19 @@ class ATragMX_Display { y=0.265*safezoneH+safezoneY+0.390; text="RH"; }; - class TEXT_RELATIVE_HUMIDITY_INPUT: TEXT_TEMPERATURE_INPUT { + class TEXT_RELATIVE_HUMIDITY_OUTPUT: TEXT_TEMPERATURE_OUTPUT { idc=220; y=0.265*safezoneH+safezoneY+0.390; }; + class TEXT_ALTITUDE: TEXT_BORE_HEIGHT { + idc=23; + x=0.550*safezoneW+safezoneX+0.20; + text="Alt"; + }; + class TEXT_ALTITUDE_OUTPUT: TEXT_TEMPERATURE_OUTPUT { + idc=230; + y=0.265*safezoneH+safezoneY+0.285; + }; class TEXT_TARGET_A: ATragMX_RscButton { idc=500; w=0.0231; @@ -420,43 +420,43 @@ class ATragMX_Display { colorBackgroundDisabled[]={0,0,0,1}; colorBackgroundActive[]={0,0,0,0}; text="A"; - action=QUOTE(call FUNC(parse_input); GVAR(currentTarget)=0; call FUNC(update_target_selection)); + action=QUOTE(0 call FUNC(change_target_slot)); }; class TEXT_TARGET_B: TEXT_TARGET_A { idc=501; x=0.550*safezoneW+safezoneX+0.2281; text="B"; - action=QUOTE(call FUNC(parse_input); GVAR(currentTarget)=1; call FUNC(update_target_selection)); + action=QUOTE(1 call FUNC(change_target_slot)); }; - class TEXT_TARGET_C: TEXT_TARGET_B { + class TEXT_TARGET_C: TEXT_TARGET_A { idc=502; x=0.550*safezoneW+safezoneX+0.2512; text="C"; - action=QUOTE(call FUNC(parse_input); GVAR(currentTarget)=2; call FUNC(update_target_selection)); + action=QUOTE(2 call FUNC(change_target_slot)); }; - class TEXT_TARGET_D: TEXT_TARGET_B { + class TEXT_TARGET_D: TEXT_TARGET_A { idc=503; x=0.550*safezoneW+safezoneX+0.2743; text="D"; - action=QUOTE(call FUNC(parse_input); GVAR(currentTarget)=3; call FUNC(update_target_selection)); + action=QUOTE(3 call FUNC(change_target_slot)); }; class TEXT_TARGET: TEXT_GUN { idc=4002; x=0.550*safezoneW+safezoneX+0.3; text="Target"; + action=QUOTE(0 call FUNC(toggle_target_data)); }; class TEXT_WIND_SPEED: TEXT_BORE_HEIGHT { idc=30; x=0.550*safezoneW+safezoneX+0.3; text="WS"; }; - class TEXT_WIND_SPEED_INPUT: ATragMX_RscEdit { + class TEXT_WIND_SPEED_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=300; w=0.058; x=0.550*safezoneW+safezoneX+0.335; y=0.265*safezoneH+safezoneY+0.285; - onKeyUp=QUOTE(if (_this select 1 == 28) then {call FUNC(calculate_target_solution)}); text="0"; }; class TEXT_WIND_DIRECTION: TEXT_BULLET_MASS { @@ -464,7 +464,7 @@ class ATragMX_Display { x=0.550*safezoneW+safezoneX+0.3; text="WD"; }; - class TEXT_WIND_DIRECTION_INPUT: TEXT_WIND_SPEED_INPUT { + class TEXT_WIND_DIRECTION_OUTPUT: TEXT_WIND_SPEED_OUTPUT { idc=310; y=0.265*safezoneH+safezoneY+0.32; }; @@ -473,7 +473,7 @@ class ATragMX_Display { x=0.550*safezoneW+safezoneX+0.3; text="IA"; }; - class TEXT_INCLINATION_ANGLE_INPUT: TEXT_WIND_SPEED_INPUT { + class TEXT_INCLINATION_ANGLE_OUTPUT: TEXT_WIND_SPEED_OUTPUT { idc=320; y=0.265*safezoneH+safezoneY+0.355; }; @@ -481,9 +481,9 @@ class ATragMX_Display { idc=33; x=0.550*safezoneW+safezoneX+0.3; text="TS"; - action=QUOTE(call FUNC(toggle_target_speed_assist)); + action=QUOTE(0 call FUNC(toggle_target_speed_assist)); }; - class TEXT_TARGET_SPEED_INPUT: TEXT_WIND_SPEED_INPUT { + class TEXT_TARGET_SPEED_OUTPUT: TEXT_WIND_SPEED_OUTPUT { idc=330; y=0.265*safezoneH+safezoneY+0.39; }; @@ -493,7 +493,7 @@ class ATragMX_Display { text="TR"; action=QUOTE(0 call FUNC(toggle_target_range_assist)); }; - class TEXT_TARGET_RANGE_INPUT: TEXT_WIND_SPEED_INPUT { + class TEXT_TARGET_RANGE_INPUT: TEXT_WIND_SPEED_OUTPUT { idc=340; y=0.265*safezoneH+safezoneY+0.425; }; @@ -501,7 +501,7 @@ class ATragMX_Display { class TEXT_ELEVATION: TEXT_GUN_PROFILE { idc=40; w=0.05; - x=0.550*safezoneW+safezoneX+0.11; + x=0.550*safezoneW+safezoneX+0.115; y=0.265*safezoneH+safezoneY+0.50; text="Elev"; }; @@ -523,9 +523,12 @@ class ATragMX_Display { x=0.550*safezoneW+safezoneX+0.32; text="Cur"; }; - class TEXT_ELEVATION_OUTPUT_ABSOLUTE: ATragMX_RscEdit { + class TEXT_ELEVATION_OUTPUT_ABSOLUTE: ATragMX_RscText { idc=400; - w=0.07; + style=160; + sizeEx=0.025; + w=0.065; + h=0.032; x=0.550*safezoneW+safezoneX+0.17; y=0.265*safezoneH+safezoneY+0.50; text=""; @@ -537,7 +540,6 @@ class ATragMX_Display { class TEXT_ELEVATION_INPUT_CURRENT: TEXT_ELEVATION_OUTPUT_ABSOLUTE { idc=402; x=0.550*safezoneW+safezoneX+0.323; - onKeyUp=QUOTE(if (_this select 1 == 28) then {call FUNC(parse_input); call FUNC(update_result)}); }; class TEXT_WINDAGE: TEXT_ELEVATION { idc=41; @@ -555,14 +557,14 @@ class ATragMX_Display { class TEXT_WINDAGE_INPUT_CURRENT: TEXT_WINDAGE_OUTPUT_ABSOLUTE { idc=412; x=0.550*safezoneW+safezoneX+0.323; - onKeyUp=QUOTE(if (_this select 1 == 28) then {call FUNC(parse_input); call FUNC(update_result)}); }; class TEXT_LEAD: TEXT_GUN { idc=42; w=0.05; - x=0.550*safezoneW+safezoneX+0.11; + x=0.550*safezoneW+safezoneX+0.115; y=0.265*safezoneH+safezoneY+0.57; text="Lead"; + action=QUOTE(GVAR(showWind2) = !GVAR(showWind2); call FUNC(update_result); call FUNC(update_target)); }; class TEXT_LEAD_OUTPUT: TEXT_ELEVATION_OUTPUT_ABSOLUTE { idc=420; @@ -594,11 +596,20 @@ class ATragMX_Display { class TEXT_SCOPE_UNIT: TEXT_GUN_LIST { idc=2000; style=ST_CENTER; + w=0.06; x=0.550*safezoneW+safezoneX+0.205; colorBackground[]={0,0,0,0}; text="TMOA"; action=QUOTE(call FUNC(cycle_scope_unit)); }; + class TEXT_SCOPE_CLICK_NUMBER: TEXT_GUN_LIST { + idc=2001; + style=ST_CENTER; + w=0.03; + x=0.550*safezoneW+safezoneX+0.27; + text="4"; + action=QUOTE(call FUNC(toggle_solution_setup)); + }; class TEXT_CALCULATE: TEXT_SCOPE_UNIT { idc=3000; style=ST_RIGHT; @@ -668,6 +679,7 @@ class ATragMX_Display { h=0.45; x=0.550*safezoneW+safezoneX+0.11; y=0.265*safezoneH+safezoneY+0.24; + sizeEx=0.025; colorSelectBackground[]={0.15,0.21,0.23,0.3}; colorSelectBackground2[]={0.15,0.21,0.23,0.3}; onMouseButtonDblClick=QUOTE(true call FUNC(toggle_gun_list)); @@ -748,7 +760,7 @@ class ATragMX_Display { y=0.265*safezoneH+safezoneY+0.35; strings[]={"Height","Width"}; values[]={1,0}; - onToolBoxSelChanged="GVAR(rangeAssistUseTargetHeight)=((_this select 1)==0)"; + onToolBoxSelChanged=QUOTE(GVAR(rangeAssistUseTargetHeight) = ((_this select 1) == 0)); }; class TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE: TEXT_TARGET_RANGE_ASSIST_MEASUREMENT_METHOD { idc=7003; @@ -814,13 +826,13 @@ class ATragMX_Display { w=0.07; x=0.550*safezoneW+safezoneX+0.32; text="cm"; - action=QUOTE(GVAR(rangeAssistTargetSizeUnit)=(GVAR(rangeAssistTargetSizeUnit)+1) % (count GVAR(GVAR(rangeAssistTargetSizeUnit)s)); ctrlSetText [7014, GVAR(GVAR(rangeAssistTargetSizeUnit)s) select GVAR(rangeAssistTargetSizeUnit)]); + action=QUOTE(call FUNC(cycle_target_size_units)); }; class TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_UNIT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_UNIT { idc=7015; y=0.265*safezoneH+safezoneY+0.45; text="MIL"; - action=QUOTE(GVAR(rangeAssistImageSizeUnit)=(GVAR(rangeAssistImageSizeUnit)+1) % (count GVAR(rangeAssistImageSizeUnits)); ctrlSetText [7015, GVAR(rangeAssistImageSizeUnits) select GVAR(rangeAssistImageSizeUnit)]); + action=QUOTE(call FUNC(cycle_image_size_units)); }; class TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE_UNIT: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE { idc=7016; @@ -861,22 +873,22 @@ class ATragMX_Display { class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE { idc=8000; - x=0.550*safezoneW+safezoneX+0.12; + x=0.550*safezoneW+safezoneX+0.13; text="Target Range"; }; class TEXT_TARGET_SPEED_ASSIST_NUM_TICKS: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE { idc=8001; - x=0.550*safezoneW+safezoneX+0.12; + x=0.550*safezoneW+safezoneX+0.13; text="Num Ticks"; }; class TEXT_TARGET_SPEED_ASSIST_TIME: TEXT_TARGET_RANGE_ASSIST_ANGLE { idc=8002; - x=0.550*safezoneW+safezoneX+0.12; + x=0.550*safezoneW+safezoneX+0.13; text="Time (secs)"; }; class TEXT_TARGET_SPEED_ASSIST_TARGET_ESTIMATED_SPEED: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE { idc=8003; - x=0.550*safezoneW+safezoneX+0.12; + x=0.550*safezoneW+safezoneX+0.13; text="Est Speed"; }; class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT { @@ -907,7 +919,7 @@ class ATragMX_Display { class TEXT_TARGET_SPEED_ASSIST_NUM_TICKS_UNIT: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_UNIT { idc=8009; text="MIL"; - action=QUOTE(GVAR(speedAssistNumTicksUnit)=(GVAR(speedAssistNumTicksUnit)+1) % (count GVAR(speedAssistNumTicksUnits)); ctrlSetText [8009, GVAR(speedAssistNumTicksUnits) select GVAR(speedAssistNumTicksUnit)]; call FUNC(calculate_target_speed_assist)); + action=QUOTE(call FUNC(cycle_num_ticks_units)); }; class TEXT_TARGET_SPEED_ASSIST_TIMER_START: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_UNIT { idc=8010; @@ -1046,5 +1058,414 @@ class ATragMX_Display { text="Cancel"; action=QUOTE(false call FUNC(show_add_new_gun); true call FUNC(show_gun_list)); }; + + class TEXT_GUN_AMMO_DATA_BORE_HEIGHT: TEXT_BORE_HEIGHT { + idc=12000; + w=0.22; + y=0.265*safezoneH+safezoneY+0.28; + text="Bore (cm)"; + }; + class TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT: ATragMX_RscEdit { + idc=120000; + w=0.06; + x=0.550*safezoneW+safezoneX+0.335; + y=0.265*safezoneH+safezoneY+0.28; + }; + class TEXT_GUN_AMMO_DATA_BULLET_MASS: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=12001; + y=0.265*safezoneH+safezoneY+0.320; + text="Bullet Weight (grams)"; + }; + class TEXT_GUN_AMMO_DATA_BULLET_MASS_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { + idc=120010; + y=0.265*safezoneH+safezoneY+0.320; + }; + class TEXT_GUN_AMMO_DATA_BULLET_DIAMETER: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=12002; + y=0.265*safezoneH+safezoneY+0.360; + text="Bullet Diam (cm)"; + }; + class TEXT_GUN_AMMO_DATA_BULLET_DIAMETER_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { + idc=120020; + y=0.265*safezoneH+safezoneY+0.360; + }; + class TEXT_GUN_AMMO_DATA_AIR_FRICTION: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=12003; + y=0.265*safezoneH+safezoneY+0.400; + text="C1 Coefficient"; + }; + class TEXT_GUN_AMMO_DATA_AIR_FRICTION_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { + idc=120030; + y=0.265*safezoneH+safezoneY+0.400; + }; + class TEXT_GUN_AMMO_DATA_RIFLE_TWIST: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=12004; + y=0.265*safezoneH+safezoneY+0.440; + text="Rifle Twist (cm/trn)"; + }; + class TEXT_GUN_AMMO_DATA_RIFLE_TWIST_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { + idc=120040; + y=0.265*safezoneH+safezoneY+0.440; + }; + class TEXT_GUN_AMMO_DATA_MUZZLE_VELOCITY: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=12005; + y=0.265*safezoneH+safezoneY+0.480; + text="Muzzle Velocity (m/s)"; + }; + class TEXT_GUN_AMMO_DATA_MUZZLE_VELOCITY_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { + idc=120050; + y=0.265*safezoneH+safezoneY+0.480; + }; + class TEXT_GUN_AMMO_DATA_ZERO_RANGE: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=12006; + y=0.265*safezoneH+safezoneY+0.520; + text="Zero Range (meters)"; + }; + class TEXT_GUN_AMMO_DATA_ZERO_RANGE_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { + idc=120060; + y=0.265*safezoneH+safezoneY+0.520; + }; + class TEXT_GUN_AMMO_DATA_ZERO_RANGE_METER_INDICATOR: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=120061; + w=0.05; + x=0.550*safezoneW+safezoneX+0.315; + y=0.265*safezoneH+safezoneY+0.520; + text=""; + }; + class TEXT_GUN_AMMO_DATA_DONE: TEXT_TARGET_SPEED_ASSIST_DONE { + idc=12008; + action=QUOTE(1 call FUNC(toggle_gun_ammo_data)); + }; + class TEXT_GUN_AMMO_DATA_CANCEL: TEXT_TARGET_SPEED_ASSIST_CANCEL { + idc=12009; + action=QUOTE(0 call FUNC(toggle_gun_ammo_data)); + }; + class TEXT_GUN_AMMO_DATA_PREV: TEXT_TARGET_SPEED_ASSIST_PREV { + idc=12010; + }; + class TEXT_GUN_AMMO_DATA_NEXT: TEXT_TARGET_SPEED_ASSIST_NEXT { + idc=12011; + }; + + class TEXT_ATMO_ENV_DATA_DEFAULT: TEXT_LEAD { + idc=13000; + w=0.08; + x=0.550*safezoneW+safezoneX+0.15; + y=0.265*safezoneH+safezoneY+0.320; + text="Default"; + action=QUOTE(call FUNC(restore_atmo_default)); + }; + class TEXT_ATMO_ENV_DATA_AT: TEXT_TARGET_A { + idc=13001; + w=0.04; + x=0.550*safezoneW+safezoneX+0.24; + y=0.265*safezoneH+safezoneY+0.320; + text="AT"; + action=QUOTE(GVAR(atmosphereModeTBH) = false; call FUNC(update_atmo_selection)); + }; + class TEXT_ATMO_ENV_DATA_TBH: TEXT_ATMO_ENV_DATA_AT { + idc=13002; + x=0.550*safezoneW+safezoneX+0.28; + text="TBH"; + action=QUOTE(GVAR(atmosphereModeTBH) = true; call FUNC(update_atmo_selection)); + }; + class TEXT_ATMO_ENV_DATA_ALTITUDE: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=13003; + x=0.550*safezoneW+safezoneX+0.115; + y=0.265*safezoneH+safezoneY+0.400; + text="Altitude (ft)"; + }; + class TEXT_ATMO_ENV_DATA_ALTITUDE_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { + idc=130030; + x=0.550*safezoneW+safezoneX+0.330; + y=0.265*safezoneH+safezoneY+0.400; + }; + class TEXT_ATMO_ENV_DATA_TEMPERATURE: TEXT_ATMO_ENV_DATA_ALTITUDE { + idc=13004; + y=0.265*safezoneH+safezoneY+0.440; + text="temperature (F)"; + }; + class TEXT_ATMO_ENV_DATA_TEMPERATURE_INPUT: TEXT_ATMO_ENV_DATA_ALTITUDE_INPUT { + idc=130040; + y=0.265*safezoneH+safezoneY+0.440; + }; + class TEXT_ATMO_ENV_DATA_BAROMETRIC_PRESSURE: TEXT_ATMO_ENV_DATA_ALTITUDE { + idc=13005; + y=0.265*safezoneH+safezoneY+0.480; + text="Barom Pres (in.merc.)"; + }; + class TEXT_ATMO_ENV_DATA_BAROMETRIC_PRESSURE_INPUT: TEXT_ATMO_ENV_DATA_ALTITUDE_INPUT { + idc=130050; + y=0.265*safezoneH+safezoneY+0.480; + }; + class TEXT_ATMO_ENV_DATA_RELATIVE_HUMIDITY: TEXT_ATMO_ENV_DATA_ALTITUDE { + idc=13006; + y=0.265*safezoneH+safezoneY+0.520; + text="Relative Humidity (%)"; + }; + class TEXT_ATMO_ENV_DATA_RELATIVE_HUMIDITY_INPUT: TEXT_ATMO_ENV_DATA_ALTITUDE_INPUT { + idc=130060; + y=0.265*safezoneH+safezoneY+0.520; + }; + class TEXT_ATMO_ENV_DATA_DONE: TEXT_TARGET_SPEED_ASSIST_DONE { + idc=13007; + action=QUOTE(1 call FUNC(toggle_atmo_env_data)); + }; + class TEXT_ATMO_ENV_DATA_CANCEL: TEXT_TARGET_SPEED_ASSIST_CANCEL { + idc=13008; + action=QUOTE(0 call FUNC(toggle_atmo_env_data)); + }; + class TEXT_ATMO_ENV_DATA_PREV: TEXT_TARGET_SPEED_ASSIST_PREV { + idc=13009; + }; + class TEXT_ATMO_ENV_DATA_NEXT: TEXT_TARGET_SPEED_ASSIST_NEXT { + idc=13010; + }; + class TEXT_ATMO_ENV_DATA_CALC_METHOD: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=13011; + style=64; + w=0.14; + h=0.07; + x=0.550*safezoneW+safezoneX+0.235; + y=0.265*safezoneH+safezoneY+0.29; + text="Calc Method"; + }; + + class TEXT_TARGET_DATA_LATITUDE: TEXT_BORE_HEIGHT { + idc=14000; + w=0.22; + y=0.265*safezoneH+safezoneY+0.28; + text="Latitude"; + }; + class TEXT_TARGET_DATA_LATITUDE_INPUT: ATragMX_RscEdit { + idc=140000; + w=0.06; + x=0.550*safezoneW+safezoneX+0.335; + y=0.265*safezoneH+safezoneY+0.28; + }; + class TEXT_TARGET_DATA_DIR_OF_FIRE: TEXT_TARGET_DATA_LATITUDE { + idc=14001; + y=0.265*safezoneH+safezoneY+0.320; + text="Dir of Fire (deg from N)"; + }; + class TEXT_TARGET_DATA_DIR_OF_FIRE_INPUT: TEXT_TARGET_DATA_LATITUDE_INPUT { + idc=140010; + y=0.265*safezoneH+safezoneY+0.320; + }; + class TEXT_TARGET_DATA_WIND_SPEED: TEXT_TARGET_DATA_LATITUDE { + idc=14002; + w=1.2; + y=0.265*safezoneH+safezoneY+0.360; + text="Wind Speed (m/s)"; + }; + class TEXT_TARGET_DATA_WIND_SPEED_1: TEXT_TARGET_DATA_LATITUDE { + idc=141020; + colorText[]={0,0,0,0.6}; + w=0.05; + h=0.03; + sizeEx=0.025; + x=0.550*safezoneW+safezoneX+0.270; + y=0.265*safezoneH+safezoneY+0.357; + text="1"; + }; + class TEXT_TARGET_DATA_WIND_SPEED_INPUT_1: TEXT_TARGET_DATA_LATITUDE_INPUT { + idc=140020; + w=0.045; + x=0.550*safezoneW+safezoneX+0.290; + y=0.265*safezoneH+safezoneY+0.360; + }; + class TEXT_TARGET_DATA_WIND_SPEED_2: TEXT_TARGET_DATA_WIND_SPEED_1 { + idc=141021; + x=0.550*safezoneW+safezoneX+0.330; + text="2"; + }; + class TEXT_TARGET_DATA_WIND_SPEED_INPUT_2: TEXT_TARGET_DATA_LATITUDE_INPUT { + idc=140021; + w=0.045; + x=0.550*safezoneW+safezoneX+0.350; + y=0.265*safezoneH+safezoneY+0.360; + }; + class TEXT_TARGET_DATA_WIND_DIRECTION: TEXT_TARGET_DATA_LATITUDE { + idc=14003; + y=0.265*safezoneH+safezoneY+0.400; + text="Wind Direction (clock)"; + }; + class TEXT_TARGET_DATA_WIND_DIRECTION_INPUT: TEXT_TARGET_DATA_LATITUDE_INPUT { + idc=140030; + y=0.265*safezoneH+safezoneY+0.400; + }; + class TEXT_TARGET_DATA_INCLINATION_ANGLE: TEXT_TARGET_DATA_LATITUDE { + idc=14004; + w=1.2; + y=0.265*safezoneH+safezoneY+0.440; + text="Inclination Angle"; + }; + class TEXT_TARGET_DATA_INCLINATION_ANGLE_COSINE: TEXT_TARGET_DATA_LATITUDE { + idc=141041; + colorText[]={0,0,0,0.6}; + w=0.05; + h=0.03; + sizeEx=0.025; + x=0.550*safezoneW+safezoneX+0.270; + y=0.265*safezoneH+safezoneY+0.437; + text="c"; + }; + class TEXT_TARGET_DATA_INCLINATION_ANGLE_INPUT_COSINE: TEXT_TARGET_DATA_LATITUDE_INPUT { + idc=140041; + w=0.045; + x=0.550*safezoneW+safezoneX+0.290; + y=0.265*safezoneH+safezoneY+0.440; + onKeyUp=QUOTE(if (_this select 1 == 28) then {0 call FUNC(update_inclination_angle)}); + }; + class TEXT_TARGET_DATA_INCLINATION_ANGLE_DEGREE: TEXT_TARGET_DATA_INCLINATION_ANGLE_COSINE { + idc=141040; + x=0.550*safezoneW+safezoneX+0.330; + text="d"; + }; + class TEXT_TARGET_DATA_INCLINATION_ANGLE_INPUT_DEGREE: TEXT_TARGET_DATA_LATITUDE_INPUT { + idc=140040; + w=0.045; + x=0.550*safezoneW+safezoneX+0.350; + y=0.265*safezoneH+safezoneY+0.440; + onKeyUp=QUOTE(if (_this select 1 == 28) then {1 call FUNC(update_inclination_angle)}); + }; + class TEXT_TARGET_DATA_TARGET_SPEED: TEXT_TARGET_DATA_LATITUDE { + idc=14005; + y=0.265*safezoneH+safezoneY+0.480; + text="Target Speed (m/s)"; + }; + class TEXT_TARGET_DATA_TARGET_SPEED_INPUT: TEXT_TARGET_DATA_LATITUDE_INPUT { + idc=140050; + y=0.265*safezoneH+safezoneY+0.480; + }; + class TEXT_TARGET_DATA_TARGET_SPEED_DIRECTION: ATragMX_RscButton { + idc=140051; + colorBackground[]={0.15,0.21,0.23,0.3}; + colorFocused[]={0.15,0.21,0.23,0.2}; + w=0.0231; + x=0.550*safezoneW+safezoneX+0.305; + y=0.265*safezoneH+safezoneY+0.480; + text=">"; + action=QUOTE(call FUNC(cycle_target_speed_direction)); + }; + class TEXT_TARGET_DATA_TARGET_RANGE: TEXT_TARGET_DATA_LATITUDE { + idc=14006; + y=0.265*safezoneH+safezoneY+0.520; + text="Target Range (meters)"; + }; + class TEXT_TARGET_DATA_TARGET_RANGE_INPUT: TEXT_TARGET_DATA_LATITUDE_INPUT { + idc=140060; + y=0.265*safezoneH+safezoneY+0.520; + }; + class TEXT_TARGET_DATA_TARGET_RANGE_METER_INDICATOR: TEXT_TARGET_DATA_LATITUDE { + idc=140061; + w=0.05; + x=0.550*safezoneW+safezoneX+0.315; + y=0.265*safezoneH+safezoneY+0.520; + text=""; + }; + class TEXT_TARGET_DATA_DONE: TEXT_TARGET_SPEED_ASSIST_DONE { + idc=14008; + action=QUOTE(1 call FUNC(toggle_target_data)); + }; + class TEXT_TARGET_DATA_CANCEL: TEXT_TARGET_SPEED_ASSIST_CANCEL { + idc=14009; + action=QUOTE(0 call FUNC(toggle_target_data)); + }; + class TEXT_TARGET_DATA_PREV: TEXT_TARGET_SPEED_ASSIST_PREV { + idc=14010; + }; + class TEXT_TARGET_DATA_NEXT: TEXT_TARGET_SPEED_ASSIST_NEXT { + idc=14011; + }; + + class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=15000; + style=64; + w=0.25; + h=0.07; + x=0.550*safezoneW+safezoneX+0.13; + y=0.265*safezoneH+safezoneY+0.32; + text="Show result in"; + }; + class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1: TEXT_TARGET_A { + idc=15001; + w=0.04; + x=0.550*safezoneW+safezoneX+0.14; + y=0.265*safezoneH+safezoneY+0.35; + text="1"; + action=QUOTE(GVAR(currentScopeClickNumberTemp) = 1; call FUNC(update_solution_setup)); + }; + class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_2: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 { + idc=15002; + x=0.550*safezoneW+safezoneX+0.18; + text="2"; + action=QUOTE(GVAR(currentScopeClickNumberTemp) = 2; call FUNC(update_solution_setup)); + }; + class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_3: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 { + idc=15003; + x=0.550*safezoneW+safezoneX+0.22; + text="3"; + action=QUOTE(GVAR(currentScopeClickNumberTemp) = 3; call FUNC(update_solution_setup)); + }; + class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_4: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 { + idc=15004; + x=0.550*safezoneW+safezoneX+0.26; + text="4"; + action=QUOTE(GVAR(currentScopeClickNumberTemp) = 4; call FUNC(update_solution_setup)); + }; + class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_8: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 { + idc=15005; + x=0.550*safezoneW+safezoneX+0.30; + text="8"; + action=QUOTE(GVAR(currentScopeClickNumberTemp) = 8; call FUNC(update_solution_setup)); + }; + class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_10: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 { + idc=15006; + x=0.550*safezoneW+safezoneX+0.34; + text="10"; + action=QUOTE(GVAR(currentScopeClickNumberTemp) = 10; call FUNC(update_solution_setup)); + }; + class TEXT_SOLUTION_SETUP_CLICKS_PER: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=15007; + style=64; + w=0.25; + h=0.07; + x=0.550*safezoneW+safezoneX+0.13; + y=0.265*safezoneH+safezoneY+0.42; + text="Clicks per"; + }; + class TEXT_SOLUTION_SETUP_CLICKS_PER_TMOA: TEXT_TARGET_A { + idc=15008; + w=0.05; + x=0.550*safezoneW+safezoneX+0.15; + y=0.265*safezoneH+safezoneY+0.45; + text="TMOA"; + action=QUOTE(GVAR(currentScopeClickUnitTemp) = 0; call FUNC(update_solution_setup)); + }; + class TEXT_SOLUTION_SETUP_CLICKS_PER_SMOA: TEXT_SOLUTION_SETUP_CLICKS_PER_TMOA { + idc=15009; + x=0.550*safezoneW+safezoneX+0.23; + text="SMOA"; + action=QUOTE(GVAR(currentScopeClickUnitTemp) = 1; call FUNC(update_solution_setup)); + }; + class TEXT_SOLUTION_SETUP_CLICKS_PER_MILS: TEXT_SOLUTION_SETUP_CLICKS_PER_TMOA { + idc=15010; + x=0.550*safezoneW+safezoneX+0.31; + text="MILS"; + action=QUOTE(GVAR(currentScopeClickUnitTemp) = 2; call FUNC(update_solution_setup)); + }; + class TEXT_SOLUTION_SETUP_DONE: TEXT_TARGET_SPEED_ASSIST_DONE { + idc=15011; + x=0.550*safezoneW+safezoneX+0.18; + y=0.265*safezoneH+safezoneY+0.55; + action=QUOTE(1 call FUNC(toggle_solution_setup)); + }; + class TEXT_SOLUTION_SETUP_CANCEL: TEXT_TARGET_SPEED_ASSIST_CANCEL { + idc=15012; + x=0.550*safezoneW+safezoneX+0.26; + y=0.265*safezoneH+safezoneY+0.55; + action=QUOTE(0 call FUNC(toggle_solution_setup)); + }; }; }; \ No newline at end of file diff --git a/addons/atragmx/XEH_postInit.sqf b/addons/atragmx/XEH_postInit.sqf index 6875b4382e..e2e3cb254c 100644 --- a/addons/atragmx/XEH_postInit.sqf +++ b/addons/atragmx/XEH_postInit.sqf @@ -1,25 +1,50 @@ #include "script_component.hpp" -//#include "initKeybinds.sqf" +#include "initKeybinds.sqf" -if (count (profileNamespace getVariable ["ACE_ATragMX_gunList", []]) > 0) then { +if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) == ATRAGMX_PROFILE_NAMESPACE_VERSION && count (profileNamespace getVariable ["ACE_ATragMX_gunList", []]) > 0) then { GVAR(gunList) = profileNamespace getVariable "ACE_ATragMX_gunList"; } else { - // Profile Name, Muzzle Velocity, Zero Range, Scope Base Angle, AirFriction, Bore Height, Scope Unit, Elevation Scope Step, Windage Scope Step, Maximum Elevation, Dialed Elevation, Dialed Windage, Mass, Ammo Class Name, Magazine Class Name, BC, Drag Model, Atmosphere Model - GVAR(gunList) = [["12.7x108mm" , 820, 100, 0.0659, -0.0008600, 3.81, 0, 0.338, 0.338, 120, 0, 0, 48.28, "B_127x108_Ball" , "5Rnd_127x108_Mag" , 0.700, 1, "ASM" ], - ["12.7x99mm" , 880, 100, 0.0607, -0.0008600, 3.81, 0, 0.338, 0.338, 120, 0, 0, 41.92, "B_127x99_Ball" , "5Rnd_mas_127x99_Stanag" , 0.670, 1, "ASM" ], - ["12.7x54mm" , 290, 100, 0.3913, -0.0014000, 3.81, 0, 0.338, 0.338, 120, 0, 0, 61.56, "B_127x54_Ball" , "10Rnd_127x54_Mag" , 1.050, 1, "ASM" ], - ["10.4x77mm" , 910, 100, 0.0572, -0.0004800, 3.81, 0, 0.338, 0.338, 120, 0, 0, 27.15, "B_408_Ball" , "7Rnd_408_Mag" , 0.970, 1, "ASM" ], - ["9.3×64mm" , 870, 100, 0.0632, -0.0007500, 3.81, 0, 0.338, 0.338, 120, 0, 0, 16.20, "B_93x64_Ball" , "10Rnd_93x64_DMR_05_Mag" , 0.368, 1, "ASM" ], - ["8.6×70mm" , 915, 100, 0.0572, -0.0006100, 3.81, 0, 0.338, 0.338, 120, 0, 0, 16.20, "B_338_Ball" , "10Rnd_338_Mag" , 0.322, 7, "ICAO"], - ["7.62x51mm" , 850, 100, 0.0639, -0.0010000, 3.81, 0, 0.338, 0.338, 120, 0, 0, 9.460, "B_762x51_Ball" , "20Rnd_762x51_Mag" , 0.393, 1, "ICAO"], - ["6.5x39mm" , 800, 100, 0.0689, -0.0009000, 3.81, 0, 0.338, 0.338, 120, 0, 0, 7.776, "B_65x39_Caseless", "30Rnd_65x39_caseless_mag", 0.263, 1, "ICAO"], - ["5.56x45mm" , 920, 100, 0.0584, -0.0012650, 3.81, 0, 0.338, 0.338, 120, 0, 0, 4.000, "B_556x45_Ball" , "30Rnd_556x45_Stanag" , 0.304, 1, "ASM" ], - ["5.56x45mm Mk262" , 850, 100, 0.0643, -0.0011250, 3.81, 0, 0.338, 0.338, 120, 0, 0, 4.990, "RH_556x45_Mk262" , "RH_30Rnd_556x45_Mk262" , 0.361, 1, "ASM" ]]; + // Profile Name, Muzzle Velocity, Zero Range, Scope Base Angle, AirFriction, Bore Height, Scope Unit, Scope Click Unit, Scope Click Number, Maximum Elevation, Dialed Elevation, Dialed Windage, Mass, Bullet Diameter, Rifle Twist, BC, Drag Model, Atmosphere Model + GVAR(gunList) = [["12.7x108mm" , 820, 100, 0.0657, -0.0006400, 3.81, 0, 2, 10, 120, 0, 0, 48.28, 12.7, 38.10, 0.630, 1, "ASM" ], + ["12.7x99mm AMAX" , 860, 100, 0.0612, -0.0003740, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 38.10, 1.050, 1, "ASM" ], + ["12.7x99mm" , 900, 100, 0.0623, -0.0006000, 3.81, 0, 2, 10, 120, 0, 0, 41.92, 12.7, 38.10, 0.670, 1, "ASM" ], + + ["12.7x54mm" , 300, 100, 0.3395, -0.0001400, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 24.13, 1.050, 1, "ASM" ], + + [".408 Chey Tac" , 910, 100, 0.0571, -0.0003950, 3.81, 0, 2, 10, 120, 0, 0, 27.15, 10.4, 33.02, 0.970, 1, "ASM" ], + + ["9.3×64mm" , 870, 100, 0.0619, -0.0010600, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 9.30, 35.56, 0.368, 1, "ASM" ], + + [".338LM 250gr" , 880, 100, 0.0598, -0.0006060, 3.81, 0, 2, 10, 120, 0, 0, 16.20, 8.58, 25.40, 0.322, 7, "ICAO"], + [".338LM 300gr" , 800, 100, 0.0677, -0.0005350, 3.81, 0, 2, 10, 120, 0, 0, 19.44, 8.58, 25.40, 0.381, 7, "ICAO"], + [".338LM API526" , 880, 100, 0.0601, -0.0006730, 3.81, 0, 2, 10, 120, 0, 0, 16.39, 8.58, 25.40, 0.290, 7, "ICAO"], + + [".300WM Mk248 Mod 0", 900, 100, 0.0584, -0.0008300, 3.81, 0, 2, 10, 120, 0, 0, 13.31, 7.80, 25.40, 0.268, 7, "ICAO"], + [".300WM Mk248 Mod 1", 867, 100, 0.0611, -0.0008150, 3.81, 0, 2, 10, 120, 0, 0, 14.26, 7.80, 25.40, 0.310, 7, "ICAO"], + [".300WM Berger OTM" , 853, 100, 0.0622, -0.0007600, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 7.80, 25.40, 0.368, 7, "ICAO"], + + ["7.62x54mmR" , 800, 100, 0.0692, -0.0010230, 3.81, 0, 2, 10, 120, 0, 0, 9.849, 7.92, 24.13, 0.400, 1, "ICAO"], + + ["7.62x51mm M80" , 810, 100, 0.0679, -0.0010350, 3.81, 0, 2, 10, 120, 0, 0, 9.525, 7.82, 25.40, 0.200, 7, "ICAO"], + ["7.62x51mm M118LR" , 820, 100, 0.0662, -0.0008525, 3.81, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.243, 7, "ICAO"], + ["7.62x51mm Mk319" , 820, 100, 0.0670, -0.0010300, 3.81, 0, 2, 10, 120, 0, 0, 8.424, 7.82, 25.40, 0.377, 1, "ICAO"], + ["7.62x51mm Subsonic", 320, 100, 0.3060, -0.0004910, 3.81, 0, 2, 10, 120, 0, 0, 12.96, 7.82, 25.40, 0.235, 7, "ICAO"], + + ["6.5x39mm" , 800, 100, 0.0683, -0.0007850, 3.81, 0, 2, 10, 120, 0, 0, 7.970, 6.71, 22.86, 0.263, 7, "ICAO"], + ["6.5x47mm Lapua" , 800, 100, 0.0682, -0.0007710, 3.81, 0, 2, 10, 120, 0, 0, 9.007, 6.71, 22.86, 0.290, 7, "ICAO"], + ["6.5mm Creedmor" , 840, 100, 0.0637, -0.0006510, 3.81, 0, 2, 10, 120, 0, 0, 9.072, 6.71, 22.86, 0.317, 7, "ICAO"], + + ["5.56x45mm M855" , 870, 100, 0.0626, -0.0012650, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.151, 7, "ASM" ], + ["5.56x45mm Mk262" , 820, 100, 0.0671, -0.0011250, 3.81, 0, 2, 10, 120, 0, 0, 4.990, 5.70, 17.78, 0.361, 1, "ASM" ], + ["5.56x45mm Mk318" , 880, 100, 0.0616, -0.0011200, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.307, 1, "ASM" ]]; + + [] call FUNC(clear_user_data); profileNamespace setVariable ["ACE_ATragMX_gunList", GVAR(gunList)]; }; [] call FUNC(init); +[] call FUNC(restore_user_data); ["RangerfinderData", {_this call FUNC(sord)}] call EFUNC(common,addEventHandler); diff --git a/addons/atragmx/XEH_preInit.sqf b/addons/atragmx/XEH_preInit.sqf index 91024d05a3..6ec288b9c7 100644 --- a/addons/atragmx/XEH_preInit.sqf +++ b/addons/atragmx/XEH_preInit.sqf @@ -11,36 +11,60 @@ PREP(calculate_target_solution); PREP(calculate_target_speed_assist); PREP(can_show); PREP(change_gun); +PREP(change_target_slot); +PREP(clear_user_data); PREP(create_dialog); +PREP(cycle_gun_list); +PREP(cycle_image_size_units); +PREP(cycle_num_ticks_units); PREP(cycle_range_card_columns); PREP(cycle_scope_unit); +PREP(cycle_target_size_units); +PREP(cycle_target_speed_direction); PREP(delete_gun); PREP(init); PREP(parse_input); PREP(reset_relative_click_memory); +PREP(restore_atmo_default); +PREP(restore_user_data); PREP(save_gun); PREP(show_add_new_gun); +PREP(show_atmo_env_data); +PREP(show_gun_ammo_data); PREP(show_gun_list); PREP(show_main_page); PREP(show_range_card); PREP(show_range_card_setup); +PREP(show_solution_setup); +PREP(show_target_data); PREP(show_target_range_assist); PREP(show_target_speed_assist); PREP(show_target_speed_assist_timer); PREP(sord); +PREP(store_user_data); PREP(target_speed_assist_timer); +PREP(toggle_atmo_env_data); +PREP(toggle_gun_ammo_data); PREP(toggle_gun_list); PREP(toggle_range_card); PREP(toggle_range_card_setup); +PREP(toggle_solution_setup); +PREP(toggle_target_data); PREP(toggle_target_range_assist); PREP(toggle_target_speed_assist); PREP(update_atmosphere); +PREP(update_atmo_env_data); +PREP(update_atmo_selection); PREP(update_gun); +PREP(update_gun_ammo_data); +PREP(update_inclination_angle); PREP(update_range_card); PREP(update_relative_click_memory); PREP(update_result); PREP(update_scope_unit); +PREP(update_solution_setup); PREP(update_target); +PREP(update_target_data); PREP(update_target_selection); PREP(update_unit_selection); PREP(update_zero_range); diff --git a/addons/atragmx/functions/fnc_add_new_gun.sqf b/addons/atragmx/functions/fnc_add_new_gun.sqf index bac04c2e07..0a0c034f39 100644 --- a/addons/atragmx/functions/fnc_add_new_gun.sqf +++ b/addons/atragmx/functions/fnc_add_new_gun.sqf @@ -19,7 +19,7 @@ private ["_gunName", "_gunProfileEntry"]; _gunName = ctrlText 11001; if (_gunName != "") then { - _gunProfileEntry = [_gunName, 850, 500, 0.280, -0.0010000, 3.81, 0, 0.338, 0.338, 120, 0, 0, 9.460, "", "", 0.393, 1, "ICAO"]; + _gunProfileEntry = [_gunName, 810, 100, 0.0679, -0.0010350, 3.81, 0, 2, 10, 120, 0, 0, 9.525, 7.82, 25.40, 0.393, 1, "ICAO"], GVAR(gunList) = GVAR(gunList) + [_gunProfileEntry]; diff --git a/addons/atragmx/functions/fnc_calculate_range_card.sqf b/addons/atragmx/functions/fnc_calculate_range_card.sqf index 05625a53f6..cfaf7441f8 100644 --- a/addons/atragmx/functions/fnc_calculate_range_card.sqf +++ b/addons/atragmx/functions/fnc_calculate_range_card.sqf @@ -18,45 +18,63 @@ [] call FUNC(parse_input); private ["_scopeBaseAngle"]; -_scopeBaseAngle = ((GVAR(workingMemory) select GVAR(currentTarget)) select 3); +_scopeBaseAngle = (GVAR(workingMemory) select 3); -private ["_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel"]; -_bulletMass = (GVAR(workingMemory) select GVAR(currentTarget)) select 12; -_boreHeight = (GVAR(workingMemory) select GVAR(currentTarget)) select 5; -_airFriction = (GVAR(workingMemory) select GVAR(currentTarget)) select 4; -_muzzleVelocity = (GVAR(workingMemory) select GVAR(currentTarget)) select 1; -_bc = (GVAR(workingMemory) select GVAR(currentTarget)) select 15; -_dragModel = (GVAR(workingMemory) select GVAR(currentTarget)) select 16; -_atmosphereModel = (GVAR(workingMemory) select GVAR(currentTarget)) select 17; +private ["_bulletMass", "_bulletDiameter", "_boreHeight", "_airFriction", "_barrelTwist", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel", "_twistDirection"]; +_bulletMass = GVAR(workingMemory) select 12; +_bulletDiameter = GVAR(workingMemory) select 13; +_boreHeight = GVAR(workingMemory) select 5; +_airFriction = GVAR(workingMemory) select 4; +_barrelTwist = GVAR(workingMemory) select 14; +_muzzleVelocity = GVAR(workingMemory) select 1; +_bc = GVAR(workingMemory) select 15; +_dragModel = GVAR(workingMemory) select 16; +_atmosphereModel = GVAR(workingMemory) select 17; -private ["_temperature", "_barometricPressure", "_relativeHumidity"]; -_temperature = (GVAR(temperature) select GVAR(currentTarget)); -_barometricPressure = (GVAR(barometricPressure) select GVAR(currentTarget)); -_relativeHumidity = (GVAR(relativeHumidity) select GVAR(currentTarget)); -if (GVAR(currentUnit) == 1) then -{ - _temperature = (_temperature - 32) / 1.8; - _barometricPressure = _barometricPressure * 33.8638866667; +_twistDirection = 0; +if (_barrelTwist > 0) then { + _twistDirection = 1; +} else { + if (_barrelTwist < 0) then { + _twistDirection = -1; + }; +}; +_barrelTwist = abs(_barrelTwist); + +private ["_altitude", "_temperature", "_barometricPressure", "_relativeHumidity"]; +_altitude = GVAR(altitude); +_temperature = GVAR(temperature); +_barometricPressure = GVAR(barometricPressure); +_relativeHumidity = GVAR(relativeHumidity); +if (!GVAR(atmosphereModeTBH)) then { + _barometricPressure = 1013.25 * exp(-(_altitude) / 7990); + _relativeHumidity = 50; }; -private ["_windSpeed", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange"]; -_windSpeed = (GVAR(windSpeed) select GVAR(currentTarget)); +private ["_bulletLength", "_stabilityFactor"]; +_bulletLength = 1.8; +_stabilityFactor = 1.5; +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + if (_bulletDiameter > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { + _stabilityFactor = [_bulletDiameter / 10 / 2.54, _bulletLength, _bulletMass * 15.4323584, _barrelTwist / 2.54, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor); + }; +}; + +private ["_latitude", "_directionOfFire", "_windSpeed1", "_windSpeed2", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange"]; +_latitude = GVAR(latitude) select GVAR(currentTarget); +_directionOfFire = GVAR(directionOfFire) select GVAR(currentTarget); +_windSpeed1 = (GVAR(windSpeed1) select GVAR(currentTarget)); +_windSpeed2 = (GVAR(windSpeed2) select GVAR(currentTarget)); _windDirection = (GVAR(windDirection) select GVAR(currentTarget)); _inclinationAngle = (GVAR(inclinationAngle) select GVAR(currentTarget)); _targetSpeed = (GVAR(targetSpeed) select GVAR(currentTarget)); _targetRange = GVAR(rangeCardEndRange); -if (GVAR(currentUnit) != 2) then -{ +if (GVAR(currentUnit) == 1) then { _targetRange = _targetRange / 1.0936133; }; -if (GVAR(currentUnit) == 1) then -{ - _windSpeed = _windSpeed / 2.23693629; - _targetSpeed = _targetSpeed / 2.23693629; -}; GVAR(rangeCardData) = []; private ["_result"]; _result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, - _windSpeed, _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, true] call FUNC(calculate_solution); + [_windSpeed1, _windSpeed2], _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, true, _stabilityFactor, _twistDirection, _latitude, _directionOfFire] call FUNC(calculate_solution); diff --git a/addons/atragmx/functions/fnc_calculate_scope_base_angle.sqf b/addons/atragmx/functions/fnc_calculate_scope_base_angle.sqf index 4822b08b37..fbd191bb79 100644 --- a/addons/atragmx/functions/fnc_calculate_scope_base_angle.sqf +++ b/addons/atragmx/functions/fnc_calculate_scope_base_angle.sqf @@ -34,6 +34,7 @@ _temperature = 15; _barometricPressure = 1013.25; _relativeHumidity = 0; -_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, 0, 0, 0, 0, _zeroRange, _airFriction, 1, "ICAO", false] call FUNC(calculate_solution); +private ["_result"]; +_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, [0, 0], 0, 0, 0, _zeroRange, _airFriction, 1, "ICAO", false, 1.5, 0, 0, 0] call FUNC(calculate_solution); _scopeBaseAngle + (_result select 0) / 60 diff --git a/addons/atragmx/functions/fnc_calculate_solution.sqf b/addons/atragmx/functions/fnc_calculate_solution.sqf index 90263a608c..2049398a9c 100644 --- a/addons/atragmx/functions/fnc_calculate_solution.sqf +++ b/addons/atragmx/functions/fnc_calculate_solution.sqf @@ -12,7 +12,7 @@ * 6: barometric pressure * 7: relative humidity * 8: simulation steps - * 9: wind speed + * 9: wind speed * 10: wind direction * 11: inclination angle * 12: target speed @@ -21,14 +21,20 @@ * 15: drag model * 16: atmosphere model * 17: Store range card data? + * 18: Stability factor + * 19: Twist Direction + * 20: Latitude * * Return Value: - * 0: Elevation - * 1: Windage - * 2: Lead - * 3: Time of fligth - * 4: Remaining velocity - * 4: Remaining kinetic energy + * 0: Elevation (MOA) + * 1: Windage (MOA) + * 2: Lead (MOA) + * 3: Time of fligth (SECONDS) + * 4: Remaining velocity (m/s) + * 5: Remaining kinetic energy (ft·lb) + * 6: Vertical coriolis drift (MOA) + * 7: Horizontal coriolis drift (MOA) + * 8: Spin drift (MOA) * * Example: * call ace_atragmx_calculate_target_range_assist @@ -37,7 +43,7 @@ */ #include "script_component.hpp" -private ["_scopeBaseAngle", "_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_temperature", "_barometricPressure", "_relativeHumidity", "_simSteps", "_windSpeed", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange", "_bc", "_dragModel", "_atmosphereModel", "_storeRangeCardData"]; +private ["_scopeBaseAngle", "_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_temperature", "_barometricPressure", "_relativeHumidity", "_simSteps", "_windSpeed1", "_windSpeed2", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange", "_drag", "_bc", "_dragModel", "_atmosphereModel", "_storeRangeCardData", "_stabilityFactor", "_twistDirection", "_latitude", "_directionOfFire"]; _scopeBaseAngle = _this select 0; _bulletMass = _this select 1; _boreHeight = _this select 2; @@ -47,7 +53,8 @@ _temperature = _this select 5; _barometricPressure = _this select 6; _relativeHumidity = _this select 7; _simSteps = _this select 8; -_windSpeed = _this select 9; +_windSpeed1 = (_this select 9) select 0; +_windSpeed2 = (_this select 9) select 1; _windDirection = _this select 10; _inclinationAngle = _this select 11; _targetSpeed = _this select 12; @@ -56,6 +63,10 @@ _bc = _this select 14; _dragModel = _this select 15; _atmosphereModel = _this select 16; _storeRangeCardData = _this select 17; +_stabilityFactor = _this select 18; +_twistDirection = _this select 19; +_latitude = _this select 20; +_directionOfFire = _this select 21; private ["_bulletPos", "_bulletVelocity", "_bulletAccel", "_bulletSpeed", "_gravity", "_deltaT"]; _bulletPos = [0, 0, 0]; @@ -65,31 +76,51 @@ _bulletSpeed = 0; _gravity = [0, sin(_scopeBaseAngle + _inclinationAngle) * -9.80665, cos(_scopeBaseAngle + _inclinationAngle) * -9.80665]; _deltaT = 1 / _simSteps; -private ["_elevation", "_windage", "_lead", "_TOF", "_trueVelocity", "_trueSpeed", "_kineticEnergy"]; +private ["_elevation", "_windage1", "_windage2", "_lead", "_TOF", "_trueVelocity", "_trueSpeed", "_kineticEnergy", "_verticalCoriolis", "_verticalDeflection", "_horizontalCoriolis", "_horizontalDeflection", "_spinDrift", "_spinDeflection"]; _elevation = 0; -_windage = 0; +_windage1 = 0; +_windage2 = 0; _lead = 0; _TOF = 0; _trueVelocity = [0, 0, 0]; _trueSpeed = 0; +_verticalCoriolis = 0; +_verticalDeflection = 0; +_horizontalCoriolis = 0; +_horizontalDeflection = 0; +_spinDrift = 0; +_spinDeflection = 0; private ["_n", "_range", "_rangeFactor"]; _n = 0; _range = 0; _rangeFactor = 1; if (_storeRangeCardData) then { - if (GVAR(currentUnit) != 2) then { + if (GVAR(currentUnit) == 1) then { _rangeFactor = 1.0936133; }; GVAR(rangeCardData) = []; }; -private ["_wind"]; -_wind = [cos(270 - _windDirection * 30) * _windSpeed, sin(270 - _windDirection * 30) * _windSpeed, 0]; -if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then { +private ["_wind1", "_wind2", "_windDrift"]; +_wind1 = [cos(270 - _windDirection * 30) * _windSpeed1, sin(270 - _windDirection * 30) * _windSpeed1, 0]; +_wind2 = [cos(270 - _windDirection * 30) * _windSpeed2, sin(270 - _windDirection * 30) * _windSpeed2, 0]; +_windDrift = 0; +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { _bc = [_bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel] call EFUNC(advanced_ballistics,calculateAtmosphericCorrection); }; +private ["_speedTotal", "_stepsTotal", "_speedAverage"]; +_speedTotal = 0; +_stepsTotal = 0; +_speedAverage = 0; + +private ["_eoetvoesMultiplier"]; +_eoetvoesMultiplier = 0; +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + _eoetvoesMultiplier = 2 * (0.0000729 * _muzzleVelocity / -9.80665) * cos(_latitude) * sin(_directionOfFire); +}; + _TOF = 0; _bulletPos set [0, 0]; @@ -102,16 +133,21 @@ _bulletVelocity set [2, Sin(_scopeBaseAngle) * _muzzleVelocity]; while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { _bulletSpeed = vectorMagnitude _bulletVelocity; + + _speedTotal = _speedTotal + _bulletSpeed; + _stepsTotal = _stepsTotal + 1; + _speedAverage = (_speedTotal / _stepsTotal); - _trueVelocity = _bulletVelocity vectorDiff _wind; + _trueVelocity = _bulletVelocity vectorDiff _wind1; _trueSpeed = vectorMagnitude _trueVelocity; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - if (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false]) then { - private ["_drag"]; - _drag = -1 * ([_dragModel, _bc, _trueSpeed] call EFUNC(advanced_ballistics,calculateRetardation)); - _bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (_drag); + _drag = if (missionNamespace getVariable [QEGVAR(advanced_ballistics,extensionAvailable), false]) then { + parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3", _dragModel, _bc, _trueSpeed])) + } else { + ([_dragModel, _bc, _trueSpeed] call EFUNC(advanced_ballistics,calculateRetardation)) }; + _bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag); } else { _bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction); }; @@ -128,15 +164,34 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { if ((_bulletPos select 1) * _rangeFactor >= _range && _range <= GVAR(rangeCardEndRange)) then { if ((_bulletPos select 1) > 0) then { _elevation = - atan((_bulletPos select 2) / (_bulletPos select 1)); - _windage = - atan((_bulletPos select 0) / (_bulletPos select 1)); + _windage1 = - atan((_bulletPos select 0) / (_bulletPos select 1)); + _windDrift = (_wind2 select 0) * (_TOF - (_range / _rangeFactor) / _muzzleVelocity); + _windage2 = - atan(_windDrift / (_bulletPos select 1)); }; if (_range != 0) then { _lead = (_targetSpeed * _TOF) / (Tan(3.38 / 60) * _range); }; _kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); _kineticEnergy = _kineticEnergy * 0.737562149; - - GVAR(rangeCardData) set [_n, [_range, _elevation * 60, _windage * 60, _lead, _TOF, _bulletSpeed, _kineticEnergy]]; + + if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (_bulletPos select 1) > 0) then { + // Coriolis + _horizontalDeflection = 0.0000729 * ((_bulletPos select 1) ^ 2) * sin(_latitude) / _speedAverage; + _horizontalCoriolis = - atan(_horizontalDeflection / (_bulletPos select 1)); + _windage1 = _windage1 + _horizontalCoriolis; + _windage2 = _windage2 + _horizontalCoriolis; + // Eoetvoes + _verticalDeflection = (_bulletPos select 2) * _eoetvoesMultiplier; + _verticalCoriolis = - atan(_verticalDeflection / (_bulletPos select 1)); + _elevation = _elevation + _verticalCoriolis; + // Spin drift + _spinDeflection = _twistDirection * 0.0254 * 1.25 * (_stabilityFactor + 1.2) * _TOF ^ 1.83; + _spinDrift = - atan(_spinDeflection / (_bulletPos select 1)); + _windage1 = _windage1 + _spinDrift; + _windage2 = _windage2 + _spinDrift; + }; + + GVAR(rangeCardData) set [_n, [_range, _elevation * 60, [_windage1 * 60, _windage2 * 60], _lead, _TOF, _bulletSpeed, _kineticEnergy]]; _n = _n + 1; }; }; @@ -144,7 +199,9 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { if ((_bulletPos select 1) > 0) then { _elevation = - atan((_bulletPos select 2) / (_bulletPos select 1)); - _windage = - atan((_bulletPos select 0) / (_bulletPos select 1)); + _windage1 = - atan((_bulletPos select 0) / (_bulletPos select 1)); + _windDrift = (_wind2 select 0) * (_TOF - _targetRange / _muzzleVelocity); + _windage2 = - atan(_windDrift / (_bulletPos select 1)); }; if (_targetRange != 0) then { @@ -154,4 +211,21 @@ if (_targetRange != 0) then { _kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); _kineticEnergy = _kineticEnergy * 0.737562149; -[_elevation * 60, _windage * 60, _lead, _TOF, _bulletSpeed, _kineticEnergy] +if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (_bulletPos select 1) > 0) then { + // Coriolis + _horizontalDeflection = 0.0000729 * ((_bulletPos select 1) ^ 2) * sin(_latitude) / _speedAverage; + _horizontalCoriolis = - atan(_horizontalDeflection / (_bulletPos select 1)); + _windage1 = _windage1 + _horizontalCoriolis; + _windage2 = _windage2 + _horizontalCoriolis; + // Eoetvoes + _verticalDeflection = (_bulletPos select 2) * _eoetvoesMultiplier; + _verticalCoriolis = - atan(_verticalDeflection / (_bulletPos select 1)); + _elevation = _elevation + _verticalCoriolis; + // Spin drift + _spinDeflection = _twistDirection * 0.0254 * 1.25 * (_stabilityFactor + 1.2) * _TOF ^ 1.83; + _spinDrift = - atan(_spinDeflection / (_bulletPos select 1)); + _windage1 = _windage1 + _spinDrift; + _windage2 = _windage2 + _spinDrift; +}; + +[_elevation * 60, [_windage1 * 60, _windage2 * 60], _lead, _TOF, _bulletSpeed, _kineticEnergy, _verticalCoriolis * 60, _horizontalCoriolis * 60, _spinDrift * 60] diff --git a/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf b/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf index 6280f19339..91eb9ae20c 100644 --- a/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf @@ -46,7 +46,7 @@ switch (GVAR(rangeAssistImageSizeUnit)) do { }; }; _estRange = parseNumber(ctrlText 7013); -if (GVAR(currentUnit) != 2) then { +if (GVAR(currentUnit) == 1) then { _estRange = _estRange / 1.0936133; }; diff --git a/addons/atragmx/functions/fnc_calculate_target_solution.sqf b/addons/atragmx/functions/fnc_calculate_target_solution.sqf index 57783d9cca..677c4bb793 100644 --- a/addons/atragmx/functions/fnc_calculate_target_solution.sqf +++ b/addons/atragmx/functions/fnc_calculate_target_solution.sqf @@ -18,48 +18,65 @@ [] call FUNC(parse_input); private ["_scopeBaseAngle"]; -_scopeBaseAngle = ((GVAR(workingMemory) select GVAR(currentTarget)) select 3); +_scopeBaseAngle = (GVAR(workingMemory) select 3); -private ["_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel"]; -_bulletMass = (GVAR(workingMemory) select GVAR(currentTarget)) select 12; -_boreHeight = (GVAR(workingMemory) select GVAR(currentTarget)) select 5; -_airFriction = (GVAR(workingMemory) select GVAR(currentTarget)) select 4; -_muzzleVelocity = (GVAR(workingMemory) select GVAR(currentTarget)) select 1; -_bc = (GVAR(workingMemory) select GVAR(currentTarget)) select 15; -_dragModel = (GVAR(workingMemory) select GVAR(currentTarget)) select 16; -_atmosphereModel = (GVAR(workingMemory) select GVAR(currentTarget)) select 17; +private ["_bulletMass", "_bulletDiameter", "_boreHeight", "_airFriction", "_barrelTwist", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel", "_twistDirection"]; +_bulletMass = GVAR(workingMemory) select 12; +_bulletDiameter = GVAR(workingMemory) select 13; +_boreHeight = GVAR(workingMemory) select 5; +_airFriction = GVAR(workingMemory) select 4; +_barrelTwist = GVAR(workingMemory) select 14; +_muzzleVelocity = GVAR(workingMemory) select 1; +_bc = GVAR(workingMemory) select 15; +_dragModel = GVAR(workingMemory) select 16; +_atmosphereModel = GVAR(workingMemory) select 17; -private ["_temperature", "_barometricPressure", "_relativeHumidity"]; -_temperature = (GVAR(temperature) select GVAR(currentTarget)); -_barometricPressure = (GVAR(barometricPressure) select GVAR(currentTarget)); -_relativeHumidity = (GVAR(relativeHumidity) select GVAR(currentTarget)); -if (GVAR(currentUnit) == 1) then -{ - _temperature = (_temperature - 32) / 1.8; - _barometricPressure = _barometricPressure * 33.8638866667; +_twistDirection = 0; +if (_barrelTwist > 0) then { + _twistDirection = 1; +} else { + if (_barrelTwist < 0) then { + _twistDirection = -1; + }; +}; +_barrelTwist = abs(_barrelTwist); + +private ["_altitude", "_temperature", "_barometricPressure", "_relativeHumidity"]; +_altitude = GVAR(altitude); +_temperature = GVAR(temperature); +_barometricPressure = GVAR(barometricPressure); +_relativeHumidity = GVAR(relativeHumidity); +if (!GVAR(atmosphereModeTBH)) then { + _barometricPressure = 1013.25 * exp(-(_altitude) / 7990); + _relativeHumidity = 50; }; -private ["_windSpeed", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange"]; -_windSpeed = (GVAR(windSpeed) select GVAR(currentTarget)); -_windDirection = (GVAR(windDirection) select GVAR(currentTarget)); -_inclinationAngle = (GVAR(inclinationAngle) select GVAR(currentTarget)); -_targetSpeed = (GVAR(targetSpeed) select GVAR(currentTarget)); -_targetRange = (GVAR(targetRange) select GVAR(currentTarget)); -if (GVAR(currentUnit) != 2) then -{ - _targetRange = _targetRange / 1.0936133; -}; -if (GVAR(currentUnit) == 1) then -{ - _windSpeed = _windSpeed / 2.23693629; - _targetSpeed = _targetSpeed / 2.23693629; +private ["_bulletLength", "_stabilityFactor"]; +_bulletLength = 1.8; +_stabilityFactor = 1.5; +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + if (_bulletDiameter > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { + _stabilityFactor = [_bulletDiameter / 10 / 2.54, _bulletLength, _bulletMass * 15.4323584, _barrelTwist / 2.54, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor); + }; }; +private ["_latitude", "_directionOfFire", "_windSpeed1", "_windSpeed2", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange"]; +_latitude = GVAR(latitude) select GVAR(currentTarget); +_directionOfFire = GVAR(directionOfFire) select GVAR(currentTarget); +_windSpeed1 = GVAR(windSpeed1) select GVAR(currentTarget); +_windSpeed2 = GVAR(windSpeed2) select GVAR(currentTarget); +_windDirection = GVAR(windDirection) select GVAR(currentTarget); +_inclinationAngle = GVAR(inclinationAngle) select GVAR(currentTarget); +_targetSpeed = GVAR(targetSpeed) select GVAR(currentTarget); +_targetRange = GVAR(targetRange) select GVAR(currentTarget); + +private ["_result"]; _result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, - _windSpeed, _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, false] call FUNC(calculate_solution); + [_windSpeed1, _windSpeed2], _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, false, _stabilityFactor, _twistDirection, _latitude, _directionOfFire] call FUNC(calculate_solution); GVAR(elevationOutput) set [GVAR(currentTarget), _result select 0]; -GVAR(windageOutput) set [GVAR(currentTarget), _result select 1]; +GVAR(windage1Output) set [GVAR(currentTarget), (_result select 1) select 0]; +GVAR(windage2Output) set [GVAR(currentTarget), (_result select 1) select 1]; GVAR(leadOutput) set [GVAR(currentTarget), _result select 2]; GVAR(tofOutput) set [GVAR(currentTarget), _result select 3]; GVAR(velocityOutput) set [GVAR(currentTarget), _result select 4]; diff --git a/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf b/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf index 7ee7e9ff78..d055af5a71 100644 --- a/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf +++ b/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf @@ -22,34 +22,27 @@ _numTicks = parseNumber(ctrlText 8005); _timeSecs = parseNumber(ctrlText 8006); _estSpeed = 0; -if (GVAR(currentUnit) != 2) then -{ +if (GVAR(currentUnit) == 1) then { _targetRange = _targetRange / 1.0936133; }; -switch (GVAR(rangeAssistImageSizeUnit)) do -{ - case 0: - { +switch (GVAR(rangeAssistImageSizeUnit)) do { + case 0: { _numTicks = _numTicks / 6400 * 360; }; - case 1: - { + case 1: { _numTicks = _numTicks / 60; }; - case 2: - { + case 2: { _numTicks = _numTicks / 60 / 1.047; }; }; -if (_timeSecs > 0) then -{ +if (_timeSecs > 0) then { _estSpeed = tan(_numTicks) * _targetRange / _timeSecs; }; -if (GVAR(currentUnit) == 1) then -{ +if (GVAR(currentUnit) != 2) then { _estSpeed = _estSpeed * 2.23693629; }; diff --git a/addons/atragmx/functions/fnc_change_gun.sqf b/addons/atragmx/functions/fnc_change_gun.sqf index 259441d51d..7c5abac47e 100644 --- a/addons/atragmx/functions/fnc_change_gun.sqf +++ b/addons/atragmx/functions/fnc_change_gun.sqf @@ -4,6 +4,8 @@ * * Arguments: * gunID + * restore workingMemory from gunList + * update display * * Return Value: * Nothing @@ -15,24 +17,38 @@ */ #include "script_component.hpp" -if (_this < 0 || _this > (count GVAR(gunList)) - 1) exitWith {}; +private ["_gunID", "_restoreMemory", "_updateDisplay"]; +_gunID = _this select 0; +_restoreMemory = _this select 1; +_updateDisplay = _this select 2; -GVAR(workingMemory) set [GVAR(currentTarget), +(GVAR(gunList) select _this)]; -GVAR(currentGun) set [GVAR(currentTarget), _this]; +if (_gunID < 0 || _gunID > (count GVAR(gunList)) - 1) exitWith {}; -lbSetCurSel [6000, (GVAR(currentGun) select GVAR(currentTarget))]; +if (_restoreMemory) then { + GVAR(workingMemory) = +(GVAR(gunList) select _gunID); +}; +GVAR(currentGun) = _gunID; -if ((GVAR(scopeUnits) select (GVAR(currentScopeUnit) select GVAR(currentTarget))) != "Clicks") then -{ - GVAR(currentScopeUnit) set [GVAR(currentTarget), (GVAR(workingMemory) select GVAR(currentTarget)) select 6]; +if (_updateDisplay) then { + lbSetCurSel [6000, GVAR(currentGun)]; }; -[] call FUNC(update_gun); +GVAR(currentScopeUnit) = 0 max (GVAR(workingMemory) select 6) min 3; +GVAR(currentScopeClickUnit) = 0 max (GVAR(workingMemory) select 7) min 2; +GVAR(currentScopeClickNumber) = 1 max (GVAR(workingMemory) select 8) min 10; + +if (_updateDisplay) then { + [] call FUNC(update_gun); + [] call FUNC(update_gun_ammo_data); +}; GVAR(elevationOutput) set [GVAR(currentTarget), 0]; -GVAR(windageOutput) set [GVAR(currentTarget), 0]; +GVAR(windage1Output) set [GVAR(currentTarget), 0]; +GVAR(windage2Output) set [GVAR(currentTarget), 0]; GVAR(leadOutput) set [GVAR(currentTarget), 0]; GVAR(tofOutput) set [GVAR(currentTarget), 0]; GVAR(velocityOutput) set [GVAR(currentTarget), 0]; -[] call FUNC(update_result); +if (_updateDisplay) then { + [] call FUNC(calculate_target_solution); +}; diff --git a/addons/atragmx/functions/fnc_change_target_slot.sqf b/addons/atragmx/functions/fnc_change_target_slot.sqf new file mode 100644 index 0000000000..ed8c622b8d --- /dev/null +++ b/addons/atragmx/functions/fnc_change_target_slot.sqf @@ -0,0 +1,26 @@ +/* + * Author: Ruthberg + * Selects a target slot (A, B, C or D) + * + * Arguments: + * target + * + * Return Value: + * Nothing + * + * Example: + * 2 call ace_atragmx_fnc_change_target_slot + * + * Public: No + */ +#include "script_component.hpp" + +private ["_target"]; +_target = 0 max _this min 3; + +call FUNC(parse_input); + +GVAR(currentTarget) = _target; +call FUNC(update_target_selection); + +[] call FUNC(calculate_target_solution); diff --git a/addons/atragmx/functions/fnc_clear_user_data.sqf b/addons/atragmx/functions/fnc_clear_user_data.sqf new file mode 100644 index 0000000000..308b5bbf12 --- /dev/null +++ b/addons/atragmx/functions/fnc_clear_user_data.sqf @@ -0,0 +1,45 @@ +/* + * Author: Ruthberg + * Removes all user data from the profileNamespace + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_clear_user_data + * + * Public: No + */ +#include "script_component.hpp" + +profileNamespace setVariable ["ACE_ATragMX_gunList", nil]; + +profileNamespace setVariable ["ACE_ATragMX_currentUnit", nil]; +profileNamespace setVariable ["ACE_ATragMX_currentGun", nil]; +profileNamespace setVariable ["ACE_ATragMX_currentTarget", nil]; +profileNamespace setVariable ["ACE_ATragMX_currentScopeUnit", nil]; + +profileNamespace setVariable ["ACE_ATragMX_atmosphereModeTBH", nil]; +profileNamespace setVariable ["ACE_ATragMX_altitude", nil]; +profileNamespace setVariable ["ACE_ATragMX_temperature", nil]; +profileNamespace setVariable ["ACE_ATragMX_barometricPressure", nil]; +profileNamespace setVariable ["ACE_ATragMX_relativeHumidity", nil]; + +profileNamespace setVariable ["ACE_ATragMX_showWind2", nil]; +profileNamespace setVariable ["ACE_ATragMX_latitude", nil]; +profileNamespace setVariable ["ACE_ATragMX_directionOfFire", nil]; +profileNamespace setVariable ["ACE_ATragMX_windSpeed1", nil]; +profileNamespace setVariable ["ACE_ATragMX_windSpeed2", nil]; +profileNamespace setVariable ["ACE_ATragMX_windDirection", nil]; +profileNamespace setVariable ["ACE_ATragMX_inclinationAngle", nil]; +profileNamespace setVariable ["ACE_ATragMX_targetSpeed", nil]; +profileNamespace setVariable ["ACE_ATragMX_targetSpeedDirection", nil]; +profileNamespace setVariable ["ACE_ATragMX_targetRange", nil]; + +profileNamespace setVariable ["ACE_ATragMX_rangeCardStartRange", nil]; +profileNamespace setVariable ["ACE_ATragMX_rangeCardEndRange", nil]; +profileNamespace setVariable ["ACE_ATragMX_rangeCardIncrement", nil]; +profileNamespace setVariable ["ACE_ATragMX_rangeCardCurrentColumn", nil]; \ No newline at end of file diff --git a/addons/atragmx/functions/fnc_create_dialog.sqf b/addons/atragmx/functions/fnc_create_dialog.sqf index 01cdcba184..09e413d535 100644 --- a/addons/atragmx/functions/fnc_create_dialog.sqf +++ b/addons/atragmx/functions/fnc_create_dialog.sqf @@ -23,15 +23,25 @@ createDialog 'ATragMX_Display'; call FUNC(update_target_selection); -true call FUNC(show_main_page); +GVAR(showMainPage) call FUNC(show_main_page); -false call FUNC(show_add_new_gun); -false call FUNC(show_gun_list); -false call FUNC(show_range_card); -false call FUNC(show_range_card_setup); -false call FUNC(show_target_range_assist); -false call FUNC(show_target_speed_assist); -false call FUNC(show_target_speed_assist_timer); +GVAR(showAddNewGun) call FUNC(show_add_new_gun); +GVAR(showAtmoEnvData) call FUNC(show_atmo_env_data); +GVAR(showGunAmmoData) call FUNC(show_gun_ammo_data); +GVAR(showGunList) call FUNC(show_gun_list); +GVAR(showRangeCard) call FUNC(show_range_card); +if (GVAR(showRangeCard)) then { + ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 5001); + [] call FUNC(update_range_card); +}; +GVAR(showRangeCardSetup) call FUNC(show_range_card_setup); +GVAR(showSolutionSetup) call FUNC(show_solution_setup); +GVAR(showTargetData) call FUNC(show_target_data); +GVAR(showTargetRangeAssist) call FUNC(show_target_range_assist); +GVAR(showTargetSpeedAssist) call FUNC(show_target_speed_assist); +GVAR(showTargetSpeedAssistTimer) call FUNC(show_target_speed_assist_timer); + +[GVAR(currentGun), false, true] call FUNC(change_gun); { lbAdd [6000, _x select 0]; diff --git a/addons/atragmx/functions/fnc_cycle_gun_list.sqf b/addons/atragmx/functions/fnc_cycle_gun_list.sqf new file mode 100644 index 0000000000..3796bb78e6 --- /dev/null +++ b/addons/atragmx/functions/fnc_cycle_gun_list.sqf @@ -0,0 +1,20 @@ +/* + * Author: Ruthberg + * Cycles through the gun list + * + * Arguments: + * step + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_cycle_scope_unit + * + * Public: No + */ +#include "script_component.hpp" + +if (!(GVAR(showMainPage) || GVAR(showGunList))) exitWith {}; + +[(GVAR(currentGun) + (count GVAR(gunList)) + _this) % (count GVAR(gunList)), true, true] call FUNC(change_gun); diff --git a/addons/atragmx/functions/fnc_cycle_image_size_units.sqf b/addons/atragmx/functions/fnc_cycle_image_size_units.sqf new file mode 100644 index 0000000000..d78b13731c --- /dev/null +++ b/addons/atragmx/functions/fnc_cycle_image_size_units.sqf @@ -0,0 +1,19 @@ +/* + * Author: Ruthberg + * Cycles through the image size units + * + * Arguments: + * step + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_cycle_image_size_units + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(rangeAssistImageSizeUnit) = (GVAR(rangeAssistImageSizeUnit) + 1) % (count GVAR(rangeAssistImageSizeUnits)); +ctrlSetText [7015, GVAR(rangeAssistImageSizeUnits) select GVAR(rangeAssistImageSizeUnit)]; diff --git a/addons/atragmx/functions/fnc_cycle_num_ticks_units.sqf b/addons/atragmx/functions/fnc_cycle_num_ticks_units.sqf new file mode 100644 index 0000000000..6afc105f62 --- /dev/null +++ b/addons/atragmx/functions/fnc_cycle_num_ticks_units.sqf @@ -0,0 +1,20 @@ +/* + * Author: Ruthberg + * Cycles through the num ticks units + * + * Arguments: + * step + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_cycle_num_ticks_units + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(speedAssistNumTicksUnit) = (GVAR(speedAssistNumTicksUnit) + 1) % (count GVAR(speedAssistNumTicksUnits)); +ctrlSetText [8009, GVAR(speedAssistNumTicksUnits) select GVAR(speedAssistNumTicksUnit)]; +call FUNC(calculate_target_speed_assist); diff --git a/addons/atragmx/functions/fnc_cycle_scope_unit.sqf b/addons/atragmx/functions/fnc_cycle_scope_unit.sqf index 99704220d4..ea9e2bd8e8 100644 --- a/addons/atragmx/functions/fnc_cycle_scope_unit.sqf +++ b/addons/atragmx/functions/fnc_cycle_scope_unit.sqf @@ -17,7 +17,8 @@ [] call FUNC(parse_input); -GVAR(currentScopeUnit) set [GVAR(currentTarget), ((GVAR(currentScopeUnit) select GVAR(currentTarget)) + 1) % (count GVAR(scopeUnits))]; +GVAR(currentScopeUnit) = (GVAR(currentScopeUnit) + 1) % (count GVAR(scopeUnits)); +GVAR(workingMemory) set [6, GVAR(currentScopeUnit)]; [] call FUNC(update_scope_unit); [] call FUNC(update_result); diff --git a/addons/atragmx/functions/fnc_cycle_target_size_units.sqf b/addons/atragmx/functions/fnc_cycle_target_size_units.sqf new file mode 100644 index 0000000000..e055c8282c --- /dev/null +++ b/addons/atragmx/functions/fnc_cycle_target_size_units.sqf @@ -0,0 +1,19 @@ +/* + * Author: Ruthberg + * Cycles through the target size units + * + * Arguments: + * step + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_cycle_target_size_units + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(rangeAssistTargetSizeUnit) = (GVAR(rangeAssistTargetSizeUnit) + 1) % (count GVAR(rangeAssistTargetSizeUnits)); +ctrlSetText [7014, GVAR(rangeAssistTargetSizeUnits) select GVAR(rangeAssistTargetSizeUnit)]; diff --git a/addons/atragmx/functions/fnc_cycle_target_speed_direction.sqf b/addons/atragmx/functions/fnc_cycle_target_speed_direction.sqf new file mode 100644 index 0000000000..3c77fab792 --- /dev/null +++ b/addons/atragmx/functions/fnc_cycle_target_speed_direction.sqf @@ -0,0 +1,22 @@ +/* + * Author: Ruthberg + * Cycles through the target directions left/right + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_cycle_target_direction + * + * Public: No + */ +#include "script_component.hpp" + +if ((ctrlText 140051) == ">") then { + ctrlSetText [140051, "<"]; +} else { + ctrlSetText [140051, ">"]; +}; diff --git a/addons/atragmx/functions/fnc_delete_gun.sqf b/addons/atragmx/functions/fnc_delete_gun.sqf index d16e1f84a0..be230da59a 100644 --- a/addons/atragmx/functions/fnc_delete_gun.sqf +++ b/addons/atragmx/functions/fnc_delete_gun.sqf @@ -20,10 +20,8 @@ _index = lbCurSel 6000; if (_index == -1) exitWith {}; -for "_i" from 0 to (count GVAR(currentGun)) - 1 do { - if ((GVAR(currentGun) select _i) > _index) then { - GVAR(currentGun) set [_i, (GVAR(currentGun) select _i) - 1]; - }; +if (GVAR(currentGun) > _index) then { + GVAR(currentGun) = GVAR(currentGun) - 1; }; GVAR(gunList) set [_index, 0]; diff --git a/addons/atragmx/functions/fnc_init.sqf b/addons/atragmx/functions/fnc_init.sqf index 3f46a71fe2..e4fe1b67a4 100644 --- a/addons/atragmx/functions/fnc_init.sqf +++ b/addons/atragmx/functions/fnc_init.sqf @@ -9,15 +9,16 @@ * Nothing * * Example: - * call ace_atragmx_init + * call ace_atragmx_fnc_init * * Public: No */ #include "script_component.hpp" -GVAR(workingMemory) = [+(GVAR(gunList) select 0), +(GVAR(gunList) select 0), +(GVAR(gunList) select 0), +(GVAR(gunList) select 0)]; +GVAR(workingMemory) = +(GVAR(gunList) select 0); GVAR(scopeUnits) = ["MILs", "TMOA", "SMOA", "Clicks"]; +GVAR(scopeClickUnits) = ["TMOA", "SMOA", "MILs"]; GVAR(rangeCardStartRange) = 200; GVAR(rangeCardEndRange) = 2000; @@ -26,7 +27,7 @@ GVAR(rangeCardLastColumns) = ["Lead", "RemV", "RemE", "TmFlt"]; GVAR(rangeCardCurrentColumn) = 3; GVAR(rangeCardData) = []; -GVAR(GVAR(rangeAssistTargetSizeUnit)s) = ["in", "ft", "cm", "m"]; +GVAR(rangeAssistTargetSizeUnits) = ["in", "ft", "cm", "m"]; GVAR(rangeAssistTargetSizeUnit) = 2; GVAR(rangeAssistImageSizeUnits) = ["MIL", "TMOA", "IOA"]; GVAR(rangeAssistImageSizeUnit) = 0; @@ -37,22 +38,47 @@ GVAR(speedAssistNumTicksUnit) = 0; GVAR(speedAssistTimer) = true; GVAR(currentUnit) = 2; -GVAR(currentGun) = [0, 0, 0, 0]; +GVAR(currentGun) = 0; GVAR(currentTarget) = 0; -GVAR(currentScopeUnit) = [0, 0, 0, 0]; +GVAR(currentScopeUnit) = 0; +GVAR(currentScopeClickUnit) = 2; +GVAR(currentScopeClickUnitTemp) = 2; +GVAR(currentScopeClickNumber) = 10; +GVAR(currentScopeClickNumberTemp) = 10; -GVAR(temperature) = [15, 15, 15, 15]; -GVAR(barometricPressure) = [1013.25, 1013.25, 1013.25, 1013.25]; -GVAR(relativeHumidity) = [0.5, 0.5, 0.5, 0.5]; +GVAR(atmosphereModeTBH) = true; +GVAR(altitude) = 0; +GVAR(temperature) = 15; +GVAR(barometricPressure) = 1013.25; +GVAR(relativeHumidity) = 0.5; -GVAR(windSpeed) = [0, 0, 0, 0]; +GVAR(latitude) = [38, 38, 38, 38]; +GVAR(directionOfFire) = [0, 0, 0, 0]; +GVAR(windSpeed1) = [0, 0, 0, 0]; +GVAR(windSpeed2) = [0, 0, 0, 0]; GVAR(windDirection) = [12, 12, 12, 12]; GVAR(inclinationAngle) = [0, 0, 0, 0]; GVAR(targetSpeed) = [0, 0, 0, 0]; +GVAR(targetSpeedDirection) = [1, 1, 1, 1]; GVAR(targetRange) = [0, 0, 0, 0]; +GVAR(showWind2) = false; GVAR(elevationOutput) = [0, 0, 0, 0]; -GVAR(windageOutput) = [0, 0, 0, 0]; +GVAR(windage1Output) = [0, 0, 0, 0]; +GVAR(windage2Output) = [0, 0, 0, 0]; GVAR(leadOutput) = [0, 0, 0, 0]; GVAR(tofOutput) = [0, 0, 0, 0]; GVAR(velocityOutput) = [0, 0, 0, 0]; + +GVAR(showMainPage) = true; +GVAR(showAddNewGun) = false; +GVAR(showAtmoEnvData) = false; +GVAR(showGunAmmoData) = false; +GVAR(showGunList) = false; +GVAR(showRangeCard) = false; +GVAR(showRangeCardSetup) = false; +GVAR(showSolutionSetup) = false; +GVAR(showTargetData) = false; +GVAR(showTargetRangeAssist) = false; +GVAR(showTargetSpeedAssist) = false; +GVAR(showTargetSpeedAssistTimer) = false; diff --git a/addons/atragmx/functions/fnc_parse_input.sqf b/addons/atragmx/functions/fnc_parse_input.sqf index 4a525dcad8..2534c2a319 100644 --- a/addons/atragmx/functions/fnc_parse_input.sqf +++ b/addons/atragmx/functions/fnc_parse_input.sqf @@ -15,75 +15,121 @@ */ #include "script_component.hpp" -GVAR(temperature) set [GVAR(currentTarget), parseNumber(ctrlText 200)]; -GVAR(barometricPressure) set [GVAR(currentTarget), 0 max parseNumber(ctrlText 210)]; -GVAR(relativeHumidity) set [GVAR(currentTarget), (0 max parseNumber(ctrlText 220) min 100) / 100]; - -GVAR(windSpeed) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 300)) min 50]; -GVAR(windDirection) set [GVAR(currentTarget), 1 max Round(parseNumber(ctrlText 310)) min 12]; -GVAR(inclinationAngle) set [GVAR(currentTarget), -60 max parseNumber(ctrlText 320) min 60]; -GVAR(targetSpeed) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 330)) min 50]; -GVAR(targetRange) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 340)) min 4000]; - -private ["_boreHeight", "_bulletMass", "_airFriction", "_muzzleVelocity"]; -_boreHeight = parseNumber(ctrlText 100); -_bulletMass = parseNumber(ctrlText 110); -if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then { - _airFriction = 0.1 max parseNumber(ctrlText 120) min 2; -} else { - _airFriction = parseNumber(ctrlText 120) / -1000; +GVAR(altitude) = -1000 max parseNumber(ctrlText 130030) min 20000; +GVAR(temperature) = -50 max parseNumber(ctrlText 130040) min 160; +GVAR(barometricPressure) = 10 max parseNumber(ctrlText 130050) min 1350; +GVAR(relativeHumidity) = (0 max parseNumber(ctrlText 130060) min 100) / 100; +if (GVAR(currentUnit) != 2) then { + GVAR(altitude) = GVAR(altitude) * 0.3048; + GVAR(temperature) = (GVAR(temperature) - 32) / 1.8; + GVAR(barometricPressure) = GVAR(barometricPressure) * 33.86389; }; -_muzzleVelocity = parseNumber(ctrlText 130); -if (GVAR(currentUnit) == 1) then -{ + +private ["_inclinationAngleCosine", "_inclinationAngleDegree"]; +GVAR(latitude) set [GVAR(currentTarget), -90 max Round(parseNumber(ctrlText 140000)) min 90]; +GVAR(directionOfFire) set [GVAR(currentTarget), 0 max abs(Round(parseNumber(ctrlText 140010))) min 359]; +GVAR(windSpeed1) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 140020)) min 50]; +GVAR(windSpeed2) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 140021)) min 50]; +GVAR(windDirection) set [GVAR(currentTarget), 1 max Round(parseNumber(ctrlText 140030)) min 12]; +_inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1; +_inclinationAngleDegree = -60 max round(parseNumber(ctrlText 140040)) min 60; +if (_inclinationAngleDegree != GVAR(inclinationAngle) select GVAR(currentTarget)) then { + GVAR(inclinationAngle) set [GVAR(currentTarget), _inclinationAngleDegree]; +} else { + if (_inclinationAngleCosine != Round(cos(GVAR(inclinationAngle) select GVAR(currentTarget)) * 100) / 100) then { + GVAR(inclinationAngle) set [GVAR(currentTarget), round(acos(_inclinationAngleCosine))]; + }; +}; +GVAR(targetSpeed) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 140050)) min 50]; +if ((ctrlText 140051) == ">") then { + GVAR(targetSpeedDirection) set [GVAR(currentTarget), +1]; +} else { + GVAR(targetSpeedDirection) set [GVAR(currentTarget), -1]; +}; +GVAR(targetRange) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 140060)) min 4000]; +if (GVAR(currentUnit) != 2) then { + GVAR(windSpeed1) set [GVAR(currentTarget), (GVAR(windSpeed1) select GVAR(currentTarget)) * 0.44704]; + GVAR(windSpeed2) set [GVAR(currentTarget), (GVAR(windSpeed2) select GVAR(currentTarget)) * 0.44704]; + GVAR(targetSpeed) set [GVAR(currentTarget), (GVAR(targetSpeed) select GVAR(currentTarget)) * 0.44704]; +}; +if (GVAR(currentUnit) == 1) then { + GVAR(targetRange) set [GVAR(currentTarget), (GVAR(targetRange) select GVAR(currentTarget)) * 0.9144]; +}; + +private ["_boreHeight", "_bulletMass", "_bulletDiameter", "_airFriction", "_rifleTwist", "_muzzleVelocity", "_zeroRange"]; +_boreHeight = parseNumber(ctrlText 120000); +_bulletMass = parseNumber(ctrlText 120010); +_bulletDiameter = parseNumber(ctrlText 120020); +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + _airFriction = 0.1 max parseNumber(ctrlText 120030) min 2; +} else { + _airFriction = parseNumber(ctrlText 120030) / -1000; +}; +_rifleTwist = parseNumber(ctrlText 120040); +_muzzleVelocity = parseNumber(ctrlText 120050); +_zeroRange = parseNumber (ctrlText 120060); +if (GVAR(currentUnit) != 2) then { _boreHeight = _boreHeight * 2.54; _bulletMass = _bulletMass * 0.06479891; + _bulletDiameter = _bulletDiameter * 10 * 2.54; + _rifleTwist = _rifleTwist * 2.54; _muzzleVelocity = _muzzleVelocity / 3.2808399; }; +if (GVAR(currentUnit) == 1) then { + _zeroRange = _zeroRange / 1.0936133; +}; _boreHeight = 0.1 max _boreHeight min 10; _bulletMass = 1 max _bulletMass min 100; +_bulletDiameter = 1 max _bulletDiameter min 25; _muzzleVelocity = 100 max _muzzleVelocity min 1400; - -(GVAR(workingMemory) select GVAR(currentTarget)) set [5, _boreHeight]; -(GVAR(workingMemory) select GVAR(currentTarget)) set [12, _bulletMass]; -if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then { - (GVAR(workingMemory) select GVAR(currentTarget)) set [15, _airFriction]; +_zeroRange = 0 max _zeroRange min 1000; +GVAR(workingMemory) set [5, _boreHeight]; +GVAR(workingMemory) set [12, _bulletMass]; +GVAR(workingMemory) set [13, _bulletDiameter]; +GVAR(workingMemory) set [14, _rifleTwist]; +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + GVAR(workingMemory) set [15, _airFriction]; } else { - (GVAR(workingMemory) select GVAR(currentTarget)) set [4, _airFriction]; + GVAR(workingMemory) set [4, _airFriction]; }; -(GVAR(workingMemory) select GVAR(currentTarget)) set [1, _muzzleVelocity]; +GVAR(workingMemory) set [1, _muzzleVelocity]; +GVAR(workingMemory) set [2, _zeroRange]; -private ["_elevationCur", "_elevationCur", "_elevationScopeStep", "_windageScopeStep"]; -_elevationCur = parseNumber(ctrlText 402); -_windageCur = parseNumber(ctrlText 412); +private ["_elevationCur", "_windageCur", "_clickSize", "_clickNumber", "_clickInterval"]; +_elevationCur = GVAR(workingMemory) select 10; +_windageCur = GVAR(workingMemory) select 11; -switch ((GVAR(currentScopeUnit) select GVAR(currentTarget))) do -{ - case 0: - { +switch (GVAR(currentScopeUnit)) do { + case 0: { _elevationCur = _elevationCur * 3.38; _windageCur = _windageCur * 3.38; }; - - case 2: - { + case 2: { _elevationCur = _elevationCur / 1.047; _windageCur = _windageCur / 1.047; }; - - case 3: - { - _elevationScopeStep = ((GVAR(workingMemory) select GVAR(currentTarget)) select 7); - _windageScopeStep = ((GVAR(workingMemory) select GVAR(currentTarget)) select 8); + case 3: { + switch (GVAR(workingMemory) select 7) do { + case 0: { _clickSize = 1; }; + case 1: { _clickSize = 1 / 1.047; }; + case 2: { _clickSize = 3.38; }; + }; + _clickNumber = GVAR(workingMemory) select 8; + _clickInterval = _clickSize / _clickNumber; - _elevationCur = _elevationCur * _elevationScopeStep; - _windageCur = _windageCur * _windageScopeStep; + _elevationCur = Round(_elevationCur / _clickInterval); + _windageCur = Round(_windageCur / _clickInterval); }; }; -(GVAR(workingMemory) select GVAR(currentTarget)) set [10, _elevationCur]; -(GVAR(workingMemory) select GVAR(currentTarget)) set [11, _windageCur]; +GVAR(workingMemory) set [10, _elevationCur]; +GVAR(workingMemory) set [11, _windageCur]; [] call FUNC(update_gun); +[] call FUNC(update_gun_ammo_data); [] call FUNC(update_atmosphere); +[] call FUNC(update_atmo_env_data); [] call FUNC(update_target); +[] call FUNC(update_target_data); + +[] call FUNC(store_user_data); diff --git a/addons/atragmx/functions/fnc_reset_relative_click_memory.sqf b/addons/atragmx/functions/fnc_reset_relative_click_memory.sqf index 1a20af7452..96d638dc1a 100644 --- a/addons/atragmx/functions/fnc_reset_relative_click_memory.sqf +++ b/addons/atragmx/functions/fnc_reset_relative_click_memory.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -(GVAR(workingMemory) select GVAR(currentTarget)) set [10, 0]; -(GVAR(workingMemory) select GVAR(currentTarget)) set [11, 0]; +GVAR(workingMemory) set [10, 0]; +GVAR(workingMemory) set [11, 0]; [] call FUNC(update_result); diff --git a/addons/atragmx/functions/fnc_restore_atmo_default.sqf b/addons/atragmx/functions/fnc_restore_atmo_default.sqf new file mode 100644 index 0000000000..08b7c56d86 --- /dev/null +++ b/addons/atragmx/functions/fnc_restore_atmo_default.sqf @@ -0,0 +1,25 @@ +/* + * Author: Ruthberg + * Restores the atmospheric data defaults + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_restore_atmo_default + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(atmosphereModeTBH) = true; +GVAR(altitude) = 0; +GVAR(temperature) = 15; +GVAR(barometricPressure) = 1013.25; +GVAR(relativeHumidity) = 0.5; + +[] call FUNC(update_atmo_selection); +[] call FUNC(update_atmosphere); diff --git a/addons/atragmx/functions/fnc_restore_user_data.sqf b/addons/atragmx/functions/fnc_restore_user_data.sqf new file mode 100644 index 0000000000..896455ec7a --- /dev/null +++ b/addons/atragmx/functions/fnc_restore_user_data.sqf @@ -0,0 +1,42 @@ +/* + * Author: Ruthberg + * Reads user data from profileNamespace + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_restore_user_data + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(currentUnit) = 0 max (profileNamespace getVariable ["ACE_ATragMX_currentUnit", 2]) min 2; +[(profileNamespace getVariable ["ACE_ATragMX_currentGun", 0]), true, false] call FUNC(change_gun); +GVAR(currentTarget) = 0 max (profileNamespace getVariable ["ACE_ATragMX_currentTarget", 0]) min 3; + +GVAR(atmosphereModeTBH) = profileNamespace getVariable ["ACE_ATragMX_atmosphereModeTBH", true]; +GVAR(altitude) = -1000 max (profileNamespace getVariable ["ACE_ATragMX_altitude", 0]) min 20000; +GVAR(temperature) = -50 max (profileNamespace getVariable ["ACE_ATragMX_temperature", 15]) min 160; +GVAR(barometricPressure) = 340 max (profileNamespace getVariable ["ACE_ATragMX_barometricPressure", 1013.25]) min 1350; +GVAR(relativeHumidity) = 0 max (profileNamespace getVariable ["ACE_ATragMX_relativeHumidity", 0.5]) min 1; + +GVAR(showWind2) = profileNamespace getVariable ["ACE_ATragMX_showWind2", false]; +GVAR(latitude) = profileNamespace getVariable ["ACE_ATragMX_latitude", [38, 38, 38, 38]]; +GVAR(directionOfFire) = profileNamespace getVariable ["ACE_ATragMX_directionOfFire", [0, 0, 0, 0]]; +GVAR(windSpeed1) = profileNamespace getVariable ["ACE_ATragMX_windSpeed1", [0, 0, 0, 0]]; +GVAR(windSpeed2) = profileNamespace getVariable ["ACE_ATragMX_windSpeed2", [0, 0, 0, 0]]; +GVAR(windDirection) = profileNamespace getVariable ["ACE_ATragMX_windDirection", [12, 12, 12, 12]]; +GVAR(inclinationAngle) = profileNamespace getVariable ["ACE_ATragMX_inclinationAngle", [0, 0, 0, 0]]; +GVAR(targetSpeed) = profileNamespace getVariable ["ACE_ATragMX_targetSpeed", [0, 0, 0, 0]]; +GVAR(targetSpeedDirection) = profileNamespace getVariable ["ACE_ATragMX_targetSpeedDirection", [1, 1, 1, 1]]; +GVAR(targetRange) = profileNamespace getVariable ["ACE_ATragMX_targetRange", [0, 0, 0, 0]]; + +GVAR(rangeCardStartRange) = 0 max (profileNamespace getVariable ["ACE_ATragMX_rangeCardStartRange", 200]) min 3000; +GVAR(rangeCardEndRange) = 0 max (profileNamespace getVariable ["ACE_ATragMX_rangeCardEndRange", 2000]) min 3000; +GVAR(rangeCardIncrement) = 1 max (profileNamespace getVariable ["ACE_ATragMX_rangeCardIncrement", 50]) min 3000; +GVAR(rangeCardCurrentColumn) = 0 max (profileNamespace getVariable ["ACE_ATragMX_rangeCardCurrentColumn", 3]) min 3; diff --git a/addons/atragmx/functions/fnc_save_gun.sqf b/addons/atragmx/functions/fnc_save_gun.sqf index d797939991..4b42f2027f 100644 --- a/addons/atragmx/functions/fnc_save_gun.sqf +++ b/addons/atragmx/functions/fnc_save_gun.sqf @@ -18,7 +18,7 @@ private ["_index"]; _index = 0 max (lbCurSel 6000); -GVAR(gunList) set [_index, +(GVAR(workingMemory) select GVAR(currentTarget))]; +GVAR(gunList) set [_index, +GVAR(workingMemory)]; lbClear 6000; { diff --git a/addons/atragmx/functions/fnc_show_add_new_gun.sqf b/addons/atragmx/functions/fnc_show_add_new_gun.sqf index 12815194dd..b1fd1deb44 100644 --- a/addons/atragmx/functions/fnc_show_add_new_gun.sqf +++ b/addons/atragmx/functions/fnc_show_add_new_gun.sqf @@ -15,4 +15,6 @@ */ #include "script_component.hpp" +GVAR(showAddNewGun) = _this; + {ctrlShow [_x, _this]} forEach [11000, 11001, 11002, 11003]; \ No newline at end of file diff --git a/addons/atragmx/functions/fnc_show_atmo_env_data.sqf b/addons/atragmx/functions/fnc_show_atmo_env_data.sqf new file mode 100644 index 0000000000..56f75f7844 --- /dev/null +++ b/addons/atragmx/functions/fnc_show_atmo_env_data.sqf @@ -0,0 +1,25 @@ +/* + * Author: Ruthberg + * Shows/Hides the atmosphere and environmental data controls + * + * Arguments: + * visible - + * + * Return Value: + * Nothing + * + * Example: + * false call ace_atragmx_fnc_show_atmo_env_data + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(showAtmoEnvData) = _this; + +{ctrlShow [_x, _this]} forEach [13000, 13001, 13002, 13003, 130030, 13004, 130040, 13005, 130050, 13006, 130060, 13007, 13008, 13009, 13010, 13011]; + +if (_this) then { + [] call FUNC(update_atmo_selection); + [] call FUNC(update_atmo_env_data); +}; diff --git a/addons/atragmx/functions/fnc_show_gun_ammo_data.sqf b/addons/atragmx/functions/fnc_show_gun_ammo_data.sqf new file mode 100644 index 0000000000..dfab6da238 --- /dev/null +++ b/addons/atragmx/functions/fnc_show_gun_ammo_data.sqf @@ -0,0 +1,24 @@ +/* + * Author: Ruthberg + * Shows/Hides the gun ammo data controls + * + * Arguments: + * visible - + * + * Return Value: + * Nothing + * + * Example: + * false call ace_atragmx_fnc_show_gun_ammo_data + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(showGunAmmoData) = _this; + +{ctrlShow [_x, _this]} forEach [12000, 120000, 12001, 120010, 12002, 120020, 12003, 120030, 12004, 120040, 12005, 120050, 12006, 120060, 120061, 12007, 12008, 12009, 12010, 12011]; + +if (_this) then { + [] call FUNC(update_gun_ammo_data); +}; diff --git a/addons/atragmx/functions/fnc_show_gun_list.sqf b/addons/atragmx/functions/fnc_show_gun_list.sqf index c34784e27a..5e1cdfa453 100644 --- a/addons/atragmx/functions/fnc_show_gun_list.sqf +++ b/addons/atragmx/functions/fnc_show_gun_list.sqf @@ -15,4 +15,12 @@ */ #include "script_component.hpp" -{ctrlShow [_x, _this]} forEach [6000, 6001, 6002, 6003, 6004, 6005, 6006, 6007]; \ No newline at end of file +GVAR(showGunList) = _this; + +{ctrlShow [_x, _this]} forEach [6000, 6001, 6002, 6003, 6004, 6005, 6006, 6007]; + +if (_this) then { + ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 6002); + + lbSetCurSel [6000, GVAR(currentGun)]; +}; diff --git a/addons/atragmx/functions/fnc_show_main_page.sqf b/addons/atragmx/functions/fnc_show_main_page.sqf index 5eaf5eb560..580d111c8f 100644 --- a/addons/atragmx/functions/fnc_show_main_page.sqf +++ b/addons/atragmx/functions/fnc_show_main_page.sqf @@ -15,5 +15,18 @@ */ #include "script_component.hpp" -{ctrlShow [_x, _this]} forEach [10, 100, 11, 110, 12, 120, 13, 130, 14, 140, 20, 200, 21, 210, 22, 220, 30, 300, 31, 310, 32, 320, 33, 330, 34, 340, 40, 400, 401, 402, 403, 41, 410, 411, 412, 42, 420, - 500, 501, 502, 503, 600, 601, 602, 603, 1000, 2000, 3000, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008]; +GVAR(showMainPage) = _this; + +{ctrlShow [_x, _this]} forEach [10, 100, 11, 110, 12, 120, 13, 130, 14, 140, 20, 200, 21, 210, 22, 220, 23, 230, 30, 300, 31, 310, 32, 320, 33, 330, 34, 340, 40, 400, 401, 402, 403, 41, 410, 411, 412, 42, 420, + 500, 501, 502, 503, 600, 601, 602, 603, 1000, 1001, 1002, 1003, 1004, 2000, 2001, 3000, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008]; + +if (_this) then { + if (GVAR(atmosphereModeTBH)) then { + {ctrlShow [_x, false]} forEach [23, 230]; + } else { + {ctrlShow [_x, false]} forEach [21, 210, 22, 220]; + }; + if (GVAR(currentScopeUnit) != 3) then { + {ctrlShow [_x, false]} forEach [2001]; + }; +}; diff --git a/addons/atragmx/functions/fnc_show_range_card.sqf b/addons/atragmx/functions/fnc_show_range_card.sqf index 655630f6c5..5728d18546 100644 --- a/addons/atragmx/functions/fnc_show_range_card.sqf +++ b/addons/atragmx/functions/fnc_show_range_card.sqf @@ -15,4 +15,6 @@ */ #include "script_component.hpp" +GVAR(showRangeCard) = _this; + {ctrlShow [_x, _this]} forEach [5000, 5001, 5002, 5003, 5004, 5005, 5006, 5007]; diff --git a/addons/atragmx/functions/fnc_show_range_card_setup.sqf b/addons/atragmx/functions/fnc_show_range_card_setup.sqf index 3ed8cb5184..3d44c14b53 100644 --- a/addons/atragmx/functions/fnc_show_range_card_setup.sqf +++ b/addons/atragmx/functions/fnc_show_range_card_setup.sqf @@ -15,4 +15,14 @@ */ #include "script_component.hpp" +GVAR(showRangeCardSetup) = _this; + {ctrlShow [_x, _this]} forEach [10000, 10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009]; + +if (_this) then { + ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 10006); + + ctrlSetText [10003, Str(Round(GVAR(rangeCardStartRange)))]; + ctrlSetText [10004, Str(Round(GVAR(rangeCardEndRange)))]; + ctrlSetText [10005, Str(Round(GVAR(rangeCardIncrement)))]; +}; diff --git a/addons/atragmx/functions/fnc_show_solution_setup.sqf b/addons/atragmx/functions/fnc_show_solution_setup.sqf new file mode 100644 index 0000000000..761df45e6f --- /dev/null +++ b/addons/atragmx/functions/fnc_show_solution_setup.sqf @@ -0,0 +1,20 @@ +/* + * Author: Ruthberg + * Shows/Hides the solution setup controls + * + * Arguments: + * visible - + * + * Return Value: + * Nothing + * + * Example: + * false call ace_atragmx_fnc_show_solution_setup + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(showSolutionSetup) = _this; + +{ctrlShow [_x, _this]} forEach [15000, 15001, 15002, 15003, 15004, 15005, 15006, 15007, 15008, 15009, 15010, 15011, 15012]; diff --git a/addons/atragmx/functions/fnc_show_target_data.sqf b/addons/atragmx/functions/fnc_show_target_data.sqf new file mode 100644 index 0000000000..f1b432edf8 --- /dev/null +++ b/addons/atragmx/functions/fnc_show_target_data.sqf @@ -0,0 +1,24 @@ +/* + * Author: Ruthberg + * Shows/Hides the target data controls + * + * Arguments: + * visible - + * + * Return Value: + * Nothing + * + * Example: + * false call ace_atragmx_fnc_show_target_data + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(showTargetData) = _this; + +{ctrlShow [_x, _this]} forEach [14000, 140000, 14001, 140010, 14002, 141020, 140020, 141021, 140021, 14003, 140030, 14004, 140040, 141040, 141041, 140041, 14005, 140050, 140051, 14006, 140060, 140061, 14007, 14008, 14009, 14010, 14011]; + +if (_this) then { + [] call FUNC(update_target_data); +}; diff --git a/addons/atragmx/functions/fnc_show_target_range_assist.sqf b/addons/atragmx/functions/fnc_show_target_range_assist.sqf index 964e5f93d0..4f46932a0b 100644 --- a/addons/atragmx/functions/fnc_show_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_show_target_range_assist.sqf @@ -15,4 +15,19 @@ */ #include "script_component.hpp" +GVAR(showTargetRangeAssist) = _this; + {ctrlShow [_x, _this]} forEach [7000, 7001, 7002, 7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020]; + +if (_this) then { + ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 7018); + + ctrlSetText [7012, Str(parseNumber(ctrlText 320))]; + ctrlSetText [7013, Str(parseNumber(ctrlText 340))]; + + if (GVAR(currentUnit) == 1) then { + ctrlSetText [7016, "Yards"]; + } else { + ctrlSetText [7016, "Meters"]; + }; +}; \ No newline at end of file diff --git a/addons/atragmx/functions/fnc_show_target_speed_assist.sqf b/addons/atragmx/functions/fnc_show_target_speed_assist.sqf index ce1e8588b9..2e66b5ea7b 100644 --- a/addons/atragmx/functions/fnc_show_target_speed_assist.sqf +++ b/addons/atragmx/functions/fnc_show_target_speed_assist.sqf @@ -15,4 +15,24 @@ */ #include "script_component.hpp" +GVAR(showTargetSpeedAssist) = _this; + {ctrlShow [_x, _this]} forEach [8000, 8001, 8002, 8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 8015]; + +if (_this) then { + ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 8012); + + ctrlSetText [8004, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; + + if (GVAR(currentUnit) == 1) then { + ctrlSetText [8008, "Yards"]; + } else { + ctrlSetText [8008, "Meters"]; + }; + + if (GVAR(currentUnit) == 2) then { + ctrlSetText [8011, "m/s"]; + } else { + ctrlSetText [8011, "mph"]; + }; +}; diff --git a/addons/atragmx/functions/fnc_show_target_speed_assist_timer.sqf b/addons/atragmx/functions/fnc_show_target_speed_assist_timer.sqf index 5b809b7ca9..8f2ff0c83e 100644 --- a/addons/atragmx/functions/fnc_show_target_speed_assist_timer.sqf +++ b/addons/atragmx/functions/fnc_show_target_speed_assist_timer.sqf @@ -15,4 +15,6 @@ */ #include "script_component.hpp" +GVAR(showTargetSpeedAssistTimer) = _this; + {ctrlShow [_x, _this]} forEach [9000, 9001, 9002]; diff --git a/addons/atragmx/functions/fnc_sord.sqf b/addons/atragmx/functions/fnc_sord.sqf index 650993cff3..a433153c0e 100644 --- a/addons/atragmx/functions/fnc_sord.sqf +++ b/addons/atragmx/functions/fnc_sord.sqf @@ -22,6 +22,6 @@ _slopeDistance = _this select 0; _azimuth = _this select 1; _inclination = _this select 2; -//_inclination = asin((ACE_player weaponDirection currentWeapon ACE_player) select 2); -GVAR(inclinationAngle) set [GVAR(currentTarget), _inclination]; -GVAR(targetRange) set [GVAR(currentTarget), _slopeDistance]; +GVAR(inclinationAngle) set [GVAR(currentTarget), round(_inclination)]; +GVAR(directionOfFire) set [GVAR(currentTarget), round(_azimuth)]; +GVAR(targetRange) set [GVAR(currentTarget), round(_slopeDistance)]; diff --git a/addons/atragmx/functions/fnc_store_user_data.sqf b/addons/atragmx/functions/fnc_store_user_data.sqf new file mode 100644 index 0000000000..5cfe7f2ae0 --- /dev/null +++ b/addons/atragmx/functions/fnc_store_user_data.sqf @@ -0,0 +1,44 @@ +/* + * Author: Ruthberg + * Saves user data into profileNamespace + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_store_user_data + * + * Public: No + */ +#include "script_component.hpp" + +profileNamespace setVariable ["ACE_ATragMX_profileNamespaceVersion", ATRAGMX_PROFILE_NAMESPACE_VERSION]; + +profileNamespace setVariable ["ACE_ATragMX_currentUnit", GVAR(currentUnit)]; +profileNamespace setVariable ["ACE_ATragMX_currentGun", GVAR(currentGun)]; +profileNamespace setVariable ["ACE_ATragMX_currentTarget", GVAR(currentTarget)]; + +profileNamespace setVariable ["ACE_ATragMX_atmosphereModeTBH", GVAR(atmosphereModeTBH)]; +profileNamespace setVariable ["ACE_ATragMX_altitude", GVAR(altitude)]; +profileNamespace setVariable ["ACE_ATragMX_temperature", GVAR(temperature)]; +profileNamespace setVariable ["ACE_ATragMX_barometricPressure", GVAR(barometricPressure)]; +profileNamespace setVariable ["ACE_ATragMX_relativeHumidity", GVAR(relativeHumidity)]; + +profileNamespace setVariable ["ACE_ATragMX_showWind2", GVAR(showWind2)]; +profileNamespace setVariable ["ACE_ATragMX_latitude", GVAR(latitude)]; +profileNamespace setVariable ["ACE_ATragMX_directionOfFire", GVAR(directionOfFire)]; +profileNamespace setVariable ["ACE_ATragMX_windSpeed1", GVAR(windSpeed1)]; +profileNamespace setVariable ["ACE_ATragMX_windSpeed2", GVAR(windSpeed2)]; +profileNamespace setVariable ["ACE_ATragMX_windDirection", GVAR(windDirection)]; +profileNamespace setVariable ["ACE_ATragMX_inclinationAngle", GVAR(inclinationAngle)]; +profileNamespace setVariable ["ACE_ATragMX_targetSpeed", GVAR(targetSpeed)]; +profileNamespace setVariable ["ACE_ATragMX_targetSpeedDirection", GVAR(targetSpeedDirection)]; +profileNamespace setVariable ["ACE_ATragMX_targetRange", GVAR(targetRange)]; + +profileNamespace setVariable ["ACE_ATragMX_rangeCardStartRange", GVAR(rangeCardStartRange)]; +profileNamespace setVariable ["ACE_ATragMX_rangeCardEndRange", GVAR(rangeCardEndRange)]; +profileNamespace setVariable ["ACE_ATragMX_rangeCardIncrement", GVAR(rangeCardIncrement)]; +profileNamespace setVariable ["ACE_ATragMX_rangeCardCurrentColumn", GVAR(rangeCardCurrentColumn)]; \ No newline at end of file diff --git a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf index 90acd1a84f..6e47461cf3 100644 --- a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf +++ b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf @@ -15,14 +15,12 @@ */ #include "script_component.hpp" -#define _dsp (uiNamespace getVariable "ATragMX_Display") - if !(ctrlVisible 9000) then { false call FUNC(show_target_speed_assist); true call FUNC(show_target_speed_assist_timer); - ctrlSetFocus (_dsp displayCtrl 9002); + ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 9002); [{ private ["_args", "_startTime"]; diff --git a/addons/atragmx/functions/fnc_toggle_atmo_env_data.sqf b/addons/atragmx/functions/fnc_toggle_atmo_env_data.sqf new file mode 100644 index 0000000000..ce761c2216 --- /dev/null +++ b/addons/atragmx/functions/fnc_toggle_atmo_env_data.sqf @@ -0,0 +1,28 @@ +/* + * Author: Ruthberg + * Toggles the atmospheric data screen on/off + * + * Arguments: + * Apply new data? + * + * Return Value: + * Nothing + * + * Example: + * 1 call ace_atragmx_fnc_toggle_atmo_env_data + * + * Public: No + */ +#include "script_component.hpp" + +if (ctrlVisible 13000) then { + false call FUNC(show_atmo_env_data); + true call FUNC(show_main_page); + + if (_this == 1) then { + call FUNC(calculate_target_solution); + }; +} else { + true call FUNC(show_atmo_env_data); + false call FUNC(show_main_page); +}; diff --git a/addons/atragmx/functions/fnc_toggle_gun_ammo_data.sqf b/addons/atragmx/functions/fnc_toggle_gun_ammo_data.sqf new file mode 100644 index 0000000000..0fd4b913b8 --- /dev/null +++ b/addons/atragmx/functions/fnc_toggle_gun_ammo_data.sqf @@ -0,0 +1,29 @@ +/* + * Author: Ruthberg + * Toggles the gun ammo data screen on/off + * + * Arguments: + * Apply new data? + * + * Return Value: + * Nothing + * + * Example: + * 1 call ace_atragmx_fnc_toggle_gun_ammo_data + * + * Public: No + */ +#include "script_component.hpp" + +if (ctrlVisible 12000) then { + false call FUNC(show_gun_ammo_data); + true call FUNC(show_main_page); + + if (_this == 1) then { + call FUNC(update_zero_range); + call FUNC(calculate_target_solution); + }; +} else { + true call FUNC(show_gun_ammo_data); + false call FUNC(show_main_page); +}; diff --git a/addons/atragmx/functions/fnc_toggle_gun_list.sqf b/addons/atragmx/functions/fnc_toggle_gun_list.sqf index 4e24e4cb77..1cc1f9338b 100644 --- a/addons/atragmx/functions/fnc_toggle_gun_list.sqf +++ b/addons/atragmx/functions/fnc_toggle_gun_list.sqf @@ -3,34 +3,26 @@ * Toggles the gun list screen on/off * * Arguments: - * Nothing + * change gun? * * Return Value: * Nothing * * Example: - * call ace_atragmx_fnc_toggle_gun_list + * false call ace_atragmx_fnc_toggle_gun_list * * Public: No */ #include "script_component.hpp" -#define _dsp (uiNamespace getVariable "ATragMX_Display") - -if (ctrlVisible 6000) then -{ +if (ctrlVisible 6000) then { false call FUNC(show_gun_list); true call FUNC(show_main_page); if (_this) then { - (lbCurSel 6000) call FUNC(change_gun); + [lbCurSel 6000, true, true] call FUNC(change_gun); }; -} else -{ +} else { false call FUNC(show_main_page); true call FUNC(show_gun_list); - - ctrlSetFocus (_dsp displayCtrl 6002); - - lbSetCurSel [6000, (GVAR(currentGun) select GVAR(currentTarget))]; }; diff --git a/addons/atragmx/functions/fnc_toggle_range_card.sqf b/addons/atragmx/functions/fnc_toggle_range_card.sqf index 6a5c386de7..059bc7e40b 100644 --- a/addons/atragmx/functions/fnc_toggle_range_card.sqf +++ b/addons/atragmx/functions/fnc_toggle_range_card.sqf @@ -15,18 +15,14 @@ */ #include "script_component.hpp" -#define _dsp (uiNamespace getVariable "ATragMX_Display") - -if (ctrlVisible 5006) then -{ +if (ctrlVisible 5006) then { false call FUNC(show_range_card); true call FUNC(show_main_page); -} else -{ +} else { false call FUNC(show_main_page); true call FUNC(show_range_card); - ctrlSetFocus (_dsp displayCtrl 5001); + ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 5001); [] call FUNC(calculate_range_card); [] call FUNC(update_range_card); diff --git a/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf b/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf index 28534c9dd9..738a154d17 100644 --- a/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf +++ b/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf @@ -3,27 +3,23 @@ * Toggles the range card setup screen on/off * * Arguments: - * Nothing + * Apply new range card settings * * Return Value: * Nothing * * Example: - * call ace_atragmx_fnc_toggle_range_card_setup + * 1 call ace_atragmx_fnc_toggle_range_card_setup * * Public: No */ #include "script_component.hpp" -#define _dsp (uiNamespace getVariable "ATragMX_Display") - -if (ctrlVisible 10000) then -{ +if (ctrlVisible 10000) then { false call FUNC(show_range_card_setup); true call FUNC(show_range_card); - if (_this == 1) then - { + if (_this == 1) then { GVAR(rangeCardStartRange) = 0 max Round(parseNumber(ctrlText 10003)) min 3000; GVAR(rangeCardEndRange) = 0 max Round(parseNumber(ctrlText 10004)) min 3000; GVAR(rangeCardIncrement) = 1 max Round(parseNumber(ctrlText 10005)) min 3000; @@ -31,14 +27,7 @@ if (ctrlVisible 10000) then [] call FUNC(calculate_range_card); [] call FUNC(update_range_card); }; -} else -{ +} else { false call FUNC(show_range_card); true call FUNC(show_range_card_setup); - - ctrlSetFocus (_dsp displayCtrl 10006); - - ctrlSetText [10003, Str(Round(GVAR(rangeCardStartRange)))]; - ctrlSetText [10004, Str(Round(GVAR(rangeCardEndRange)))]; - ctrlSetText [10005, Str(Round(GVAR(rangeCardIncrement)))]; }; diff --git a/addons/atragmx/functions/fnc_toggle_solution_setup.sqf b/addons/atragmx/functions/fnc_toggle_solution_setup.sqf new file mode 100644 index 0000000000..0e9f702383 --- /dev/null +++ b/addons/atragmx/functions/fnc_toggle_solution_setup.sqf @@ -0,0 +1,38 @@ +/* + * Author: Ruthberg + * Toggles the solution setup screen on/off + * + * Arguments: + * Apply new data? + * + * Return Value: + * Nothing + * + * Example: + * 1 call ace_atragmx_fnc_toggle_solution_setup + * + * Public: No + */ +#include "script_component.hpp" + +if (ctrlVisible 15000) then { + false call FUNC(show_solution_setup); + true call FUNC(show_main_page); + + if (_this == 1) then { + GVAR(currentScopeClickUnit) = GVAR(currentScopeClickUnitTemp); + GVAR(currentScopeClickNumber) = GVAR(currentScopeClickNumberTemp); + GVAR(workingMemory) set [7, GVAR(currentScopeClickUnit)]; + GVAR(workingMemory) set [8, GVAR(currentScopeClickNumber)]; + [] call FUNC(update_scope_unit); + [] call FUNC(update_result); + }; +} else { + true call FUNC(show_solution_setup); + false call FUNC(show_main_page); + + GVAR(currentScopeClickUnitTemp) = GVAR(currentScopeClickUnit); + GVAR(currentScopeClickNumberTemp) = GVAR(currentScopeClickNumber); + + [] call FUNC(update_solution_setup); +}; diff --git a/addons/atragmx/functions/fnc_toggle_target_data.sqf b/addons/atragmx/functions/fnc_toggle_target_data.sqf new file mode 100644 index 0000000000..90fefbf37e --- /dev/null +++ b/addons/atragmx/functions/fnc_toggle_target_data.sqf @@ -0,0 +1,28 @@ +/* + * Author: Ruthberg + * Toggles the target data screen on/off + * + * Arguments: + * Apply new data? + * + * Return Value: + * Nothing + * + * Example: + * 1 call ace_atragmx_fnc_toggle_target_data + * + * Public: No + */ +#include "script_component.hpp" + +if (ctrlVisible 14000) then { + false call FUNC(show_target_data); + true call FUNC(show_main_page); + + if (_this == 1) then { + call FUNC(calculate_target_solution); + }; +} else { + true call FUNC(show_target_data); + false call FUNC(show_main_page); +}; diff --git a/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf b/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf index 352a6d0e1f..d13ef4fb2e 100644 --- a/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf @@ -3,45 +3,30 @@ * Toggles the target range assist screen on/off * * Arguments: - * Nothing + * update range? * * Return Value: * Nothing * * Example: - * call ace_atragmx_fnc_toggle_target_range_assist + * 1 call ace_atragmx_fnc_toggle_target_range_assist * * Public: No */ #include "script_component.hpp" -#define _dsp (uiNamespace getVariable "ATragMX_Display") - -if (ctrlVisible 7000) then -{ +if (ctrlVisible 7000) then { false call FUNC(show_target_range_assist); true call FUNC(show_main_page); - if (_this == 1) then - { + if (_this == 1) then { ctrlSetText [320, Str(parseNumber(ctrlText 7012))]; + ctrlSetText [140040, Str(parseNumber(ctrlText 7012))]; ctrlSetText [340, Str(parseNumber(ctrlText 7013))]; + ctrlSetText [140060, Str(parseNumber(ctrlText 7013))]; + [] call FUNC(calculate_target_solution); }; -} else -{ +} else { false call FUNC(show_main_page); true call FUNC(show_target_range_assist); - - ctrlSetFocus (_dsp displayCtrl 7018); - - ctrlSetText [7012, Str(parseNumber(ctrlText 320))]; - ctrlSetText [7013, Str(parseNumber(ctrlText 340))]; - - if (GVAR(currentUnit) != 2) then - { - ctrlSetText [7016, "Yards"]; - } else - { - ctrlSetText [7016, "Meters"]; - }; }; diff --git a/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf b/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf index 0bda7ad019..5b88a6cfce 100644 --- a/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf +++ b/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf @@ -3,52 +3,33 @@ * Toggles the target speed assist screen on/off * * Arguments: - * Nothing + * update speed? * * Return Value: * Nothing * * Example: - * call ace_atragmx_fnc_toggle_target_speed_assist + * 1 call ace_atragmx_fnc_toggle_target_speed_assist * * Public: No */ #include "script_component.hpp" -#define _dsp (uiNamespace getVariable "ATragMX_Display") - -if (ctrlVisible 8000) then -{ +if (ctrlVisible 8000) then { false call FUNC(show_target_speed_assist); true call FUNC(show_main_page); - if (_this == 1) then - { + if (_this == 1) then { [] call FUNC(calculate_target_speed_assist); - ctrlSetText [330, Str(parseNumber(ctrlText 8007))]; + private ["_targetSpeed"]; + _targetSpeed = parseNumber(ctrlText 8007); + if (_targetSpeed != 0) then { + ctrlSetText [330, Str(_targetSpeed)]; + ctrlSetText [140050, Str(_targetSpeed)]; + [] call FUNC(calculate_target_solution); + }; }; -} else -{ +} else { false call FUNC(show_main_page); true call FUNC(show_target_speed_assist); - - ctrlSetFocus (_dsp displayCtrl 8012); - - ctrlSetText [8004, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; - - if (GVAR(currentUnit) != 2) then - { - ctrlSetText [8008, "Yards"]; - } else - { - ctrlSetText [8008, "Meters"]; - }; - - if (GVAR(currentUnit) != 1) then - { - ctrlSetText [8011, "m/s"]; - } else - { - ctrlSetText [8011, "mph"]; - }; }; diff --git a/addons/atragmx/functions/fnc_update_atmo_env_data.sqf b/addons/atragmx/functions/fnc_update_atmo_env_data.sqf new file mode 100644 index 0000000000..7cd34754da --- /dev/null +++ b/addons/atragmx/functions/fnc_update_atmo_env_data.sqf @@ -0,0 +1,45 @@ +/* + * Author: Ruthberg + * Updates the atmospheric data fields + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_update_atmo_env_data + * + * Public: No + */ +#include "script_component.hpp" + +ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 13007); + +if (GVAR(currentUnit) == 2) then { + ctrlSetText [130040, Str(Round(GVAR(temperature) * 10) / 10)]; +} else { + ctrlSetText [130040, Str(Round((GVAR(temperature) * 1.8 + 32) * 10) / 10)]; +}; +if (GVAR(currentUnit) == 2) then { + ctrlSetText [130050, Str(Round(GVAR(barometricPressure)))]; +} else { + ctrlSetText [130050, Str(Round(GVAR(barometricPressure) / 33.8638866667 * 100) / 100)]; +}; +ctrlSetText [130060, Str(Round(GVAR(relativeHumidity) * 100 * 10) / 10)]; +if (GVAR(currentUnit) == 2) then { + ctrlSetText [130030, Str(Round(GVAR(altitude)))]; +} else { + ctrlSetText [130030, Str(Round(GVAR(altitude) * 3.2808399))]; +}; + +if (GVAR(currentUnit) == 2) then { + ctrlSetText [13003, "Altitude (m)"]; + ctrlSetText [13004, "temperature (C)"]; + ctrlSetText [13005, "Barom Pres (milibars)"]; +} else { + ctrlSetText [13003, "Altitude (ft)"]; + ctrlSetText [13004, "temperature (F)"]; + ctrlSetText [13005, "Barom Pres (in.merc.)"]; +}; diff --git a/addons/atragmx/functions/fnc_update_atmo_selection.sqf b/addons/atragmx/functions/fnc_update_atmo_selection.sqf new file mode 100644 index 0000000000..18036178b4 --- /dev/null +++ b/addons/atragmx/functions/fnc_update_atmo_selection.sqf @@ -0,0 +1,31 @@ +/* + * Author: Ruthberg + * Updates the atmospheric data input method + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_update_atmo_selection + * + * Public: No + */ +#include "script_component.hpp" + +((uiNamespace getVariable "ATragMX_Display") displayCtrl 13001) ctrlEnable true; +((uiNamespace getVariable "ATragMX_Display") displayCtrl 13002) ctrlEnable true; + +if (GVAR(atmosphereModeTBH)) then { + ((uiNamespace getVariable "ATragMX_Display") displayCtrl 13002) ctrlEnable false; + {ctrlShow [_x, false]} forEach [13003, 130030]; + {ctrlShow [_x, true]} forEach [13005, 130050, 13006, 130060]; +} else { + ((uiNamespace getVariable "ATragMX_Display") displayCtrl 13001) ctrlEnable false; + {ctrlShow [_x, false]} forEach [13005, 130050, 13006, 130060]; + {ctrlShow [_x, true]} forEach [13003, 130030]; +}; + +[] call FUNC(update_atmo_env_data); diff --git a/addons/atragmx/functions/fnc_update_atmosphere.sqf b/addons/atragmx/functions/fnc_update_atmosphere.sqf index 91f1831b04..be7565bda7 100644 --- a/addons/atragmx/functions/fnc_update_atmosphere.sqf +++ b/addons/atragmx/functions/fnc_update_atmosphere.sqf @@ -15,10 +15,19 @@ */ #include "script_component.hpp" -ctrlSetText [200, Str(Round((GVAR(temperature) select GVAR(currentTarget)) * 10) / 10)]; -if (GVAR(currentUnit) == 1) then { - ctrlSetText [210, Str(Round((GVAR(barometricPressure) select GVAR(currentTarget)) * 100) / 100)]; +if (GVAR(currentUnit) == 2) then { + ctrlSetText [200, Str(Round(GVAR(temperature) * 10) / 10)]; } else { - ctrlSetText [210, Str(Round(GVAR(barometricPressure) select GVAR(currentTarget)))]; + ctrlSetText [200, Str(Round((GVAR(temperature) * 1.8 + 32) * 10) / 10)]; +}; +if (GVAR(currentUnit) == 2) then { + ctrlSetText [210, Str(Round(GVAR(barometricPressure)))]; +} else { + ctrlSetText [210, Str(Round(GVAR(barometricPressure) / 33.8638866667 * 100) / 100)]; +}; +ctrlSetText [220, Str(Round(GVAR(relativeHumidity) * 100 * 10) / 10)]; +if (GVAR(currentUnit) == 2) then { + ctrlSetText [230, Str(Round(GVAR(altitude)))]; +} else { + ctrlSetText [230, Str(Round(GVAR(altitude) * 3.2808399))]; }; -ctrlSetText [220, Str(Round((GVAR(relativeHumidity) select GVAR(currentTarget)) * 100 * 10) / 10)]; diff --git a/addons/atragmx/functions/fnc_update_gun.sqf b/addons/atragmx/functions/fnc_update_gun.sqf index cd80e5f122..aa1f8c44bf 100644 --- a/addons/atragmx/functions/fnc_update_gun.sqf +++ b/addons/atragmx/functions/fnc_update_gun.sqf @@ -15,39 +15,36 @@ */ #include "script_component.hpp" -ctrlSetText [1000, (GVAR(workingMemory) select GVAR(currentTarget)) select 0]; -if (GVAR(currentUnit) == 1) then -{ - ctrlSetText [ 100, Str(Round(((GVAR(workingMemory) select GVAR(currentTarget)) select 5) / 2.54 * 100) / 100)]; -} else -{ - ctrlSetText [ 100, Str(Round(((GVAR(workingMemory) select GVAR(currentTarget)) select 5) * 100) / 100)]; -}; -if (GVAR(currentUnit) == 1) then -{ - ctrlSetText [ 110, Str(Round(((GVAR(workingMemory) select GVAR(currentTarget)) select 12) * 15.4323584))]; -} else -{ - ctrlSetText [ 110, Str(Round((GVAR(workingMemory) select GVAR(currentTarget)) select 12))]; -}; -if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then { - ctrlSetText [ 120, Str(Round(((GVAR(workingMemory) select GVAR(currentTarget)) select 15) * 1000) / 1000)]; +ctrlSetText [1000, GVAR(workingMemory) select 0]; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [100, Str(Round((GVAR(workingMemory) select 5) / 2.54 * 100) / 100)]; } else { - ctrlSetText [ 120, Str(Round(((GVAR(workingMemory) select GVAR(currentTarget)) select 4) * -1000 * 1000) / 1000)]; + ctrlSetText [100, Str(Round((GVAR(workingMemory) select 5) * 100) / 100)]; }; -if (GVAR(currentUnit) == 1) then -{ - ctrlSetText [130, Str(Round(((GVAR(workingMemory) select GVAR(currentTarget)) select 1) * 3.2808399))]; -} else -{ - ctrlSetText [130, Str(Round((GVAR(workingMemory) select GVAR(currentTarget)) select 1))]; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [110, Str(Round((GVAR(workingMemory) select 12) * 15.4323584))]; +} else { + ctrlSetText [110, Str(Round(GVAR(workingMemory) select 12))]; }; -if (GVAR(currentUnit) == 2) then -{ - ctrlSetText [140, Str(Round((GVAR(workingMemory) select GVAR(currentTarget)) select 2))]; -} else -{ - ctrlSetText [140, Str(Round(((GVAR(workingMemory) select GVAR(currentTarget)) select 2) * 1.0936133))]; +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + ctrlSetText [120, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; +} else { + ctrlSetText [120, Str(Round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)]; +}; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [130, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))]; +} else { + ctrlSetText [130, Str(Round(GVAR(workingMemory) select 1))]; +}; +switch (GVAR(currentUnit)) do { + case 0: { + ctrlSetText [140, format["*%1", Round(GVAR(workingMemory) select 2)]]; + }; + case 1: { + ctrlSetText [140, Str(Round((GVAR(workingMemory) select 2) * 1.0936133))]; + }; + case 2: { + ctrlSetText [140, Str(Round(GVAR(workingMemory) select 2))]; + }; }; - [] call FUNC(update_scope_unit); diff --git a/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf b/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf new file mode 100644 index 0000000000..b11b214500 --- /dev/null +++ b/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf @@ -0,0 +1,79 @@ +/* + * Author: Ruthberg + * Updates the gun ammo data fields + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_update_gun_ammo_data + * + * Public: No + */ +#include "script_component.hpp" + +ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 12008); + +if (GVAR(currentUnit) != 2) then { + ctrlSetText [120000, Str(Round((GVAR(workingMemory) select 5) / 2.54 * 100) / 100)]; +} else { + ctrlSetText [120000, Str(Round((GVAR(workingMemory) select 5) * 100) / 100)]; +}; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [120010, Str(Round((GVAR(workingMemory) select 12) * 15.4323584))]; +} else { + ctrlSetText [120010, Str(Round(GVAR(workingMemory) select 12))]; +}; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [120020, Str(Round((GVAR(workingMemory) select 13) / 10 / 2.54 * 1000) / 1000)]; +} else { + ctrlSetText [120020, Str(Round((GVAR(workingMemory) select 13) * 1000) / 1000)]; +}; +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + ctrlSetText [120030, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; +} else { + ctrlSetText [120030, Str(Round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)]; +}; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [120040, Str(Round((GVAR(workingMemory) select 14) / 2.54 * 10) / 10)]; +} else { + ctrlSetText [120040, Str(Round((GVAR(workingMemory) select 14) * 100) / 100)]; +}; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [120050, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))]; +} else { + ctrlSetText [120050, Str(Round(GVAR(workingMemory) select 1))]; +}; +if (GVAR(currentUnit) == 1) then { + ctrlSetText [120060, Str(Round((GVAR(workingMemory) select 2) * 1.0936133))]; +} else { + ctrlSetText [120060, Str(Round(GVAR(workingMemory) select 2))]; +}; +if (GVAR(currentUnit) == 0) then { + ctrlSetText [120061, "*"]; +} else { + ctrlSetText [120061, ""]; +}; + +if (GVAR(currentUnit) == 2) then { + ctrlSetText [12000, "Bore (cm)"]; + ctrlSetText [12001, "Bullet Weight (grams)"]; + ctrlSetText [12002, "Bullet Diam (cm)"]; + ctrlSetText [12004, "Rifle Twist (cm/trn)"]; + ctrlSetText [12005, "Muzzle Velocity (m/s)"]; +} else { + ctrlSetText [12000, "Bore (inches)"]; + ctrlSetText [12001, "Bullet Weight (grains)"]; + ctrlSetText [12002, "Bullet Diam (inches)"]; + ctrlSetText [12004, "Rifle Twist (inches/trn)"]; + ctrlSetText [12005, "Muzzle Velocity (feet/sec)"]; +}; + +if (GVAR(currentUnit) == 1) then { + ctrlSetText [12006, "Zero Range (yards)"]; +} else { + ctrlSetText [12006, "Zero Range (meters)"]; +}; diff --git a/addons/atragmx/functions/fnc_update_inclination_angle.sqf b/addons/atragmx/functions/fnc_update_inclination_angle.sqf new file mode 100644 index 0000000000..ea5599bf2d --- /dev/null +++ b/addons/atragmx/functions/fnc_update_inclination_angle.sqf @@ -0,0 +1,26 @@ +/* + * Author: Ruthberg + * Updates the inclination angle input fields + * + * Arguments: + * Reference input field ID + * + * Return Value: + * Nothing + * + * Example: + * 0 call ace_atragmx_fnc_update_inclination_angle + * + * Public: No + */ +#include "script_component.hpp" + +private ["_inclinationAngleCosine", "_inclinationAngleDegree"]; +_inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1; +_inclinationAngleDegree = -60 max parseNumber(ctrlText 140040) min 60; + +if (_this == 0) then { + ctrlSetText [140040, Str(round(acos(_inclinationAngleCosine)))]; +} else { + ctrlSetText [140041, Str(round(cos(_inclinationAngleDegree) * 100) / 100)]; +}; diff --git a/addons/atragmx/functions/fnc_update_range_card.sqf b/addons/atragmx/functions/fnc_update_range_card.sqf index 546c38d24c..7e19abc36e 100644 --- a/addons/atragmx/functions/fnc_update_range_card.sqf +++ b/addons/atragmx/functions/fnc_update_range_card.sqf @@ -15,16 +15,18 @@ */ #include "script_component.hpp" -private ["_range", "_elevation", "_windage", "_lead", "_TOF", "_velocity", "_kineticEnergy", "_rangeOutput", "_elevationOutput", "_windageOutput", "_lastColumnOutput"]; +private ["_range", "_elevation", "_windage1", "_windage2", "_clickSize", "_clickNumber", "_clickInterval", "_lead", "_TOF", "_velocity", "_kineticEnergy", "_rangeOutput", "_elevationOutput", "_windageOutput", "_lastColumnOutput"]; _lastColumnOutput = ""; -ctrlSetText [5006, (GVAR(rangeCardLastColumns) select GVAR(rangeCardCurrentColumn))]; +if (GVAR(showWind2) && GVAR(rangeCardCurrentColumn) == 0) then { + ctrlSetText [5006, "Wind2"]; +} else { + ctrlSetText [5006, (GVAR(rangeCardLastColumns) select GVAR(rangeCardCurrentColumn))]; +}; -if (GVAR(currentUnit) != 2) then -{ +if (GVAR(currentUnit) == 1) then { ctrlSetText [5003, "Yards"]; -} else -{ +} else { ctrlSetText [5003, "Meters"]; }; @@ -33,69 +35,66 @@ lnbClear 5007; { _range = _x select 0; _elevation = _x select 1; - _windage = _x select 2; + _windage1 = (_x select 2) select 0; + _windage2 = (_x select 2) select 1; _lead = _x select 3; _TOF = _x select 4; _velocity = _x select 5; _kineticEnergy = _x select 6; - switch ((GVAR(currentScopeUnit) select GVAR(currentTarget))) do - { - case 0: - { + switch (GVAR(currentScopeUnit)) do { + case 0: { _elevation = _elevation / 3.38; - _windage = _windage / 3.38; + _windage1 = _windage1 / 3.38; + _windage2 = _windage2 / 3.38; }; - - case 2: - { + case 2: { _elevation = _elevation * 1.047; - _windage = _windage * 1.047; + _windage1 = _windage1 * 1.047; + _windage2 = _windage2 * 1.047; }; - - case 3: - { - _elevationScopeStep = ((GVAR(workingMemory) select GVAR(currentTarget)) select 7); - _windageScopeStep = ((GVAR(workingMemory) select GVAR(currentTarget)) select 8); + case 3: { + switch (GVAR(workingMemory) select 7) do { + case 0: { _clickSize = 1; }; + case 1: { _clickSize = 1 / 1.047; }; + case 2: { _clickSize = 3.38; }; + }; + _clickNumber = GVAR(workingMemory) select 8; + _clickInterval = _clickSize / _clickNumber; - _elevation = Round(_elevation / _elevationScopeStep); - _windage = Round(_windage / _windageScopeStep); + _elevation = Round(_elevation / _clickInterval); + _windage1 = Round(_windage1 / _clickInterval); + _windage2 = Round(_windage2 / _clickInterval); }; }; _elevationOutput = Str(Round(_elevation * 100) / 100); - _windageOutput = Str(Round(_windage * 100) / 100); + _windageOutput = Str(Round(_windage1 * 100) / 100); _rangeOutput = Str(_range); - if (_velocity < 340.29) then - { + if (_velocity < 340.29) then { _rangeOutput = _rangeOutput + "*"; }; - if (GVAR(currentUnit) == 1) then - { + if (GVAR(currentUnit) == 1) then { _velocity = _velocity * 3.2808399; }; - switch (GVAR(rangeCardCurrentColumn)) do - { - case 0: - { - _lastColumnOutput = Str(Round(_lead * 100) / 100); + switch (GVAR(rangeCardCurrentColumn)) do { + case 0: { + if (GVAR(showWind2)) then { + _lastColumnOutput = Str(Round(_windage2 * 100) / 100); + } else { + _lastColumnOutput = Str(Round(_lead * 100) / 100); + }; }; - - case 1: - { + case 1: { _lastColumnOutput = Str(Round(_velocity)); }; - - case 2: - { + case 2: { _lastColumnOutput = Str(Round(_kineticEnergy)); }; - - case 3: - { + case 3: { _lastColumnOutput = Str(Round(_TOF * 100) / 100); } }; diff --git a/addons/atragmx/functions/fnc_update_relative_click_memory.sqf b/addons/atragmx/functions/fnc_update_relative_click_memory.sqf index 378124ad4f..1dc534ce4b 100644 --- a/addons/atragmx/functions/fnc_update_relative_click_memory.sqf +++ b/addons/atragmx/functions/fnc_update_relative_click_memory.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -(GVAR(workingMemory) select GVAR(currentTarget)) set [10, (GVAR(elevationOutput) select GVAR(currentTarget))]; -(GVAR(workingMemory) select GVAR(currentTarget)) set [11, (GVAR(windageOutput) select GVAR(currentTarget))]; +GVAR(workingMemory) set [10, (GVAR(elevationOutput) select GVAR(currentTarget))]; +GVAR(workingMemory) set [11, (GVAR(windage1Output) select GVAR(currentTarget))]; [] call FUNC(update_result); diff --git a/addons/atragmx/functions/fnc_update_result.sqf b/addons/atragmx/functions/fnc_update_result.sqf index 11ff8a314e..bb708efaab 100644 --- a/addons/atragmx/functions/fnc_update_result.sqf +++ b/addons/atragmx/functions/fnc_update_result.sqf @@ -15,66 +15,155 @@ */ #include "script_component.hpp" -private ["_elevationAbs", "_elevationRel", "_elevationCur", "_windageAbs", "_windageRel", "_windageCur", "_lead", "_elevationScopeStep", "_windageScopeStep"]; -_elevationAbs = (GVAR(elevationOutput) select GVAR(currentTarget)); -_windageAbs = (GVAR(windageOutput) select GVAR(currentTarget)); +private ["_elevationAbs", "_elevationRel", "_elevationCur", "_windageAbs", "_wind2", "_windageRel", "_windageCur", "_lead", "_clickSize", "_clickNumber", "_clickInterval"]; +_elevationAbs = GVAR(elevationOutput) select GVAR(currentTarget); +_windageAbs = GVAR(windage1Output) select GVAR(currentTarget); -_elevationCur = (GVAR(workingMemory) select GVAR(currentTarget)) select 10; -_windageCur = (GVAR(workingMemory) select GVAR(currentTarget)) select 11; +_wind2 = GVAR(windage2Output) select GVAR(currentTarget); + +_elevationCur = GVAR(workingMemory) select 10; +_windageCur = GVAR(workingMemory) select 11; _elevationRel = _elevationAbs - _elevationCur; _windageRel = _windageAbs - _windageCur; -_lead = (GVAR(leadOutput) select GVAR(currentTarget)); +_lead = GVAR(leadOutput) select GVAR(currentTarget); -switch ((GVAR(currentScopeUnit) select GVAR(currentTarget))) do -{ - case 0: - { +switch (GVAR(currentScopeUnit)) do { + case 0: { _elevationAbs = _elevationAbs / 3.38; _windageAbs = _windageAbs / 3.38; + _wind2 = _wind2 / 3.38; + _elevationRel = _elevationRel / 3.38; _windageRel = _windageRel / 3.38; _elevationCur = _elevationCur / 3.38; _windageCur = _windageCur / 3.38; }; - - case 2: - { + case 2: { _elevationAbs = _elevationAbs * 1.047; _windageAbs = _windageAbs * 1.047; + _wind2 = _wind2 / 1.047; + _elevationRel = _elevationRel * 1.047; _windageRel = _windageRel * 1.047; _elevationCur = _elevationCur * 1.047; _windageCur = _windageCur * 1.047; }; - - case 3: - { - _elevationScopeStep = ((GVAR(workingMemory) select GVAR(currentTarget)) select 7); - _windageScopeStep = ((GVAR(workingMemory) select GVAR(currentTarget)) select 8); + case 3: { + switch (GVAR(workingMemory) select 7) do { + case 0: { _clickSize = 1; }; + case 1: { _clickSize = 1 / 1.047; }; + case 2: { _clickSize = 3.38; }; + }; + _clickNumber = GVAR(workingMemory) select 8; + _clickInterval = _clickSize / _clickNumber; - _elevationAbs = Round(_elevationAbs / _elevationScopeStep); - _windageAbs = Round(_windageAbs / _windageScopeStep); + _elevationAbs = Round(_elevationAbs / _clickInterval); + _windageAbs = Round(_windageAbs / _clickInterval); - _elevationRel = Round(_elevationRel / _elevationScopeStep); - _windageRel = Round(_windageRel / _windageScopeStep); + _wind2 = Round(_wind2 / _clickInterval); - _elevationCur = Round(_elevationCur / _elevationScopeStep); - _windageCur = Round(_windageCur / _windageScopeStep); + _elevationRel = Round(_elevationRel / _clickInterval); + _windageRel = Round(_windageRel / _clickInterval); + + _elevationCur = Round(_elevationCur / _clickInterval); + _windageCur = Round(_windageCur / _clickInterval); }; }; -ctrlSetText [400, Str(Round(_elevationAbs * 100) / 100)]; -ctrlSetText [401, Str(Round(_elevationRel * 100) / 100)]; -ctrlSetText [402, Str(Round(_elevationCur * 100) / 100)]; +if (GVAR(showWind2)) then { + ctrlSetText [42, "Wind2"]; +} else { + ctrlSetText [42, "Lead"]; +}; -ctrlSetText [410, Str(Round(_windageAbs * 100) / 100)]; -ctrlSetText [411, Str(Round(_windageRel * 100) / 100)]; -ctrlSetText [412, Str(Round(_windageCur * 100) / 100)]; +_elevationAbs = Round(_elevationAbs * 100) / 100; +if (_elevationAbs > 0) then { + ctrlSetText [400, format["%1", abs(_elevationAbs)]]; +} else { + if (_elevationAbs < 0) then { + ctrlSetText [400, format["%1D", abs(_elevationAbs)]]; + } else { + ctrlSetText [400, "0.0"]; + }; +}; +_elevationRel = Round(_elevationRel * 100) / 100; +if (_elevationRel > 0) then { + ctrlSetText [401, format["%1", abs(_elevationRel)]]; +} else { + if (_elevationRel < 0) then { + ctrlSetText [401, format["%1D", abs(_elevationRel)]]; + } else { + ctrlSetText [401, "0.0"]; + }; +}; +_elevationCur = Round(_elevationCur * 100) / 100; +if (_elevationCur > 0) then { + ctrlSetText [402, format["%1", abs(_elevationCur)]]; +} else { + if (_elevationCur < 0) then { + ctrlSetText [402, format["%1D", abs(_elevationCur)]]; + } else { + ctrlSetText [402, "0.0"]; + }; +}; -ctrlSetText [420, Str(Round(_lead * 100) / 100)]; +_windageAbs = Round(_windageAbs * 100) / 100; +if (_windageAbs > 0) then { + ctrlSetText [410, format["%1R", abs(_windageAbs)]]; +} else { + if (_windageAbs < 0) then { + ctrlSetText [410, format["%1L", abs(_windageAbs)]]; + } else { + ctrlSetText [410, "0.0"]; + }; +}; +_windageRel = Round(_windageRel * 100) / 100; +if (_windageRel > 0) then { + ctrlSetText [411, format["%1R", abs(_windageRel)]]; +} else { + if (_windageRel < 0) then { + ctrlSetText [411, format["%1L", abs(_windageRel)]]; + } else { + ctrlSetText [411, "0.0"]; + }; +}; +_windageCur = Round(_windageCur * 100) / 100; +if (_windageCur > 0) then { + ctrlSetText [412, format["%1R", abs(_windageCur)]]; +} else { + if (_windageCur < 0) then { + ctrlSetText [412, format["%1L", abs(_windageCur)]]; + } else { + ctrlSetText [412, "0.0"]; + }; +}; + +if (GVAR(showWind2)) then { + _wind2 = Round(_wind2 * 100) / 100; + if (_wind2 > 0) then { + ctrlSetText [420, format["%1R", abs(_wind2)]]; + } else { + if (_wind2 < 0) then { + ctrlSetText [420, format["%1L", abs(_wind2)]]; + } else { + ctrlSetText [420, "0.0"]; + }; + }; +} else { + _lead = Round(_lead * 100) / 100; + if (_lead > 0) then { + if ((GVAR(targetSpeedDirection) select GVAR(currentTarget)) == 1) then { + ctrlSetText [420, format["%1R", abs(_lead)]]; + } else { + ctrlSetText [420, format["%1L", abs(_lead)]]; + }; + } else { + ctrlSetText [420, "0.0"]; + }; +}; \ No newline at end of file diff --git a/addons/atragmx/functions/fnc_update_scope_unit.sqf b/addons/atragmx/functions/fnc_update_scope_unit.sqf index 2a4435c376..46db8c40c4 100644 --- a/addons/atragmx/functions/fnc_update_scope_unit.sqf +++ b/addons/atragmx/functions/fnc_update_scope_unit.sqf @@ -15,5 +15,15 @@ */ #include "script_component.hpp" -ctrlSetText [2000, GVAR(scopeUnits) select (GVAR(currentScopeUnit) select GVAR(currentTarget))]; -ctrlSetText [5000, GVAR(scopeUnits) select (GVAR(currentScopeUnit) select GVAR(currentTarget))]; +ctrlSetText [2000, GVAR(scopeUnits) select GVAR(currentScopeUnit)]; +ctrlSetText [2001, Str(GVAR(currentScopeClickNumber))]; + +if (GVAR(currentScopeUnit) == 3) then { + ctrlSetText [5000, format["Clicks=%1", GVAR(currentScopeClickNumber)]]; + if (GVAR(showMainPage)) then { + ctrlShow [2001, true]; + }; +} else { + ctrlSetText [5000, GVAR(scopeUnits) select GVAR(currentScopeUnit)]; + ctrlShow [2001, false]; +}; \ No newline at end of file diff --git a/addons/atragmx/functions/fnc_update_solution_setup.sqf b/addons/atragmx/functions/fnc_update_solution_setup.sqf new file mode 100644 index 0000000000..204a844c9d --- /dev/null +++ b/addons/atragmx/functions/fnc_update_solution_setup.sqf @@ -0,0 +1,31 @@ +/* + * Author: Ruthberg + * Updates all solution setup input fields + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_update_solution_setup + * + * Public: No + */ +#include "script_component.hpp" + +{((uiNamespace getVariable "ATragMX_Display") displayCtrl _x) ctrlEnable true} forEach [15001, 15002, 15003, 15004, 15005, 15006, 15008, 15009, 15010]; + +switch (GVAR(currentScopeClickNumberTemp)) do { + case 1: { ((uiNamespace getVariable "ATragMX_Display") displayCtrl 15001) ctrlEnable false; }; + case 2: { ((uiNamespace getVariable "ATragMX_Display") displayCtrl 15002) ctrlEnable false; }; + case 3: { ((uiNamespace getVariable "ATragMX_Display") displayCtrl 15003) ctrlEnable false; }; + case 4: { ((uiNamespace getVariable "ATragMX_Display") displayCtrl 15004) ctrlEnable false; }; + case 8: { ((uiNamespace getVariable "ATragMX_Display") displayCtrl 15005) ctrlEnable false; }; + case 10: { ((uiNamespace getVariable "ATragMX_Display") displayCtrl 15006) ctrlEnable false; }; +}; + +((uiNamespace getVariable "ATragMX_Display") displayCtrl (15008 + GVAR(currentScopeClickUnitTemp))) ctrlEnable false; + +ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 15011); diff --git a/addons/atragmx/functions/fnc_update_target.sqf b/addons/atragmx/functions/fnc_update_target.sqf index 18d7a72cd2..ef2ef1de5c 100644 --- a/addons/atragmx/functions/fnc_update_target.sqf +++ b/addons/atragmx/functions/fnc_update_target.sqf @@ -15,23 +15,34 @@ */ #include "script_component.hpp" -if (!isNil QGVAR(windSpeed)) then -{ - ctrlSetText [300, Str(Round((GVAR(windSpeed) select GVAR(currentTarget)) * 100) / 100)]; +if (GVAR(showWind2)) then { + if (GVAR(currentUnit) != 2) then { + ctrlSetText [300, format["%1/%2", Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629), Round((GVAR(windSpeed2) select GVAR(currentTarget)) * 2.23693629)]]; + } else { + ctrlSetText [300, format["%1/%2", Round(GVAR(windSpeed1) select GVAR(currentTarget)), Round(GVAR(windSpeed2) select GVAR(currentTarget))]]; + }; +} else { + if (GVAR(currentUnit) != 2) then { + ctrlSetText [300, Str(Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; + } else { + ctrlSetText [300, Str(Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 100) / 100)]; + }; }; -if (!isNil QGVAR(windDirection)) then -{ - ctrlSetText [310, Str(Round((GVAR(windDirection) select GVAR(currentTarget))))]; -}; -if (!isNil QGVAR(inclinationAngle)) then -{ - ctrlSetText [320, Str(Round((GVAR(inclinationAngle) select GVAR(currentTarget))))]; -}; -if (!isNil QGVAR(targetSpeed)) then -{ +ctrlSetText [310, Str(Round((GVAR(windDirection) select GVAR(currentTarget))))]; +ctrlSetText [320, Str(Round((GVAR(inclinationAngle) select GVAR(currentTarget))))]; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [330, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; +} else { ctrlSetText [330, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 100) / 100)]; }; -if (!isNil QGVAR(targetRange)) then -{ - ctrlSetText [340, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; +switch (GVAR(currentUnit)) do { + case 0: { + ctrlSetText [340, format["*%1", Round((GVAR(targetRange) select GVAR(currentTarget)))]]; + }; + case 1: { + ctrlSetText [340, Str(Round((GVAR(targetRange) select GVAR(currentTarget)) * 1.0936133))]; + }; + case 2: { + ctrlSetText [340, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; + }; }; diff --git a/addons/atragmx/functions/fnc_update_target_data.sqf b/addons/atragmx/functions/fnc_update_target_data.sqf new file mode 100644 index 0000000000..6fa9035a62 --- /dev/null +++ b/addons/atragmx/functions/fnc_update_target_data.sqf @@ -0,0 +1,63 @@ +/* + * Author: Ruthberg + * Updates all target column input fields + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_update_target + * + * Public: No + */ +#include "script_component.hpp" + +ctrlSetText [140000, Str(Round((GVAR(latitude) select GVAR(currentTarget)) * 100) / 100)]; +ctrlSetText [140010, Str(Round((GVAR(directionOfFire) select GVAR(currentTarget)) * 100) / 100)]; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [140020, Str(Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; + ctrlSetText [140021, Str(Round((GVAR(windSpeed2) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; +} else { + ctrlSetText [140020, Str(Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 100) / 100)]; + ctrlSetText [140021, Str(Round((GVAR(windSpeed2) select GVAR(currentTarget)) * 100) / 100)]; +}; +ctrlSetText [140030, Str(Round((GVAR(windDirection) select GVAR(currentTarget))))]; +ctrlSetText [140040, Str(Round((GVAR(inclinationAngle) select GVAR(currentTarget))))]; +ctrlSetText [140041, Str(Round(cos(GVAR(inclinationAngle) select GVAR(currentTarget)) * 100) / 100)]; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [140050, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; +} else { + ctrlSetText [140050, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 100) / 100)]; +}; +if ((GVAR(targetSpeedDirection) select GVAR(currentTarget)) == 1) then { + ctrlSetText [140051, ">"]; +} else { + ctrlSetText [140051, "<"]; +}; +if (GVAR(currentUnit) == 1) then { + ctrlSetText [140060, Str(Round((GVAR(targetRange) select GVAR(currentTarget)) * 1.0936133))]; +} else { + ctrlSetText [140060, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; +}; +if (GVAR(currentUnit) == 0) then { + ctrlSetText [140061, "*"]; +} else { + ctrlSetText [140061, ""]; +}; + +if (GVAR(currentUnit) == 2) then { + ctrlSetText [14002, "Wind Speed (m/s)"]; + ctrlSetText [14005, "Target Speed (m/s)"]; +} else { + ctrlSetText [14002, "Wind Speed (mph)"]; + ctrlSetText [14005, "Target Speed (mph)"]; +}; + +if (GVAR(currentUnit) == 1) then { + ctrlSetText [14006, "Target Range (yards)"]; +} else { + ctrlSetText [14006, "Target Range (meters)"]; +}; diff --git a/addons/atragmx/functions/fnc_update_target_selection.sqf b/addons/atragmx/functions/fnc_update_target_selection.sqf index d48412def0..d9fd6002c9 100644 --- a/addons/atragmx/functions/fnc_update_target_selection.sqf +++ b/addons/atragmx/functions/fnc_update_target_selection.sqf @@ -15,15 +15,10 @@ */ #include "script_component.hpp" -#define _dsp (uiNamespace getVariable "ATragMX_Display") +{((uiNamespace getVariable "ATragMX_Display") displayCtrl _x) ctrlEnable true} forEach [500, 501, 502, 503]; -(_dsp displayCtrl 500) ctrlEnable true; -(_dsp displayCtrl 501) ctrlEnable true; -(_dsp displayCtrl 502) ctrlEnable true; -(_dsp displayCtrl 503) ctrlEnable true; +((uiNamespace getVariable "ATragMX_Display") displayCtrl 500 + GVAR(currentTarget)) ctrlEnable false; -(_dsp displayCtrl 500 + GVAR(currentTarget)) ctrlEnable false; - -ctrlSetFocus (_dsp displayCtrl 3000); +ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 3000); [] call FUNC(update_unit_selection); diff --git a/addons/atragmx/functions/fnc_update_unit_selection.sqf b/addons/atragmx/functions/fnc_update_unit_selection.sqf index dacc228032..77d96bfdd6 100644 --- a/addons/atragmx/functions/fnc_update_unit_selection.sqf +++ b/addons/atragmx/functions/fnc_update_unit_selection.sqf @@ -15,15 +15,17 @@ */ #include "script_component.hpp" -#define _dsp (uiNamespace getVariable "ATragMX_Display") +((uiNamespace getVariable "ATragMX_Display") displayCtrl 600) ctrlEnable true; +((uiNamespace getVariable "ATragMX_Display") displayCtrl 601) ctrlEnable true; +((uiNamespace getVariable "ATragMX_Display") displayCtrl 602) ctrlEnable true; -(_dsp displayCtrl 600) ctrlEnable true; -(_dsp displayCtrl 601) ctrlEnable true; -(_dsp displayCtrl 602) ctrlEnable true; - -(_dsp displayCtrl 600 + GVAR(currentUnit)) ctrlEnable false; +((uiNamespace getVariable "ATragMX_Display") displayCtrl 600 + GVAR(currentUnit)) ctrlEnable false; [] call FUNC(update_gun); +[] call FUNC(update_gun_ammo_data); [] call FUNC(update_atmosphere); +[] call FUNC(update_atmo_env_data); [] call FUNC(update_target); +[] call FUNC(update_target_data); + [] call FUNC(update_result); diff --git a/addons/atragmx/functions/fnc_update_zero_range.sqf b/addons/atragmx/functions/fnc_update_zero_range.sqf index 15e65c38a6..299c321d33 100644 --- a/addons/atragmx/functions/fnc_update_zero_range.sqf +++ b/addons/atragmx/functions/fnc_update_zero_range.sqf @@ -16,40 +16,35 @@ #include "script_component.hpp" private ["_scopeBaseAngle"]; -_scopeBaseAngle = ((GVAR(workingMemory) select GVAR(currentTarget)) select 3); +_scopeBaseAngle = (GVAR(workingMemory) select 3); private ["_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel"]; -_bulletMass = (GVAR(workingMemory) select GVAR(currentTarget)) select 12; -_boreHeight = (GVAR(workingMemory) select GVAR(currentTarget)) select 5; -_airFriction = (GVAR(workingMemory) select GVAR(currentTarget)) select 4; -_muzzleVelocity = (GVAR(workingMemory) select GVAR(currentTarget)) select 1; -_bc = (GVAR(workingMemory) select GVAR(currentTarget)) select 15; -_dragModel = (GVAR(workingMemory) select GVAR(currentTarget)) select 16; -_atmosphereModel = (GVAR(workingMemory) select GVAR(currentTarget)) select 17; +_bulletMass = GVAR(workingMemory) select 12; +_boreHeight = GVAR(workingMemory) select 5; +_airFriction = GVAR(workingMemory) select 4; +_muzzleVelocity = GVAR(workingMemory) select 1; +_bc = GVAR(workingMemory) select 15; +_dragModel = GVAR(workingMemory) select 16; +_atmosphereModel = GVAR(workingMemory) select 17; private ["_zeroRange"]; -_zeroRange = Round(parseNumber(ctrlText 140)); -if (GVAR(currentUnit) != 2) then -{ +_zeroRange = Round(parseNumber(ctrlText 120060)); +if (GVAR(currentUnit) == 1) then { _zeroRange = _zeroRange / 1.0936133; }; if (_zeroRange < 10) exitWith { - (GVAR(workingMemory) select GVAR(currentTarget)) set [2, _zeroRange]; - (GVAR(workingMemory) select GVAR(currentTarget)) set [3, 0]; + GVAR(workingMemory) set [2, _zeroRange]; + GVAR(workingMemory) set [3, 0]; }; -private ["_temperature", "_barometricPressure", "_relativeHumidity"]; -_temperature = (GVAR(temperature) select GVAR(currentTarget)); -_barometricPressure = (GVAR(barometricPressure) select GVAR(currentTarget)); -_relativeHumidity = (GVAR(relativeHumidity) select GVAR(currentTarget)); -if (GVAR(currentUnit) == 1) then -{ - _temperature = (_temperature - 32) / 1.8; - _barometricPressure = _barometricPressure * 33.8638866667; -}; +private ["_altitude", "_temperature", "_barometricPressure", "_relativeHumidity"]; +_altitude = GVAR(altitude); +_temperature = GVAR(temperature); +_barometricPressure = GVAR(barometricPressure); +_relativeHumidity = GVAR(relativeHumidity); private ["_result"]; -_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, 0, 0, 0, 0, _zeroRange, _bc, _dragModel, _atmosphereModel, false] call FUNC(calculate_solution); +_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, [0, 0], 0, 0, 0, _zeroRange, _bc, _dragModel, _atmosphereModel, false, 1.5, 0, 0, 0] call FUNC(calculate_solution); -(GVAR(workingMemory) select GVAR(currentTarget)) set [2, _zeroRange]; -(GVAR(workingMemory) select GVAR(currentTarget)) set [3, _scopeBaseAngle + (_result select 0) / 60]; +GVAR(workingMemory) set [2, _zeroRange]; +GVAR(workingMemory) set [3, _scopeBaseAngle + (_result select 0) / 60]; diff --git a/addons/atragmx/initKeybinds.sqf b/addons/atragmx/initKeybinds.sqf index 28616b872f..796d7f9d97 100644 --- a/addons/atragmx/initKeybinds.sqf +++ b/addons/atragmx/initKeybinds.sqf @@ -1,11 +1,11 @@ -["ACE3", QGVAR(ATragMXDialogKey), localize "STR_ACE_ATragMX_ATragMXDialogKey", +["ACE3 Equipment", QGVAR(ATragMXDialogKey), localize "STR_ACE_ATragMX_ATragMXDialogKey", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; - + // Statement [] call FUNC(create_dialog); false }, {false}, -[197, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // (PRINT) \ No newline at end of file +[0, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // (empty default key) \ No newline at end of file diff --git a/addons/atragmx/script_component.hpp b/addons/atragmx/script_component.hpp index 062df59d19..c201925147 100644 --- a/addons/atragmx/script_component.hpp +++ b/addons/atragmx/script_component.hpp @@ -9,4 +9,6 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_ATRAGMX #endif -#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" + +#define ATRAGMX_PROFILE_NAMESPACE_VERSION 1.3 diff --git a/addons/atragmx/stringtable.xml b/addons/atragmx/stringtable.xml index 6b6a921c2a..fefcc2c7e5 100644 --- a/addons/atragmx/stringtable.xml +++ b/addons/atragmx/stringtable.xml @@ -1,5 +1,4 @@  - @@ -17,14 +16,35 @@ Open ATragMX Otwórz ATragMX + Открыть ATragMX + Abrir ATragMX + Ouvrir ATragMX + ATragMX öffnen + Apri ATragMX + ATragMX elővétele + Otevřít ATragMX Rugged PDA with ATragMX Przenośny PDA z kalkulatorem balistycznym ATragMX + Защищенный КПК с ATragMX + PDA rugerizada con ATragMX + Robuster PDA mit ATragMX + PDA avec ATragMX + PDA Robusto con ATragMX + Megerősített PDA, ATragMX-el + PDA s ATragMX Open ATragMX Otwórz ATragMX + Открыть ATragMX + Abrir ATragMX + Ouvrir ATragMX + ATragMX öffnen + Apri ATragMX + ATragMX elővétele + Otevřít ATragMX \ No newline at end of file diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 3bb54eee16..45b1c0a336 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -62,6 +62,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment _actionID = _unit addAction [format ["%1", localize "STR_ACE_Attach_CancelAction"], {GVAR(placeAction) = 0}]; [{ + private "_startingPosition"; PARAMS_2(_args,_pfID); EXPLODE_7_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_tempObject,_onAtachText,_actionID); diff --git a/addons/attach/functions/fnc_canAttach.sqf b/addons/attach/functions/fnc_canAttach.sqf index d0930dc069..18071092d5 100644 --- a/addons/attach/functions/fnc_canAttach.sqf +++ b/addons/attach/functions/fnc_canAttach.sqf @@ -19,7 +19,7 @@ PARAMS_3(_attachToVehicle,_player,_args); -private ["_itemName", "_attachLimit", "_attachedObjects"]; +private ["_itemName", "_attachLimit", "_attachedObjects","_playerPos"]; _itemName = [_args, 0, ""] call CBA_fnc_defaultParam; _attachLimit = [6, 1] select (_player == _attachToVehicle); diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index 99ac646013..a56936301d 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -18,7 +18,7 @@ PARAMS_2(_attachToVehicle,_unit); -private ["_attachedObjects", "_attachedItems"]; +private ["_attachedObjects", "_attachedItems", "_itemDisplayName"]; _attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; _attachedItems = _attachToVehicle getVariable [QGVAR(ItemNames), []]; diff --git a/addons/attach/functions/fnc_getChildrenAttachActions.sqf b/addons/attach/functions/fnc_getChildrenAttachActions.sqf index 3594e10bd6..fb432146be 100644 --- a/addons/attach/functions/fnc_getChildrenAttachActions.sqf +++ b/addons/attach/functions/fnc_getChildrenAttachActions.sqf @@ -17,6 +17,7 @@ */ #include "script_component.hpp" +private ["_listed", "_actions", "_item", "_displayName", "_picture", "_action"]; PARAMS_2(_target,_player); _listed = []; diff --git a/addons/attach/stringtable.xml b/addons/attach/stringtable.xml index 21577a6bce..02066f26b4 100644 --- a/addons/attach/stringtable.xml +++ b/addons/attach/stringtable.xml @@ -11,7 +11,7 @@ Acoplar item >> Attacca l'oggetto >> Tárgy hozzácsatolása >> - Добавить приспособления + Прикрепить предмет Attach @@ -23,7 +23,7 @@ Acoplar Attacca Hozzácsatolás - Присоединить + Прикрепить Detach item @@ -42,19 +42,19 @@ IR-Stroboskop befestigt Marcador IR acoplado Przyczepiono stroboskop IR - Strobe IR attaché + Balise IR attachée IR Značkovač připnutý Marcador IV Acoplado Strobo IR attaccata Infravörös jeladó hozzácsatolva - ИК-маяк присоединён + ИК-маяк прикреплён IR Strobe Detached IR-Stroboskop entfernt Marcador IR quitado Odczepiono stroboskop IR - Strobe IR détaché + Balise IR détachée IR Značkovač odepnutý Marcador IV Separado Strobo IR staccata @@ -71,7 +71,7 @@ Granada IV Acoplada Granata IR attaccata Infravörös gránát hozzácsatolva - ИК-граната присоединена + ИК-граната прикреплена IR Grenade Detached @@ -95,7 +95,7 @@ Chemlight Acoplada Chemlight attaccata Chemlight hozzácsatolva - Химсвет присоединён + Химсвет прикреплён Chemlight Detached @@ -126,7 +126,7 @@ IR-Stroboskop Marcador IR Stroboskop IR - Strobe IR + Balise IR IR Značkovač Marcador IV Strobo IR @@ -138,7 +138,7 @@ Das IR-Stroboskop erlaubt es dir deine Position mit einem blinkenden Leuchtfeuer zu signalisieren, welches nur mit Nachtsichtgerät zu erkennen ist. Stroboskop światła podczerwieni umożliwia oznaczenie swojej pozycji pulsacyjnym światłem widocznym tylko przez optykę noktowizyjną i gogle noktowizyjne. El Marcador IR permite señalizar su posisición a través de una baliza visible solo a través de dispositivos de visión nocturna. - Le Strobe IR permet de signaler votre position grace à un clignotement visible par des JVN. + La balise IR permet de signaler votre position grace à un clignotement visible par des JVN. IR Značkovač je Infračerveně zářící stroboskop umožňující signalizaci vaší pozice díky blikajícímu světlu, které je vidět pouze při užití noktovizoru. O Marcador IV permite que você sinalize sua posição através de um pulso visível somente com equipamento de visão noturna. La Strobo IR è una luce stroboscopica che ti permette di segnalare la tua posizione grazie all'emissione di impulsi ad infrarossi visibili solo con i visori notturni. @@ -176,31 +176,34 @@ Не удалось присоединить Error al acoplar Připnutí selhalo + Erro ao anexar Przyczepianie nie powiodło się + Hozzácsatolás sikertelen + Impossibile Attaccare %1<br/>Attached %1<br/>befestigt %1<br/>acoplada - %1<br/>Przyczepiono + %1<br/>przyczepiono %1<br/>attachée %1<br/>Připnutý %1<br/>Acoplada %1<br/>attaccata %1<br/>hozzácsatolva - %1<br/>присоединена + %1<br/>присоединен(-а) %1<br/>Detached %1<br/>entfernt %1<br/>quitada - %1<br/>Odczepiono + %1<br/>odczepiono %1<br/>détachée %1<br/>Odepnutý %1<br/>Separada %1<br/>staccata %1<br/>lecsatolva - %1<br/>отсоединена + %1<br/>отсоединен(-а) diff --git a/addons/backpacks/functions/fnc_backpackOpened.sqf b/addons/backpacks/functions/fnc_backpackOpened.sqf index 1894d68f23..3f5cf53994 100644 --- a/addons/backpacks/functions/fnc_backpackOpened.sqf +++ b/addons/backpacks/functions/fnc_backpackOpened.sqf @@ -13,11 +13,7 @@ */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; -_backpack = _this select 2; +PARAMS_3(_unit,_target,_backpack); // do cam shake if the target is the player if ([_target] call EFUNC(common,isPlayer)) then { diff --git a/addons/ballistics/CfgAmmo.hpp b/addons/ballistics/CfgAmmo.hpp index 620484950d..02df51e891 100644 --- a/addons/ballistics/CfgAmmo.hpp +++ b/addons/ballistics/CfgAmmo.hpp @@ -3,27 +3,28 @@ class CfgAmmo { class BulletCore; class BulletBase: BulletCore { - // Default: 6 | More is good, but too much is bad (especially with wind deflection / advanced ballistics) - timeToLive = 10; + timeToLive=6; }; class B_20mm : BulletBase { - timeToLive = 30; + timeToLive=30; }; class B_25mm : BulletBase { - timeToLive = 30; + timeToLive=30; }; class B_35mm_AA : BulletBase { - timeToLive = 30; + timeToLive=30; }; class B_30mm_AP : BulletBase { - timeToLive = 30; + timeToLive=30; }; class B_556x45_Ball : BulletBase { airFriction=-0.001265; hit=8; typicalSpeed=750; + tracerStartTime = 0.073; //M856 tracer burns out to 800m + tracerEndTime = 1.579; //Time in seconds calculated with ballistics calculator ACE_caliber=0.224; ACE_bulletLength=0.906; ACE_bulletMass=62; @@ -37,7 +38,7 @@ class CfgAmmo { }; class ACE_556x45_Ball_Mk262 : B_556x45_Ball { airFriction=-0.001125; - caliber=0.6; + caliber=0.8; deflecting=18; hit=11; typicalSpeed=836; @@ -54,7 +55,7 @@ class CfgAmmo { }; class ACE_556x45_Ball_Mk318 : B_556x45_Ball { airFriction=-0.001120; - caliber=0.6; + caliber=0.8; deflecting=18; hit=9; typicalSpeed=886; @@ -69,13 +70,30 @@ class CfgAmmo { ACE_muzzleVelocities[]={780, 886, 950}; ACE_barrelLengths[]={10, 15.5, 20}; }; + class ACE_556x45_Ball_M995_AP : B_556x45_Ball { + airFriction=-0.001120; + caliber=1.6; + deflecting=18; + hit=6; + typicalSpeed=886; + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=46; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.151}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={950, 1030, 1040}; + ACE_barrelLengths[]={10, 15.5, 20}; + }; class B_556x45_Ball_Tracer_Red; class ACE_B_556x45_Ball_Tracer_Dim: B_556x45_Ball_Tracer_Red { nvgOnly = 1; }; class ACE_545x39_Ball_7N6M : B_556x45_Ball { airFriction=-0.001162; - caliber=0.5; + caliber=0.6; deflecting=18; hit=7; typicalSpeed=880; @@ -85,30 +103,33 @@ class CfgAmmo { ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; ACE_ballisticCoefficients[]={0.168}; ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; + ACE_standardAtmosphere="ICAO"; ACE_dragModel=7; ACE_muzzleVelocities[]={780, 880, 920}; ACE_barrelLengths[]={10, 16.3, 20}; }; - class ACE_545x39_Ball_7T3M : B_556x45_Ball_Tracer_Red { + class B_556x45_Ball_Tracer_Green; + class ACE_545x39_Ball_7T3M : B_556x45_Ball_Tracer_Green { airFriction=-0.001162; - caliber=0.5; + caliber=0.6; deflecting=18; hit=7; typicalSpeed=883; + tracerStartTime = 0.073; //7T3M tracer burns out to 850m + tracerEndTime = 1.736; //Time in seconds calculated with ballistics calculator ACE_caliber=0.220; ACE_bulletLength=0.85; ACE_bulletMass=49.8; ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; ACE_ballisticCoefficients[]={0.168}; ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; + ACE_standardAtmosphere="ICAO"; ACE_dragModel=7; ACE_muzzleVelocities[]={785, 883, 925}; ACE_barrelLengths[]={10, 16.3, 20}; }; class B_65x39_Caseless : BulletBase { - airFriction=-0.000772; + airFriction=-0.000785; typicalSpeed=800; ACE_caliber=0.264; ACE_bulletLength=1.295; @@ -122,13 +143,49 @@ class CfgAmmo { ACE_barrelLengths[]={10, 16, 20, 24, 26, 30}; }; class B_65x39_Case_yellow; - class ACE_B_65x39_Caseless_Tracer_Dim : B_65x39_Case_yellow { + class ACE_65x39_Caseless_Tracer_Dim : B_65x39_Case_yellow { nvgOnly = 1; }; + class B_65x39_Caseless_green; + class ACE_65x39_Caseless_green_Tracer_Dim : B_65x39_Caseless_green { + nvgOnly = 1; + }; + class ACE_65x47_Ball_Scenar: B_65x39_Caseless { + airFriction=-0.00078; + typicalSpeed=820 ; + caliber=0.9; + ACE_caliber=0.264; + ACE_bulletLength=1.364; + ACE_bulletMass=139; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.290}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={730, 760, 790, 820, 830}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class ACE_65_Creedmor_Ball: B_65x39_Caseless { + airFriction=-0.000651; + typicalSpeed=860 ; + caliber=1.1; + ACE_caliber=0.264; + ACE_bulletLength=1.426; + ACE_bulletMass=140; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.317}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={750, 820, 840, 852, 860}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; class B_762x51_Ball : BulletBase { airFriction=-0.001035; typicalSpeed=833; - hit=14; + hit=9; + tracerStartTime = 0.073; //Based on the British L5A1 which burns out to 1000m + tracerEndTime = 2.058; //Time in seconds calculated with ballistics calculator ACE_caliber=0.308; ACE_bulletLength=1.14; ACE_bulletMass=146; @@ -140,32 +197,80 @@ class CfgAmmo { ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; ACE_barrelLengths[]={10, 16, 20, 24, 26}; }; - class B_762x51_Tracer_Red; - class ACE_B_762x51_Tracer_Dim: B_762x51_Tracer_Red { + class B_762x51_Tracer_Yellow; + class ACE_B_762x51_Tracer_Dim: B_762x51_Tracer_Yellow { nvgOnly = 1; }; class ACE_762x51_Ball_M118LR : B_762x51_Ball { airFriction=-0.0008525; - caliber=1.05; + caliber=1.8; hit=16; typicalSpeed=790; ACE_caliber=0.308; ACE_bulletLength=1.24; ACE_bulletMass=175; ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.505, 0.496, 0.485, 0.485, 0.485}; - ACE_velocityBoundaries[]={853, 549, 549, 549}; + ACE_ballisticCoefficients[]={0.243}; + ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; + ACE_dragModel=7; ACE_muzzleVelocities[]={750, 780, 790, 794}; ACE_barrelLengths[]={16, 20, 24, 26}; }; - class ACE_762x51_Ball_Subsonic : B_762x51_Ball { - airFriction=-0.000535; - caliber=0.5; + class ACE_762x51_Ball_Mk316_Mod_0 : B_762x51_Ball { + airFriction=-0.0008525; + caliber=1.8; hit=16; typicalSpeed=790; ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=175; + ACE_ammoTempMuzzleVelocityShifts[]={-5.3, -5.1, -4.6, -4.2, -3.4, -2.6, -1.4, -0.3, 1.4, 3.0, 5.2}; + ACE_ballisticCoefficients[]={0.243}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={775, 790, 805, 810}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class ACE_762x51_Ball_Mk319_Mod_0 : B_762x51_Ball { + airFriction=-0.00103; + caliber=1.5; + hit=14; + typicalSpeed=900; + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=130; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.377}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={838, 892, 910}; + ACE_barrelLengths[]={13, 16, 20}; + }; + class ACE_762x51_Ball_M993_AP : B_762x51_Ball { + airFriction=-0.00103; + caliber=2.2; + hit=11; + typicalSpeed=930; + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=127; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.377}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={875, 910, 930}; + ACE_barrelLengths[]={13, 16, 20}; + }; + class ACE_762x51_Ball_Subsonic : B_762x51_Ball { + airFriction=-0.000535; + caliber=1; + hit=6; + typicalSpeed=320; + ACE_caliber=0.308; ACE_bulletLength=1.340; ACE_bulletMass=200; ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; @@ -176,7 +281,105 @@ class CfgAmmo { ACE_muzzleVelocities[]={305, 325, 335, 340}; ACE_barrelLengths[]={16, 20, 24, 26}; }; - class B_762x54_Ball : BulletBase { + class ACE_30_06_M1_Ball : B_762x51_Ball { + airFriction=-0.0009; + typicalSpeed=800; + caliber=2.0; + hit=10; + ACE_caliber=0.308; + ACE_bulletLength=1.21; + ACE_bulletMass=174; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.494}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={700, 785, 800, 830, 840}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class ACE_7_Remington_Magnum_Ball : B_762x51_Ball { + airFriction=-0.0008; + typicalSpeed=820; + caliber=2.1; + hit=8; + ACE_caliber=0.284; + ACE_bulletLength=1.529; + ACE_bulletMass=180; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.345}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={720, 780, 812, 822, 830}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class ACE_243_Winchester_Ball : B_762x51_Ball { + airFriction=-0.00095; + typicalSpeed=915; + caliber=2.3; + hit=6; + ACE_caliber=0.243; + ACE_bulletLength=1.282; + ACE_bulletMass=180; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.278}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={830, 875, 900, 915, 920}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class ACE_762x67_Ball_Mk248_Mod_0 : B_762x51_Ball { + airFriction=-0.000830; + caliber=1.8; + hit=17; + typicalSpeed=900; + ACE_caliber=0.308; + ACE_bulletLength=1.353; + ACE_bulletMass=190; + ACE_ammoTempMuzzleVelocityShifts[]={-5.3, -5.1, -4.6, -4.2, -3.4, -2.6, -1.4, -0.3, 1.4, 3.0, 5.2}; + ACE_ballisticCoefficients[]={0.268}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={865, 900, 924}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class ACE_762x67_Ball_Mk248_Mod_1 : B_762x51_Ball { + airFriction=-0.000815; + caliber=1.9; + hit=18; + typicalSpeed=867; + ACE_caliber=0.308; + ACE_bulletLength=1.489; + ACE_bulletMass=220; + ACE_ammoTempMuzzleVelocityShifts[]={-5.3, -5.1, -4.6, -4.2, -3.4, -2.6, -1.4, -0.3, 1.4, 3.0, 5.2}; + ACE_ballisticCoefficients[]={0.310}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={847, 867, 877}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class ACE_762x67_Ball_Berger_Hybrid_OTM : B_762x51_Ball { + airFriction=-0.00076; + caliber=2.0; + hit=19; + typicalSpeed=853; + ACE_caliber=0.308; + ACE_bulletLength=1.602; + ACE_bulletMass=230; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.368}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={800, 853, 884}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class B_762x54_Ball: B_762x51_Ball { + airFriction=-0.001023; + typicalSpeed=820; ACE_caliber=0.312; ACE_bulletLength=1.14; ACE_bulletMass=152; @@ -190,7 +393,7 @@ class CfgAmmo { }; class ACE_762x54_Ball_7N14 : B_762x51_Ball { airFriction=-0.001023; - caliber=0.95; + caliber=1.5; hit=15; typicalSpeed=820; ACE_caliber=0.312; @@ -204,11 +407,14 @@ class CfgAmmo { ACE_muzzleVelocities[]={700, 800, 820, 833}; ACE_barrelLengths[]={16, 20, 24, 26}; }; - class ACE_762x54_Ball_7T2 : B_762x51_Tracer_Red { + class B_762x54_Tracer_Green; + class ACE_762x54_Ball_7T2 : B_762x54_Tracer_Green { airFriction=-0.001023; - caliber=0.9; + caliber=1.5; hit=15; typicalSpeed=800; + tracerStartTime = 0.073; //Based on the 7T2 which burns three seconds + tracerEndTime = 3; ACE_caliber=0.312; ACE_bulletLength=1.14; ACE_bulletMass=149; @@ -222,7 +428,7 @@ class CfgAmmo { }; class ACE_762x35_Ball : B_762x51_Ball { airFriction=-0.000821; - caliber=0.9; + caliber=1.5; hit=11; typicalSpeed=790; ACE_caliber=0.308; @@ -239,6 +445,7 @@ class CfgAmmo { class ACE_762x39_Ball : B_762x51_Ball { airFriction=-0.0015168; hit=12; + caliber=1.5; typicalSpeed=716; ACE_caliber=0.308; ACE_bulletLength=1.14; @@ -251,10 +458,13 @@ class CfgAmmo { ACE_muzzleVelocities[]={650, 716, 750}; ACE_barrelLengths[]={10, 16.3, 20}; }; - class ACE_762x39_Ball_57N231P : B_762x51_Tracer_Red { + class ACE_762x39_Ball_57N231P : B_762x54_Tracer_Green { airFriction=-0.0015168; hit=12; + caliber=1.5; typicalSpeed=716; + tracerStartTime = 0.073; //57N231P tracer burns out to 800m + tracerEndTime = 2.082; //Time in seconds calculated with ballistics calculator ACE_caliber=0.308; ACE_bulletLength=1.14; ACE_bulletMass=117; @@ -276,7 +486,7 @@ class CfgAmmo { ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; ACE_ballisticCoefficients[]={0.17}; ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; + ACE_standardAtmosphere="ICAO"; ACE_dragModel=1; ACE_muzzleVelocities[]={440, 460, 480}; ACE_barrelLengths[]={4, 5, 9}; @@ -291,7 +501,7 @@ class CfgAmmo { ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; ACE_ballisticCoefficients[]={0.125}; ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; + ACE_standardAtmosphere="ICAO"; ACE_dragModel=1; ACE_muzzleVelocities[]={298, 330, 350}; ACE_barrelLengths[]={3.8, 5, 9}; @@ -321,7 +531,7 @@ class CfgAmmo { ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; ACE_ballisticCoefficients[]={0.189}; ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; + ACE_standardAtmosphere="ICAO"; ACE_dragModel=1; ACE_muzzleVelocities[]={360, 400, 430}; ACE_barrelLengths[]={4, 4.61, 9}; @@ -344,6 +554,7 @@ class CfgAmmo { class ACE_303_Ball : ACE_762x51_Ball_M118LR { airFriction=-0.00083; typicalSpeed=761; + caliber=2.0; ACE_caliber=0.311; ACE_bulletLength=1.227; ACE_bulletMass=174; @@ -356,10 +567,11 @@ class CfgAmmo { ACE_barrelLengths[]={20, 24, 26}; }; class B_93x64_Ball : BulletBase { + airFriction=-0.00106; + typicalSpeed=880; ACE_caliber=0.366; ACE_bulletLength=1.350; ACE_bulletMass=230; - ACE_transonicStabilityCoef=1; ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; ACE_ballisticCoefficients[]={0.368}; ACE_velocityBoundaries[]={}; @@ -369,6 +581,7 @@ class CfgAmmo { ACE_barrelLengths[]={20, 24.41, 26}; }; class B_408_Ball : BulletBase { + timeToLive=10; airFriction=-0.000395; typicalSpeed=910; ACE_caliber=0.408; @@ -384,6 +597,7 @@ class CfgAmmo { ACE_barrelLengths[]={29}; }; class ACE_106x83mm_Ball : B_408_Ball { + timeToLive=10; ACE_caliber=0.416; ACE_bulletLength=2.089; ACE_bulletMass=398; @@ -395,24 +609,10 @@ class CfgAmmo { ACE_muzzleVelocities[]={960}; ACE_barrelLengths[]={29}; }; - class ACE_338_Ball : B_408_Ball { - airFriction=-0.000526; - caliber=1.55; - deflecting=12; - hit=20; - typicalSpeed=826; - ACE_caliber=0.338; - ACE_bulletLength=1.70; - ACE_bulletMass=300; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.381}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={820, 826, 830}; - ACE_barrelLengths[]={24, 26.5, 28}; - }; class B_338_Ball : BulletBase { + timeToLive=10; + airFriction=-0.000606; + typicalSpeed=915; ACE_caliber=0.338; ACE_bulletLength=1.558; ACE_bulletMass=250; @@ -425,6 +625,8 @@ class CfgAmmo { ACE_barrelLengths[]={20, 26, 28}; }; class B_338_NM_Ball : BulletBase { + airFriction=-0.000537; + typicalSpeed=820; ACE_caliber=0.338; ACE_bulletLength=1.70; ACE_bulletMass=300; @@ -436,10 +638,43 @@ class CfgAmmo { ACE_muzzleVelocities[]={790, 807, 820}; ACE_barrelLengths[]={20, 24, 26}; }; + class ACE_338_Ball : B_338_Ball { + timeToLive=10; + airFriction=-0.000535; + typicalSpeed=826; + ACE_caliber=0.338; + ACE_bulletLength=1.70; + ACE_bulletMass=300; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.381}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={800, 820, 826, 830}; + ACE_barrelLengths[]={20, 24, 26.5, 28}; + }; + class ACE_338_Ball_API526 : B_338_Ball { + timeToLive=10; + airFriction=-0.000673; + caliber=2.8; + typicalSpeed=826; + ACE_caliber=0.338; + ACE_bulletLength=1.535; + ACE_bulletMass=253; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.290}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={880, 915, 925}; + ACE_barrelLengths[]={20, 26, 28}; + }; class B_127x54_Ball : BulletBase { - ACE_caliber=0.50; + airFriction=-0.00014; + typicalSpeed=300; + ACE_caliber=0.510; ACE_bulletLength=2.540; - ACE_bulletMass=950; + ACE_bulletMass=750; ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; ACE_ballisticCoefficients[]={1.050}; ACE_velocityBoundaries[]={}; @@ -449,8 +684,9 @@ class CfgAmmo { ACE_barrelLengths[]={17.2}; }; class B_127x99_Ball : BulletBase { + timeToLive=10; airFriction=-0.0006; - typicalSpeed=853; + typicalSpeed=900; ACE_caliber=0.510; ACE_bulletLength=2.310; ACE_bulletMass=647; @@ -459,10 +695,31 @@ class CfgAmmo { ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ASM"; ACE_dragModel=1; - ACE_muzzleVelocities[]={853}; + ACE_muzzleVelocities[]={900}; + ACE_barrelLengths[]={29}; + }; + class ACE_127x99_API : BulletBase { + timeToLive=10; + airFriction=-0.0006; + typicalSpeed=900; + hit=25; + caliber=4.0; + ACE_caliber=0.510; + ACE_bulletLength=2.310; + ACE_bulletMass=648; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.670}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={900}; ACE_barrelLengths[]={29}; }; class ACE_127x99_Ball_AMAX : B_127x99_Ball { + timeToLive=10; + airFriction=-0.000374; + typicalSpeed=860; + caliber=3.0; ACE_caliber=0.510; ACE_bulletLength=2.540; ACE_bulletMass=750; @@ -475,6 +732,8 @@ class CfgAmmo { ACE_barrelLengths[]={29}; }; class B_127x108_Ball : BulletBase { + timeToLive=10; + airFriction=-0.00064; typicalSpeed=820; ACE_caliber=0.511; ACE_bulletLength=2.520; diff --git a/addons/ballistics/CfgMagazines.hpp b/addons/ballistics/CfgMagazines.hpp index 6e6f5a11e8..32121e4e87 100644 --- a/addons/ballistics/CfgMagazines.hpp +++ b/addons/ballistics/CfgMagazines.hpp @@ -11,22 +11,68 @@ class CfgMagazines { class 100Rnd_65x39_caseless_mag_Tracer: 100Rnd_65x39_caseless_mag { initSpeed = 760; }; + class ACE_100Rnd_65x39_caseless_mag_Tracer_Dim: 100Rnd_65x39_caseless_mag_Tracer { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_65x39_Caseless_Tracer_Dim"; + displayName = "$STR_ACE_100Rnd_65x39_caseless_mag_Tracer_DimName"; + displayNameShort = "$STR_ACE_100Rnd_65x39_caseless_mag_Tracer_DimNameShort"; + descriptionShort = "$STR_ACE_100Rnd_65x39_caseless_mag_Tracer_DimDescription"; + picture = "\A3\weapons_f\data\ui\m_100rnd_65x39_yellow_ca.paa"; + }; class 200Rnd_65x39_cased_Box: 100Rnd_65x39_caseless_mag { initSpeed = 760; }; - class 30Rnd_65x39_caseless_mag_Tracer: 30Rnd_65x39_caseless_mag { + class ACE_200Rnd_65x39_cased_Box_Tracer_Dim: 200Rnd_65x39_cased_Box { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_65x39_Caseless_Tracer_Dim"; + displayName = "$STR_ACE_200Rnd_65x39_cased_Box_Tracer_DimName"; + displayNameShort = "$STR_ACE_200Rnd_65x39_cased_Box_Tracer_DimNameShort"; + descriptionShort = "$STR_ACE_200Rnd_65x39_cased_Box_Tracer_DimDescription"; + picture = "\A3\weapons_f\data\ui\m_200rnd_65x39_yellow_ca.paa"; }; + class 30Rnd_65x39_caseless_mag_Tracer; class ACE_30Rnd_65x39_caseless_mag_Tracer_Dim: 30Rnd_65x39_caseless_mag_Tracer { author = "$STR_ACE_Common_ACETeam"; - ammo = "ACE_B_65x39_Caseless_Tracer_Dim"; + ammo = "ACE_65x39_Caseless_Tracer_Dim"; displayName = "$STR_ACE_30Rnd_65x39_caseless_mag_Tracer_DimName"; displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_mag_Tracer_DimNameShort"; descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_mag_Tracer_DimDescription"; - picture = "\A3\weapons_f\data\ui\m_30stanag_caseless_yellow_CA.paa"; + }; + class 30Rnd_65x39_caseless_green_mag_Tracer; + class ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim: 30Rnd_65x39_caseless_green_mag_Tracer { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_65x39_Caseless_green_Tracer_Dim"; + displayName = "$STR_ACE_30Rnd_65x39_caseless_green_mag_Tracer_DimName"; + displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_Tracer_DimNameShort"; + descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_Tracer_DimDescription"; }; class 30Rnd_556x45_Stanag: CA_Magazine { }; + class ACE_30Rnd_556x45_Stanag_M995_AP_mag: 30Rnd_556x45_Stanag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_556x45_Ball_M995_AP"; + displayName = "$STR_ACE_30Rnd_556x45_Stanag_M995_AP_mag_Name"; + displayNameShort = "$STR_ACE_30Rnd_556x45_Stanag_M995_AP_mag_NameShort"; + descriptionShort = "$STR_ACE_30Rnd_556x45_Stanag_M995_AP_mag_Description"; + initSpeed = 1046; + }; + class ACE_30Rnd_556x45_Stanag_Mk262_mag: 30Rnd_556x45_Stanag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_556x45_Ball_Mk262"; + displayName = "$STR_ACE_30Rnd_556x45_Stanag_Mk262_mag_Name"; + displayNameShort = "$STR_ACE_30Rnd_556x45_Stanag_Mk262_mag_NameShort"; + descriptionShort = "$STR_ACE_30Rnd_556x45_Stanag_Mk262_mag_Description"; + initSpeed = 832; + }; + class ACE_30Rnd_556x45_Stanag_Mk318_mag: 30Rnd_556x45_Stanag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_556x45_Ball_Mk318"; + displayName = "$STR_ACE_30Rnd_556x45_Stanag_Mk318_mag_Name"; + displayNameShort = "$STR_ACE_30Rnd_556x45_Stanag_Mk318_mag_NameShort"; + descriptionShort = "$STR_ACE_30Rnd_556x45_Stanag_Mk318_mag_Description"; + initSpeed = 922; + }; class 30Rnd_556x45_Stanag_Tracer_Red: 30Rnd_556x45_Stanag { }; class ACE_30Rnd_556x45_Stanag_Tracer_Dim: 30Rnd_556x45_Stanag_Tracer_Red { @@ -35,7 +81,7 @@ class CfgMagazines { displayName = "$STR_ACE_30Rnd_556x45_mag_Tracer_DimName"; displayNameShort = "$STR_ACE_30Rnd_556x45_mag_Tracer_DimNameShort"; descriptionShort = "$STR_ACE_30Rnd_556x45_mag_Tracer_DimDescription"; - picture = "\A3\weapons_f\data\ui\m_30stanag_yellow_ca.paa"; + picture = "\A3\weapons_f\data\ui\m_20stanag_red_ca.paa"; }; class 20Rnd_762x51_Mag: CA_Magazine { @@ -50,7 +96,7 @@ class CfgMagazines { class 150Rnd_762x51_Box_Tracer: 150Rnd_762x51_Box { initSpeed = 833; }; - class ACE_20Rnd_762x51_Mag_Tracer: 20Rnd_762x51_Mag { //@todo Green tracers for opfor and yellow tracers for independent + class ACE_20Rnd_762x51_Mag_Tracer: 20Rnd_762x51_Mag { author = "$STR_ACE_Common_ACETeam"; ammo = "B_762x51_Tracer_Red"; displayName = "$STR_ACE_20Rnd_762x51_mag_TracerName"; @@ -76,6 +122,159 @@ class CfgMagazines { initSpeed = 325; }; + class ACE_10Rnd_762x51_M118LR_Mag: 10Rnd_762x51_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x51_Ball_M118LR"; + count = 10; + displayName = "$STR_ACE_10Rnd_762x51_M118LR_Mag_Name"; + displayNameShort = "$STR_ACE_10Rnd_762x51_M118LR_Mag_NameShort"; + descriptionShort = "$STR_ACE_10Rnd_762x51_M118LR_Mag_Description"; + initSpeed = 780; + }; + class ACE_10Rnd_762x51_Mk316_Mod_0_Mag: 10Rnd_762x51_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x51_Ball_Mk316_Mod_0"; + count = 10; + displayName = "$STR_ACE_10Rnd_762x51_Mk316_Mod_0_Mag_Name"; + displayNameShort = "$STR_ACE_10Rnd_762x51_Mk316_Mod_0_Mag_NameShort"; + descriptionShort = "$STR_ACE_10Rnd_762x51_Mk316_Mod_0_Mag_Description"; + initSpeed = 790; + }; + class ACE_10Rnd_762x51_Mk319_Mod_0_Mag: 10Rnd_762x51_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x51_Ball_Mk319_Mod_0"; + count = 10; + displayName = "$STR_ACE_10Rnd_762x51_Mk319_Mod_0_Mag_Name"; + displayNameShort = "$STR_ACE_10Rnd_762x51_Mk319_Mod_0_Mag_NameShort"; + descriptionShort = "$STR_ACE_10Rnd_762x51_Mk319_Mod_0_Mag_Description"; + initSpeed = 900; + }; + class ACE_10Rnd_762x51_M993_AP_Mag: 10Rnd_762x51_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x51_Ball_M993_AP"; + count = 10; + displayName = "$STR_ACE_10Rnd_762x51_M993_AP_Mag_Name"; + displayNameShort = "$STR_ACE_10Rnd_762x51_M993_AP_Mag_NameShort"; + descriptionShort = "$STR_ACE_10Rnd_762x51_M993_AP_Mag_Description"; + initSpeed = 920; + }; + class ACE_20Rnd_762x51_M118LR_Mag: 20Rnd_762x51_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x51_Ball_M118LR"; + displayName = "$STR_ACE_20Rnd_762x51_M118LR_Mag_Name"; + displayNameShort = "$STR_ACE_20Rnd_762x51_M118LR_Mag_NameShort"; + descriptionShort = "$STR_ACE_20Rnd_762x51_M118LR_Mag_Description"; + initSpeed = 780; + }; + class ACE_20Rnd_762x51_Mk316_Mod_0_Mag: 20Rnd_762x51_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x51_Ball_Mk316_Mod_0"; + count = 20; + displayName = "$STR_ACE_20Rnd_762x51_Mk316_Mod_0_Mag_Name"; + displayNameShort = "$STR_ACE_20Rnd_762x51_Mk316_Mod_0_Mag_NameShort"; + descriptionShort = "$STR_ACE_20Rnd_762x51_Mk316_Mod_0_Mag_Description"; + initSpeed = 790; + }; + class ACE_20Rnd_762x51_Mk319_Mod_0_Mag: 20Rnd_762x51_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x51_Ball_Mk319_Mod_0"; + displayName = "$STR_ACE_20Rnd_762x51_Mk319_Mod_0_Mag_Name"; + displayNameShort = "$STR_ACE_20Rnd_762x51_Mk319_Mod_0_Mag_NameShort"; + descriptionShort = "$STR_ACE_20Rnd_762x51_Mk319_Mod_0_Mag_Description"; + initSpeed = 900; + }; + class ACE_20Rnd_762x51_M993_AP_Mag: 20Rnd_762x51_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x51_Ball_M993_AP"; + count = 20; + displayName = "$STR_ACE_20Rnd_762x51_M993_AP_Mag_Name"; + displayNameShort = "$STR_ACE_20Rnd_762x51_M993_AP_Mag_NameShort"; + descriptionShort = "$STR_ACE_20Rnd_762x51_M993_AP_Mag_Description"; + initSpeed = 920; + }; + class ACE_20Rnd_762x67_Mk248_Mod_0_Mag: 20Rnd_762x51_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x67_Ball_Mk248_Mod_0"; + displayName = "$STR_ACE_20Rnd_762x67_Mk248_Mod_0_Mag_Name"; + displayNameShort = "$STR_ACE_20Rnd_762x67_Mk248_Mod_0_Mag_NameShort"; + descriptionShort = "$STR_ACE_20Rnd_762x67_Mk248_Mod_0_Mag_Description"; + initSpeed = 900; + }; + class ACE_20Rnd_762x67_Mk248_Mod_1_Mag: 20Rnd_762x51_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x67_Ball_Mk248_Mod_1"; + displayName = "$STR_ACE_20Rnd_762x67_Mk248_Mod_1_Mag_Name"; + displayNameShort = "$STR_ACE_20Rnd_762x67_Mk248_Mod_1_Mag_NameShort"; + descriptionShort = "$STR_ACE_20Rnd_762x67_Mk248_Mod_1_Mag_Description"; + initSpeed = 880; + }; + class ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag: 20Rnd_762x51_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x67_Ball_Berger_Hybrid_OTM"; + displayName = "$STR_ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag_Name"; + displayNameShort = "$STR_ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag_NameShort"; + descriptionShort = "$STR_ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag_Description"; + initSpeed = 832; + }; + class ACE_30Rnd_65x47_Scenar_mag: 30Rnd_65x39_caseless_mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_65x47_Ball_Scenar"; + displayName = "$STR_ACE_30Rnd_65x47_Scenar_mag_Name"; + displayNameShort = "$STR_ACE_30Rnd_65x47_Scenar_mag_NameShort"; + descriptionShort = "$STR_ACE_30Rnd_65x47_Scenar_mag_Description"; + }; + class ACE_30Rnd_65_Creedmor_mag: 30Rnd_65x39_caseless_mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_65_Creedmor_Ball"; + displayName = "$STR_ACE_30Rnd_65_Creedmor_mag_Name"; + displayNameShort = "$STR_ACE_30Rnd_65_Creedmor_mag_NameShort"; + descriptionShort = "$STR_ACE_30Rnd_65_Creedmor_mag_Description"; + }; + class 10Rnd_338_Mag; + class ACE_10Rnd_338_300gr_HPBT_Mag: 10Rnd_338_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_338_Ball"; + displayName = "$STR_ACE_10Rnd_338_300gr_HPBT_Mag_Name"; + displayNameShort = "$STR_ACE_10Rnd_338_300gr_HPBT_Mag_NameShort"; + descriptionShort = "$STR_ACE_10Rnd_338_300gr_HPBT_Mag_Description"; + initSpeed = 800; + }; + class ACE_10Rnd_338_API526_Mag: 10Rnd_338_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_338_Ball_API526"; + displayName = "$STR_ACE_10Rnd_338_API526_Mag_Name"; + displayNameShort = "$STR_ACE_10Rnd_338_API526_Mag_NameShort"; + descriptionShort = "$STR_ACE_10Rnd_338_API526_Mag_Description"; + initSpeed = 880; + }; + + class 5Rnd_127x108_Mag; + class ACE_5Rnd_127x99_Mag: 5Rnd_127x108_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "B_127x99_Ball"; + displayName = "$STR_ACE_5Rnd_127x99_Mag_Name"; + displayNameShort = "$STR_ACE_5Rnd_127x99_Mag_NameShort"; + descriptionShort = "$STR_ACE_5Rnd_127x99_Mag_Description"; + initSpeed = 900; + }; + class ACE_5Rnd_127x99_API_Mag: 5Rnd_127x108_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_127x99_API"; + displayName = "$STR_ACE_5Rnd_127x99_API_Mag_Name"; + displayNameShort = "$STR_ACE_5Rnd_127x99_API_Mag_NameShort"; + descriptionShort = "$STR_ACE_5Rnd_127x99_API_Mag_Description"; + initSpeed = 900; + }; + class ACE_5Rnd_127x99_AMAX_Mag: 5Rnd_127x108_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_127x99_Ball_AMAX"; + displayName = "$STR_ACE_5Rnd_127x99_AMAX_Mag_Name"; + displayNameShort = "$STR_ACE_5Rnd_127x99_AMAX_Mag_NameShort"; + descriptionShort = "$STR_ACE_5Rnd_127x99_AMAX_Mag_Description"; + initSpeed = 860; + }; + + class 30Rnd_9x21_Mag: CA_Magazine { initSpeed = 450; }; @@ -104,7 +303,7 @@ class CfgMagazines { initSpeed = 250; }; - class 30Rnd_45ACP_Mag_SMG_01_Tracer_Green: CA_Magazine { + class 30Rnd_45ACP_Mag_SMG_01_Tracer_Green: 30Rnd_45ACP_Mag_SMG_01 { initSpeed = 250; }; @@ -123,6 +322,15 @@ class CfgMagazines { class 10Rnd_762x54_Mag: 10Rnd_762x51_Mag { initSpeed = 800; }; + class ACE_10Rnd_762x54_Tracer_mag: 10Rnd_762x54_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x54_Ball_7T2"; + displayName = "$STR_ACE_10Rnd_762x54_Tracer_mag_Name"; + displayNameShort = "$STR_ACE_10Rnd_762x54_Tracer_mag_NameShort"; + descriptionShort = "$STR_ACE_10Rnd_762x54_Tracer_mag_Description"; + initSpeed = 800; + tracersEvery = 1; + }; class 150Rnd_762x54_Box: 150Rnd_762x51_Box { initSpeed = 750; diff --git a/addons/ballistics/CfgVehicles.hpp b/addons/ballistics/CfgVehicles.hpp index efd2132d95..82e7fef5e3 100644 --- a/addons/ballistics/CfgVehicles.hpp +++ b/addons/ballistics/CfgVehicles.hpp @@ -9,4 +9,221 @@ class CfgVehicles { //hitPart = "systemChat str _this"; }; }; + + class NATO_Box_Base; + class Box_NATO_Wps_F: NATO_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); + }; + }; + + class Box_NATO_WpsSpecial_F: NATO_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_100Rnd_65x39_caseless_mag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_200Rnd_65x39_cased_Box_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,1); + MACRO_ADDMAGAZINE(ACE_10Rnd_338_300gr_HPBT_Mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_338_API526_Mag,4); + MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_Mag,4); + MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_API_Mag,4); + MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_AMAX_Mag,4); + }; + }; + + class Box_NATO_Ammo_F: NATO_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_M118LR_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_M118LR_Mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_Mk316_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mk316_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_Mk319_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mk319_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_338_300gr_HPBT_Mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_338_API526_Mag,4); + MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_Mag,4); + MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_API_Mag,4); + MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_AMAX_Mag,4); + }; + }; + + class Box_NATO_Support_F: NATO_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_M118LR_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_M118LR_Mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_Mk316_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mk316_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_Mk319_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mk319_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_SD,3); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_M993_AP_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_M993_AP_Mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_338_300gr_HPBT_Mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_338_API526_Mag,4); + MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_Mag,4); + MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_API_Mag,4); + MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_AMAX_Mag,4); + }; + }; + + class ReammoBox_F; + class B_supplyCrate_F: ReammoBox_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_M118LR_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_M118LR_Mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_Mk316_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mk316_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_Mk319_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mk319_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer_Dim,4); + }; + }; + + class EAST_Box_Base; + class Box_East_Wps_F: EAST_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x54_Tracer_mag,4); + }; + }; + + class Box_East_WpsSpecial_F: EAST_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,1); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x54_Tracer_mag,4); + }; + }; + + class Box_East_Ammo_F: EAST_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x54_Tracer_mag,4); + }; + }; + + class Box_East_Support_F: EAST_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,6); + MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x54_Tracer_mag,4); + }; + }; + + class IND_Box_Base; + class Box_IND_Wps_F: IND_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_M995_AP_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk262_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk318_mag,4); + }; + }; + + class Box_IND_WpsSpecial_F: IND_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,4); + }; + }; + + class Box_IND_Ammo_F: IND_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_M995_AP_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk262_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk318_mag,4); + }; + }; + + class FIA_Box_Base_F; + class Box_FIA_Wps_F: FIA_Box_Base_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_M995_AP_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk262_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk318_mag,4); + }; + }; + + class Box_FIA_Ammo_F: FIA_Box_Base_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_M995_AP_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk262_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk318_mag,4); + }; + }; + + class I_supplyCrate_F: B_supplyCrate_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_M995_AP_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk262_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk318_mag,4); + }; + }; + + class IG_supplyCrate_F: ReammoBox_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_M995_AP_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk262_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk318_mag,4); + }; + }; + + class C_supplyCrate_F: ReammoBox_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); + }; + }; + + class ACE_Box_Ammo: NATO_Box_Base { + scope = 2; + accuracy = 1000; + displayName = "[ACE] Ammo Supply Crate"; + model = "\A3\weapons_F\AmmoBoxes\AmmoBox_F"; + author = "$STR_ACE_Common_ACETeam"; + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_SD,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_M993_AP_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_M993_AP_Mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_M118LR_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_M118LR_Mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_Mk316_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mk316_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_Mk319_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mk319_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x67_Mk248_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x67_Mk248_Mod_1_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x54_Tracer_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_M995_AP_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk262_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk318_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_100Rnd_65x39_caseless_mag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_200Rnd_65x39_cased_Box_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_338_300gr_HPBT_Mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_338_API526_Mag,4); + MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_Mag,4); + MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_API_Mag,4); + MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_AMAX_Mag,4); + }; + }; }; diff --git a/addons/ballistics/CfgWeapons.hpp b/addons/ballistics/CfgWeapons.hpp index 513829130f..0f9dbcfbe4 100644 --- a/addons/ballistics/CfgWeapons.hpp +++ b/addons/ballistics/CfgWeapons.hpp @@ -56,6 +56,14 @@ class CfgWeapons { }; }; class arifle_MX_SW_F: arifle_MX_Base_F { + magazines[] = { + "100Rnd_65x39_caseless_mag_Tracer", + "100Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag_Tracer", + "ACE_100Rnd_65x39_caseless_mag_Tracer_Dim", + "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" + }; initSpeed = -1.0; ACE_barrelTwist=9; ACE_barrelLength=16.0; @@ -76,6 +84,13 @@ class CfgWeapons { }; }; class arifle_MXM_F: arifle_MX_Base_F { + magazines[] = { + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag_Tracer", + "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim", + "ACE_30Rnd_65x47_Scenar_mag", + "ACE_30Rnd_65_Creedmor_mag" + }; initSpeed = -1.018; ACE_barrelTwist=9; ACE_barrelLength=18; @@ -111,6 +126,11 @@ class CfgWeapons { /* Other */ class LMG_Mk200_F: Rifle_Long_Base_F { + magazines[] = { + "200Rnd_65x39_cased_Box", + "200Rnd_65x39_cased_Box_Tracer", + "ACE_200Rnd_65x39_cased_Box_Tracer_Dim" + }; initSpeed = -0.9763; class WeaponSlotsInfo: WeaponSlotsInfo { class MuzzleSlot: MuzzleSlot { @@ -180,7 +200,7 @@ class CfgWeapons { /* SMGs */ class SDAR_base_F: Rifle_Base_F { - initSpeed = -0.9723; + initSpeed = -0.989; class Single: Mode_SemiAuto { dispersion = 0.0008727; // radians. Equal to 3 MOA, about the limit of mass-produced M855 plus // some extra because Kel-Tec. @@ -284,26 +304,51 @@ class CfgWeapons { ACE_barrelLength=7; }; class arifle_Katiba_F: arifle_katiba_Base_F { - initSpeed = -1.09; + magazines[] = { + "30Rnd_65x39_caseless_green", + "30Rnd_65x39_caseless_green_mag_Tracer", + "ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim" + }; + initSpeed = -1.08; ACE_barrelTwist=8; ACE_barrelLength=28.7; }; class arifle_Katiba_C_F: arifle_katiba_Base_F { + magazines[] = { + "30Rnd_65x39_caseless_green", + "30Rnd_65x39_caseless_green_mag_Tracer", + "ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim" + }; initSpeed = -1.07; ACE_barrelTwist=8; ACE_barrelLength=26.8; }; class arifle_Katiba_GL_F: arifle_katiba_Base_F { - initSpeed = -1.09; + magazines[] = { + "30Rnd_65x39_caseless_green", + "30Rnd_65x39_caseless_green_mag_Tracer", + "ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim" + }; + initSpeed = -1.08; ACE_barrelTwist=8; ACE_barrelLength=28.7; }; class arifle_MX_F: arifle_MX_Base_F { + magazines[] = { + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag_Tracer", + "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" + }; initSpeed = -0.99; ACE_barrelTwist=9; ACE_barrelLength=14.5; }; class arifle_MX_GL_F: arifle_MX_Base_F { + magazines[] = { + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag_Tracer", + "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" + }; initSpeed = -0.99; ACE_barrelTwist=9; ACE_barrelLength=14.5; @@ -315,6 +360,11 @@ class CfgWeapons { }; */ class arifle_MXC_F: arifle_MX_Base_F { + magazines[] = { + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag_Tracer", + "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" + }; initSpeed = -0.965; ACE_barrelTwist=8; ACE_barrelLength=10.5; @@ -326,7 +376,18 @@ class CfgWeapons { }; */ class arifle_SDAR_F: SDAR_base_F { - initSpeed = -0.9723; + magazines[] = { + "20Rnd_556x45_UW_mag", + "30Rnd_556x45_Stanag", + "30Rnd_556x45_Stanag_Tracer_Red", + "30Rnd_556x45_Stanag_Tracer_Green", + "30Rnd_556x45_Stanag_Tracer_Yellow", + "ACE_30Rnd_556x45_Stanag_M995_AP_mag", + "ACE_30Rnd_556x45_Stanag_Mk262_mag", + "ACE_30Rnd_556x45_Stanag_Mk318_mag", + "ACE_30Rnd_556x45_Stanag_Tracer_Dim" + }; + initSpeed = -0.989; ACE_barrelTwist=11.25; ACE_barrelLength=18; }; @@ -336,16 +397,46 @@ class CfgWeapons { ACE_barrelLength=7.7; }; class arifle_TRG20_F: Tavor_base_F { + magazines[] = { + "30Rnd_556x45_Stanag", + "30Rnd_556x45_Stanag_Tracer_Red", + "30Rnd_556x45_Stanag_Tracer_Green", + "30Rnd_556x45_Stanag_Tracer_Yellow", + "ACE_30Rnd_556x45_Stanag_M995_AP_mag", + "ACE_30Rnd_556x45_Stanag_Mk262_mag", + "ACE_30Rnd_556x45_Stanag_Mk318_mag", + "ACE_30Rnd_556x45_Stanag_Tracer_Dim" + }; initSpeed = -0.95; ACE_barrelTwist=7; ACE_barrelLength=15; }; class arifle_TRG21_F: Tavor_base_F { + magazines[] = { + "30Rnd_556x45_Stanag", + "30Rnd_556x45_Stanag_Tracer_Red", + "30Rnd_556x45_Stanag_Tracer_Green", + "30Rnd_556x45_Stanag_Tracer_Yellow", + "ACE_30Rnd_556x45_Stanag_M995_AP_mag", + "ACE_30Rnd_556x45_Stanag_Mk262_mag", + "ACE_30Rnd_556x45_Stanag_Mk318_mag", + "ACE_30Rnd_556x45_Stanag_Tracer_Dim" + }; initSpeed = -0.989; ACE_barrelTwist=7; ACE_barrelLength=18.1; }; - class arifle_TRG21_GL_F: Tavor_base_F { + class arifle_TRG21_GL_F: arifle_TRG21_F { + magazines[] = { + "30Rnd_556x45_Stanag", + "30Rnd_556x45_Stanag_Tracer_Red", + "30Rnd_556x45_Stanag_Tracer_Green", + "30Rnd_556x45_Stanag_Tracer_Yellow", + "ACE_30Rnd_556x45_Stanag_M995_AP_mag", + "ACE_30Rnd_556x45_Stanag_Mk262_mag", + "ACE_30Rnd_556x45_Stanag_Mk318_mag", + "ACE_30Rnd_556x45_Stanag_Tracer_Dim" + }; initSpeed = -0.989; ACE_barrelTwist=7; ACE_barrelLength=18.1; @@ -357,16 +448,46 @@ class CfgWeapons { }; */ class arifle_Mk20_F: mk20_base_F { + magazines[] = { + "30Rnd_556x45_Stanag", + "30Rnd_556x45_Stanag_Tracer_Red", + "30Rnd_556x45_Stanag_Tracer_Green", + "30Rnd_556x45_Stanag_Tracer_Yellow", + "ACE_30Rnd_556x45_Stanag_M995_AP_mag", + "ACE_30Rnd_556x45_Stanag_Mk262_mag", + "ACE_30Rnd_556x45_Stanag_Mk318_mag", + "ACE_30Rnd_556x45_Stanag_Tracer_Dim" + }; initSpeed = -0.98; ACE_barrelTwist=7; ACE_barrelLength=17.4; }; class arifle_Mk20C_F: mk20_base_F { + magazines[] = { + "30Rnd_556x45_Stanag", + "30Rnd_556x45_Stanag_Tracer_Red", + "30Rnd_556x45_Stanag_Tracer_Green", + "30Rnd_556x45_Stanag_Tracer_Yellow", + "ACE_30Rnd_556x45_Stanag_M995_AP_mag", + "ACE_30Rnd_556x45_Stanag_Mk262_mag", + "ACE_30Rnd_556x45_Stanag_Mk318_mag", + "ACE_30Rnd_556x45_Stanag_Tracer_Dim" + }; initSpeed = -0.956; ACE_barrelTwist=7; ACE_barrelLength=16; }; class arifle_Mk20_GL_F: mk20_base_F { + magazines[] = { + "30Rnd_556x45_Stanag", + "30Rnd_556x45_Stanag_Tracer_Red", + "30Rnd_556x45_Stanag_Tracer_Green", + "30Rnd_556x45_Stanag_Tracer_Yellow", + "ACE_30Rnd_556x45_Stanag_M995_AP_mag", + "ACE_30Rnd_556x45_Stanag_Mk262_mag", + "ACE_30Rnd_556x45_Stanag_Mk318_mag", + "ACE_30Rnd_556x45_Stanag_Tracer_Dim" + }; initSpeed = -0.956; ACE_barrelTwist=7; ACE_barrelLength=16; @@ -377,11 +498,25 @@ class CfgWeapons { ACE_barrelLength=5.5; }; class srifle_DMR_01_F: DMR_01_base_F { + magazines[] = { + "10Rnd_762x54_Mag", + "ACE_10Rnd_762x54_Tracer_mag" + }; initSpeed = -1.025; ACE_barrelTwist=9.5; ACE_barrelLength=24; }; class srifle_EBR_F: EBR_base_F { + magazines[] = { + "20Rnd_762x51_Mag", + "ACE_20Rnd_762x51_Mag_Tracer", + "ACE_20Rnd_762x51_Mag_Tracer_Dim", + "ACE_20Rnd_762x51_Mk316_Mod_0_Mag", + "ACE_20Rnd_762x51_M118LR_Mag", + "ACE_20Rnd_762x51_Mk319_Mod_0_Mag", + "ACE_20Rnd_762x51_M993_AP_Mag", + "ACE_20Rnd_762x51_Mag_SD" + }; initSpeed = -0.9724; ACE_barrelTwist=12; ACE_barrelLength=18; @@ -399,16 +534,41 @@ class CfgWeapons { ACE_barrelLength=29; }; class srifle_GM6_F: GM6_base_F { + magazines[] = { + "5Rnd_127x108_Mag", + "5Rnd_127x108_APDS_Mag", + "ACE_5Rnd_127x99_Mag", + "ACE_5Rnd_127x99_API_Mag", + "ACE_5Rnd_127x99_AMAX_Mag" + }; initSpeed = -1.0; ACE_barrelTwist=15; - ACE_barrelLength=43.3; + ACE_barrelLength=36.6; }; class srifle_DMR_02_F: DMR_02_base_F { - initSpeed = -1.0; + magazines[] = { + "10Rnd_338_Mag", + "ACE_10Rnd_338_300gr_HPBT_Mag", + "ACE_10Rnd_338_API526_Mag", + "ACE_20Rnd_762x67_Mk248_Mod_0_Mag", + "ACE_20Rnd_762x67_Mk248_Mod_1_Mag", + "ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag" + }; + initSpeed = -0.962; ACE_barrelTwist=10; - ACE_barrelLength=26; + ACE_barrelLength=20; }; class srifle_DMR_03_F: DMR_03_base_F { + magazines[] = { + "20Rnd_762x51_Mag", + "ACE_20Rnd_762x51_Mag_Tracer", + "ACE_20Rnd_762x51_Mag_Tracer_Dim", + "ACE_20Rnd_762x51_Mk316_Mod_0_Mag", + "ACE_20Rnd_762x51_M118LR_Mag", + "ACE_20Rnd_762x51_Mk319_Mod_0_Mag", + "ACE_20Rnd_762x51_M993_AP_Mag", + "ACE_20Rnd_762x51_Mag_SD" + }; initSpeed = -0.9843; ACE_barrelTwist=10; ACE_barrelLength=20; @@ -424,6 +584,16 @@ class CfgWeapons { ACE_barrelLength=24.41; }; class srifle_DMR_06_camo_F: DMR_06_base_F { + magazines[] = { + "20Rnd_762x51_Mag", + "ACE_20Rnd_762x51_Mag_Tracer", + "ACE_20Rnd_762x51_Mag_Tracer_Dim", + "ACE_20Rnd_762x51_Mk316_Mod_0_Mag", + "ACE_20Rnd_762x51_M118LR_Mag", + "ACE_20Rnd_762x51_Mk319_Mod_0_Mag", + "ACE_20Rnd_762x51_M993_AP_Mag", + "ACE_20Rnd_762x51_Mag_SD" + }; initSpeed = -0.9916; ACE_barrelTwist=12; ACE_barrelLength=22; diff --git a/addons/ballistics/config.cpp b/addons/ballistics/config.cpp index 8ea75e4460..66ff7d188e 100644 --- a/addons/ballistics/config.cpp +++ b/addons/ballistics/config.cpp @@ -2,7 +2,7 @@ class CfgPatches { class ADDON { - units[] = {"ACE_TargetWall"}; + units[] = {"ACE_TargetWall","ACE_Box_Ammo"}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; diff --git a/addons/ballistics/scripts/initTargetWall.sqf b/addons/ballistics/scripts/initTargetWall.sqf index b09d5897bc..391faaa82e 100644 --- a/addons/ballistics/scripts/initTargetWall.sqf +++ b/addons/ballistics/scripts/initTargetWall.sqf @@ -1,6 +1,8 @@ // by commy2 #include "script_component.hpp" +private ["_wall", "_paper"]; + _wall = _this select 0; if (local _wall) then { diff --git a/addons/ballistics/stringtable.xml b/addons/ballistics/stringtable.xml index 261a6a8ea1..e4b2029e7e 100644 --- a/addons/ballistics/stringtable.xml +++ b/addons/ballistics/stringtable.xml @@ -1,59 +1,58 @@  - 6.5mm 30Rnd Tracer IR-DIM Mag - 6,5 mm Nyomjelző IR-DIM 30-as Tár - 6,5 mm 30-Schuss-Magazin Leuchtspur IR-DIM + 6,5mm Nyomjelző IR-DIM 30-as Tár + 6,5mm 30-Patronen-Magazin Leuchtspur IR-DIM Cargador de 30 balas trazadoras IR-DIM de 6,5mm Ch. 6,5mm 30Cps Traçantes IR-DIM Magazynek 6,5mm 30rd Smugacz IR-DIM - 6.5mm 30ks Svítící IR-DIM Zásobník + 6.5mm 30náb. Svítící IR-DIM Zásobník Carregador de 30 projéteis traçantes IR-DIM de 6,5mm Caricatore 6.5mm 30Rnd Traccianti IR-DIM - Магазин из 30-ти 6.5 мм трассирующих под ПНВ + Магазин из 30-ти 6,5 мм ИК-трассирующих 6.5mm IR-DIM - 6,5 mm IR-DIM + 6,5mm IR-DIM 6,5mm IR-DIM 6,5mm IR-DIM 6,5mm IR-DIM 6,5mm IR-DIM 6.5mm IR-DIM 6,5mm IR-DIM - 6.5 IR-DIM - 6.5 мм ИК-трассирующие + 6.5mm IR-DIM + 6,5 мм ИК-трассирующие - Caliber: 6.5x39 mm Tracer IR-DIM<br />Rounds: 30<br />Used in: MX/C/M/SW/3GL - Kaliber: 6,5x39 mm Nyomjelző IR-DIM<br />Lőszerek: 30<br />Használható: MX/C/M/SW/3GL - Kaliber: 6,5x39 mm Leuchtspur IR-DIM<br />Patronen: 30<br />Eingesetzt von: MX/C/M/SW/3GL - Calibre: 6,5x39 mm Trazadoras IR-DIM<br />Balas: 30<br />Se usa en: MX/C/M/SW/3GL - Calibre: 6,5x39 mm Traçantes IR-DIM<br />Cartouches: 30<br />Utilisé dans: MX/C/M/SW/3GL - Kaliber: 6,5 x 39 mm Smugowy IR-DIM<br />Pociski: 30<br />Używane w: MX/C/M/SW/3GL - Ráže: 6.5x39 mm Svítící IR-DIM<br />Munice: 30<br />Použití: MX/C/M/SW/3GL - Calibre: 6,5x39 mm Traçante IR-DIM<br />Projéteis: 30<br />Usado em: MX/C/M/SW/3GL - Calibro: 6.5x39 mm Traccianti IR-DIM <br />Munizioni: 30<br />In uso su: MX/C/M/SW/3GL - Калибр: 6.5x39 мм трассирующие под ПНВ<br />Патронов: 30<br />Применимы в: MX/C/M/SW/3GL + Caliber: 6.5x39mm Tracer IR-DIM<br />Rounds: 30<br />Used in: MX/C/M/SW/3GL + Kaliber: 6,5x39mm Nyomjelző IR-DIM<br />Lövedékek: 30<br />Használható: MX/C/M/SW/3GL + Kaliber: 6,5x39mm Leuchtspur IR-DIM<br />Patronen: 30<br />Eingesetzt von: MX/C/M/SW/3GL + Calibre: 6,5x39mm Trazadoras IR-DIM<br />Balas: 30<br />Se usa en: MX/C/M/SW/3GL + Calibre: 6,5x39mm Traçantes IR-DIM<br />Cartouches: 30<br />Utilisé avec: MX/C/M/SW/3GL + Kaliber: 6,5x39mm Smugacz IR-DIM<br />Pociski: 30<br />Używane w: MX/C/M/SW/3GL + Ráže: 6.5x39mm Svítící IR-DIM<br />Munice: 30<br />Použití: MX/C/M/SW/3GL + Calibre: 6,5x39mm Traçante IR-DIM<br />Projéteis: 30<br />Usado em: MX/C/M/SW/3GL + Calibro: 6.5x39mm Traccianti IR-DIM <br />Munizioni: 30<br />In uso su: MX/C/M/SW/3GL + Калибр: 6,5x39 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: MX/C/M/SW/3GL 6.5mm 30Rnd SD Mag - 6,5 mm Hangtompítós 30-as Tár - 6,5 mm 30-Schuss-Magazin SD + 6,5mm Halk 30-as Tár + 6,5mm 30-Patronen-Magazin SD Cargador de 30 balas SD de 6,5mm Ch. 6,5mm 30Cps SD Magazynek 6,5mm 30rd SD - 6.5mm 30ks SD Zásobník + 6.5mm 30náb. SD Zásobník Carregador de 30 projéteis SD de 6,5mm Caricatore 6.5mm 30Rnd Sil. - Магазин из 30-ти 6.5 мм дозвуковых + Магазин из 30-ти 6,5 мм дозвуковых 6.5mm SD - 6,5 mm Hangtompítós + 6,5mm Halk 6,5mm SD 6,5mm SD 6,5mm SD @@ -61,35 +60,35 @@ 6.5mm SD 6,5mm SD 6.5mm Sil. - 6.5 мм дозвуковые + 6,5 мм дозвуковые - Caliber: 6.5x39 mm SD<br />Rounds: 30<br />Used in: MX/C/M/SW/3GL - Kaliber: 6,5x39 mm Hangtompítós<br />Lőszerek: 30<br />Használható: MX/C/M/SW/3GL - Kaliber: 6,5x39 mm SD<br />Patronen: 30<br />Eingesetzt von: MX/C/M/SW/3GL - Calibre: 6,5x39 mm SD<br />Balas: 30<br />Se usa en: MX/C/M/SW/3GL - Calibre: 6,5x39 mm SD<br />Cartouches: 30<br />Utilisé dans: MX/C/M/SW/3GL - Kaliber: 6,5 x 39 mm SD<br />Pociski: 30<br />Używane w: MX/C/M/SW/3GL - Ráže: 6.5x39 mm SD<br />Munice: 30<br />Použití: MX/C/M/SW/3GL - Calibre: 6,5x39 mm SD<br />Projéteis: 30<br />Usado em: MX/C/M/SW/3GL - Calibro: 6.5x39 mm Sil.<br />Munizioni: 30<br />In uso su: MX/C/M/SW/3GL - Калибр: 6.5x39 мм дозвуковые<br />Патронов: 30<br />Применимы в: MX/C/M/SW/3GL + Caliber: 6.5x39mm SD<br />Rounds: 30<br />Used in: MX/C/M/SW/3GL + Kaliber: 6,5x39mm Halk<br />Lövedékek: 30<br />Használható: MX/C/M/SW/3GL + Kaliber: 6,5x39mm SD<br />Patronen: 30<br />Eingesetzt von: MX/C/M/SW/3GL + Calibre: 6,5x39mm SD<br />Balas: 30<br />Se usa en: MX/C/M/SW/3GL + Calibre: 6,5x39mm SD<br />Cartouches: 30<br />Utilisé avec: MX/C/M/SW/3GL + Kaliber: 6,5x39mm SD<br />Pociski: 30<br />Używane w: MX/C/M/SW/3GL + Ráže: 6.5x39mm SD<br />Munice: 30<br />Použití: MX/C/M/SW/3GL + Calibre: 6,5x39mm SD<br />Projéteis: 30<br />Usado em: MX/C/M/SW/3GL + Calibro: 6.5x39mm Sil.<br />Munizioni: 30<br />In uso su: MX/C/M/SW/3GL + Калибр: 6,5x39 мм дозвуковые<br />Патронов: 30<br />Используются с: MX/C/M/SW/3GL 6.5mm 30Rnd AP Mag - 6,5 mm Páncéltörő 30-as Tár - 6,5 mm 30-Schuss-Magazin AP + 6,5mm Páncéltörő 30-as Tár + 6,5mm 30-Patronen-Magazin AP Cargador de 30 balas AP de 6,5mm Ch. 6,5mm 30Cps AP Magazynek 6,5mm 30rd AP - 6.5mm 30ks AP Zásobník + 6.5mm 30náb. AP Zásobník Carregador de 30 projéteis AP de 6,5mm Caricatore 6.5mm 30Rnd AP - Магазин из 30-ти 6.5 мм бронебойных + Магазин из 30-ти 6,5 мм бронебойных 6.5mm AP - 6,5 mm Páncéltörő + 6,5mm Páncéltörő 6,5mm AP 6,5mm AP 6,5mm AP @@ -97,32 +96,32 @@ 6.5mm AP 6,5mm AP 6.5mm AP - 6.5 мм бронебойные + 6,5 мм бронебойные - Caliber: 6.5x39 mm AP<br />Rounds: 30<br />Used in: MX/C/M/SW/3GL - Kaliber: 6,5x39 mm Páncéltörő<br />Lőszerek: 30<br />Használható: MX/C/M/SW/3GL - Kaliber: 6,5x39 mm AP<br />Patronen: 30<br />Eingesetzt von: MX/C/M/SW/3GL - Calibre: 6,5x39 mm AP<br />Balas: 30<br />Se usa en: MX/C/M/SW/3GL - Calibre: 6,5x39 mm AP<br />Cartouches: 30<br />Utilisé dans: MX/C/M/SW/3GL - Kaliber: 6,5 x 39 mm AP<br />Pociski: 30<br />Używane w: MX/C/M/SW/3GL - Ráže: 6.5x39 mm AP<br />Munice: 30<br />Použití: MX/C/M/SW/3GL - Calibre: 6,5x39 mm AP<br />Projéteis: 30<br />Usado em: MX/C/M/SW/3GL - Calibro: 6.5x39 mm AP<br />Munizioni: 30<br />In uso su: MX/C/M/SW/3GL - Калибр: 6.5x39 мм бронебойные<br />Патронов: 30<br />Применимы в: MX/C/M/SW/3GL + Caliber: 6.5x39mm AP<br />Rounds: 30<br />Used in: MX/C/M/SW/3GL + Kaliber: 6,5x39mm Páncéltörő<br />Lövedékek: 30<br />Használható: MX/C/M/SW/3GL + Kaliber: 6,5x39mm AP<br />Patronen: 30<br />Eingesetzt von: MX/C/M/SW/3GL + Calibre: 6,5x39mm AP<br />Balas: 30<br />Se usa en: MX/C/M/SW/3GL + Calibre: 6,5x39mm AP<br />Cartouches: 30<br />Utilisé avec: MX/C/M/SW/3GL + Kaliber: 6,5x39mm AP<br />Pociski: 30<br />Używane w: MX/C/M/SW/3GL + Ráže: 6.5x39mm AP<br />Munice: 30<br />Použití: MX/C/M/SW/3GL + Calibre: 6,5x39mm AP<br />Projéteis: 30<br />Usado em: MX/C/M/SW/3GL + Calibro: 6.5x39mm AP<br />Munizioni: 30<br />In uso su: MX/C/M/SW/3GL + Калибр: 6,5x39 мм бронебойные<br />Патронов: 30<br />Используются с: MX/C/M/SW/3GL 6.5mm 30Rnd Tracer IR-DIM Mag 6,5mm IR-DIM Nyomjelző 30-as Tár - 6,5 mm 30-Schuss-Magazin Leuchtspur IR-DIM + 6,5mm 30-Patronen-Magazin Leuchtspur IR-DIM Cargador de 30 balas trazadoras IR-DIM de 6,5mm Ch. 6,5mm 30Cps Traçantes IR-DIM Magazynek 6,5mm 30rd Smugacz IR-DIM - 6.5mm 30ks Svítící IR-DIM Zásobník + 6.5mm 30náb. Svítící IR-DIM Zásobník Carregador de 30 projéteis traçantes IR-DIM de 6,5mm Caricatore 6.5mm 30Rnd Traccianti IR-DIM - Магазин из 30-ти 6.5 мм трассирующих под ПНВ + Магазин из 30-ти 6,5 мм ИК-трассирующих 6.5mm IR-DIM @@ -134,35 +133,35 @@ 6.5mm IR-DIM 6,5mm IR-DIM 6.5mm IR-DIM - 6.5 мм ИК-трассирующие + 6,5 мм ИК-трассирующие - Caliber: 6.5x39 mm Tracer IR-DIM<br />Rounds: 30<br />Used in: Katiba - Kaliber: 6,5x39 mm Nyomjelző IR-DIM<br />Lőszerek: 30<br />Használható: Katiba - Kaliber: 6,5x39 mm Leuchtspur IR-DIM<br />Patronen: 30<br />Eingesetzt von: Katiba - Calibre: 6,5x39 mm Trazadoras IR-DIM<br />Balas: 30<br />Se usa en: Katiba - Calibre: 6,5x39 mm Traçantes IR-DIM<br />Cartouches: 30<br />Utilisé dans: Katiba - Kaliber: 6,5x39 mm Smugowy IR-DIM<br />Pociski: 30<br />Używane w: Katiba - Ráže: 6.5x39 mm Svítící IR-DIM<br />Munice: 30<br />Použití: Katiba - Calibre: 6,5x39 mm Traçante IR-DIM<br />Projéteis: 30<br />Usado em: Katiba - Calibro: 6.5x39 mm Tracciant IR-DIM<br />Munizioni: 30<br />In uso su: Katiba - Калибр: 6.5x39 мм трассирующие под ПНВ<br />Патронов: 30<br />Применимы в: Katiba + Caliber: 6.5x39mm Tracer IR-DIM<br />Rounds: 30<br />Used in: Katiba + Kaliber: 6,5x39mm Nyomjelző IR-DIM<br />Lövedékek: 30<br />Használható: Katiba + Kaliber: 6,5x39mm Leuchtspur IR-DIM<br />Patronen: 30<br />Eingesetzt von: Katiba + Calibre: 6,5x39mm Trazadoras IR-DIM<br />Balas: 30<br />Se usa en: Katiba + Calibre: 6,5x39mm Traçantes IR-DIM<br />Cartouches: 30<br />Utilisé avec: Katiba + Kaliber: 6,5x39mm Smugacz IR-DIM<br />Pociski: 30<br />Używane w: Katiba + Ráže: 6.5x39mm Svítící IR-DIM<br />Munice: 30<br />Použití: Katiba + Calibre: 6,5x39mm Traçante IR-DIM<br />Projéteis: 30<br />Usado em: Katiba + Calibro: 6.5x39mm Tracciant IR-DIM<br />Munizioni: 30<br />In uso su: Katiba + Калибр: 6,5x39 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: Katiba 6.5mm 30Rnd SD Mag - 6,5 mm Hangtompítós 30-as Tár - 6,5 mm 30-Schuss-Magazin SD + 6,5mm Halk 30-as Tár + 6,5mm 30-Patronen-Magazin SD Cargador de 30 balas SD de 6,5mm Ch. 6,5mm 30Cps SD Magazynek 6,5mm 30rd SD - 6.5mm 30ks SD Zásobník + 6.5mm 30náb. SD Zásobník Carregador de 30 projéteis SD de 6,5mm Caricatore 6.5mm 30Rnd Sil. - Магазин из 30-ти 6.5 мм дозвуковых + Магазин из 30-ти 6,5 мм дозвуковых 6.5mm SD - 6,5 mm Hangtompítós + 6,5mm Halk 6,5mm SD 6,5mm SD 6,5mm SD @@ -170,35 +169,35 @@ 6.5mm SD 6,5mm SD 6.5mm Sil. - 6.5 мм дозвуковые + 6,5 мм дозвуковые - Caliber: 6.5x39 mm SD<br />Rounds: 30<br />Used in: Katiba - Kaliber: 6,5x39 mm Hangtompítós<br />Lőszerek: 30<br />Használható: Katiba - Kaliber: 6,5x39 mm SD<br />Patronen: 30<br />Eingesetzt von: Katiba - Calibre: 6,5x39 mm SD<br />Balas: 30<br />Se usa en: Katiba - Calibre: 6,5x39 mm SD<br />Cartouches: 30<br />Utilisé dans: Katiba - Kaliber: 6,5 x 39 mm SD<br />Naboje: 30<br />Używane w: Katiba - Ráže: 6.5x39 mm SD<br />Munice: 30<br />Použití: Katiba - Calibre: 6,5x39 mm SD<br />Projéteis: 30<br />Usado em: Katiba - Calibro: 6.5x39 mm Sil.<br />Munizioni: 30<br />In uso su: Katiba - Калибр: 6.5x39 мм дозвуковые<br />Патронов: 30<br />Применимы в: Katiba + Caliber: 6.5x39mm SD<br />Rounds: 30<br />Used in: Katiba + Kaliber: 6,5x39mm Halk<br />Lövedékek: 30<br />Használható: Katiba + Kaliber: 6,5x39mm SD<br />Patronen: 30<br />Eingesetzt von: Katiba + Calibre: 6,5x39mm SD<br />Balas: 30<br />Se usa en: Katiba + Calibre: 6,5x39mm SD<br />Cartouches: 30<br />Utilisé avec: Katiba + Kaliber: 6,5x39mm SD<br />Naboje: 30<br />Używane w: Katiba + Ráže: 6.5x39mm SD<br />Munice: 30<br />Použití: Katiba + Calibre: 6,5x39mm SD<br />Projéteis: 30<br />Usado em: Katiba + Calibro: 6.5x39mm Sil.<br />Munizioni: 30<br />In uso su: Katiba + Калибр: 6,5x39 мм дозвуковые<br />Патронов: 30<br />Используются с: Katiba 6.5mm 30Rnd AP Mag - 6,5 mm Páncéltörő 30-as Tár - 6,5 mm 30-Schuss-Magazin AP + 6,5mm Páncéltörő 30-as Tár + 6,5mm 30-Patronen-Magazin AP Cargador de 30 balas AP de 6,5mm Ch. 6,5mm 30Cps AP Magazynek 6,5mm 30rd AP - 6.5mm 30ks AP Zásobník + 6.5mm 30náb. AP Zásobník Carregador de 30 projéteis AP de 6,5mm Caricatore 6.5mm 30Rnd AP - Магазин из 30-ти 6.5 мм бронебойных + Магазин из 30-ти 6,5 мм бронебойных 6.5mm AP - 6,5 mm Páncéltörő + 6,5mm Páncéltörő 6,5mm AP 6,5mm AP 6,5mm AP @@ -206,36 +205,36 @@ 6.5mm AP 6,5mm AP 6.5mm AP - 6.5 мм бронебойные + 6,5 мм бронебойные - Caliber: 6.5x39 mm AP<br />Rounds: 30<br />Used in: Katiba - Kaliber: 6,5x39 mm Páncéltörő<br />Lőszerek: 30<br />Használható: Katiba - Kaliber: 6,5x39 mm AP<br />Patronen: 30<br />Eingesetzt von: Katiba - Calibre: 6,5x39 mm AP<br />Balas: 30<br />Se usa en: Katiba - Calibre: 6,5x39 mm AP<br />Cartouches: 30<br />Utilisé dans: Katiba - Kaliber: 6,5 x 39 mm AP<br />Pociski: 30<br />Używane w: Katiba - Ráže: 6.5x39 mm AP<br />Munice: 30<br />Použití: Katiba - Calibre: 6,5x39 mm AP<br />Projéteis: 30<br />Usado em: Katiba - Calibro: 6.5x39 mm AP<br />Munizioni: 30<br />In uso su: Katiba - Калибр: 6.5x39 мм бронебойные<br />Патронов: 30<br />Применимы в: Katiba + Caliber: 6.5x39mm AP<br />Rounds: 30<br />Used in: Katiba + Kaliber: 6,5x39mm Páncéltörő<br />Lövedékek: 30<br />Használható: Katiba + Kaliber: 6,5x39mm AP<br />Patronen: 30<br />Eingesetzt von: Katiba + Calibre: 6,5x39mm AP<br />Balas: 30<br />Se usa en: Katiba + Calibre: 6,5x39mm AP<br />Cartouches: 30<br />Utilisé avec: Katiba + Kaliber: 6,5x39mm AP<br />Pociski: 30<br />Używane w: Katiba + Ráže: 6.5x39mm AP<br />Munice: 30<br />Použití: Katiba + Calibre: 6,5x39mm AP<br />Projéteis: 30<br />Usado em: Katiba + Calibro: 6.5x39mm AP<br />Munizioni: 30<br />In uso su: Katiba + Калибр: 6,5x39 мм бронебойные<br />Патронов: 30<br />Используются с: Katiba 5.56mm 30rnd Tracer IR-DIM Mag - 5,56 mm Nyomjelző IR-DIM 30-as Tár - 5,56 mm 30-Schuss-Magazin Leuchtspur IR-DIM + 5,56mm Nyomjelző IR-DIM 30-as Tár + 5,56mm 30-Patronen-Magazin Leuchtspur IR-DIM Cargador de 30 balas trazadoras IR-DIM de 5,56mm Ch. 5,56mm 30Cps Traçantes IR-DIM Magazynek 5,56mm 30rd Smugacz IR-DIM - 5.56mm 30ks Svítící IR-DIM Zásobník + 5.56mm 30náb. Svítící IR-DIM Zásobník Carregador de 30 projéteis traçantes IR-DIM de 5,56mm Caricatore 5.56mm 30rnd Traccianti IR-DIM - Магазин из 30-ти 5.56 мм трассирующих под ПНВ + Магазин из 30-ти 5,56 мм ИК-трассирующих 5.56mm IR-DIM - 5,56 mm IR-DIM + 5,56mm IR-DIM 5,56mm IR-DIM 5,56mm IR-DIM 5,56mm IR-DIM @@ -243,108 +242,36 @@ 5.56mm IR-DIM 5,56mm IR-DIM 5.56mm IR-DIM - 5.56 мм ИК-трассирующие + 5,56 мм ИК-трассирующие - Caliber: 5.56x45 mm Tracer IR-DIM<br />Rounds: 30<br />Used in: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Kaliber: 5,56x45 mm Nyomjelző IR-DIM<br />Lőszerek: 30<br />Használható: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Kaliber: 5,56x45 mm Leuchtspur IR-DIM<br />Patronen: 30<br />Eingesetzt von: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Calibre: 5,56x45 mm Trazadoras IR-DIM<br />Balas: 30<br />Se usa en: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Calibre: 5,56x45 mm Traçantes IR-DIM<br />Cartouches: 30<br />Utilisé dans: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Kaliber: 5,56 x 45 mm Smugowy IR-DIM<br />Pociski: 30<br />Używane w: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Ráže: 5.56x45 mm Svítící IR-DIM<br />Munice: 30<br />Použití: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Calibre: 5,56x45 mm Traçante IR-DIM<br />Projéteis: 30<br />Usado em: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Calibro: 5.56x45 mm Traccianti IR-DIM<br />Munizioni: 30<br />In uso su: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Калибр: 5.56x45 мм трассирующие под ПНВ<br />Патронов: 30<br />Применимы в: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - - - 5.56mm 30Rnd SD Mag - 5,56 mm Hangtompítós 30-as Tár - 5,56 mm 30-Schuss-Magazin SD - Cargador de 30 balas SD de 5,56 mm - Ch. 5,56mm 30Cps SD - Magazynek 5,56mm 30rd SD - 5.56mm 30ks SD Zásobník - Carregador de 30 projéteis SD de 5,56mm - Caricatore 5.56mm 30Rnd Sil. - Магазин из 30-ти 5.56 мм дозвуковых - - - 5.56mm SD - 5,56 mm Hangtompítós - 5,56mm SD - 5,56 mm SD - 5,56mm SD - 5,56mm SD - 5.56mm SD - 5,56mm SD - 5.56 Sil. - 5.56 мм дозвуковые - - - Caliber: 5.56x45 mm SD<br />Rounds: 30<br />Used in: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Kaliber: 5,56x45 mm Hangtompítós<br />Lőszerek: 30<br />Használható: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Kaliber: 5,56x45 mm SD<br />Patronen: 30<br />Eingesetzt von: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Calibre: 5,56x45 mm SD<br />Balas: 30<br />Se usa en: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Calibre: 5.56x45 mm SD<br />Cartouches: 30<br />Utilisé dans: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Kaliber: 5,56 x 45 mm SD<br />Pociski: 30<br />Używane w: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Ráže: 5.56x45 mm SD<br />Munice: 30<br />Použití: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Calibre: 5,56x45 mm SD<br />Projéteis: 30<br />Usado em: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Calibro: 5.56x45 mm Sil.<br />Munizioni: 30<br />In uso su: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Калибр: 5.56x45 мм дозвуковые<br />Патронов: 30<br />Применимы в: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - - - 5.56mm 30Rnd AP Mag - 5,56 mm Páncéltörő 30-as Tár - 5,56 mm 30-Schuss-Magazin AP - Cargador de 30 balas AP de 5,56mm - Ch. 5,56mm 30Cps AP - Magazynek 5,56mm 30rd AP - 5.56mm 30ks AP Zásobník - Carregador de 30 projéteis AP de 5,56mm - Caricatore 5.56mm 30Rnd AP - Магазин из 30-ти 5.56 мм бронебойных - - - 5.56mm AP - 5,56 mm Páncéltörő - 5,56mm AP - 5,56mm AP - 5,56mm AP - 5,56mm AP - 5.56mm AP - 5,56mm AP - 5.56mm AP - 5.56 мм бронебойные - - - Caliber: 5.56x45 mm AP<br />Rounds: 30<br />Used in: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Kaliber: 5,56x45 mm Páncéltörő<br />Lőszerek: 30<br />Használható: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Kaliber: 5,56x45 mm AP<br />Patronen: 30<br />Eingesetzt von: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Calibre: 5,56x45 mm AP<br />Balas: 30<br />Se usa en: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Calibre: 5,56x45 mm AP<br />Cartouches: 30<br />Utilisé dans: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Kaliber: 5,56 x 45 mm AP<br />Pociski: 30<br />Używane w: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Ráže: 5.56x45 mm AP<br />Munice: 30<br />Použití: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Calibre: 5,56x45 mm AP<br />Projéteis: 30<br />Usado em: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Calibro: 5.56x45 mm AP<br />Munizioni: 30<br />In uso su: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Калибр: 5.56x45 мм бронебойные<br />Патронов: 30<br />Применимы в: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR + Caliber: 5.56x45mm Tracer IR-DIM<br />Rounds: 30<br />Used in: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR + Kaliber: 5,56x45mm Nyomjelző IR-DIM<br />Lövedékek: 30<br />Használható: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR + Kaliber: 5,56x45mm Leuchtspur IR-DIM<br />Patronen: 30<br />Eingesetzt von: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR + Calibre: 5,56x45mm Trazadoras IR-DIM<br />Balas: 30<br />Se usa en: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR + Calibre: 5,56x45mm Traçantes IR-DIM<br />Cartouches: 30<br />Utilisé avec: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR + Kaliber: 5,56x45mm Smugacz IR-DIM<br />Pociski: 30<br />Używane w: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR + Ráže: 5.56x45mm Svítící IR-DIM<br />Munice: 30<br />Použití: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR + Calibre: 5,56x45mm Traçante IR-DIM<br />Projéteis: 30<br />Usado em: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR + Calibro: 5.56x45mm Traccianti IR-DIM<br />Munizioni: 30<br />In uso su: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR + Калибр: 5,56x45 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR 7.62mm 20rnd Tracer Mag - 7,62 mm Nyomjelző IR-DIM 20-as Tár - 7,62 mm 20-Schuss-Magazin Leuchtspur + 7,62mm Nyomjelző IR-DIM 20-as Tár + 7,62mm 20-Patronen-Magazin Leuchtspur Cargador de 20 balas trazadores de 7,62mm Ch. 7,62mm 20Cps Traçantes Magazynek 7,62mm 20rd Smugacz - 7.62mm 20ks Svítící Zásobník + 7.62mm 20náb. Svítící Zásobník Carregador de 20 projéteis traçantes de 7,62mm Caricatore 7.62mm 20Rnd Traccianti - Магазин из 20-ти 7.62 мм трассирующих + Магазин из 20-ти 7,62 мм трассирующих 7.62mm Tracer - 7,62 mm Nyomjelző + 7,62mm Nyomjelző 7,62mm Leuchtspur 7,62mm Trazadora 7,62mm Traçantes @@ -352,35 +279,35 @@ 7.62mm Svítící 7,62mm Traçante 7.62mm Traccianti - 7.62 мм трассирущие + 7,62 мм трассирущие - Caliber: 7.62x51 mm Tracer<br />Rounds: 20<br />Used in: Mk18 ABR - Kaliber: 7,62x51 mm Nyomjelző<br />Lőszerek: 20<br />Használható: Mk18 ABR - Kaliber: 7,62x51 mm Leuchtspur<br />Patronen: 20<br />Eingesetzt von: EBR - Calibre: 7,62x51 mm Trazadora<br />Balas: 20<br />Se usa en: Mk18 ABR - Calibre: 7,62x51 mm Traçantes<br />Cartouches: 20<br />Utilisé dans: EBR - Kaliber: 7,62 x 51 mm Smugacz<br />Pociski: 20<br />Używane w: Mk18 ABR - Ráže: 7.62x51 mm Svítící<br />Munice: 20<br />Použití: Mk18 ABR - Calibre: 7,62x51 mm Traçante<br />Projéteis: 20<br />Usado em: Mk18 ABR - Calibro: 7.62x51 mm Traccianti<br />Munizioni: 20<br />In uso su: Mk18 ABR - Калибр: 7.62x51 мм трассирующие<br />Патронов: 20<br />Применимы в: Mk18 ABR + Caliber: 7.62x51mm Tracer<br />Rounds: 20<br />Used in: Mk18 ABR + Kaliber: 7,62x51mm Nyomjelző<br />Lövedékek: 20<br />Használható: Mk18 ABR + Kaliber: 7,62x51mm Leuchtspur<br />Patronen: 20<br />Eingesetzt von: EBR + Calibre: 7,62x51mm Trazadora<br />Balas: 20<br />Se usa en: Mk18 ABR + Calibre: 7,62x51mm Traçantes<br />Cartouches: 20<br />Utilisé avec: EBR + Kaliber: 7,62x51mm Smugacz<br />Pociski: 20<br />Używane w: Mk18 ABR + Ráže: 7.62x51mm Svítící<br />Munice: 20<br />Použití: Mk18 ABR + Calibre: 7,62x51mm Traçante<br />Projéteis: 20<br />Usado em: Mk18 ABR + Calibro: 7.62x51mm Traccianti<br />Munizioni: 20<br />In uso su: Mk18 ABR + Калибр: 7,62x51 мм трассирующие<br />Патронов: 20<br />Используются с: Mk18 ABR 7.62mm 20rnd Tracer IR-DIM Mag - 7,62 mm Nyomjelző IR-DIM 20-as Tár - 7,62 mm 20-Schuss-Magazin Leuchtspur IR-DIM - Cargador de 20 balas IR-DIM de 7,62mm + 7,62mm Nyomjelző IR-DIM 20-as Tár + 7,62mm 20-Patronen-Magazin Leuchtspur IR-DIM + Cargador de 20 balas trazadoras IR-DIM de 7,62mm Ch. 7,62mm 20Cps Traçantes IR-DIM Magazynek 7,62mm 20rd Smugacz IR-DIM - 7.62mm 20ks Svítící IR-DIM Zásobník + 7.62mm 20náb. Svítící IR-DIM Zásobník Carregador de 20 projéteis IR-DIM de 7,62mm Caricatore 7.62mm 20rnd Traccianti IR-DIM - Магазин из 20-ти 7.62 мм трассирующих под ПНВ + Магазин из 20-ти 7,62 мм ИК-трассирующих 7.62mm IR-DIM - 7,62 mm IR-DIM + 7,62mm IR-DIM 7,62mm IR-DIM 7,62mm IR-DIM 7,62mm IR-DIM @@ -388,35 +315,35 @@ 7.62mm IR-DIM 7,62mm IR-DIM 7.62mm IR-DIM - 7.62 мм ИК-трассирующие + 7,62 мм ИК-трассирующие - Caliber: 7.62x51 mm Tracer IR-DIM<br />Rounds: 20<br />Used in: Mk18 ABR - Kaliber: 7,62x51 mm Nyomjelző IR-DIM<br />Lőszerek: 20<br />Használható: Mk18 ABR - Kaliber: 7,62x51 mm Leuchtspur IR-DIM<br />Patronen: 20<br />Eingesetzt von: EBR - Calibre: 7,62x51 mm Trazadoras IR-DIM<br />Balas: 20<br />Se usa en: Mk18 ABR - Calibre: 7,62x51 mm Traçantes IR-DIM<br />Cartouches: 20<br />Utilisé dans: EBR - Kaliber: 7,62 x 51 mm Smugacz IR-DIM<br />Pociski: 20<br />Używane w: Mk18 ABR - Ráže: 7.62x51 mm Svítící IR-DIM<br />Munice: 20<br />Použití: Mk18 ABR - Calibre: 7,62x51 mm Traçante IR-DIM<br />Projéteis: 20<br />Usado em: Mk18 ABR - Calibro: 7.62x51 mm Traccianti IR-DIM<br />Munizioni: 20<br />In uso su: Mk18 ABR - Калибр: 7.62x51 мм трассирующие под ПНВ<br />Патронов: 20<br />Применимы в: Mk18 ABR + Caliber: 7.62x51mm Tracer IR-DIM<br />Rounds: 20<br />Used in: Mk18 ABR + Kaliber: 7,62x51mm Nyomjelző IR-DIM<br />Lövedékek: 20<br />Használható: Mk18 ABR + Kaliber: 7,62x51mm Leuchtspur IR-DIM<br />Patronen: 20<br />Eingesetzt von: EBR + Calibre: 7,62x51mm Trazadoras IR-DIM<br />Balas: 20<br />Se usa en: Mk18 ABR + Calibre: 7,62x51mm Traçantes IR-DIM<br />Cartouches: 20<br />Utilisé avec: EBR + Kaliber: 7,62x51mm Smugacz IR-DIM<br />Pociski: 20<br />Używane w: Mk18 ABR + Ráže: 7.62x51mm Svítící IR-DIM<br />Munice: 20<br />Použití: Mk18 ABR + Calibre: 7,62x51mm Traçante IR-DIM<br />Projéteis: 20<br />Usado em: Mk18 ABR + Calibro: 7.62x51mm Traccianti IR-DIM<br />Munizioni: 20<br />In uso su: Mk18 ABR + Калибр: 7,62x51 мм ИК-трассирующие<br />Патронов: 20<br />Используются с: Mk18 ABR 7.62mm 20Rnd SD Mag - 7,62 mm Hangtompítós 20-as Tár - 7,62 mm 20-Schuss-Magazin SD + 7,62mm Halk 20-as Tár + 7,62mm 20-Patronen-Magazin SD Cargador de 20 balas SD de 7,62mm Ch. 7,62mm 20Cps SD Magazynek 7,62mm 20rd SD - 7.62mm 20ks SD Zásobník + 7.62mm 20náb. SD Zásobník Carregador de 20 projéteis SD de 7,62mm Caricatore 7.62mm 20Rnd Sil. - Магазин из 20-ти 7.62 мм дозвуковых + Магазин из 20-ти 7,62 мм дозвуковых 7.62mm SD - 7,62 mm Hangtompítós + 7,62mm Halk 7,62mm SD 7,62mm SD 7,62mm SD @@ -424,308 +351,1042 @@ 7.62mm SD 7,62mm SD 7.62mm Sil. - 7.62 мм дозвуковые + 7,62 мм дозвуковые - Caliber: 7.62x51 mm SD<br />Rounds: 20<br />Used in: Mk18 ABR - Kaliber: 7,62x51 mm Hangtompítós<br />Lőszerek: 20<br />Használható: Mk18 ABR - Kaliber: 7,62x51 mm SD<br />Patronen: 20<br />Eingesetzt von: EBR - Calibre: 7,62x51 mm SD<br />Balas: 20<br />Se usa en: Mk18 ABR - Calibre: 7,62x51 mm SD<br />Cartouches: 20<br />Utilisé dans: EBR - Kaliber: 7,62 x 51 mm SD<br />Pociski: 20<br />Używane w: Mk18 ABR - Ráže: 7.62x51 mm SD<br />Munice: 20<br />Použití: Mk18 ABR - Calibre: 7,62x51 mm SD<br />Projéteis: 20<br />Usado em: Mk18 ABR - Calibro: 7.62x51 mm Sil.<br />Munizioni: 20<br />In uso su: Mk18 ABR - Калибр: 7.62x51 мм дозвуковые<br />Патронов: 20<br />Применимы в: Mk18 ABR - - - 7.62mm 20Rnd AP Mag - 7,62 mm Páncéltörő 20-as Tár - 7,62 mm 20-Schuss-Magazin AP - Cargador de 20 balas AP de 7,62mm - Ch. 7,62mm 20Cps AP - Magazynek 7,62mm 20rd AP - 7.62mm 20ks AP Zásobník - Carregador de 20 projéteis AP de 7,62mm - Caricatore 7.62mm 20Rnd AP - Магазин из 20-ти 7.62 мм бронебойных - - - 7.62mm AP - 7,62 mm Páncéltörő - 7,62mm AP - 7,62mm AP - 7,62mm AP - 7,62mm AP - 7.62mm AP - 7,62mm AP - 7.62mm AP - 7.62 мм бронебойные - - - Caliber: 7.62x51 mm AP<br />Rounds: 20<br />Used in: Mk18 ABR - Kaliber: 7,62x51 mm Páncéltörő<br />Lőszerek: 20<br />Használható: Mk18 ABR - Kaliber: 7,62x51 mm AP<br />Patronen: 20<br />Eingesetzt von: EBR - Calibre: 7,62x51 mm AP<br />Balas: 20<br />Se usa en: Mk18 ABR - Calibre: 7,62x51 mm AP<br />Cartouches: 20<br />Utilisé dans: EBR - Kaliber: 7,62 x 51 mm AP<br />Pociski: 20<br />Używane w: Mk18 ABR - Ráže: 7.62x51 mm AP<br />Munice: 20<br />Použití: Mk18 ABR - Calibre: 7,62x51 mm AP<br />Projéteis: 20<br />Usado em: Mk18 ABR - Calibro: 7.62x51 mm AP<br />Munizioni: 20<br />In uso su: Mk18 ABR - Калибр: 7.62x51 мм дозвуковые<br />Патронов: 20<br />Применимы в: Mk18 ABR - - - Caliber: 7.62x51mm M118LR<br />Rounds: 20<br />Type: M14 - Kaliber: 7,62x51 mm M118LR<br />Lőszerek: 20<br />Típus: M14 - Kaliber: 7,62x51mm M118LR<br />Schuss: 20<br />Typ: M14 - Calibre: 7,62x51mm M118LR<br />Balas: 20<br />Tipo: M14 - Kaliber: 7,62 x 51 mm M118LR<br />Pociski: 20<br />Typ: M14 - Kalibr: 7.62x51mm M118LR<br />Náboje: 20<br />Typ: M14 - Calibre : 7,62x51mm M118LR<br />Cartouches: 20<br />Type: M14 - Calibre: 7,62x51mm M118LR<br />Projéteis: 20<br />Tipo: M14 - Калибр: 7.62x51mm M118LR<br />Патронов: 20<br />Тип: M14 - Calibro: 7.62x51mm M118LR<br />Munizioni:20<br />In uso su: M14 - - - - .338 LM 10Rnd Tracer Mag - .338 LM 10-Schuss-Magazin Leuchtspur - Magazynek .338 LM 10rd Smugacz - .338 LM 10Rnd Svítící Zásobník - - - .338 LM Tracer - .338 LM Leuchtspur - .338 LM Smugacz - .338 LM Svítící - - - Caliber: .338 Lapua Magnum Tracer<br />Rounds: 10<br />Used in: MAR-10 - Kaliber: .338 Lapua Magnum Leuchtspur<br />Schuss: 10<br />Verwendet für: MAR-10 - Kaliber: .338 Lapua Magnum Smugacz<br />Pociski: 10<br />Używane w: MAR-10 - - - .338 LM 10Rnd IR-DIM Mag - .338 LM 10-Schuss-Magazin Leuchtspur IR-DIM - Magazynek .338 LM 10rd IR-DIM - - - .338 LM IR-DIM - .338 LM IR-DIM - .338 LM IR-DIM - .338 LM IR-DIM - - - Caliber: .338 Lapua Magnum Tracer IR-DIM<br />Rounds: 10<br />Used in: MAR-10 - Kaliber: .338 Lapua Magnum Leuchtspur IR-DIM<br />Schuss: 10<br />Verwendet für: MAR-10 - Kaliber: .338 Lapua Magnum Smugacz IR-DIM<br />Pociski: 10<br />Używane w: MAR-10 - - - .338 LM 10Rnd AP Mag - .338 LM 10-Schuss-Magazin Hartkern - Magazynek .338 LM 10rd AP - - - .338 LM AP - .338 LM AP - .338 LM AP - .338 LM AP - - - Caliber: .338 Lapua Magnum AP<br />Rounds: 10<br />Used in: MAR-10 - Kaliber: .338 Lapua Magnum Hartkern<br />Schuss: 10<br />Verwendet für: MAR-10 - Kaliber: .338 Lapua Magnum AP<br />Pociski: 10<br />Używany w: MAR-10 - - - .338 LM 10Rnd SD Mag - .338 LM 10-Schuss-Magazin Unterschall - Magazynek .338 LM 10rd SD - - - .338 LM SD - .338 LM SD - .338 LM SD - .338 LM SD - - - Caliber: .338 Lapua Magnum SD<br />Rounds: 10<br />Used in: MAR-10 - Kaliber: .338 Lapua Magnum Unterschall<br />Schuss: 10<br />Verwendet für: MAR-10 - Kaliber: .338 Lapua Magnum SD<br />Pociski: 10<br />Używany w: MAR-10 + Caliber: 7.62x51mm SD<br />Rounds: 20<br />Used in: Mk18 ABR + Kaliber: 7,62x51mm Halk<br />Lövedékek: 20<br />Használható: Mk18 ABR + Kaliber: 7,62x51mm SD<br />Patronen: 20<br />Eingesetzt von: EBR + Calibre: 7,62x51mm SD<br />Balas: 20<br />Se usa en: Mk18 ABR + Calibre: 7,62x51mm SD<br />Cartouches: 20<br />Utilisé avec: EBR + Kaliber: 7,62x51mm SD<br />Pociski: 20<br />Używane w: Mk18 ABR + Ráže: 7.62x51mm SD<br />Munice: 20<br />Použití: Mk18 ABR + Calibre: 7,62x51mm SD<br />Projéteis: 20<br />Usado em: Mk18 ABR + Calibro: 7.62x51mm Sil.<br />Munizioni: 20<br />In uso su: Mk18 ABR + Калибр: 7,62x51 мм дозвуковые<br />Патронов: 20<br />Используются с: Mk18 ABR .338 NM 130Rnd Tracer Belt - .338 NM 130-Schuss-Gurt Leuchtspur + .338 NM 130-Patronen-Gurt Leuchtspur Taśma .338 NM 130rd Smugacz + Bande .338 NM 130Cps Traçante + Cinta de 130 balas trazadoras de .338 NM + Лента из 130-ти .338 NM трассирующих + .338 NM 130Rnd Tracciante Belt + .338 NM 130náb. Svítící Pás .338 NM Tracer .338 NM Leuchtspur .338 NM Tracer .338 NM Svítící + .338 NM Traçante + .338 NM Trazadora + .338 NM трассирующие + .338 NM 130Rnd Tracciante Caliber: .338 Norma Magnum Tracer<br />Rounds: 130<br />Used in: SPMG - Kaliber: .338 Norma Magnum Leuchtspur<br />Schuss: 130<br />Verwendet für: SPMG + Kaliber: .338 Norma Magnum Leuchtspur<br />Patronen: 130<br />Eingesetzt von: SPMG Kaliber: .338 Norma Magnum Smugacz<br />Pociski: 130<br />Używany w: SPMG + Calibre: .338 Norma Magnum Traçante<br />Cartouches: 130<br />Utilisé avec: SPMG + Calibre: .338 Norma Magnum trazadora<br />Balas: 130<br />Se usa en: SPMG + Калибр: .338 Norma Magnum трассирующие<br />Патронов: 130<br />Используются в: SPMG + Calibro: .338 Norma Magnum Tracciante<br />Munizioni: 130<br />In uso su: SPMG + Ráže: .338 Noma Magnum Svítící<br />Munice: 130<br />Použití: SPMG .338 NM 130Rnd IR-DIM Belt - .338 NM 130-Schuss-Gurt Leuchtspur IR-DIM + .338 NM 130-Patronen-Gurt Leuchtspur IR-DIM Taśma .338 NM 130rd IR-DIM + Bande .338 NM 130Cps IR-DIM + Cinta de 130 balas IR-DIM de .338 NM + Лента из 130-ти .338 NM ИК-трассирующих + .338 NM 130Rnd IR-DIM Belt + .338 NM 130náb. IR-DIM Pás .338 NM IR-DIM .338 LM IR-DIM .338 NM IR-DIM .338 NM IR-DIM + .338 NM IR-DIM + .338 NM IR-DIM + .338 NM ИК-трассирующие + .338 NM IR-DIM Caliber: .338 Norma Magnum Tracer IR-DIM<br />Rounds: 130<br />Used in: SPMG - Kaliber: .338 Norma Magnum Leuchtspur IR-DIM<br />Schuss: 130<br />Verwendet für: SPMG + Kaliber: .338 Norma Magnum Leuchtspur IR-DIM<br />Patronen: 130<br />Eingesetzt von: SPMG Kaliber: .338 Norma Magnum Smugacz IR-DIM<br />Pociski: 130<br />Używany w: SPMG + Calibre: .338 Norma Magnum Traçante IR-DIM<br />Cartouches: 130<br />Utilisé avec: SPMG + Calibre: .338 Norma Magnum trazadora IR-DIM<br />Balas: 130<br />Se usa en: SPMG + Калибр: .338 Norma Magnum ИК-трассирующие<br />Патронов: 130<br />Используются с: SPMG + Calibro: .338 Norma Magnum Tracciante IR-DIM<br />Munizioni: 130<br />In uso su: SPMG + Ráže: .338 Noma Magnum Svítící IR-DIM<br />Munice: 130<br />Použití: SPMG .338 NM 130Rnd AP Belt - .338 NM 130-Schuss-Gurt Hartkern + .338 NM 130-Patronen-Gurt Hartkern Taśma .338 NM 130rd AP + Bande .338 NM 130Cps AP + Cinta de 130 balas AP de .338 NM + Лента из 130-ти .338 NM бронебойных + .338 NM 130Rnd AP Belt + .338 NM 130náb. AP Pás .338 NM AP .338 NM AP .338 NM AP .338 NM AP + .338 NM AP + .338 NM AP + .338 NM бронебойные + .338 NM AP Caliber: .338 Norma Magnum AP<br />Rounds: 130<br />Used in: SPMG - Kaliber: .338 Norma Magnum Hartkern<br />Schuss: 130<br />Verwendet für: SPMG + Kaliber: .338 Norma Magnum Hartkern<br />Patronen: 130<br />Eingesetzt von: SPMG Kaliber: .338 Norma Magnum AP<br />Pociski: 130<br />Używane w: SPMG + Calibre: .338 Norma Magnum AP<br />Cartouches: 130<br />Utilisé avec: SPMG + Calibre: .338 Norma Magnum AP<br />Balas: 130<br />Se usa en: SPMG + Калибр: .338 Norma Magnum бронебойные<br />Патронов: 130<br />Используются с: SPMG + Calibro: .338 Norma Magnum AP<br />Munizioni: 130<br />In uso su: SPMG + Ráže: .338 Noma Magnum AP<br />Munice: 130<br />Použití: SPMG 9.3mm 10Rnd Tracer Mag - 9,3mm 10-Schuss-Magazin Leuchtspur + 9,3mm 10-Patronen-Magazin Leuchtspur Magazynek 9.3mm 10rd Smugacz + Ch. 9.3mm 10Cps Traçante + Cargador de 10 balas trazadoras de 9.3mm + Магазин из 10-ти 9,3 мм трассирующих + 9.3mm 10Rnd Tracer Mag + 9.3mm 10Rnd Svítící Zásobník 9.3mm Tracer 9,3mm Leuchtspur 9,3mm Smugacz 9.3mm Svítící + 9.3mm Traçante + 9.3mm Trazadora + 9,3 мм трассирующие + 9.3mm Tracer Caliber: 9.3x64mm Tracer<br />Rounds: 10<br />Used in: Cyrus - Kaliber: 9,3x64mm Leuchtspur<br />Schuss: 10<br />Verwendet für: Cyrus - Kaliber: 9,3 x 64 mm Smugacz<br />Pociski: 10<br />Używany w: Cyrus + Kaliber: 9,3x64mm Leuchtspur<br />Patronen: 10<br />Eingesetzt von: Cyrus + Kaliber: 9,3x64mm Smugacz<br />Pociski: 10<br />Używany w: Cyrus + Calibre: 9.3x64mm Traçante<br />Cartouches: 10<br />Utilisé avec: Cyrus + Calibre: 9.3x64mm trazadora<br />Balas: 10<br />Se usa en: Cyrus + Калибр: 9,3x64 мм трассирующие<br />Патронов: 10<br />Используются с: Cyrus + Calibro: 9.3x64mm Tracer<br />Munizioni: 10<br />In uso su: Cyrus + Ráže: 9.3x64mm Svítící<br />Munice: 10<br />Použití: Cyrus 9.3mm 10Rnd Tracer IR-DIM Mag - 9,3mm 10-Schuss-Magazin Leuchtspur IR-DIM + 9,3mm 10-Patronen-Magazin Leuchtspur IR-DIM Magazynek 9,3mm 10rd Smugacz IR-DIM + Ch. 9.3mm 10Cps Traçante IR-DIM + Cargador de 10 balas trazadoras IR-DIM de 9.3mm + Магазин из 10-ти 9,3 мм ИК-трассирующих + 9.3mm 10Rnd Tracciante IR-DIM Mag + 9.3mm 10náb. Svítící IR-DIM Zásobník 9.3mm IR-DIM 9,3mm IR-DIM 9,3mm IR-DIM 9.3mm IR-DIM + 9.3mm IR-DIM + 9.3mm IR-DIM + 9,3 мм ИК-трассирующие + 9.3mm IR-DIM Caliber: 9.3x64mm Tracer IR-DIM<br />Rounds: 10<br />Used in: Cyrus - Kaliber: 9,3x64mm Leuchtspur IR-DIM<br />Schuss: 10<br />Verwendet für: Cyrus - Kaliber: 9,3 x 64 mm Smugacz IR-DIM<br />Pociski: 10<br />Używany w: Cyrus - - - 9.3mm 10Rnd AP Mag - 9,3mm 10-Schuss-Magazin Hartkern - Magazynek 9,3mm 10rd AP - - - 9.3mm AP - 9,3mm AP - 9,3mm AP - 9.3mm AP - - - Caliber: 9.3x64mm AP<br />Rounds: 10<br />Used in: Cyrus - Kaliber: 9,3x64mm Hartkern<br />Schuss: 10<br />Verwendet für: Cyrus - Kaliber: 9,3 x 64 mm AP<br />Pociski: 10<br />Używany w: Cyrus - - - 9.3mm 10Rnd SD Mag - 9,3mm 10-Schuss-Magazin Unterschall - Magazynek 9,3mm 10rd SD - - - 9.3mm SD - 9,3mm SD - 9,3mm SD - 9.3mm SD - - - Caliber: 9.3x64mm SD<br />Rounds: 10<br />Used in: Cyrus - Kaliber: 9,3x64mm Unterschall<br />Schuss: 10<br />Verwendet für: Cyrus - Kaliber: 9,3 x 64 mm SD<br />Pociski: 10<br />Używany w: Cyrus + Kaliber: 9,3x64mm Leuchtspur IR-DIM<br />Patronen: 10<br />Eingesetzt von: Cyrus + Kaliber: 9,3x64mm Smugacz IR-DIM<br />Pociski: 10<br />Używany w: Cyrus + Calibre: 9.3x64mm Traçante IR-DIM<br />Cartouches: 10<br />Utilisé avec: Cyrus + Calibre: 9.3x64mm trazadora IR-DIM<br />Balas: 10<br />Se usa en: Cyrus + Калибр: 9,3x64 мм ИК-трассирующие<br />Патронов: 10<br />Используются с: Cyrus + Calibro: 9.3x64mm Tracciante IR-DIM<br />Munizioni: 10<br />In uso su: Cyrus + Ráže: 9.3x64mm Svítící IR-DIM<br />Munice: 10<br />Použití: Cyrus 9.3mm 150Rnd Tracer Belt - 9,3mm 150-Schuss-Gurt Leuchtspur + 9,3mm 150-Patronen-Gurt Leuchtspur Taśma 9,3mm 150rd Smugacz + Bande 9.3mm 150Cps Traçante + Cinta de 150 balas trazadoras de 9.3mm + Лента из 150-ти 9,3 мм трассирующих + 9.3mm 150Rnd Tracer Belt + 9.3mm 150náb. Svítící Pás 9.3mm Tracer 9,3mm Leuchtspur 9,3mm Smugacz 9.3mm Svítící + 9.3mm Traçante + 9.3mm Trazadora + 9,3 мм трассирующие + 9.3mm Tracciante Caliber: 9.3x64mm Tracer<br />Rounds: 150<br />Used in: Navid - Kaliber: 9,3x64mm Leuchtspur<br />Schuss: 150<br />Verwendet für: Navid - Kaliber: 9,3 x 64 mm Smugacz<br />Pociski: 150<br />Używane w: Navid + Kaliber: 9,3x64mm Leuchtspur<br />Patronen: 150<br />Eingesetzt von: Navid + Kaliber: 9,3x64mm Smugacz<br />Pociski: 150<br />Używane w: Navid + Calibre: 9.3x64mm Traçante<br />Cartouches: 150<br />Utilisé avec: Navid + Calibre: 9.3x64mm trazadora<br />Balas: 150<br />Se usa en: Navid + Калибр: 9,3x64 мм трассирующие<br />Патронов: 150<br />Используются с: Навид + Calibro: 9.3x64mm Tracciante<br />Munizioni: 150<br />In uso su: Navid + Ráže: 9.3x64mm Svítící<br />Munice: 150<br />Použití: Navid 9.3mm 150Rnd Tracer IR-DIM Belt - 9,3mm 150-Schuss-Gurt Leuchtspur IR-DIM + 9,3mm 150-Patronen-Gurt Leuchtspur IR-DIM Taśma 9,3mm 150rd Smugacz IR-DIM + Bande 9.3mm 150Cps Traçante IR-DIM + Cinta de 150 balas trazadoras IR-DIM de 9.3mm + Лента из 150-ти 9,3 мм ИК-трассирующих + 9.3mm 150Rnd Tracciante IR-DIM Belt + 9.3mm 150náb. Svítící IR-DIM Pás 9.3mm IR-DIM 9,3mm IR-DIM 9,3mm IR-DIM 9.3mm IR-DIM + 9.3mm IR-DIM + 9.3mm IR-DIM + 9,3 мм ИК-трассирующие + 9.3mm IR-DIM Caliber: 9.3x64mm Tracer IR-DIM<br />Rounds: 150<br />Used in: Navid - Kaliber: 9,3x64mm Leuchtspur IR-DIM<br />Schuss: 150<br />Verwendet für: Navid - Kaliber: 9,3 x 64 mm Smugacz IR-DIM<br />Pociski: 150<br />Używane w: Navid + Kaliber: 9,3x64mm Leuchtspur IR-DIM<br />Patronen: 150<br />Eingesetzt von: Navid + Kaliber: 9,3x64mm Smugacz IR-DIM<br />Pociski: 150<br />Używane w: Navid + Calibre: 9.3x64mm Traçante IR-DIM<br />Cartouches: 150<br />Utilisé avec: Navid + Calibre: 9.3x64mm trazadora IR-DIM<br />Balas: 150<br />Se usa en: Navid + Калибр: 9,3x64 мм ИК-трассирующие<br />Патронов: 150<br />Используются с: Навид + Calibro: 9.3x64mm Tracciante IR-DIM<br />Munizioni: 150<br />In uso su: Navid + Ráže: 9.3x64mm Svítící IR-DIM<br />Munice: 150<br />Použití: Navid 9.3mm 150Rnd AP Belt - 9,3mm 150-Schuss-Gurt Hartkern + 9,3mm 150-Patronen-Gurt Hartkern Taśma 9,3mm 150rd AP + Bande 9.3mm 150Cps AP + Cinta de 150 balas AP de 9.3mm + Лента из 150-ти 9,3 мм бронебойных + 9.3mm 150Rnd AP Belt + 9.3mm 150náb. AP Pás 9.3mm AP 9,3mm AP 9,3mm AP 9.3mm AP + 9.3mm AP + 9.3mm AP + 9,3 мм бронебойные + 9.3mm AP Caliber: 9.3x64mm AP<br />Rounds: 150<br />Used in: Navid - Kaliber: 9,3x64mm Hartkern<br />Schuss: 150<br />Verwendet für: Navid - Kaliber: 9,3 x 64 mm AP<br />Pociski: 150<br />Używane w: Navid + Kaliber: 9,3x64mm Hartkern<br />Patronen: 150<br />Eingesetzt von: Navid + Kaliber: 9,3x64mm AP<br />Pociski: 150<br />Używane w: Navid + Calibre: 9.3x64mm AP<br />Cartouches: 150<br />Utilisé avec: Navid + Calibre: 9.3x64mm AP<br />Balas: 150<br />Se usa en: Navid + Калибр: 9,3x64 мм бронебойные<br />Патронов: 150<br />Используются с: Навид + Calibro: 9.3x64mm AP<br />Munizioni: 150<br />In uso su: Navid + Ráže: 9.3x64mm AP<br />Munice: 150<br />Použití: Navid + 9x19mm 16Rnd Mag + Magazynek 9x19mm 16rd + Ch. 9x19mm 16Cps + Cargador de 16 balas de 9x19mm + Магазин из 16-ти 9х19 мм + 9x19mm 20-Patronen-Magazin + 9x19mm 16Rnd Mag + 9x19mm 16náb. Zásobník + 9x19mm + 9x19mm + 9x19mm + 9x19mm + 9х19 мм + 9x19mm + 9x19mm + 9x19mm + 9x19mm 30Rnd Mag + Magazynek 9x19mm 16rd + Ch. 9x19mm 30Cps + Cargador de 16 balas de 9x19mm + Магазин из 16-ти 9х19 мм + 9x19mm 30-Patronen-Magazin + 9x19mm 30Rnd Mag + 9x19mm 30náb. Zásobník + 9x19mm 30Rnd Mag + Magazynek 9x19mm 30rd + Ch. 9x19mm 30Cps + Cargador de 30 balas de 9x19mm + Магазин из 30-ти 9х19 мм + 9x19mm 30-Patronen-Magazin + 9x19mm 30Rnd Mag + 9x19mm 30náb. Zásobník + 9x19mm + 9x19mm + 9x19mm + 9x19mm + 9х19 мм + 9x19mm + 9x19mm + 9x19mm + 9x19mm 30Rnd Mag + Magazynek 9x19mm 30rd + Ch. 9x19mm 30Cps + Cargador de 30 balas de 9x19mm + Магазин из 30-ти 9х19 мм + 9x19mm 30-Patronen-Magazin + 9x19mm 30Rnd Mag + 9x19mm 30náb. Zásobník + + + 7.62x54mm 10Rnd Tracer Mag + Magazynek 7,62x54mm 10rd Smugacz + Ch. 7.62x54mm 10Rnd Traçante + Cargador de 10 balas trazadoras de 7.62x54mm + Магазин из 10-ти 7,62 мм ИК-трассирующих + 7,62x54mm 10-Patronen-Magazin Leuchtspur + 7.62x54mm 10Munizioni Traccianti IR-DIM Mag + 7.62x54mm 10náb. Svítící Zásobník + + + 7.62mm + 7,62mm + 7.62mm + 7.62mm + 7,62 мм + 7,62x54mm + 7.62mm IR-DIM + 7.62mm + + + 7.62x54mm 10Rnd Tracer Mag + Magazynek 7,62x54mm 10rd Smugacz + Ch. 7.62x54mm 10Cps Traçante + Cargador de 10 balas trazadoras de 7.62x54mm + Магазин из 10-ти 7,62 мм ИК-трассирующих + 7,62x54mm 10-Patronen-Magazin Leuchtspur + 7.62x54mm 10Munizioni Traccianti IR-DIM Mag + 7.62x54mm 10náb. Svítící Zásobník + + + 6.5mm 100Rnd Tracer IR-DIM Mag + Magazynek 6,5mm 100rd Smugacz IR-DIM + Ch. 6.5mm 100Rnd Traçante IR-DIM + Cargador de 100 balas trazadoras IR-DIM de 6.5mm + Магазин из 100 6,5 мм ИК-трассирующих + 6,5mm 100-Patronen-Magazin IR-DIM Leuchtspur + 6.5mm 100Munizioni Traccianti IR-DIM Mag + 6.5mm 100náb. Svítící IR-DIM Zásobník + + + 6.5mm IR-DIM + 6,5mm IR-DIM + 6.5mm IR-DIM + 6.5mm IR-DIM + 6,5 мм ИК-трассирующие + 6,5mm IR-DIM + 6.5mm IR-DIM + 6.5mm IR-DIM + + + 6.5mm 100Rnd Tracer IR-DIM Mag<br />Rounds: 100<br />Used in: MX LSW + Magazynek 6,5mm 100rd Smugacz IR-DIM + Ch. 6.5mm 100Rnd Traçante IR-DIM<br />Cartouches: 100<br />Utilisé avec: MX LSW + Cargador de 100 balas trazadoras IR-DIM de 6.5mm + Магазин из 100 6,5 мм ИК-трассирующих + 6,5mm 100-Patronen-Magazin IR-DIM Leuchtspur<br />Patronen: 100<br />Eingesetzt von: MXLSW + 6.5mm 100Rnd Tracer IR-DIM Mag<br />Munizioni: 100<br />In uso su: MX LSW + 6.5mm 100náb. Svítící IR-DIM Zásobník<br />Munice: 100<br />Použití: MX LSW + + + 6.5mm 200Rnd Tracer IR-DIM Belt + Magazynek 6,5mm 200rd Smugacz IR-DIM + Bande 6.5mm 200Rnd Traçante IR-DIM + Cinta de 200 balas trazadoras IR-DIM de 6.5mm + Магазин из 200-т 6,5 мм ИК-трассирующих + 6,5mm 200-Patronen-Gurt IR-DIM Leuchtspur + 6.5mm 200Rnd Tracer IR-DIM Belt + 6.5mm 200náb. Svítící IR-DIM Pás + + + 6.5mm IR-DIM + 6,5mm IR-DIM + 6.5mm IR-DIM + 6.5mm IR-DIM + 6,5 мм ИК-трассирующие + 6,5mm IR-DIM + 6.5mm IR-DIM + 6.5mm IR-DIM + + + 6.5mm 200Rnd Tracer IR-DIM Belt<br />Rounds: 200<br />Used in: Stoner 99 LMG + Magazynek 6,5mm 200rd Smugacz IR-DIM + Bande 6.5mm 200Cps Traçante IR-DIM<br />Cartouches: 200<br />Utilisé avec: Stoner 99 LMG + Cinta de 200 balas trazadoras IR-DIM de 6.5mm + Магазин из 200-т 6,5 мм ИК-трассирующих + 6,5mm 200-Patronen-Gurt IR-DIM Leuchtspur<br />Patronen: 200<br />Eingesetzt von: Stoner 99 LMG + 6.5mm 200Rnd Tracer IR-DIM Belt<br />Munizioni: 200<br />In uso su: Stoner 99 LMG + 6.5mm 200náb. Svítící IR-DIM Pás<br />Munice: 200<br />Použití: Stoner 99 LMG + + + 5.56mm 30Rnd Mag (Mk262) + Magazynek 5,56mm 30rd Mk262 + 5.56mm 30Cps (Mk262) + Cargador de 30 balas de 5.56mm (Mk262) + Магазин из 30-ти 5.56 мм Mk262 + 5,56mm 30-Patronen-Magazin (Mk262) + 5.56mm 30Rnd Mag (Mk262) + 5.56mm 30náb. Zásobník (Mk262) + + + 5.56mm Mk262 + 5,56mm Mk262 + 5.56mm Mk262 + 5.56mm Mk262 + 5,56 мм Mk262 + 5,56mm Mk262 + 5.56mm Mk262 + 5.56mm Mk262 + + + Caliber: 5.56x45mm NATO (Mk262)<br />Rounds: 30 + Kaliber: 5,56x45mm NATO (Mk262)<br />Pociski: 30 + Calibre: 5.56x45mm NATO (Mk262)<br />Cartouches: 30 + Calibre: 5.56x45mm NATO (Mk262)<br />Balas: 30 + Калибр: 5,56x45 мм NATO (Mk262)<br />Патронов: 30 + Kaliber: 5,56x45mm NATO (Mk262)<br />Patronen: 30 + Calibro: 5.56x45 mm NATO (Mk262)<br />Munizioni: 30 + Ráže: 5.56x45mm NATO (Mk262)<br />Munice: 30 + + + 5.56mm 30Rnd Mag (Mk318) + Magazynek 5,56mm 30rd (Mk318) + Ch. 5.56mm 30Cps (Mk318) + Cargador de 30 balas de 5.56mm (Mk318) + Магазин из 30-ти 5.56 мм (Mk318) + 5,56mm 30-Patronen-Magazin (Mk318) + 5.56mm 30Rnd Mag (Mk318) + 5.56mm 30Rnd Zásobník (Mk318) + + + 5.56mm Mk318 + 5,56mm Mk318 + 5.56mm Mk318 + 5.56mm Mk318 + 5.56 мм Mk318 + 5,56mm Mk318 + 5.56mm Mk318 + 5.56mm Mk318 + + + Caliber: 5.56x45mm NATO (Mk318)<br />Rounds: 30 + Kaliber: 5,56x45mm NATO (Mk318)<br />Pociski: 30 + Calibre: 5.56x45mm NATO (Mk318)<br />Cartouches: 30 + Calibre: 5.56x45mm NATO (Mk318)<br />Balas: 30 + Калибр: 5,56x45 мм NATO (Mk318)<br />Патронов: 30 + Kaliber: 5,56x45mm NATO (Mk318)<br />Patronen: 30 + Calibro: 5.56x45 mm NATO (Mk318)<br />Munizioni: 30 + Ráže: 5.56x45mm NATO (Mk318)<br />Munice: 30 + + + 5.56mm 30Rnd Mag (M995 AP) + Magazynek 5,56mm 30rd (M995 AP) + Ch. 5.56mm 30Cps (M995 AP) + Cargador de 30 balas de 5.56mm (M995 AP) + Магазин из 30-ти 5.56 мм (M995 бронебойные) + 5,56mm 30-Patronen-Magazin (M995AP) + 5.56mm 30Rnd Mag (M995 AP) + 5.56mm 30náb. Zásobník (M995 AP) + + + 5.56mm AP + 5,56mm AP + 5.56mm AP + 5.56mm AP + 5.56 мм бронебойные + 5,56mm AP + 5.56mm AP + 5.56mm AP + + + Caliber: 5.56x45mm NATO (M995 AP)<br />Rounds: 30 + Kaliber: 5,56x45mm NATO (M995 AP)<br />Pociski: 30 + Calibre: 5.56x45mm NATO (M995 AP)<br />Cartouches: 30 + Calibre: 5.56x45mm NATO (M995 AP)<br />Balas: 30 + Калибр: 5,56x45 мм NATO (M995 бронебойные)<br />Патронов: 30 + Kaliber: 5,56x45mm NATO (M995 AP)<br />Patronen: 30 + Calibro: 5.56x45 mm NATO (M995 AP)<br />Munizioni: 30 + Ráže: 5.56x45mm NATO (M995 AP)<br />Munice: 30 + + + 7.62mm 10Rnd Mag (M118LR) + Magazynek 7,62mm 10rd (M118LR) + Ch. 7.62mm 10Cps (M118LR) + Cargador de 10 balas de 7.62mm (M118LR) + Магазин из 10-ти 7,62 мм (M118LR) + 7,62mm 10-Patronen-Magazin (M118LR) + 7.62mm 10Rnd Mag (M118LR) + 7.62mm 10náb. Zásobník (M118LR) + + + 7.62mm M118LR + 7,62mm M118LR + 7.62mm M118LR + 7.62mm (M118LR) + 7,62 мм M118LR + 7,62mm M118LR + 7.62mm M118LR + 7.62mm M118LR + + + Caliber: 7.62x51mm NATO (M118LR)<br />Rounds: 10 + Kaliber: 7,62x51mm NATO (M118LR)<br />Pociski: 10 + Calibre: 7.62x51mm NATO (M118LR)<br />Cartouches: 10 + Calibre: 7.62x51mm NATO (M118LR)<br />Balas: 10 + Калибр: 7,62x51 мм NATO (M118LR)<br />Патронов: 10 + Kaliber: 7,62x51mm NATO (M118LR)<br />Patronen: 10 + Calibro: 7.62x51 mm NATO (M118LR)<br />Munizioni: 10 + Ráže: 7.62x51mm NATO (M118LR)<br />Munice: 10 + + + 7.62mm 20Rnd Mag (M118LR) + Magazynek 7,62mm 20rd (M118LR) + Ch. 7.62mm 20Cps (M118LR) + Cargador de 20 balas de 7.62mm (M118LR) + Магазин из 20-ти 7,62 мм (M118LR) + 7,62mm 20-Patronen-Magazin (M118LR) + 7.62mm 20Rnd Mag (M118LR) + 7.62mm 20náb. Zásobník (M118LR) + + + 7.62mm M118LR + 7,62mm M118LR + 7.62mm M118LR + 7.62mm (M118LR) + 7,62 мм M118LR + 7,62mm M118LR + 7.62mm M118LR + 7.62mm M118LR + + + Caliber: 7.62x51mm NATO (M118LR)<br />Rounds: 20 + Kaliber: 7,62x51mm NATO (M118LR)<br />Pociski: 20 + Calibre: 7.62x51mm NATO (M118LR)<br />Cartouches: 20 + Calibre: 7.62x51mm NATO (M118LR)<br />Balas: 20 + Калибр: 7,62x51 мм NATO (M118LR)<br />Патронов: 20 + Kaliber: 7,62x51mm NATO (M118LR)<br />Patronen: 20 + Calibro: 7.62x51 mm NATO (M118LR)<br />Munizioni: 20 + Ráže: 7.62x51mm NATO (M118LR)<br />Munice: 20 + + + 7.62mm 10Rnd Mag (Mk316 Mod 0) + Magazynek 7,62mm 10rd (Mk316 Mod 0) + Ch. 7.62mm 10Cps (Mk316 Mod 0) + Cargador de 10 balas de 7.62mm (Mk316 Mod 0) + Магазин из 10-ти 7,62 мм (Mk316 Mod 0) + 7,62mm 10-Patronen-Magazin (Mk316 Mod 0) + 7.62mm 10Rnd Mag (Mk316 Mod 0) + 7.62mm 10náb. Zásobník (Mk316 Mod 0) + + + 7.62mm Mk316 + 7,62mm Mk316 + 7.62mm Mk316 + 7.62mm Mk316 + 7,62 мм Mk316 + 7,62mm Mk316 + 7.62mm Mk316 + 7.62mm Mk316 + + + Caliber: 7.62x51mm NATO (Mk316 Mod 0)<br />Rounds: 10 + Kaliber: 7,62x51mm NATO (Mk316 Mod 0)<br />Pociski: 10 + Calibre: 7.62x51mm NATO (Mk316 Mod 0)<br />Cartouches: 10 + Calibre: 7.62x51mm NATO (Mk316 Mod 0)<br />Balas: 10 + Калибр: 7,62x51 мм NATO (Mk316 Mod 0)<br />Патронов: 10 + Kaliber: 7,62x51mm NATO (Mk316 Mod 0)<br />Patronen: 10 + Calibro: 7.62x51 mm NATO (Mk316 Mod 0)<br />Munizioni: 10 + Ráže: 7.62x51mm NATO (Mk316 Mod 0)<br />Munice: 10 + + + 7.62mm 20Rnd Mag (Mk316 Mod 0) + Magazynek 7,62mm 20rd (Mk316 Mod 0) + Ch. 7.62mm 20Cps (Mk316 Mod 0) + Cargador de 20 balas de 7.62mm (Mk316 Mod 0) + Магазин из 20-ти 7,62 мм (Mk316 Mod 0) + 7,62mm 20-Patronen-Magazin (Mk316 Mod 0) + 7.62mm 20Rnd Mag (Mk316 Mod 0) + 7.62mm 20náb. Zásobník (Mk316 Mod 0) + + + 7.62mm Mk316 + 7,62mm Mk316 + 7.62mm Mk316 + 7.62mm Mk316 + 7,62 мм Mk316 + 7,62mm Mk316 + 7.62mm Mk316 + 7.62mm Mk316 + + + Caliber: 7.62x51mm NATO (Mk316 Mod 0)<br />Rounds: 20 + Kaliber: 7,62x51mm NATO (Mk316 Mod 0)<br />Pociski: 20 + Calibre: 7.62x51mm NATO (Mk316 Mod 0)<br />Cartouches: 20 + Calibre: 7.62x51mm NATO (Mk316 Mod 0)<br />Balas: 20 + Калибр: 7,62x51 мм NATO (Mk316 Mod 0)<br />Патронов: 20 + Kaliber: 7,62x51mm NATO (Mk316 Mod 0)<br />Patronen: 20 + Calibro: 7.62x51 mm NATO (Mk316 Mod 0)<br />Munizioni: 20 + Ráže: 7.62x51mm NATO (Mk316 Mod 0)<br />Munice: 20 + + + 7.62mm 10Rnd Mag (Mk319 Mod 0) + Magazynek 7,62mm 10rd (Mk319 Mod 0) + Ch. 7.62mm 10Cps (Mk319 Mod 0) + Cargador de 10 balas de 7.62mm (Mk319 Mod 0) + Магазин из 10-ти 7,62 мм (Mk319 Mod 0) + 7,62mm 10-Patronen-Magazin (Mk319 Mod 0) + 7.62mm 10Rnd Mag (Mk319 Mod 0) + 7.62mm 10náb. Zásobník (Mk319 Mod 0) + + + 7.62mm Mk319 + 7,62mm Mk319 + 7.62mm Mk319 + 7.62mm Mk319 + 7,62 мм Mk319 + 7,62mm Mk319 + 7.62mm Mk319 + 7.62mm Mk319 + + + Caliber: 7.62x51mm NATO (Mk319 Mod 0)<br />Rounds: 10 + Kaliber: 7,62x51mm NATO (Mk319 Mod 0)<br />Pociski: 10 + Calibre: 7.62x51mm NATO (Mk319 Mod 0)<br />Cartouches: 10 + Calibre: 7.62x51mm NATO (Mk319 Mod 0)<br />Balas: 10 + Калибр: 7,62x51 мм NATO (Mk319 Mod 0)<br />Патронов: 10 + Kaliber: 7,62x51mm NATO (Mk319 Mod 0)<br />Patronen: 10 + Calibro: 7.62x51 mm NATO (Mk319 Mod 0)<br />Munizioni: 10 + Ráže: 7.62x51mm NATO (Mk319 Mod 0)<br />Munice: 10 + + + 7.62mm 20Rnd Mag (Mk319 Mod 0) + Magazynek 7,62mm 20rd (Mk319 Mod 0) + Ch. 7.62mm 20Cps (Mk319 Mod 0) + Cargador de 20 balas de 7.62mm (Mk319 Mod 0) + Магазин из 20-ти 7,62 мм (Mk319 Mod 0) + 7,62mm 20-Patronen-Magazin (Mk319 Mod 0) + 7.62mm 20Rnd Mag (Mk319 Mod 0) + 7.62mm 20náb. Zásobník (Mk319 Mod 0) + + + 7.62mm Mk319 + 7,62mm Mk319 + 7.62mm Mk319 + 7.62mm Mk319 + 7,62 мм Mk319 + 7,62mm Mk319 + 7.62mm Mk319 + 7.62mm Mk319 + + + Caliber: 7.62x51mm NATO (Mk319 Mod 0)<br />Rounds: 20 + Kaliber: 7,62x51mm NATO (Mk319 Mod 0)<br />Pociski: 20 + Calibre: 7.62x51mm NATO (Mk319 Mod 0)<br />Cartouches: 20 + Calibre: 7.62x51mm NATO (Mk319 Mod 0)<br />Balas: 20 + Калибр: 7,62x51 мм NATO (Mk319 Mod 0)<br />Патронов: 20 + Kaliber: 7,62x51mm NATO (Mk319 Mod 0)<br />Patronen: 20 + Calibro: 7.62x51 mm NATO (Mk319 Mod 0)<br />Munizioni: 20 + Ráže: 7.62x51mm NATO (Mk319 Mod 0)<br />Munice: 20 + + + 7.62mm 10Rnd Mag (M993 AP) + Magazynek 7,62mm 10rd (M993 AP) + Ch. 7.62mm 10Cps (M993 AP) + Cargador de 10 balas de 7.62mm (M993 AP) + Магазин из 10-ти 7,62 мм (M993 бронебойные) + 7,62mm 10-Patronen-Magazin (M993 AP) + 7.62mm 10Rnd Mag (M993 AP) + 7.62 10náb. Zásobník (M993 AP) + + + 7.62mm AP + 7,62mm AP + 7.62mm AP + 7.62mm AP + 7,62mm бронебойные + 7,62mm AP + 7.62mm AP + 7.62mm AP + + + Caliber: 7.62x51mm NATO (M993 AP)<br />Rounds: 10 + Kaliber: 7,62x51mm NATO (M993 AP)<br />Pociski: 10 + Calibre: 7.62x51mm NATO (M993 AP)<br />Cartouches: 10 + Calibre: 7.62x51mm NATO (M993 AP)<br />Balas: 10 + Калибр: 7,62x51 мм NATO (M993 бронебойные)<br />Патронов: 10 + Kaliber: 7,62x51mm NATO (M993 AP)<br />Patronen: 10 + Calibro: 7.62x51 mm NATO (M993 AP)<br />Munizioni: 10 + Ráže: 7.62x51mm NATO (M993 AP)<br />Munice: 10 + + + 7.62mm 20Rnd Mag (M993 AP) + Magazynek 7,62mm 20rd (M993 AP) + Ch. 7.62mm 20Cps (M993 AP) + Cargador de 20 balas de 7.62mm (M993 AP) + Магазин из 20-ти 7,62 мм (M993 бронебойные) + 7,62mm 20-Patronen-Magazin (M993 AP) + 7.62mm 20Rnd Mag (M993 AP) + 7.62mm 20náb. Zásobník (M993 AP) + + + 7.62mm AP + 7,62mm AP + 7.62mm AP + 7.62mm AP + 7,62 мм бронебойные + 7,62mm AP + 7.62mm AP + 7.62mm AP + + + Caliber: 7.62x51mm NATO (M993 AP)<br />Rounds: 20 + Kaliber: 7,62x51mm NATO (M993 AP)<br />Pociski: 20 + Calibre: 7.62x51mm NATO (M993 AP)<br />Cartouches: 20 + Калибр: 7,62x51 мм NATO (M993 бронебойные)<br />Патронов: 20 + Kaliber: 7,62x51mm NATO (M993 AP)<br />Patronen: 20 + Calibro: 7.62x51 mm NATO (M993 AP)<br />Munizioni: 20 + Calibre: 7.62x51 mm NATO (M993 AP)<br />Balas: 20 + Ráže: 7.62x51mm NATO (M993 AP)<br />Munice: 20 + + + 7.62mm 20Rnd Mag (Mk248 Mod 0) + Magazynek 7,62mm 20rd (Mk248 Mod 0) + Ch. 7.62mm 20Cps (Mk248 Mod 0) + Cargador de 20 balas de 7.62mm (Mk248 Mod 0) + Магазин из 20-ти 7,62 мм (Mk248 Mod 0) + 7,62mm 20-Patronen-Magazin (Mk248 Mod 0) + 7.62mm 20Rnd Mag (Mk248 Mod 0) + 7.62mm 20náb. Zásobník (Mk248 Mod 0) + + + 7.62mm (Mk248 Mod 0) + 7,62mm (Mk248 Mod 0) + 7.62mm (Mk248 Mod 0) + 7.62mm (Mk248 Mod 0) + 7,62 мм (Mk248 Mod 0) + 7,62mm (Mk248 Mod 0) + 7.62mm (Mk248 Mod 0) + 7.62mm (Mk248 Mod 0) + + + Caliber: 7.62x67mm NATO (Mk248 Mod 0)<br />Rounds: 20 + Kaliber: 7,62x67mm NATO (Mk248 Mod 0)<br />Pociski: 20 + Calibre: 7.62x67mm NATO (Mk248 Mod 0)<br />Cartouches: 20 + Calibre: 7.62x67mm NATO (Mk248 Mod 0)<br />Balas: 20 + Калибр: 7,62x67 мм NATO (Mk248 Mod 0)<br />Патронов: 20 + Kaliber: 7,62x51mm NATO (Mk248 Mod 0)<br />Patronen: 20 + Calibro: 7.62x67 mm NATO (Mk248 Mod 0)<br />Munizioni: 20 + Ráže: 7.62x67mm NATO (Mk248 Mod 0)<br />Munice: 20 + + + 7.62mm 20Rnd Mag (Mk248 Mod 1) + Magazynek 7,62mm 20rd (Mk248 Mod 1) + Ch. 7.62mm 20Cps (Mk248 Mod 1) + Cargador de 20 balas de 7.62mm (Mk248 Mod 1) + Магазин из 20-ти 7,62 мм (Mk248 Mod 1) + 7,62mm 20-Patronen-Magazin (Mk248 Mod 1) + 7.62mm 20Rnd Mag (Mk248 Mod 1) + 7.62mm 20náb. Zásobník (Mk248 Mod 1) + + + 7.62mm (Mk248 Mod 1) + 7,62mm (Mk248 Mod 1) + 7.62mm (Mk248 Mod 1) + 7.62mm (Mk248 Mod 1) + 7,62 мм (Mk248 Mod 1) + 7,62mm (Mk248 Mod 1) + 7.62mm (Mk248 Mod 1) + 7.62mm (Mk248 Mod 1) + + + Caliber: 7.62x67mm NATO (Mk248 Mod 1)<br />Rounds: 20 + Kaliber: 7,62x67mm NATO (Mk248 Mod 1)<br />Pociski: 20 + Calibre: 7.62x67mm NATO (Mk248 Mod 1)<br />Cartouches: 20 + Calibre: 7.62x67mm NATO (Mk248 Mod 1)<br />Balas: 20 + Калибр: 7,62x67 мм NATO (Mk248 Mod 1)<br />Патронов: 20 + Kaliber: 7,62x51mm NATO (Mk248 Mod 1)<br />Patronen: 20 + Calibro: 7.62x67 mm NATO (Mk248 Mod 1)<br />Munizioni: 20 + Ráže: 7.62x67mm NATO (Mk248 Mod 1)<br />Munice: 20 + + + 7.62mm 20Rnd Mag (Berger Hybrid OTM) + Magazynek 7,62mm 20rd (Berger Hybrid OTM) + Ch. 7.62 20Cps (Berger Hybrid OTM) + Cargador de 20 balas de 7.62mm (Berger Hybrid OTM) + Магазин из 20-ти 7,62 мм (Berger Hybrid OTM) + 7,62mm 20-Patronen-Magazin (Berger Hybrid OTM) + 7.62mm 20Rnd Mag (Berger Hybrid OTM) + 7.62mm 20náb. Zásobník (Berger Hybrid OTM) + + + 7.62mm (OTM) + 7,62mm (OTM) + 7.62mm (OTM) + 7.62mm (OTM) + 7,62 мм (OTM) + 7,62mm (OTM) + 7.62mm (OTM) + 7.62mm (OTM) + + + Caliber: 7.62x67mm NATO (Berger Hybrid OTM)<br />Rounds: 20 + Kaliber: 7,62x67mm NATO (Berger Hybrid OTM)<br />Pociski: 20 + Calibre: 7.62x67mm NATO (Berger Hybrid OTM)<br />Cartouches: 20 + Calibre: 7.62x67mm NATO (Berger Hybrid OTM)<br />Balas: 20 + Калибр: 7,62x67 мм NATO (Berger Hybrid OTM)<br />Патронов: 20 + Kaliber: 7,62x67mm NATO (Berger Hybrid OTM)<br />Patronen: 20 + Calibro: 7.62x67 mm NATO (Berger Hybrid OTM)<br />Munizioni: 20 + Ráže: 7.62x67mm NATO (Berger Hybrid OTM)<br />Munice: 20 + + + 6.5x47mm 30Rnd Mag (HPBT Scenar) + Ch. 6.5x47mm 30Cps (HPBT Scenar) + Cargador de 30 balas de 6.5x47mm (HPBT Scenar) + Magazynek 6,5x47mm 30rd (HPBT Scenar) + Магазин из 30-ти 6,5x47 мм (экспансивные Scenar) + 6,5x47mm 30-Patronen-Magazin (HPBT Scenar) + 6.5x47mm 30Rnd Mag (HPBT Scenar) + 6.5x47mm 30náb. Zásobník (HPBT Scenar) + + + 6.5mm Lapua + 6.5mm Lapua + 6.5mm Lapua + 6,5mm Lapua + 6,5 мм Lapua + 6,5mm Lapua + 6.5mm Lapua + 6.5mm Lapua + + + Caliber: 6.5x47mm (HPBT Scenar)<br />Rounds: 30<br />Used in: MXM + Calibre: 6.5x47mm (HPBT Scenar)<br />Cartouches: 30 + Calibre: 6.5x47mm (HPBT Scenar)<br />Balas: 30<br />Se usa en: MXM + Kaliber: 6,5x47mm (HPBT Scenar)<br />Pociski: 30 + Калибр: 6,5x47 мм (экспансивные Scenar)<br />Патронов: 30<br />Используются с: MXM + Kaliber: 6,5x47mm (HPBT Scenar)<br />Patronen: 30<br />Eingesetzt von: MXM + Calibro: 6.5x47mm (HPBT Scenar)<br />Munizioni: 30<br />In uso su: MXM + Ráže: 6.5x47mm (HPBT Scenar)<br />Munice: 30<br />Použití: MXM + + + 6.5mm Creedmor 30Rnd Mag + Magazynek 6,5mm Creedmor 30rd + 6.5mm Creedmor 30Rnd Mag + Магазин из 30-ти 6,5 мм Creedmor + 6,5mm Creedmor 30-Patronen-Magazin + Cargador de 30 balas Creedmor de 6.5mm + Ch. 6.5mm Creedmor 30Cps + 6.5mm Creedmor 30náb. Zásobník + + + 6.5mm CM + 6.5mm CM + 6.5mm CM + 6,5mm CM + 6,5 мм CM + 6,5mm CM + 6.5mm CM + 6.5mm CM + + + Caliber: 6.5x47mm Creedmor<br />Rounds: 30<br />Used in: MXM + Kaliber: 6,5x47mm Creedmor<br />Pociski: 30<br />Używany w: MXM + Kaliber: 6,5x47mm Creedmor<br />Patronen: 30<br />Eingesetzt von: MXM + Calibre: 6.5x47mm Creedmor <br />Cartouches: 30<br />Utilisé avec: MXM + Calibro: 6.5mm Creedmor<br />Munizioni: 30<br />In uso su: MXM + Calibre: 6.5mm Creedmor<br />Balas: 30<br />Se usa en: MXM + Калибр: 6,5x47мм Creedmor<br />Патронов: 30<br />Используются c: MXM + Ráže: 6.5x47mm Creedmor<br />Munice: 30<br />Použití: MXM + + + .338 10Rnd Mag (300gr Sierra MatchKing HPBT) + Ch. .338 10 Cps (300gr Sierra MatchKing HPBT) + Cargador de 10 balas de 8.6x70mm (300gr Sierra MatchKing HPBT) + Magazynek .338 10rd (300gr Sierra MatchKing HPBT) + Магазин из 10-ти .338 (300 гран Sierra MatchKing экспансивные) + .338 10-Patronen-Magazin (300gr Sierra MatchKing HPBT) + .338 10Munizioni Mag (300gr Sierra MatchKing HPBT) + .338 10náb. Zásobník (300gr Sierra MatchKing HPBT) + + + .338 HPBT + .338 HPBT + .338 HPBT + .338 HPBT + .338 экспансивные + .338 HPBT + .338 (HPBT) + .338 HPBT + + + Caliber: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />Rounds: 10 + Calibre: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />Cartouches: 10 + Calibre: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />Balas: 10 + Kaliber: 8,6x70mm (300gr Sierra MatchKing HPBT)<br />Pociski: 10 + Калибр: 8,6x70mm (300 гран Sierra MatchKing экспансивные)<br />Патронов: 10 + Kaliber: 8,6x70mm (300gr Sierra MatchKing HPBT)<br />Patronen: 10 + Calibro: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />Munizioni: 10 + Ráže: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />Munice: 10 + + + .338 10Rnd Mag (API526) + Ch. .338 10Cps (API526) + Cargador de 10 balas de .338 (API526) + Magazynek .338 10rd (API526) + Магазин из 10-ти .338 (API526) + .338 10-Patronen-Magazin (API526) + .338 10Rnd Mag (API526) + .338 10náb. Zásobník (API526) + + + .338 AP + .338 AP + .338 AP + .338 AP + .338 AP + .338 AP + .338 AP + .338 AP + + + Caliber: 8.6x70mm (API526)<br />Rounds: 10 + Calibre: 8.6x70mm (API526)<br />Cartouches: 10 + Calibre: 8.6x70mm (API526)<br />Balas: 10 + Kaliber: 8,6x70mm (API526)<br />Pociski: 10 + Калибр: 8,6x70 мм (API526)<br />Патронов: 10 + Kaliber: 8,6x70mm (API526)<br />Patronen: 10 + Calibro: 8.6x70mm (API526)<br />Munizioni: 10 + Ráže: 8.6x70mm (API526)<br />Munice: 10 + + + 12.7x99mm 5Rnd Mag + Ch. 12.7x99mm 5Cps + Cargador de 5 balas de 12.7x99mm + Magazynek 12,7x99mm 5rd + Магазин из 5-ти 12,7x99 мм + 12,7x99mm 5-Patronen-Magazin + 12.7x99mm 5Rnd Mag + 12.7x99mm 5náb. Zásobník + + + 12.7mm + 12.7mm + 12.7mm + 12,7mm + 12,7 мм + 12,7mm + 12.7mm + 12.7mm + + + Caliber: 12.7x99mm<br />Rounds: 5 + Calibre: 12.7x99mm<br />Cartouches: 5 + Calibre: 12.7x99mm<br />Balas: 5 + Kaliber: 12,7x99mm<br />Pociski: 5 + Калибр: 12,7x99 мм<br />Патронов: 5 + Kaliber: 12,7x99mm<br />Patronen: 5 + Calibro: 12.7x99mm<br />Munizioni: 5 + Ráže: 12.7x99mm<br />Munice: 5 + + + 12.7x99mm API 5Rnd Mag + Ch. 12.7x99mm API 5Cps + Cargador de 5 balas de 12.7x99mm API + Magazynek 12,7x99mm API 5rd + 12.7x99mm API 5Rnd Mag + Магазин из 5-ти 12,7x99 мм (бронебойно-зажигательные) + 12,7x99mm 5-Patronen-Magazin (API) + 12.7x99mm API 5náb. Zásobník + + + 12.7mm API + 12.7mm API + 12.7mm API + 12,7mm API + 12.7mm API + 12.7 мм бронебойно-зажигательные + 12,7mm API + 12.7mm API + + + Caliber: 12.7x99mm API<br />Rounds: 5 + Calibre: 12.7x99mm API<br />Cartouches: 5 + Calibre: 12.7x99mm API<br />Balas: 5 + Kaliber: 12,7x99mm API<br />Pociski: 5 + Калибр: 12,7x99 мм бронебойно-зажигательные<br />Патронов: 5 + Kaliber:12,7x99mm API<br />Patronen: 5 + Calibro: 12.7x99mm API<br />Munizioni: 5 + Ráže: 12.7x99mm API<br />Munice: 5 + + + 12.7x99mm 5Rnd Mag (AMAX) + Ch. 12.7x99mm 5Cps (AMAX) + Cargador de 5 balas de 12.7x99mm (AMAX) + Magazynek 12,7x99mm 5rd (AMAX) + Магазин из 5-ти 12,7x99 мм (A-MAX) + 12,7x99mm 5-Patronen-Magazin (AMAX) + 12.7x99mm 5Rnd Mag (AMAX) + 12.7x99mm 5náb. Zásobník (AMAX) + + + 12.7mm + 12.7mm + 12.7mm + 12,7mm + 12,7 мм + 12,7mm + 12.7mm + 12.7mm + + + Caliber: 12.7x99mm (AMAX)<br />Rounds: 5 + Calibre: 12.7x99mm (AMAX)<br />Cartouches: 5 + Calibre: 12.7x99mm (AMAX)<br />Balas: 5 + Kaliber: 12,7x99mm (AMAX)<br />Pociski: 5 + Калибр: 12,7x99 мм (A-MAX)<br />Патронов: 5 + Calibro: 12.7x99mm (AMAX)<br />Munizioni: 5 + Kaliber:12,7x99mm (AMAX)<br />Patronen: 5 + Ráže: 12.7x99mm (AMAX)<br />Munice: 5 - \ No newline at end of file + diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index 10b2d0285f..1e2eb3f201 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -101,25 +101,20 @@ class CfgVehicles { #define MACRO_LOADUNLOADCAPTIVE \ class ACE_Actions { \ class ACE_MainActions { \ - selection = ""; \ - class ACE_LoadCaptive { \ + class GVAR(LoadCaptive) { \ displayName = "$STR_ACE_Captives_LoadCaptive"; \ distance = 4; \ condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \ statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(doLoadCaptive)); \ exceptions[] = {"isNotEscorting"}; \ - showDisabled = 0; \ priority = 1.2; \ - hotkey = "L"; \ }; \ - class ACE_UnloadCaptive { \ + class GVAR(UnloadCaptive) { \ displayName = "$STR_ACE_Captives_UnloadCaptive"; \ distance = 4; \ condition = QUOTE([ARR_2(_player, _target)] call FUNC(canUnloadCaptive)); \ statement = QUOTE([ARR_2(_player, _target)] call FUNC(doUnloadCaptive)); \ - showDisabled = 0; \ priority = 1.2; \ - hotkey = "C"; \ }; \ }; \ }; diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index 651edbcf86..f91f24025e 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -7,6 +7,7 @@ if (isServer) then { addMissionEventHandler ["HandleDisconnect", { PARAMS_1(_disconnectedPlayer); + private "_escortedUnit"; _escortedUnit = _disconnectedPlayer getVariable [QGVAR(escortedUnit), objNull]; if ((!isNull _escortedUnit) && {(attachedTo _escortedUnit) == _disconnectedPlayer}) then { detach _escortedUnit; diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf index 08f44a1437..b8758065d8 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -22,7 +22,7 @@ PARAMS_3(_unit,_target,_state); if (_state) then { if (_unit getVariable [QGVAR(isEscorting), false]) exitWith {}; - [_unit, _target] call EFUNC(common,claim); + [_unit, _target, false] call EFUNC(common,claim); _unit setVariable [QGVAR(isEscorting), true, true]; _target attachTo [_unit, [0, 1, 0]]; @@ -34,8 +34,7 @@ if (_state) then { {[(_this select 0), ((_this select 0) getVariable [QGVAR(escortedUnit), objNull]), false] call FUNC(doEscortCaptive);}, nil, 20, false, true, "", QUOTE(!isNull (GETVAR(_target,QGVAR(escortedUnit),objNull)))]; - private "_escortFnc"; - _escortFnc = { + [{ EXPLODE_3_PVT((_this select 0),_unit,_target,_actionID); if (_unit getVariable [QGVAR(isEscorting), false]) then { if (!alive _target || {!alive _unit} || {!canStand _target} || {!canStand _unit} || {_target getVariable ["ACE_isUnconscious", false]} || {_unit getVariable ["ACE_isUnconscious", false]} || {!isNull (attachedTo _unit)}) then { @@ -45,13 +44,12 @@ if (_state) then { if (!(_unit getVariable [QGVAR(isEscorting), false])) then { [(_this select 1)] call cba_fnc_removePerFrameHandler; - [objNull, _target] call EFUNC(common,claim); + [objNull, _target, false] call EFUNC(common,claim); detach _target; _unit removeAction _actionID; _unit setVariable [QGVAR(escortedUnit), objNull, true]; }; - }; - [_escortFnc, 0, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler; + }, 0, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler; } else { _unit setVariable [QGVAR(isEscorting), false, true]; diff --git a/addons/captives/functions/fnc_doLoadCaptive.sqf b/addons/captives/functions/fnc_doLoadCaptive.sqf index 9fd65a130d..97ecd98a0a 100644 --- a/addons/captives/functions/fnc_doLoadCaptive.sqf +++ b/addons/captives/functions/fnc_doLoadCaptive.sqf @@ -18,6 +18,7 @@ #include "script_component.hpp" PARAMS_3(_unit,_target,_vehicle); +private "_objects"; if (isNull _target) then { _objects = attachedObjects _unit; diff --git a/addons/captives/functions/fnc_moduleSurrender.sqf b/addons/captives/functions/fnc_moduleSurrender.sqf index 0506b0cc17..bf0e04cd6a 100644 --- a/addons/captives/functions/fnc_moduleSurrender.sqf +++ b/addons/captives/functions/fnc_moduleSurrender.sqf @@ -18,6 +18,7 @@ #include "script_component.hpp" PARAMS_3(_logic,_units,_activated); +private ["_bisMouseOver", "_mouseOverObject"]; if (!_activated) exitWith {}; diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index e992339186..bd141988bb 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -29,11 +29,11 @@ if ((_unit getVariable [QGVAR(isHandcuffed), false]) isEqualTo _state) exitWith if (_state) then { _unit setVariable [QGVAR(isHandcuffed), true, true]; [_unit, QGVAR(Handcuffed), true] call EFUNC(common,setCaptivityStatus); - + if (_unit getVariable [QGVAR(isSurrendering), false]) then { //If surrendering, stop [_unit, false] call FUNC(setSurrendered); }; - + //Set unit cargoIndex (will be -1 if dismounted) _unit setVariable [QGVAR(CargoIndex), ((vehicle _unit) getCargoIndex _unit), true]; @@ -47,30 +47,31 @@ if (_state) then { if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then { [_unit] call EFUNC(common,fixLoweredRifleAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); - + //Adds an animation changed eh //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain) + private "_animChangedEHID"; _animChangedEHID = _unit addEventHandler ["AnimChanged", { PARAMS_2(_unit,_newAnimation); if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { - ERROR("Handcuff animation interrupted"); - // systemChat format ["debug %2: new %1", _newAnimation, time]; + TRACE_1("Handcuff animation interrupted",_newAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); }; }]; _unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID]; - + }; }, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute); } else { _unit setVariable [QGVAR(isHandcuffed), false, true]; [_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus); - - //remove AnimChanged EH + + //remove AnimChanged EH + private "_animChangedEHID"; _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1]; _unit removeEventHandler ["AnimChanged", _animChangedEHID]; _unit setVariable [QGVAR(handcuffAnimEHID), -1]; - + if (((vehicle _unit) == _unit) && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { //Break out of hands up animation loop [_unit, "ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index 30f9105511..22de70921d 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -48,11 +48,11 @@ if (_state) then { if (_unit getVariable [QGVAR(isSurrendering), false] && {(vehicle _unit) == _unit}) then { //Adds an animation changed eh //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain) + private "_animChangedEHID"; _animChangedEHID = _unit addEventHandler ["AnimChanged", { PARAMS_2(_unit,_newAnimation); if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { - ERROR("Surrender animation interrupted"); - // systemChat format ["debug %2: new %1", _newAnimation, time]; + TRACE_1("Surrender animation interrupted",_newAnimation); [_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation); }; }]; @@ -64,6 +64,7 @@ if (_state) then { [_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus); //remove AnimChanged EH + private "_animChangedEHID"; _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1]; _unit removeEventHandler ["AnimChanged", _animChangedEHID]; _unit setVariable [QGVAR(surrenderAnimEHID), -1]; diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 292da895f3..86722a0014 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -6,7 +6,7 @@ Gefangen nehmen Tomar prisionero Capturer le prisonnier - Weź więźnia + Aresztuj Zajmout Osobu Arresta il Prigioniero Tomar Prisioneiro @@ -22,7 +22,7 @@ Osvobodit Zajatce Libera il Prigioniero Libertar Prisioneiro - Fogoly szabadon elengedése + Fogoly szabadon engedése Освободить пленника @@ -53,12 +53,12 @@ You need to take him as prisoner first! Du musst ihn zuerst gefangen nehmen. Necesitas hacerle prisionero primero! - Najpierw musisz wziąć go jako więźnia! + Najpierw musisz go aresztować! Vous devez d'abord le capturer! Musíš ho nejdříve zajmout! Prima devi arrestarlo! Você deve tomá-lo como prisioneiro primeiro! - Először foglyul kell ejtened! + Először foglyul kell ejtened őt! Вы должны сначала взять его в плен! @@ -71,6 +71,7 @@ Fogoly berakása Загрузить пленного Embarcar Prisioneiro + Carica il prigioniero Unload Captive @@ -82,6 +83,7 @@ Fogoly kivevése Выгрузить пленного Desembarcar Prisioneiro + Scarica il prigioniero Cable Tie @@ -104,7 +106,7 @@ Stahovací pásky vám umožní zadržet vězně. A algema plástica permite que você contenha prisioneiros. Fascietta che ti consente di arrestare i prigionieri. - Gyorskötöző emberek fogjulejtéséhez. + Gyorskötöző, emberek foglyulejtéséhez használható. Кабельные стяжки позволяют связывать пленников. @@ -115,8 +117,9 @@ Motozott személy felszerelése Inventář prohledávané osoby Ekwipunek rewidowanej osoby - Инвентарь обысканных лиц + Инвентарь обысканного человека Inventário da pessoa revistada + Inventario delle persone perquisite Frisk person @@ -128,51 +131,65 @@ Motozás Обыскать человека Revistar + Perquisisci la persona Surrender - Capituler + Se rendre Kapitulieren Rendirse + Render-se Vzdát se Poddaj się - Сдаться в плен + Сдаться + Megadás + Arreso Stop Surrendering Annuler la capitulation Den Kampf erneut aufnehmen Dejar de rendirse + Parar de se render Přestat se vzdávat Podejmij walkę ponownie - Отменить сдачу в плен + Прекратить сдачу в плен + Megadás abbahagyása + Annulla la resa Only use on alive units - Utiliser uniquement sur unité vivante + Utiliser uniquement sur une unité vivante Nur bei lebenden Einheiten verwendbar Utilizar solo en unidades vivas Použitelné jen na živé jednotky Używaj tylko na żywych jednostkach Применимо только к живым юнитам + Csak élő egységeken használni + Si può fare solo su persone vive Only use on dismounted inf - Utiliser uniquement sur personnel à pied + Utiliser uniquement sur du personnel à pied Nur bei abgesessener Infanterie verwendbar Utilizar solo en infanteria desmontada Použitelné jen na pěsích jednotkách Używaj tylko na piechocie poza wszelkimi pojazdami Применимо только к пехоте вне техники + Csak járműben kívül lévő egységeken használni + Si può usare solo su fanteria a piedi Nothing under mouse - Rien sous la souris + Rien sous le curseur Es wurde nichts ausgewählt Nada bajo el ratón + Nada debaixo do mouse Nic není vybráno Nie ma nic pod kursorem Ничего не выделено + Semmi sincs az egér alatt + Niente selezionato diff --git a/addons/common/CfgEventHandlers.hpp b/addons/common/CfgEventHandlers.hpp index ce0938f063..bea7b6e7bc 100644 --- a/addons/common/CfgEventHandlers.hpp +++ b/addons/common/CfgEventHandlers.hpp @@ -24,7 +24,7 @@ class Extended_InitPost_EventHandlers { init = QUOTE(if (local (_this select 0)) then {_this call FUNC(setName)};); }; class GVAR(forceWalk) { - init = QUOTE(if (local (_this select 0)) then {_this call FUNC(applyForceWalkStatus);};); + init = QUOTE(_this call FUNC(applyForceWalkStatus)); }; class GVAR(muteUnit) { init = QUOTE(_this call FUNC(muteUnitHandleInitPost)); diff --git a/addons/common/CfgMagazines.hpp b/addons/common/CfgMagazines.hpp index 815ab6db9f..465ea57f78 100644 --- a/addons/common/CfgMagazines.hpp +++ b/addons/common/CfgMagazines.hpp @@ -2,6 +2,7 @@ class CfgMagazines { class CA_Magazine; class ACE_FakeMagazine: CA_Magazine { + scopeCurator = 1; descriptionShort = ""; displayName = ""; displayNameShort = ""; diff --git a/addons/common/CfgUnitInsignia.hpp b/addons/common/CfgUnitInsignia.hpp new file mode 100644 index 0000000000..aba82823c9 --- /dev/null +++ b/addons/common/CfgUnitInsignia.hpp @@ -0,0 +1,15 @@ + +class CfgUnitInsignia { + class ACE_insignia_logo { + displayName = "ACE3"; + author = "$STR_ACE_Common_ACETeam"; + texture = PATHTOF(data\Insignia_ace3logo_ca.paa); + textureVehicle = ""; + }; + class ACE_insignia_banana { + displayName = "ABE3"; + author = "$STR_ACE_Common_ACETeam"; + texture = PATHTOF(data\insignia_banana_ca.paa); + textureVehicle = ""; + }; +}; diff --git a/addons/common/CfgVoice.hpp b/addons/common/CfgVoice.hpp index 9c53338e6e..1fb0f5d2b6 100644 --- a/addons/common/CfgVoice.hpp +++ b/addons/common/CfgVoice.hpp @@ -199,6 +199,8 @@ class ACE_RadioProtocolNoRadio: RadioProtocolBase { Ready[] = {}; Waiting[] = {}; StandingBy[] = {}; + RallyUp[] = {}; + UnderFireE[] = {}; /*IAmReady[] = {}; ReadyForOrders[] = {}; AwaitingOrders[] = {};*/ diff --git a/addons/common/CfgWeapons.hpp b/addons/common/CfgWeapons.hpp index c2d1532f40..59bb8f6b9a 100644 --- a/addons/common/CfgWeapons.hpp +++ b/addons/common/CfgWeapons.hpp @@ -14,6 +14,8 @@ class CfgWeapons { class ACE_FakePrimaryWeapon: Rifle_Base_F { scope = 2; + scopeCurator = 1; + scopeArsenal = 1; displayName = ""; model = "\A3\Weapons_f\empty"; picture = ""; diff --git a/addons/common/ProgressScreen.hpp b/addons/common/ProgressScreen.hpp index 751d48af9f..ab624669cf 100644 --- a/addons/common/ProgressScreen.hpp +++ b/addons/common/ProgressScreen.hpp @@ -1,77 +1,79 @@ - class GVAR(ProgressBar_Dialog) { - idd = -1; - movingEnable = false; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ctrlProgressBar)),(_this select 0) displayCtrl 1)]; uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ctrlProgressBarTitle)),(_this select 0) displayCtrl 2)];); - objects[] = {}; + idd = -1; + movingEnable = false; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ctrlProgressBG)),(_this select 0) displayCtrl 1)]; uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ctrlProgressBar)),(_this select 0) displayCtrl 2)]; uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ctrlProgressBarTitle)),(_this select 0) displayCtrl 3)];); + objects[] = {}; - class controlsBackground { - class Background { - idc = -1; - moving = 0; - font = "TahomaB"; - text = ""; - sizeEx = 0; - lineSpacing = 0; - access = 0; - type = 0; - style = 0; - size = 1; - colorBackground[] = {0, 0, 0, 0.0}; - colorText[] = {0, 0, 0, 0}; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; + class controlsBackground { + class Background { + idc = -1; + moving = 0; + font = "TahomaB"; + text = ""; + sizeEx = 0; + lineSpacing = 0; + access = 0; + type = 0; + style = 0; + size = 1; + colorBackground[] = {0, 0, 0, 0.0}; + colorText[] = {0, 0, 0, 0}; + x = "safezoneX"; + y = "safezoneY"; + w = "safezoneW"; + h = "safezoneH"; + }; + class TitleBackground: ACE_gui_staticBase { + idc = 1; + style = ST_CENTER; + sizeEx = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0, 0, 0, 0.5}; + colorText[] = {1, 1, 1, 1}; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + class Progress: ACE_gui_RscProgress { + idc = 2; + x = "1.2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "0.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorFrame[] = {1,1,1,0.5}; + colorBar[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])","(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"}; + texture = "#(argb,8,8,3)color(1,1,1,0.7)"; + }; + class TitleText: TitleBackground { + idc = 3; + colorBackground[] = {0, 0, 0, 0}; + }; }; - - class Progress: ACE_gui_RscProgress { - idc = 1; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "0.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = ".8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorFrame[] = {0,0,0,0.0}; - colorBar[] = {0.27,0.5,0.31,0.8}; - texture = "#(argb,8,8,3)color(1,1,1,0.7)"; - }; - - class Title_Bar : ACE_gui_staticBase { - idc = 2; - style = 0x22; - colorBackground[] = {0, 0, 0, 0}; - colorText[] = {1, 1, 1, 1}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - }; }; class GVAR(DisableMouse_Dialog) { - idd = -1; - movingEnable = false; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgDisableMouse)),_this select 0)];); - objects[] = {}; - class controlsBackground { - class Background { - idc = -1; - moving = 0; - font = "TahomaB"; - text = ""; - sizeEx = 0; - lineSpacing = 0; - access = 0; - type = 0; - style = 0; - size = 1; - colorBackground[] = {0, 0, 0, 0};//0.5 - colorText[] = {0, 0, 0, 0}; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; + idd = -1; + movingEnable = false; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgDisableMouse)),_this select 0)];); + objects[] = {}; + class controlsBackground { + class Background { + idc = -1; + moving = 0; + font = "TahomaB"; + text = ""; + sizeEx = 0; + lineSpacing = 0; + access = 0; + type = 0; + style = 0; + size = 1; + colorBackground[] = {0, 0, 0, 0};//0.5 + colorText[] = {0, 0, 0, 0}; + x = "safezoneX"; + y = "safezoneY"; + w = "safezoneW"; + h = "safezoneH"; + }; }; - }; }; diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index e470e91c95..53de6b5d69 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -4,6 +4,7 @@ // Load settings from profile if (hasInterface) then { call FUNC(loadSettingsFromProfile); + call FUNC(loadSettingsLocalizedText); }; // Listens for global "SettingChanged" events, to update the force status locally @@ -65,23 +66,47 @@ if (_currentVersion != _previousVersion) then { 0 spawn COMPILE_FILE(scripts\Version\checkVersionNumber); +// ACE events "ACEg" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); }; "ACEc" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); }; +// Synced ACE events +// Handle JIP scenario +if(!isServer) then { + ["PlayerJip", { + diag_log text format["[ACE] * JIP event synchronization initialized"]; + ["SEH_all", [player]] call FUNC(serverEvent); + }] call FUNC(addEventHandler); +} else { + ["SEH_all", FUNC(_handleRequestAllSyncedEvents)] call FUNC(addEventHandler); +}; +["SEH", FUNC(_handleSyncedEvent)] call FUNC(addEventHandler); +["SEH_s", FUNC(_handleRequestSyncedEvent)] call FUNC(addEventHandler); +[FUNC(syncedEventPFH), 0.5, []] call cba_fnc_addPerFrameHandler; + + +/***************************************************************/ +/***************************************************************/ +/***************************************************************/ +/***************************************************************/ +/***************************************************************/ + // everything that only player controlled machines need, goes below this if (!hasInterface) exitWith {}; call COMPILE_FILE(scripts\assignedItemFix); call COMPILE_FILE(scripts\initScrollWheel); -0 spawn { - while {true} do { - waitUntil {!isNull (findDisplay 46)}; sleep 0.1; - findDisplay 46 displayAddEventHandler ["MouseZChanged", QUOTE( _this call GVAR(onScrollWheel) )]; - [false] call FUNC(disableUserInput); - waitUntil {isNull (findDisplay 46)}; - }; +DFUNC(mouseZHandler) = { + waitUntil {!isNull (findDisplay 46)}; sleep 0.1; + findDisplay 46 displayAddEventHandler ["MouseZChanged", QUOTE( _this call GVAR(onScrollWheel) )]; + [false] call FUNC(disableUserInput); }; + +addMissionEventHandler ["Loaded", {[] spawn FUNC(mouseZHandler)}]; +[] spawn FUNC(mouseZHandler); + + enableCamShake true; // Set the name for the current player @@ -107,7 +132,6 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player; // PFH to raise varios events [{ - // "playerInventoryChanged" event _newPlayerInventory = [ACE_player] call FUNC(getAllGear); if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then { @@ -174,10 +198,36 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player; }, 0, []] call cba_fnc_addPerFrameHandler; + +// PFH to raise camera created event. Only works on these cams by BI. +#define ALL_CAMERAS [ \ + missionNamespace getVariable ["BIS_DEBUG_CAM", objNull], \ + missionNamespace getVariable ["BIS_fnc_camera_cam", objNull], \ + uiNamespace getVariable ["BIS_fnc_arsenal_cam", objNull], \ + uiNamespace getVariable ["BIS_fnc_animViewer_cam", objNull], \ + missionNamespace getVariable ["BIS_fnc_establishingShot_fakeUAV", objNull] \ +] + +GVAR(OldIsCamera) = false; + +[{ + + // "activeCameraChanged" event + _isCamera = {!isNull _x} count ALL_CAMERAS > 0; + if !(_isCamera isEqualTo GVAR(OldIsCamera)) then { + // Raise ACE event locally + GVAR(OldIsCamera) = _isCamera; + ["activeCameraChanged", [ACE_player, _isCamera]] call FUNC(localEvent); + }; + +}, 1, []] call cba_fnc_addPerFrameHandler; // feel free to decrease the sleep time if you need it. + + [QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable); ["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler); ["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler); +["medical_onUnconscious", {if (local (_this select 0) && {!(_this select 1)}) then {[ _this select 0, false, QUOTE(FUNC(loadPerson)), west /* dummy side */] call FUNC(switchToGroupSide);};}] call FUNC(addEventhandler); ["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithCondition); ["isNotInside", { @@ -188,3 +238,26 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player; // Players can always interact with passengers of the same vehicle {!((_this select 0) isEqualTo (_this select 1)) && {vehicle (_this select 0) == vehicle (_this select 1)}} }] call FUNC(addCanInteractWithCondition); + +// Lastly, do JIP events +// JIP Detection and event trigger. Run this at the very end, just in case anything uses it +if(isMultiplayer && { time > 0 || isNull player } ) then { + // We are jipping! Get ready and wait, and throw the event + [{ + if(!(isNull player)) then { + ["PlayerJip", [player] ] call FUNC(localEvent); + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + }, 0, []] call cba_fnc_addPerFrameHandler; +}; + +// check dlls +{ + if (_x callExtension "version" == "") then { + private "_errorMsg"; + _errorMsg = format ["Extension %1.dll not installed.", _x]; + + diag_log text format ["[ACE] ERROR: %1", _errorMsg]; + ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); + }; +} forEach getArray (configFile >> "ACE_Extensions" >> "extensions"); diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index b5382d0b5e..54a5118cb0 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -42,6 +42,7 @@ PREP(doAnimation); PREP(dropBackpack); PREP(endRadioTransmission); PREP(eraseCache); +PREP(errorMessage); PREP(execNextFrame); PREP(execPersistentFnc); PREP(execRemoteFnc); @@ -119,6 +120,7 @@ PREP(loadPerson); PREP(loadPersonLocal); PREP(loadSettingsFromProfile); PREP(loadSettingsOnServer); +PREP(loadSettingsLocalizedText); PREP(map); PREP(moduleCheckPBOs); PREP(moduleLSDVehicles); @@ -269,6 +271,21 @@ PREP(hashListSelect); PREP(hashListSet); PREP(hashListPush); +// Synchronized Events +PREP(syncedEventPFH); +PREP(addSyncedEventHandler); +PREP(removeSyncedEventHandler); +PREP(requestSyncedEvent); +PREP(syncedEvent); + +PREP(_handleSyncedEvent); +PREP(_handleRequestSyncedEvent); +PREP(_handleRequestAllSyncedEvents); + +GVAR(syncedEvents) = HASH_CREATE; + +// @TODO: Generic local-managed global-synced objects (createVehicleLocal) + //Debug ACE_COUNTERS = []; diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 90309af612..27647f8d00 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -22,6 +22,7 @@ class CfgPatches { #include "CfgActions.hpp" #include "CfgMoves.hpp" #include "CfgVoice.hpp" +#include "CfgUnitInsignia.hpp" class ACE_Rsc_Display_Base { idd = -1; @@ -69,9 +70,9 @@ class ACE_Settings { * force = 0; * * Does it appear on the options menu? - * isClientSetable = 1; + * isClientSettable = 1; * - * The following settings only apply when isClientSetable == 1 + * The following settings only apply when isClientSettable == 1 * Stringtable entry with the setting name * displayName = "$STR_ACE_Common_SettingName"; * @@ -90,14 +91,14 @@ class ACE_Settings { /*class GVAR(enableNumberHotkeys) { value = 1; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Common_EnableNumberHotkeys"; };*/ class GVAR(settingFeedbackIcons) { value = 1; typeName = "SCALAR"; force = 0; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Common_SettingFeedbackIconsName"; description = "$STR_ACE_Common_SettingFeedbackIconsDesc"; values[] = {"Hide", "Top right, downwards", "Top right, to the left", "Top left, downwards", "Top left, to the right"}; @@ -106,7 +107,7 @@ class ACE_Settings { value = 0; typeName = "SCALAR"; force = 0; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Common_SettingProgressbarLocationName"; description = "$STR_ACE_Common_SettingProgressbarLocationDesc"; values[] = {"Top", "Bottom"}; @@ -114,14 +115,14 @@ class ACE_Settings { class GVAR(displayTextColor) { value[] = {0,0,0,0.1}; typeName = "COLOR"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Common_SettingDisplayTextColorName"; description = "$STR_ACE_Common_SettingDisplayTextColorDesc"; }; class GVAR(displayTextFontColor) { value[] = {1,1,1,1}; typeName = "COLOR"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Common_SettingDisplayTextFontColorName"; description = "$STR_ACE_Common_SettingDisplayTextFontColorDesc"; }; @@ -152,3 +153,15 @@ class CfgUIGrids { }; }; }; + +/* +// check dll +class RscStandardDisplay; +class RscDisplayMain: RscStandardDisplay { + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayMain"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_5('header','tail',{0},{},_this select 0)] call COMPILE_FILE(functions\fnc_errorMessage)); +}; +*/ + +class ACE_Extensions { + extensions[] = {}; +}; diff --git a/addons/common/data/insignia_ace3logo_ca.paa b/addons/common/data/insignia_ace3logo_ca.paa new file mode 100644 index 0000000000..5a8ca321d7 Binary files /dev/null and b/addons/common/data/insignia_ace3logo_ca.paa differ diff --git a/addons/common/data/insignia_banana_ca.paa b/addons/common/data/insignia_banana_ca.paa new file mode 100644 index 0000000000..379fd9c733 Binary files /dev/null and b/addons/common/data/insignia_banana_ca.paa differ diff --git a/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf new file mode 100644 index 0000000000..7c566ce4d1 --- /dev/null +++ b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf @@ -0,0 +1,25 @@ +/* + * Author: jaynus + * + * Handles a server-side request for synchronization ALL events on JIP to a client. + * + * Argument: + * 0: client (object) + * + * Return value: + * Boolean of success + */ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +PARAMS_1(_client); + +{ + private["_eventName", "_eventEntry", "_eventLog"]; + _eventName = _x; + _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName); + _eventLog = _eventEntry select 1; + + ["SEH_s", _client, [_eventName, _eventLog] ] call FUNC(targetEvent); +} forEach (GVAR(syncedEvents) select 0); + +true \ No newline at end of file diff --git a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf new file mode 100644 index 0000000000..2d58aae869 --- /dev/null +++ b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf @@ -0,0 +1,45 @@ +/* + * Author: jaynus + * + * Receives either requests for synchronization from clients, or the synchronization data from the server. + * + * Arguments [Client] : + * 0: eventName (String) + * 1: eventLog (Array) + * + * Arguments [Server] : + * 0: eventName (String) + * 1: client (Object) + * + * Return value: + * Boolean of success + */ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +//SEH_s +if(isServer) then { + // Find the event name, and shovel out the events to the client + PARAMS_2(_eventName,_client); + private["_eventEntry", "_eventLog"]; + + if(!HASH_HASKEY(GVAR(syncedEvents),_eventName)) exitWith { + diag_log text format["[ACE] Error, request for synced event - key not found."]; + false + }; + _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName); + _eventLog = _eventEntry select 1; + + ["SEH_s", _client, [_eventName, _eventLog] ] call FUNC(targetEvent); +} else { + PARAMS_2(_eventName,_eventLog); + // This is the client handling the response from the server + // Start running the events + { + _eventArgs = _x select 1; + [_eventName, _eventArgs, (_x select 2)] call FUNC(_handleSyncedEvent); + } forEach _eventLog; + diag_log text format["[ACE] + [%1] synchronized", _eventName]; +}; + +true \ No newline at end of file diff --git a/addons/common/functions/fnc__handleSyncedEvent.sqf b/addons/common/functions/fnc__handleSyncedEvent.sqf new file mode 100644 index 0000000000..9807896358 --- /dev/null +++ b/addons/common/functions/fnc__handleSyncedEvent.sqf @@ -0,0 +1,36 @@ +/* + * Author: jaynus + * + * Handles synced events being received. Server will log them, and server/client will execute them. + * + * Arguments [Client] : + * 0: eventName (String) + * 1: arguments (Array) + * 2: ttl (Scalar) + * + * Return value: + * Boolean of success + */ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +PARAMS_3(_name,_args,_ttl); +private["_internalData", "_eventLog", "_eventCode"]; + +if(!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { + diag_log text format["[ACE] Error, synced event key not found."]; + false +}; + +_internalData = HASH_GET(GVAR(syncedEvents),_name); + +if(isServer) then { + // Server needs to internally log it for synchronization + if(_ttl > -1) then { + _internalData = HASH_GET(GVAR(syncedEvents),_name); + _eventLog = _internalData select 1; + _eventLog pushback [diag_tickTime, _args, _ttl]; + }; +}; + +_eventCode = _internalData select 0; +_args call _eventCode; \ No newline at end of file diff --git a/addons/common/functions/fnc_addActionEventHandler.sqf b/addons/common/functions/fnc_addActionEventHandler.sqf index a75b1537d1..a0e9d24f2c 100644 --- a/addons/common/functions/fnc_addActionEventHandler.sqf +++ b/addons/common/functions/fnc_addActionEventHandler.sqf @@ -31,7 +31,11 @@ if (typeName _statement == "STRING") then { _name = format ["ACE_Action_%1", _action]; -_actionsVar = _unit getVariable [_name, [-1, [-1, [], []]]]; +_actionsVar = _unit getVariable [_name, [-1, [-1, [], []], objNull]]; + +if (_unit != _actionsVar select 2) then { // check if the unit is still valid, fixes respawn issues + _actionsVar = [-1, [-1, [], []], objNull]; +}; _actionID = _actionsVar select 0; _actions = _actionsVar select 1; @@ -65,6 +69,6 @@ if (_actionID == -1) then { _actionID = _unit addAction _addAction; }; -_unit setVariable [_name, [_actionID, [_id, _actionIDs, _actions]], false]; +_unit setVariable [_name, [_actionID, [_id, _actionIDs, _actions], _unit], false]; _id diff --git a/addons/common/functions/fnc_addSyncedEventHandler.sqf b/addons/common/functions/fnc_addSyncedEventHandler.sqf new file mode 100644 index 0000000000..5d2b221178 --- /dev/null +++ b/addons/common/functions/fnc_addSyncedEventHandler.sqf @@ -0,0 +1,32 @@ +/* + * Author: jaynus + * + * Register an event handler for an ACE synced event + * + * Argument: + * 0: Name (String) + * 1: Handler (Code) + * 2: TTL (Number or Code) [Optional] + * + * Return value: + * Boolean of success + */ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +PARAMS_2(_name,_handler); + +private["_ttl", "_eventId", "_data"]; +if( (count _this) > 2) then { + _ttl = _this select 2; +} else { + _ttl = 0; +}; + +if(HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { + diag_log text format["[ACE] Error, duplicate synced event creation."]; + false +}; + +_eventId = [_name, FUNC(_handleSyncedEvent)] call FUNC(addEventHandler); +_data = [_handler,[],_ttl,_eventId]; +HASH_SET(GVAR(syncedEvents),_name,_data); \ No newline at end of file diff --git a/addons/common/functions/fnc_disableAI.sqf b/addons/common/functions/fnc_disableAI.sqf index 92ad35c0f9..0e1985eced 100644 --- a/addons/common/functions/fnc_disableAI.sqf +++ b/addons/common/functions/fnc_disableAI.sqf @@ -27,7 +27,7 @@ if ((local _unit) && {!([_unit] call EFUNC(common,isPlayer))}) then { _unit disableConversation true; } else { //Sanity check to make sure we don't enable unconsious AI - if (_unit getVariable ["ace_isunconscious", false]) exitWith {ERROR("Enabling AI for unconsious unit");}; + if (_unit getVariable ["ace_isunconscious", false] && alive _unit) exitWith {ERROR("Enabling AI for unconsious unit");}; _unit enableAI "MOVE"; _unit enableAI "TARGET"; _unit enableAI "AUTOTARGET"; diff --git a/addons/common/functions/fnc_disableUserInput.sqf b/addons/common/functions/fnc_disableUserInput.sqf index 57be44fe43..0b1275e9cf 100644 --- a/addons/common/functions/fnc_disableUserInput.sqf +++ b/addons/common/functions/fnc_disableUserInput.sqf @@ -1,14 +1,16 @@ /* * Author: commy2 - * * Disables key input. ESC can still be pressed to open the menu. * - * Argument: - * 0: True to disable key inputs, false to re-enable them (Bool) + * Arguments: + * 0: True to disable key inputs, false to re-enable them * * Return value: * Nothing + * + * Public: Yes */ + #include "script_component.hpp" private ["_state", "_dlg"]; @@ -16,76 +18,93 @@ private ["_state", "_dlg"]; _state = _this select 0; if (_state) then { - disableSerialization; + disableSerialization; - if (!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])) exitWith {}; - if ("ACE_DisableUserInput" in ([BIS_stackedEventHandlers_onEachFrame, {_this select 0}] call FUNC(map))) exitWith {}; + if (!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])) exitWith {}; + if ("ACE_DisableUserInput" in ([BIS_stackedEventHandlers_onEachFrame, {_this select 0}] call FUNC(map))) exitWith {}; - // end TFAR and ACRE2 radio transmissions - 0 spawn FUNC(endRadioTransmission); + // end TFAR and ACRE2 radio transmissions + call FUNC(endRadioTransmission); - // Close map - if (visibleMap && {!(player getVariable ["ACE_canSwitchUnits", false])}) then {openMap false}; + // Close map + if (visibleMap && {!(player getVariable ["ACE_canSwitchUnits", false])}) then { + openMap false; + }; - closeDialog 0; - createDialog QGVAR(DisableMouse_Dialog); + closeDialog 0; + createDialog QGVAR(DisableMouse_Dialog); - _dlg = uiNamespace getVariable QGVAR(dlgDisableMouse); + _dlg = uiNamespace getVariable QGVAR(dlgDisableMouse); - _dlg displayAddEventHandler ["KeyDown", { - _key = _this select 1; - - if (_key == 1 && {alive player}) then { - createDialog (["RscDisplayInterrupt", "RscDisplayMPInterrupt"] select isMultiplayer); - - disableSerialization; - _dlg = finddisplay 49; - _dlg displayAddEventHandler ["KeyDown", { + _dlg displayAddEventHandler ["KeyDown", { _key = _this select 1; - !(_key == 1) - }]; - for "_index" from 100 to 2000 do { - (_dlg displayCtrl _index) ctrlEnable false; - }; + if (_key == 1 && {alive player}) then { + createDialog (["RscDisplayInterrupt", "RscDisplayMPInterrupt"] select isMultiplayer); - _ctrl = _dlg displayctrl 103; - _ctrl ctrlSetEventHandler ["buttonClick", QUOTE(while {!isNull (uiNamespace getVariable [ARR_2(QUOTE(QGVAR(dlgDisableMouse)),displayNull)])} do {closeDialog 0}; failMission 'LOSER'; [false] call DFUNC(disableUserInput);)]; - _ctrl ctrlEnable true; - _ctrl ctrlSetText "ABORT"; - _ctrl ctrlSetTooltip "Abort."; + disableSerialization; + _dlg = finddisplay 49; + _dlg displayAddEventHandler ["KeyDown", { + _key = _this select 1; + !(_key == 1) + }]; - _ctrl = _dlg displayctrl ([104, 1010] select isMultiplayer); - _ctrl ctrlSetEventHandler ["buttonClick", QUOTE(closeDialog 0; player setDamage 1; [false] call DFUNC(disableUserInput);)]; - _ctrl ctrlEnable (call {_config = missionConfigFile >> "respawnButton"; !isNumber _config || {getNumber _config == 1}}); - _ctrl ctrlSetText "RESPAWN"; - _ctrl ctrlSetTooltip "Respawn."; - }; + for "_index" from 100 to 2000 do { + (_dlg displayCtrl _index) ctrlEnable false; + }; - if (_key in actionKeys "TeamSwitch" && {teamSwitchEnabled}) then {(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; teamSwitch};//_acc = accTime; teamSwitch; setAccTime _acc}; - if (_key in actionKeys "CuratorInterface" && {getAssignedCuratorLogic player in allCurators}) then {(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; openCuratorInterface}; - if (_key in actionKeys "ShowMap" && {player getVariable ["ACE_canSwitchUnits", false]}) then {(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; openMap true}; + _ctrl = _dlg displayctrl 103; + _ctrl ctrlSetEventHandler ["buttonClick", QUOTE(while {!isNull (uiNamespace getVariable [ARR_2(QUOTE(QGVAR(dlgDisableMouse)),displayNull)])} do {closeDialog 0}; failMission 'LOSER'; [false] call DFUNC(disableUserInput);)]; + _ctrl ctrlEnable true; + _ctrl ctrlSetText "ABORT"; + _ctrl ctrlSetTooltip "Abort."; - if (serverCommandAvailable "#missions" || {player getVariable ["ACE_isUnconscious", false] && {(call FUNC(player)) getVariable [QEGVAR(medical,AllowChatWhileUnconscious), missionNamespace getVariable [QEGVAR(medical,AllowChatWhileUnconscious), false]]}}) then { - if (!(_key in (actionKeys "DefaultAction" + actionKeys "Throw")) && {_key in (actionKeys "Chat" + actionKeys "PrevChannel" + actionKeys "NextChannel")}) then { - _key = 0; - }; - }; + _ctrl = _dlg displayctrl ([104, 1010] select isMultiplayer); + _ctrl ctrlSetEventHandler ["buttonClick", QUOTE(closeDialog 0; player setDamage 1; [false] call DFUNC(disableUserInput);)]; + _ctrl ctrlEnable (call {_config = missionConfigFile >> "respawnButton"; !isNumber _config || {getNumber _config == 1}}); + _ctrl ctrlSetText "RESPAWN"; + _ctrl ctrlSetTooltip "Respawn."; + }; - _key > 0 - }]; - _dlg displayAddEventHandler ["KeyUp", {true}]; + if (_key in actionKeys "TeamSwitch" && {teamSwitchEnabled}) then { + (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; + _acc = accTime; + teamSwitch; + setAccTime _acc; + }; + + if (_key in actionKeys "CuratorInterface" && {getAssignedCuratorLogic player in allCurators}) then { + (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; + openCuratorInterface; + }; + + if (_key in actionKeys "ShowMap" && {player getVariable ["ACE_canSwitchUnits", false]}) then { + (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; + openMap true; + }; + + if (serverCommandAvailable "#missions" || {player getVariable ["ACE_isUnconscious", false] && {(call FUNC(player)) getVariable [QEGVAR(medical,AllowChatWhileUnconscious), missionNamespace getVariable [QEGVAR(medical,AllowChatWhileUnconscious), false]]}}) then { + if (!(_key in (actionKeys "DefaultAction" + actionKeys "Throw")) && {_key in (actionKeys "Chat" + actionKeys "PrevChannel" + actionKeys "NextChannel")}) then { + _key = 0; + }; + }; + + _key > 0 + }]; + + _dlg displayAddEventHandler ["KeyUp", {true}]; + + ["ACE_DisableUserInput", "onEachFrame", { + if (isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) && {!visibleMap && isNull findDisplay 49 && isNull findDisplay 312 && isNull findDisplay 632}) then { + ["ACE_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; + [true] call FUNC(disableUserInput); + }; + }] call BIS_fnc_addStackedEventHandler; - ["ACE_DisableUserInput", "onEachFrame", { - if (isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) && {!visibleMap && isNull findDisplay 49 && isNull findDisplay 312 && isNull findDisplay 632}) then { - ["ACE_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; - [true] call FUNC(disableUserInput); - }; - }] call BIS_fnc_addStackedEventHandler; } else { - if ("ACE_DisableUserInput" in ([BIS_stackedEventHandlers_onEachFrame, {_this select 0}] call FUNC(map))) then { - ["ACE_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; - }; + if ("ACE_DisableUserInput" in ([BIS_stackedEventHandlers_onEachFrame, {_this select 0}] call FUNC(map))) then { + ["ACE_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; + }; - (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; + (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; }; diff --git a/addons/common/functions/fnc_errorMessage.sqf b/addons/common/functions/fnc_errorMessage.sqf new file mode 100644 index 0000000000..e061772942 --- /dev/null +++ b/addons/common/functions/fnc_errorMessage.sqf @@ -0,0 +1,144 @@ +/* + * Author: commy2, based on BIS_fnc_errorMsg and BIS_fnc_guiMessage by Karel Moricky (BI) + * Stops simulation and opens a textbox with error message. + * + * Arguments: + * ? + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +disableSerialization; +endLoadingScreen; + +private ["_textHeader", "_textMessage", "_onOK", "_onCancel"]; + +_textHeader = _this select 0; +_textMessage = _this select 1; +_onOK = ARR_SELECT(_this,2,{}); +_onCancel = ARR_SELECT(_this,3,{}); + +if (typeName _textMessage == "STRING") then { + _textMessage = parseText _textMessage; +}; + +(ARR_SELECT(_this,4,call BIS_fnc_displayMission)) createDisplay "RscDisplayCommonMessagePause"; + +private ["_display", "_ctrlRscMessageBox", "_ctrlBcgCommonTop", "_ctrlBcgCommon", "_ctrlText", "_ctrlBackgroundButtonOK", "_ctrlBackgroundButtonMiddle", "_ctrlBackgroundButtonCancel", "_ctrlButtonOK", "_ctrlButtonCancel"]; + +_display = uiNamespace getVariable "RscDisplayCommonMessage_display"; +_ctrlRscMessageBox = _display displayCtrl 2351; +_ctrlBcgCommonTop = _display displayCtrl 235100; +_ctrlBcgCommon = _display displayCtrl 235101; +_ctrlText = _display displayCtrl 235102; +_ctrlBackgroundButtonOK = _display displayCtrl 235103; +_ctrlBackgroundButtonMiddle = _display displayCtrl 235104; +_ctrlBackgroundButtonCancel = _display displayCtrl 235105; +_ctrlButtonOK = _display displayCtrl 235106; +_ctrlButtonCancel = _display displayCtrl 235107; + +_ctrlBcgCommonTop ctrlSetText _textHeader; + +private ["_ctrlButtonOKPos", "_ctrlBcgCommonPos", "_bottomSpaceY", "_ctrlTextPos", "_marginX", "_marginY"]; + +_ctrlButtonOKPos = ctrlPosition _ctrlButtonOK; +_ctrlBcgCommonPos = ctrlPosition _ctrlBcgCommon; +_bottomSpaceY = (_ctrlButtonOKPos select 1) - ((_ctrlBcgCommonPos select 1) + (_ctrlBcgCommonPos select 3)); + +_ctrlTextPos = ctrlPosition _ctrlText; +_marginX = (_ctrlTextPos select 0) - (_ctrlBcgCommonPos select 0); +_marginY = (_ctrlTextPos select 1) - (_ctrlBcgCommonPos select 1); + +private ["_ctrlTextPosH", "_bottomPosY"]; + +_ctrlText ctrlSetStructuredText _textMessage; +_ctrlTextPosH = ctrlTextHeight _ctrlText; + +_ctrlBcgCommon ctrlSetPosition [ + _ctrlBcgCommonPos select 0, + _ctrlBcgCommonPos select 1, + _ctrlBcgCommonPos select 2, + _ctrlTextPosH + _marginY * 2 +]; +_ctrlBcgCommon ctrlCommit 0; + +_ctrlText ctrlSetPosition [ + (_ctrlBcgCommonPos select 0) + _marginX, + (_ctrlBcgCommonPos select 1) + _marginY, + (_ctrlBcgCommonPos select 2) - _marginX * 2, + _ctrlTextPosH +]; +_ctrlText ctrlCommit 0; + +_bottomPosY = (_ctrlBcgCommonPos select 1) + _ctrlTextPosH + (_marginY * 2) + _bottomSpaceY; + +{ + private "_xPos"; + _xPos = ctrlPosition _x; + + _xPos set [1, _bottomPosY]; + _x ctrlSetPosition _xPos; + _x ctrlCommit 0; +} foreach [ + _ctrlBackgroundButtonOK, + _ctrlBackgroundButtonMiddle, + _ctrlBackgroundButtonCancel, + _ctrlButtonOK, + _ctrlButtonCancel +]; + +private ["_ctrlRscMessageBoxPos", "_ctrlRscMessageBoxPosH"]; + +_ctrlRscMessageBoxPos = ctrlPosition _ctrlRscMessageBox; +_ctrlRscMessageBoxPosH = _bottomPosY + (_ctrlButtonOKPos select 3); + +_ctrlRscMessageBox ctrlSetPosition [ + 0.5 - (_ctrlBcgCommonPos select 2) / 2, + 0.5 - _ctrlRscMessageBoxPosH / 2, + (_ctrlBcgCommonPos select 2) + 0.5, + _ctrlRscMessageBoxPosH +]; + +_ctrlRscMessageBox ctrlEnable true; +_ctrlRscMessageBox ctrlCommit 0; + +if (_onOK isEqualTo {}) then { + _ctrlButtonOK ctrlEnable false; + _ctrlButtonOK ctrlSetFade 0; + _ctrlButtonOK ctrlSetText ""; + _ctrlButtonOK ctrlCommit 0; +} else { + _ctrlButtonOK ctrlEnable true; + _ctrlButtonOK ctrlSetFade 0; + _ctrlButtonOK ctrlSetText localize "STR_DISP_OK"; + _ctrlButtonOK ctrlCommit 0; + + ctrlSetFocus _ctrlButtonOK; +}; + +if (_onCancel isEqualTo {}) then { + _ctrlButtonCancel ctrlEnable false; + _ctrlButtonCancel ctrlSetFade 0; + _ctrlButtonCancel ctrlSetText ""; + _ctrlButtonCancel ctrlCommit 0; +} else { + _ctrlButtonCancel ctrlEnable true; + _ctrlButtonCancel ctrlSetFade 0; + _ctrlButtonCancel ctrlSetText localize "STR_DISP_CANCEL"; + _ctrlButtonCancel ctrlCommit 0; + + ctrlSetFocus _ctrlButtonCancel; +}; + +_ctrlButtonOK ctrlAddEventHandler ["buttonClick", {(ctrlParent (_this select 0)) closeDisplay 1; true}]; +_ctrlButtonCancel ctrlAddEventHandler ["buttonClick", {(ctrlParent (_this select 0)) closeDisplay 2; true}]; + +GVAR(errorOnOK) = _onOK; +GVAR(errorOnCancel) = _onCancel; + +_display displayAddEventHandler ["unload", {call ([{}, GVAR(errorOnOK), GVAR(errorOnCancel)] select (_this select 1))}]; +_display displayAddEventHandler ["keyDown", {_this select 1 == 1}]; diff --git a/addons/common/functions/fnc_getDeathAnim.sqf b/addons/common/functions/fnc_getDeathAnim.sqf index d5185e6562..1e84224b0f 100644 --- a/addons/common/functions/fnc_getDeathAnim.sqf +++ b/addons/common/functions/fnc_getDeathAnim.sqf @@ -1,38 +1,51 @@ -/** - * fn_getDeathAnim.sqf - * @Descr: Get the death animation for the unit at current time - * @Author: Glowbal +/* + * Author: Glowbal, PabstMirror + * Get the death animation for the unit at current time * - * @Arguments: [unit OBJECT] - * @Return: STRING animation - * @PublicAPI: true + * Arguments: + * 0: unit + * + * Return Value: + * animation + * + * Example: + * [bob] call ace_common_fnc_getDeathAnim; + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_curAnim", "_animation", "_cfg","_unitAnimation", "_animationState"]; -_unit = _this select 0; +PARAMS_1(_unit); -if (vehicle _unit != _unit) exitwith { - _animation = ""; - _animationState = (animationState _unit); - _unitAnimation = (configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState); - if (isText (_unitAnimation >> "actions")) then { - if ((vehicle _unit) != _unit) then { - _cfg = (configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState); - if (isArray (_cfg >> "interpolateTo")) then { - _animation = getArray (_cfg >> "interpolateTo") select 0; - }; - } else { - _cfg = (configFile >> "CfgMovesBasic" >> "Actions" >> (getText (_unitAnimation >> "actions")) >> "die"); - if (isText _cfg) then { - _animation = getText _cfg; - }; +private ["_returnAnimation", "_animationState", "_unitAnimationCfg", "_unitActionsCfg", "_interpolateArray", "_indexAnimation", "_index"]; + +_returnAnimation = ""; + +_animationState = (animationState _unit); +_unitAnimationCfg = (configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState); +//If we're already in a terminal animation just return current +if ((getNumber (_unitAnimationCfg >> "terminal")) == 1) exitWith {_animationState}; + +_unitActionsCfg = (configFile >> "CfgMovesBasic" >> "Actions" >> (getText (_unitAnimationCfg >> "actions"))); + +TRACE_2("Animation/Action", configName _unitAnimationCfg, configName _unitActionsCfg); + +if ((vehicle _unit) != _unit) then { + _interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo"); + for "_index" from 0 to (count _interpolateArray - 1) step 2 do { + _indexAnimation = _interpolateArray select _index; + //No guarentee that first animation will be right so scan for the first "terminal" animation + //E.G.: interpolateTo[] = {"passenger_apc_generic04still",1,"KIA_passenger_apc_generic04",1}; + + if ((getNumber ((configFile >> "CfgMovesMaleSdr" >> "States" >> _indexAnimation) >> "terminal")) == 1) exitWith { + _returnAnimation = _indexAnimation; }; }; - if (isnil "_animation") then { - _animation = ""; - }; - _animation; +} else { + _returnAnimation = getText (_unitActionsCfg >> "die"); }; -"Unconscious"; +//Fallback if nothing valid found: +if (_returnAnimation == "") then {_returnAnimation = "Unconscious"}; + +_returnAnimation diff --git a/addons/common/functions/fnc_loadPersonLocal.sqf b/addons/common/functions/fnc_loadPersonLocal.sqf index 6e31050cf9..ccde28b9aa 100644 --- a/addons/common/functions/fnc_loadPersonLocal.sqf +++ b/addons/common/functions/fnc_loadPersonLocal.sqf @@ -30,7 +30,12 @@ if (!([_unit] call FUNC(isAwake))) then { _vehicle = _this select 1; waituntil {vehicle _unit == _vehicle}; sleep 0.5; - [_unit,([_unit] call FUNC(getDeathAnim)), 1] call FUNC(doAnimation); + + //Save the "awake" animation before applying the death animation + if (vehicle _unit == _vehicle) then { + _unit setVariable [QEGVAR(medical,vehicleAwakeAnim), [_vehicle, (animationState _unit)]]; + }; + [_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call FUNC(doAnimation); }; } else { if ([_unit] call FUNC(isArrested)) then { diff --git a/addons/common/functions/fnc_loadSettingsFromProfile.sqf b/addons/common/functions/fnc_loadSettingsFromProfile.sqf index 69d86eac98..7cb99e3400 100644 --- a/addons/common/functions/fnc_loadSettingsFromProfile.sqf +++ b/addons/common/functions/fnc_loadSettingsFromProfile.sqf @@ -13,6 +13,8 @@ */ #include "script_component.hpp" +private ["_name", "_isClientSetable", "_isForced", "_profileValue"]; + // Iterate through settings { _name = _x select 0; @@ -34,4 +36,5 @@ }; }; }; + } forEach GVAR(settings); diff --git a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf new file mode 100644 index 0000000000..280a1e9907 --- /dev/null +++ b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf @@ -0,0 +1,48 @@ +/* + * Author: Glowbal + * Parse all settings and load the localized displayName and description for all text + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +private ["_parseConfigForDisplayNames", "_name"]; + +_parseConfigForDisplayNames = { + private "_optionEntry"; + _optionEntry = _this select 0; + if !(isClass _optionEntry) exitwith {false}; + _x set [3, getText (_optionEntry >> "displayName")]; + _x set [4, getText (_optionEntry >> "description")]; + + private "_values"; + _values = _x select 5; + { + private "_text"; + _text = _x; + if (((typeName _text) == "STRING") && {(count _text) > 1} && {(_text select [0,1]) == "$"}) then { + _text = localize (_text select [1, ((count _text) - 1)]); //chop off the leading $ + _values set [_forEachIndex, _text]; + }; + } forEach _values; + true; +}; + + +// Iterate through settings +{ + _name = _x select 0; + + if !([configFile >> "ACE_Settings" >> _name] call _parseConfigForDisplayNames) then { + if !([configFile >> "ACE_ServerSettings" >> _name] call _parseConfigForDisplayNames) then { + [missionConfigFile >> "ACE_Settings" >> _name] call _parseConfigForDisplayNames; + }; + }; + +} forEach GVAR(settings); diff --git a/addons/common/functions/fnc_progressBar.sqf b/addons/common/functions/fnc_progressBar.sqf index 3191a57d72..f7d927556c 100644 --- a/addons/common/functions/fnc_progressBar.sqf +++ b/addons/common/functions/fnc_progressBar.sqf @@ -26,7 +26,7 @@ PARAMS_4(_totalTime,_args,_onFinish,_onFail); DEFAULT_PARAM(4,_localizedTitle,""); DEFAULT_PARAM(5,_condition,{true}); DEFAULT_PARAM(6,_exceptions,[]); -private ["_player", "_perFrameFunction"]; +private ["_player", "_perFrameFunction", "_ctrlPos"]; _player = ACE_player; @@ -35,14 +35,17 @@ closeDialog 0; createDialog QGVAR(ProgressBar_Dialog); (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetText _localizedTitle; -if (GVAR(SettingProgressBarLocation) == 1) then { - private "_ctrlPos"; - _ctrlPos = [1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2), 29 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2), 38 * (((safezoneW / safezoneH) min 1.2) / 40), 0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)]; - (uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlSetPosition _ctrlPos; - (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetPosition _ctrlPos; - (uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlCommit 0; - (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlCommit 0; -}; +//Adjust position based on user setting: +_ctrlPos = ctrlPosition (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)); +_ctrlPos set [1, ((0 + 29 * GVAR(SettingProgressBarLocation)) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))]; + +(uiNamespace getVariable QGVAR(ctrlProgressBG)) ctrlSetPosition _ctrlPos; +(uiNamespace getVariable QGVAR(ctrlProgressBG)) ctrlCommit 0; +(uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlSetPosition _ctrlPos; +(uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlCommit 0; +(uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetPosition _ctrlPos; +(uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlCommit 0; + _perFrameFunction = { diff --git a/addons/common/functions/fnc_removeActionEventHandler.sqf b/addons/common/functions/fnc_removeActionEventHandler.sqf index 7d92b3de75..2bcc970ab0 100644 --- a/addons/common/functions/fnc_removeActionEventHandler.sqf +++ b/addons/common/functions/fnc_removeActionEventHandler.sqf @@ -23,7 +23,7 @@ if (_id == -1) exitWith {}; _name = format ["ACE_Action_%1", _action]; -_actionsVar = _unit getVariable [_name, [-1, [-1, [], []]]]; +_actionsVar = _unit getVariable [_name, [-1, [-1, [], []], objNull]]; _actionID = _actionsVar select 0; _actions = _actionsVar select 1; @@ -32,6 +32,8 @@ _currentID = _actions select 0; _actionIDs = _actions select 1; _actions = _actions select 2; +if (_unit != _actionsVar select 2) exitWith {}; + _id = _actionIDs find _id; if (_id == -1) exitWith {}; @@ -47,4 +49,4 @@ if (count _actions == 0) then { _actionID = -1; }; -_unit setVariable [_name, [_actionID, [_currentID, _actionIDs, _actions]], false]; +_unit setVariable [_name, [_actionID, [_currentID, _actionIDs, _actions], _unit], false]; diff --git a/addons/common/functions/fnc_removeSyncedEventHandler.sqf b/addons/common/functions/fnc_removeSyncedEventHandler.sqf new file mode 100644 index 0000000000..6429120bbe --- /dev/null +++ b/addons/common/functions/fnc_removeSyncedEventHandler.sqf @@ -0,0 +1,24 @@ +/* + * Author: jaynus + * + * Remove a synced event handler + * + * Argument: + * 0: Name (String) + * + * Return value: + * Boolean of success + */ +#include "script_component.hpp" +PARAMS_1(_name); + +if(!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { + diag_log text format["[ACE] Error, synced event key not found."]; + false +}; + +_data = HASH_GET(GVAR(syncedEvents),_name); +_eventId = _data select 3; + +[_eventId] call ace_common_fnc_removeEventHandler; +HASH_REM(GVAR(syncedEvents),_name); \ No newline at end of file diff --git a/addons/common/functions/fnc_requestSyncedEvent.sqf b/addons/common/functions/fnc_requestSyncedEvent.sqf new file mode 100644 index 0000000000..dea0c7adef --- /dev/null +++ b/addons/common/functions/fnc_requestSyncedEvent.sqf @@ -0,0 +1,19 @@ +/* + * Author: jaynus + * + * Send a request to synchronize an event name from the client->server. Execute on client only. + * + * Argument: + * 0: eventName (String) + * + * Return value: + * Boolean of success + */ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +PARAMS_1(_eventName); + +// Only JIP machines on initialization send this off, requesting sync on events with the serverCommand +if(isServer) exitWith { false }; + +["SEH_s", [_eventName, ACE_player] ] call ace_common_fnc_serverEvent; \ No newline at end of file diff --git a/addons/common/functions/fnc_resetAllDefaults.sqf b/addons/common/functions/fnc_resetAllDefaults.sqf index 63e6764d01..64a8e39fa6 100644 --- a/addons/common/functions/fnc_resetAllDefaults.sqf +++ b/addons/common/functions/fnc_resetAllDefaults.sqf @@ -37,3 +37,4 @@ if (isPlayer _unit) then { }; }foreach ([_unit] call FUNC(getAllDefinedSetVariables)); +_unit setVariable ["ACE_forceWalkStatusNumber", 0, true]; diff --git a/addons/common/functions/fnc_setForceWalkStatus.sqf b/addons/common/functions/fnc_setForceWalkStatus.sqf index 52b674015f..477f76297d 100644 --- a/addons/common/functions/fnc_setForceWalkStatus.sqf +++ b/addons/common/functions/fnc_setForceWalkStatus.sqf @@ -50,4 +50,4 @@ _bitmaskNumber = _forceWalkReasonsBooleans call FUNC(toBitmask); _unit setVariable ["ACE_forceWalkStatusNumber", _bitmaskNumber, true]; // actually apply the forceWalk command globaly -[[_unit], QUOTE(FUNC(applyForceWalkStatus)), _unit] call FUNC(execRemoteFnc); +[[_unit], QUOTE(FUNC(applyForceWalkStatus)), 2] call FUNC(execRemoteFnc); diff --git a/addons/common/functions/fnc_setHearingCapability.sqf b/addons/common/functions/fnc_setHearingCapability.sqf index 26d8ca98ac..76837b4433 100644 --- a/addons/common/functions/fnc_setHearingCapability.sqf +++ b/addons/common/functions/fnc_setHearingCapability.sqf @@ -52,4 +52,4 @@ _lowestVolume = 1; // Set Radio mod variables. player setVariable ["tf_globalVolume", _lowestVolume]; -player setVariable ["acre_sys_core_globalVolume", _lowestVolume]; +if (!isNil "acre_api_fnc_setGlobalVolume") then { [_lowestVolume^0.33] call acre_api_fnc_setGlobalVolume; }; diff --git a/addons/common/functions/fnc_setSettingFromConfig.sqf b/addons/common/functions/fnc_setSettingFromConfig.sqf index 9d93b9e62d..3a1b6fd055 100644 --- a/addons/common/functions/fnc_setSettingFromConfig.sqf +++ b/addons/common/functions/fnc_setSettingFromConfig.sqf @@ -58,7 +58,7 @@ if (isNil _name) then { /*_settingData = [ _name, _typeName, - _isClientSetable, + _isClientSettable, _localizedName, _localizedDescription, _possibleValues, @@ -68,7 +68,7 @@ if (isNil _name) then { _settingData = [ _name, _typeName, - (getNumber (_optionEntry >> "isClientSetable")) > 0, + (getNumber (_optionEntry >> "isClientSettable")) > 0, getText (_optionEntry >> "displayName"), getText (_optionEntry >> "description"), getArray (_optionEntry >> "values"), @@ -76,6 +76,18 @@ if (isNil _name) then { _value ]; + //Strings in the values array won't be localized from the config, so just do that now: + /*private "_values"; + _values = _settingData select 5; + { + _text = _x; + if (((typeName _text) == "STRING") && {(count _text) > 1} && {(_text select [0,1]) == "$"}) then { + _text = localize (_text select [1, ((count _text) - 1)]); //chop off the leading $ + _values set [_forEachIndex, _text]; + }; + } forEach _values;*/ + + GVAR(settings) pushBack _settingData; } else { diff --git a/addons/common/functions/fnc_setVolume.sqf b/addons/common/functions/fnc_setVolume.sqf index ee2c42e39c..133a09bd24 100644 --- a/addons/common/functions/fnc_setVolume.sqf +++ b/addons/common/functions/fnc_setVolume.sqf @@ -27,8 +27,8 @@ if (_setVolume) then { player setVariable ["tf_unable_to_use_radio", false]; // ACRE2 - [NORMAL_LEVEL] call acre_api_fnc_setGlobalVolume; - player setVariable ["acre_sys_core_isDisabled", false, true]; + if (!isNil "acre_api_fnc_setGlobalVolume") then { [NORMAL_LEVEL^0.33] call acre_api_fnc_setGlobalVolume; }; + player setVariable ["acre_sys_core_isDisabled", false, true]; } else { // Vanilla Game @@ -40,7 +40,7 @@ if (_setVolume) then { player setVariable ["tf_unable_to_use_radio", true]; // ACRE2 - [MUTED_LEVEL] call acre_api_fnc_setGlobalVolume; + if (!isNil "acre_api_fnc_setGlobalVolume") then { [MUTED_LEVEL^0.33] call acre_api_fnc_setGlobalVolume; }; player setVariable ["acre_sys_core_isDisabled", true, true]; }; diff --git a/addons/common/functions/fnc_syncedEvent.sqf b/addons/common/functions/fnc_syncedEvent.sqf new file mode 100644 index 0000000000..70c30a19da --- /dev/null +++ b/addons/common/functions/fnc_syncedEvent.sqf @@ -0,0 +1,31 @@ +/* + * Author: jaynus + * + * Call and propegate a synced event + * + * Argument: + * 0: Name (String) + * 1: Arguments (Array) + * 2: TTL (Number or Code) [Optional] for this specific event call + * + * Return value: + * Boolean of success + */ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +PARAMS_2(_name,_args); +private["_ttl", "_eventData", "_internalData", "_eventLog"]; + +if( (count _this) > 2) then { + _ttl = _this select 2; +} else { + _ttl = 0; +}; + +if(!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { + diag_log text format["[ACE] Error, synced event key not found."]; + false +}; + +_eventData = [_name, _args,_ttl]; +["SEH", _eventData] call FUNC(globalEvent); \ No newline at end of file diff --git a/addons/common/functions/fnc_syncedEventPFH.sqf b/addons/common/functions/fnc_syncedEventPFH.sqf new file mode 100644 index 0000000000..e8a21202ab --- /dev/null +++ b/addons/common/functions/fnc_syncedEventPFH.sqf @@ -0,0 +1,52 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +if(!isServer) exitWith { false }; + +// Walk through the local synced events and clean up anything thats already EOL +// @TODO: This should be iteration limited to prevent FPS lag +private["_data"]; +{ + private["_data", "_ttl", "_eventLog", "_newEventLog", "_name"]; + _name = _x; + + _data = HASH_GET(GVAR(syncedEvents),_name); + _eventLog = _data select 1; + _globalEventTTL = _data select 2; + _newEventLog = []; + + // @TODO: This should be iteration limited to prevent FPS lag + { + private["_eventEntry", "_ttlReturn"]; + _eventEntry = _x; + + _ttlReturn = true; + if(typeName _globalEventTTL == "CODE") then { + _ttlReturn = [(_data select 0),_eventEntry] call _globalEventTTL; + } else { + _ttlReturn = call { _globalEventTTL < 1 || {diag_tickTime < (_eventEntry select 0) + _globalEventTTL} }; + }; + + if(_ttlReturn) then { + // Do event based TTL check + private["_eventTTL"]; + _eventTTL = _eventEntry select 2; + + if(typeName _eventTTL == "CODE") then { + _ttlReturn = [(_data select 0),_eventEntry] call _eventTTL; + } else { + _ttlReturn = call { _eventTTL < 1 || {diag_tickTime < (_eventEntry select 0) + _eventTTL} }; + }; + }; + + // Finally drop it if the TTL check fails + if(_ttlReturn) then { + _newEventLog pushBack _x; + }; + } forEach _eventLog; + + _data set[1, _newEventLog]; +} forEach (GVAR(syncedEvents) select 0); + + +// @TODO: Next, detect if we had a new request from a JIP player, and we need to continue syncing events diff --git a/addons/common/functions/fnc_unloadPerson.sqf b/addons/common/functions/fnc_unloadPerson.sqf index 33c0e9c0c2..60e4f56d7d 100644 --- a/addons/common/functions/fnc_unloadPerson.sqf +++ b/addons/common/functions/fnc_unloadPerson.sqf @@ -1,59 +1,44 @@ -/** - * fn_unloadPerson_f.sqf - * @Descr: Unload a person from a vehicle - * @Author: Glowbal +/* + * Author: Glowbal + * Unload a person from a vehicle * - * @Arguments: [caller OBJECT, unit OBJECT] - * @Return: BOOL Returns true if succesfully unloaded person - * @PublicAPI: true + * Arguments: + * 0: unit + * + * Return Value: + * Returns true if succesfully unloaded person + * + * Public: No */ #include "script_component.hpp" #define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson)) -private ["_caller", "_unit","_vehicle", "_loaded"]; -_caller = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; -_unit = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param; +private ["_unit","_vehicle", "_loaded", "_emptyPos"]; +_unit = _this select 0; _vehicle = vehicle _unit; if (_vehicle == _unit) exitwith {false;}; if !(speed _vehicle <1 && (((getpos _vehicle) select 2) < 2)) exitwith {false;}; -if (!([_caller] call FUNC(isAwake))) exitwith{false;}; -moveOut _unit; +_emptyPos = ((getPos _vehicle) findEmptyPosition [0, 10, typeof _unit]); +if (count _emptyPos == 0) exitwith {false}; + +_unit setPos _emptyPos; unassignVehicle _unit; if (!alive _unit) then { _unit action ["Eject", vehicle _unit]; }; -[_unit, false, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide); +[_unit, false, GROUP_SWITCH_ID, side group _unit] call FUNC(switchToGroupSide); _loaded = _vehicle getvariable [QGVAR(loaded_persons),[]]; _loaded = _loaded - [_unit]; _vehicle setvariable [QGVAR(loaded_persons),_loaded,true]; if (!([_unit] call FUNC(isAwake))) then { - _handle = [_unit,_vehicle] spawn { - private ["_unit","_vehicle"]; - _unit = _this select 0; - _vehicle = _this select 1; - waituntil {vehicle _unit != _vehicle}; - [_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call FUNC(doAnimation); - [format["Unit should move into death anim: %1", _unit]] call FUNC(debug); - }; -} else { - if ([_unit] call FUNC(isArrested)) then { - _handle = [_unit,_vehicle] spawn { - _unit = _this select 0; - _vehicle = _this select 1; - waituntil {vehicle _unit != _vehicle}; - [_unit,"UnaErcPoslechVelitele2", 1] call FUNC(doAnimation); - [format["Unit should move into arrested anim: %1", _unit]] call FUNC(debug); - }; - } else { - [format["Unit should move into normal anim: %1", _unit]] call FUNC(debug); - }; + [_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call FUNC(doAnimation); }; -true; \ No newline at end of file +true; diff --git a/addons/common/functions/fnc_worldToScreenBounds.sqf b/addons/common/functions/fnc_worldToScreenBounds.sqf index 7b88350c6a..afb5817d81 100644 --- a/addons/common/functions/fnc_worldToScreenBounds.sqf +++ b/addons/common/functions/fnc_worldToScreenBounds.sqf @@ -40,12 +40,13 @@ if (true) then { { _ppos = worldToScreen (_object modelToWorld _x); - _pposX = _ppos select 0; - _pposY = _ppos select 1; - if (_pposX < _minX) then {_minX = _pposX}; - if (_pposX > _maxX) then {_maxX = _pposX}; - if (_pposY < _minY) then {_minY = _pposY}; - if (_pposY > _maxY) then {_maxY = _pposY}; + if (count _ppos >= 2) then { + EXPLODE_2_PVT(_ppos,_pposX,_pposY); + if (_pposX < _minX) then {_minX = _pposX}; + if (_pposX > _maxX) then {_maxX = _pposX}; + if (_pposY < _minY) then {_minY = _pposY}; + if (_pposY > _maxY) then {_maxY = _pposY}; + }; //else - what to do if it is offscreen? } forEach _boundsCorners; }; diff --git a/addons/common/script_component.hpp b/addons/common/script_component.hpp index 279785f223..7c266c169d 100644 --- a/addons/common/script_component.hpp +++ b/addons/common/script_component.hpp @@ -11,4 +11,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_COMMON #endif -#include "\z\ace\addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index f29ff773a4..a78ff0a7fc 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -46,7 +46,7 @@ Options ACE ACE Настройки Opções do ACE - ACE Opciók + ACE Beállítások Opzioni ACE @@ -272,10 +272,11 @@ Desactivar menú de mando Wyłącz menu dowodzenia Vypnout velící menu - Désactiver Menu Commande + Désactiver menu commande Выключить командное меню Parancsnoki menü kikapcsolása Disabilita Menù di comando + Desabilitar menu de comando Unknown @@ -287,6 +288,7 @@ Ismeretlen Sconosciuto Inconnu + Desconhecido No Voice @@ -298,6 +300,7 @@ Nincs hang Senza voce Pas de voix + Sem voz Accept Requests @@ -308,6 +311,8 @@ Accetta Richieste Accepter requête Принять запросы + Kérések elfogadása + Aceitar Pedido Decline Requests @@ -318,6 +323,8 @@ Rifiuta Richieste Отклонить запросы Rejeter requête + Kérések elutasítása + Rejeitar pedido Accept Requests send by other players. These can be requests to use / share equipment, perform certain actions. @@ -325,10 +332,11 @@ Acepta peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones. Akceptuj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności. Accetta le richieste degli altri giocatori. Queste possono riguardare l'uso o la condivisione dell'equipaggiamento, o di determinate azioni. - Подтвердить запросы, посланные другими игроками. Это могут быть просьбы о передаче снаряжения или выполнении определённых действий. Přijimutí žádosti poslané jinými hráči. Mohou to být žádosti k použítí/sdílení vybavení nebo k vykonání určité činnosti. Принять запросы, отправленные другими игроками. Например, запросы на использование/совместное использование снаряжения, выполнение определенных действий - Accepter les requêtes d'autres joueurs. Comme l'utilisation / l'échange d'équipement, la réalistion d'actions. + Accepter les requêtes d'autres joueurs. Comme l'utilisation / l'échange d'équipement, la réalisation d'actions. + Más játékosok általi kérések elfogadása. Ezek a kérések vonatkozhatnak a felszerelés használatára/megosztására, valamint különböző cselekményekre. + Aceitar pedidos enviados por outros jogadores. Podem ser pedidos para usar/ compartilhar equipamento, realizar certas ações. Decline Requests send by other players. These can be requests to use / share equipment, perform certain actions. @@ -336,10 +344,11 @@ Rechazar peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones. Ignoruj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności. Rifiuta le richieste degli altri giocatori. Queste possono riguardare l'uso o la condivisione dell'equipaggiamento, o di determinate azioni. - Отклонить запросы, посланные другими игроками. Это могут быть просьбы о передаче снаряжения или выполнении определённых действий. Zamítnutí žádostii poslané jinými hráči. Mohou to být žádosti k použítí/sdílení vybavení nebo k vykonání určité činnosti. Отклонить запросы, отправленные другими игроками. Например, запросы на использование/совместное использование снаряжения, выполнение определенных действий - Rejeter les requêtes d'autres joueurs. Comme l'utilisation / l'échange d'équipement, la réalistion d'actions. + Rejeter les requêtes d'autres joueurs. Comme l'utilisation / l'échange d'équipement, la réalisation d'actions. + Más játékosok általi kérések elutasítása. Ezek a kérések vonatkozhatnak a felszerelés használatára/megosztására, valamint különböző cselekményekre. + Rejeita pedidos enviados por outros jogadores. Podem ser pedidos para usar/ compartilhar equipamento, realizar certas ações. Feedback icons @@ -350,6 +359,8 @@ Ikony pomocnicze Icones d'information Pomocné ikony + Visszajelző ikonok + Ícones de Feedback Select the position of or disable the feedback icons on your screen. These icons will show to provide extra feedback on your character status and actions performed. @@ -360,6 +371,8 @@ Ustaw pozycję lub wyłącz całkowicie ikony pomocnicze na ekranie. Te ikony dostarczają dodatkowych informacji na temat statusu Twojej postaci i wykonywanych przez nią akcji. Sélection de la position ou la désactivation des icones de feedback. Ces icones vous apportent des informations complémentaires sur votre status et sur les actions en cours. Nastavuje pozici nebo vypíná pomocné ikony. Tyto ikony ukazují extra informace ke stavu postavy a vykonávaných činností. + Itt beállítható a visszajelző ikonok képernyőn lévő helyzete és jelenléte. Ezek az ikonok extra visszajelzést biztosítanak a karaktered állapotán és végrehajtott cselekvésein. + Selecione a posição ou disabilite a posição dos ícones de feedback na sua tela. Esses ícones irão aparecer para mostrar feedback extra do status do seu personagem e ações realizadas. Progress bar location @@ -370,56 +383,68 @@ Lokalizacja paska postępu Position de la barre de progression Pozice ukazetele průběhu činnosti + Állapotjelző sáv helyzete + Local da barra de progresso Set the desired location of the progress bar on your screen. Setze die gewünschte Position der Fortschrittsanzeige fest. Seleccionar la ubicación deseada de la barra de progreso en tu pantalla - Modifica la posizione su schermo della barra di avanzamento. + Modifica la posizione della barra di avanzamernto sullo schermo Установите желаемое положение строки состояния на экране. Ustaw pożądaną lokalizację paska postępu na ekranie - Appliquer la postion de la barre de progression sur l'écran + Appliquer la position de la barre de progression sur l'écran Nastavuje pozici ukazetele průběhu činnosti na vaší obrazovce. + Itt beállítható az állapotjelző sáv képernyődön lévő helyzete. + Define o local desejado da barra de progresso na sua tela. Hint Background color Hintergrundfarbe der Hinweise Color de fondo de las notificaciones - Sfondo dei Suggerimenti + Colore di sfondo dei Suggerimenti Цвет фона всплывающих подсказок Kolor tła powiadomień Notification: couleur de l'arrière plan Barva pozadí nápovědy + Súgó háttérszíne + Cor do fundo da hint The color of the background from the ACE hints. Die Hintergrundfarbe der ACE-Hinweise. El color de fondo de las notificaciones del ACE Il colore di sfondo dei suggerimenti dell'ACE. - Цвет фона всплывающий подсказок АСЕ. + Цвет фона всплывающих подсказок АСЕ. Kolor tła dla powiadomień ACE - Notifications ACE: couleur de l'arrière plan + Notification ACE: couleur de l'arrière plan Barva pozadí ACE nápověd. + Az ACE-súgók hátterének színe. + A cor de fundo das hints do ACE. Hint text font color Textfarbe der Hinweise Color del texto de las notificaciones - Testo dei Suggerimenti + Il colore del Testo dei Suggerimenti Цвет шрифта всплывающих подсказок Kolor tekstu powiadomień Notification: couleur du texte Barva fontu nápověd. + Súgószöveg betűinek színe + Cor do do texto da hint The color of the text font from the ACE hints. This color is the default color for all text displayed through the ACE Hint system, if the hint text has no other color specified. Wähle die Textfarbe für ACE-Hinweise. Die gewählte Farbe wird als Standartfarbe der Hinweise angezeigt, wenn der Hinweis selbst keine spezifische Farbe hat. El color del texto de las notificaciones del ACE. Este es el color predeterminado para todo el texto que se muestra a través del sistema de notificaciones del ACE, si el texto de notificación no tiene otro color especificado. - Il colore del testo dei suggerimenti dell'ACE. Questo è il colore standard per tutti i caratteri mostrati dal sistema di suggerimenti dell'ACE, se questo non è altrimenti specificato. + Il colore del testo dei suggerimenti dell'ACE. Questo è il colore standard per tutti i caratteri mostrati dal sistema di suggerimenti dell'ACE, se il colore del testo non è specificato. Цвет шрифта текста всплывающих подсказок АСЕ. Этот цвет является стандартным для всего текста, транслирующегося через систему подсказок АСЕ, если не установлено другого цвета для текста подсказок. Kolor tekstu dla powiadomień ACE. Ten kolor jest domyślnym dla wszystkich tekstów wyświetlanych poprzez System Powiadomień ACE, jeżeli dla powiadomienia nie określono innego koloru. - Notification ACE: couleur du texte. C'est la couleur par défaut de tout texte afficher dans les notifications ACE, si aucune couleur n'est spécifiée pour les notifications + Notification ACE: couleur du texte. C'est la couleur par défaut de tout texte affiché dans les notifications ACE, si aucune couleur n'est spécifiée pour les notifications Barva fontu ACE nápověd. Toto je standardní barva pro všechen text zobrazovaný ACE nápovědami, pokud nemá nápověda žádnou specifikanou barvu. + Az ACE-súgók betűkészletének színek. Ez a szín alapértelmezett az összes szövegre az ACE-súgórendszerben, ha a súgószöveg maga nem ad meg más színt. + A cor do texto das hints do ACE. Essa cor é a cor default para todos os texos exibidos pelo sistema de hints do ACE , caso o texto da hint não tem outra cor especificada. Banana @@ -430,20 +455,20 @@ Банан Banan Banane + Banán + Banana A banana is an edible fruit, botanically a berry, produced by several kinds of large herbaceous flowering plants in the genus Musa. - Die Banane ist eine essbare Frucht, biologisch betrachtet jedoch eine Beere. Sie wächst an unterschiedlichen, krautartigen Gewächsen aus der Familie der Musa. + Die Bananen (Musa) sind eine Pflanzengattung in der Familie der Bananengewächse (Musaceae) innerhalb der Einkeimblättrigen Pflanzen (Monokotyledonen). Una banana es una fruta comestible, botanicamente una baya, producida por varios tipos de grandes plantas herbáceas del género Musa. Banán je protáhlé ovoce a plod banánovníku (epigeická bobule). - Una banana è un frutto commestibile, nello specifico una bacca cuoiosa, prodotto da un gran numero di grandi pianti erbacee dotate di fiori, della famiglia delle Musaceae. + Una banana è un frutto commestibile, nello specifico una bacca cuoiosa, prodotta da un gran numero di grandi piante erbacee dotate di fiori, della famiglia delle Musaceae. Банан - это съедобный фрукт, ягода с ботанической точки зрения, произрастающий на нескольких видах травянистых растениях рода Банан (Musa). + A banán egy ehető gyümölcs, technikai szempontból bogyótermés, melyet több fürtvirágzatú növény termel a Musa rendszertani nemzetségben. Rodzaj roślin z rodziny bananowatych, obejmujący około 80 gatunków.<br />Przedstawiciele są typowymi przedstawicielami flory międzyzwrotnikowej Azji, Afryki i Australii.<br />Część gatunków dostarcza jadalnych owoców. Słowo banan pochodzi prawdopodobnie od arabskiego słowa banan, co oznacza palec, lub afrykańskiego języka wolof, w którym rośliny te określa się mianem banaana. Une banane est un fruit qui, d'un point de vue botanique, fait partie du groupe des baies. Produite par plusieurs sortes de grandes plantes à fleurs herbacées du type Musa. - - - - Die Bananen (Musa) sind eine Pflanzengattung in der Familie der Bananengewächse (Musaceae) innerhalb der Einkeimblättrigen Pflanzen (Monokotyledonen). + A banana é uma fruta comestível, botanicamente uma baga, produzida por vários tipos de plantas herbáceas grandes do genero Musa. diff --git a/addons/disarming/functions/fnc_canBeDisarmed.sqf b/addons/disarming/functions/fnc_canBeDisarmed.sqf index 04171a900d..25ec884919 100644 --- a/addons/disarming/functions/fnc_canBeDisarmed.sqf +++ b/addons/disarming/functions/fnc_canBeDisarmed.sqf @@ -17,6 +17,8 @@ PARAMS_1(_target); +private ["_animationStateCfgMoves", "_putDownAnim"]; + //Check animationState for putDown anim //This ensures the unit doesn't have to actualy do any animation to drop something //This should always be true for the 3 possible status effects that allow disarming diff --git a/addons/disarming/functions/fnc_disarmDropItems.sqf b/addons/disarming/functions/fnc_disarmDropItems.sqf index 24ab96a2cf..2cb3e89b5d 100644 --- a/addons/disarming/functions/fnc_disarmDropItems.sqf +++ b/addons/disarming/functions/fnc_disarmDropItems.sqf @@ -20,6 +20,9 @@ #define TIME_MAX_WAIT 5 +private ["_fncSumArray", "_return", "_holder", "_dropPos", "_targetMagazinesStart", "_holderMagazinesStart", "_xClassname", "_xAmmo", "_targetMagazinesEnd", "_holderMagazinesEnd", "_holderItemsStart", "_targetItemsStart", "_addToCrateClassnames", "_addToCrateCount", "_index", "_holderItemsEnd", "_targetItemsEnd", "_holderIsEmpty"]; + + PARAMS_3(_caller,_target,_listOfItemsToRemove); DEFAULT_PARAM(3,_doNotDropAmmo,false); //By default units drop all weapon mags when dropping a weapon @@ -154,6 +157,8 @@ if (_holderIsEmpty) then { //Start the PFEH to do the actions (which could take >1 frame) [{ + private ["_needToRemoveWeapon", "_needToRemoveMagazines", "_needToRemoveBackpack", "_needToRemoveVest", "_needToRemoveUniform", "_error", "_magsToPickup", "_index", "_magazinesInHolder"]; + PARAMS_2(_args,_pfID); EXPLODE_8_PVT(_args,_caller,_target,_listOfItemsToRemove,_holder,_holderIsEmpty,_maxWaitTime,_doNotDropAmmo,_startingMagazines); diff --git a/addons/disarming/functions/fnc_eventTargetStart.sqf b/addons/disarming/functions/fnc_eventTargetStart.sqf index c91f717e2a..316ec2b656 100644 --- a/addons/disarming/functions/fnc_eventTargetStart.sqf +++ b/addons/disarming/functions/fnc_eventTargetStart.sqf @@ -20,6 +20,8 @@ PARAMS_3(_caller,_target,_listOfObjectsToRemove); +private "_itemsToAdd"; + _itemsToAdd = []; { if (_x == (uniform _target)) then { diff --git a/addons/disarming/functions/fnc_getAllGearUnit.sqf b/addons/disarming/functions/fnc_getAllGearUnit.sqf index d07f40c972..a319c006ee 100644 --- a/addons/disarming/functions/fnc_getAllGearUnit.sqf +++ b/addons/disarming/functions/fnc_getAllGearUnit.sqf @@ -17,6 +17,8 @@ PARAMS_1(_target); +private ["_allItems", "_classnamesCount", "_index", "_uniqueClassnames"]; + _allItems = ((weapons _target) + (magazines _target) + (items _target) + (assignedItems _target)); if ((backpack _target) != "") then { diff --git a/addons/disarming/functions/fnc_openDisarmDialog.sqf b/addons/disarming/functions/fnc_openDisarmDialog.sqf index 6da123b831..88e0e81be8 100644 --- a/addons/disarming/functions/fnc_openDisarmDialog.sqf +++ b/addons/disarming/functions/fnc_openDisarmDialog.sqf @@ -28,6 +28,7 @@ ] PARAMS_2(_caller,_target); +private "_display"; //Sanity Checks if (_caller != ACE_player) exitwith {ERROR("Player isn't caller?");}; @@ -59,6 +60,7 @@ GVAR(disarmTarget) = _target; //Setup PFEH [{ + private ["_groundContainer", "_targetContainer", "_playerName", "_rankPicture", "_rankIndex", "_targetUniqueItems", "_holderUniqueItems", "_holder"]; disableSerialization; EXPLODE_2_PVT(_this,_args,_pfID); EXPLODE_3_PVT(_args,_player,_target,_display); @@ -71,6 +73,7 @@ GVAR(disarmTarget) = _target; GVAR(disarmTarget) = objNull; if (!isNull _display) then {closeDialog 0;}; //close dialog if still open } else { + _groundContainer = _display displayCtrl 632; _targetContainer = _display displayCtrl 633; _playerName = _display displayCtrl 111; diff --git a/addons/disarming/functions/fnc_showItemsInListbox.sqf b/addons/disarming/functions/fnc_showItemsInListbox.sqf index e040233b82..5c809de4a2 100644 --- a/addons/disarming/functions/fnc_showItemsInListbox.sqf +++ b/addons/disarming/functions/fnc_showItemsInListbox.sqf @@ -19,7 +19,7 @@ disableSerialization; PARAMS_2(_listBoxCtrl,_itemsCountArray); -private "_classname"; +private ["_classname", "_count", "_displayName", "_picture"]; { _displayName = ""; diff --git a/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf b/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf index 779a5e39ba..e1753f390a 100644 --- a/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf +++ b/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf @@ -20,7 +20,7 @@ */ #include "script_component.hpp" -private ["_problem", "_beginingArray"]; +private ["_problem", "_beginingArray", "_index"]; PARAMS_4(_startA,_endA,_startB,_endB); diff --git a/addons/disarming/stringtable.xml b/addons/disarming/stringtable.xml index e6820dbf16..8f02cb7769 100644 --- a/addons/disarming/stringtable.xml +++ b/addons/disarming/stringtable.xml @@ -6,6 +6,11 @@ Öffne Inventar Otwórz ekwipunek Otevřít inventář + Abrir inventario + Открыть инвентарь + Apri l'inventario + Ouvrir l'inventaire + Felszerelés megtekintése - + \ No newline at end of file diff --git a/addons/disposable/CfgEventHandlers.hpp b/addons/disposable/CfgEventHandlers.hpp index 02d0cb625f..e4e4abffd8 100644 --- a/addons/disposable/CfgEventHandlers.hpp +++ b/addons/disposable/CfgEventHandlers.hpp @@ -1,44 +1,28 @@ class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - clientInit = QUOTE( call COMPILE_FILE(XEH_postInitClient) ); + init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; class Extended_FiredBIS_EventHandlers { class CAManBase { class ADDON { - firedBIS = QUOTE( _this call FUNC(replaceATWeapon) ); + firedBIS = QUOTE(_this call FUNC(replaceATWeapon)); }; }; }; // handle preloaded missile -class Extended_Init_EventHandlers { +class Extended_InitPost_EventHandlers { class CAManBase { class ADDON { - init = QUOTE( _this call FUNC(takeLoadedATWeapon) ); - }; - }; -}; - -class Extended_Take_EventHandlers { - class CAManBase { - class ADDON { - take = QUOTE( _this call FUNC(takeLoadedATWeapon); [_this select 0] call FUNC(updateInventoryDisplay); ); - }; - }; -}; - -class Extended_Put_EventHandlers { - class CAManBase { - class ADDON { - put = QUOTE( [_this select 0] call FUNC(updateInventoryDisplay); ); + init = QUOTE([ARR_2(_this select 0, secondaryWeapon (_this select 0))] call FUNC(takeLoadedATWeapon)); }; }; }; diff --git a/addons/disposable/CfgMagazines.hpp b/addons/disposable/CfgMagazines.hpp index 8fbae08dfd..6265c06f50 100644 --- a/addons/disposable/CfgMagazines.hpp +++ b/addons/disposable/CfgMagazines.hpp @@ -3,6 +3,7 @@ class CfgMagazines { class ACE_PreloadedMissileDummy: NLAW_F { // The dummy magazine author = "$STR_ACE_Common_ACETeam"; scope = 1; + scopeArsenal = 1; displayName = "$STR_ACE_Disposable_PreloadedMissileDummy"; picture = PATHTOEF(common,UI\blank_CO.paa); weaponPoolAvailable = 0; diff --git a/addons/disposable/XEH_postInit.sqf b/addons/disposable/XEH_postInit.sqf new file mode 100644 index 0000000000..bc51974bc6 --- /dev/null +++ b/addons/disposable/XEH_postInit.sqf @@ -0,0 +1,10 @@ +// by commy2 +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +["inventoryDisplayLoaded", {[ACE_player, _this select 0] call FUNC(updateInventoryDisplay)}] call EFUNC(common,addEventHandler); +["playerInventoryChanged", { + [_this select 0, _this select 1 select 11] call FUNC(takeLoadedATWeapon); + [_this select 0] call FUNC(updateInventoryDisplay); +}] call EFUNC(common,addEventHandler); diff --git a/addons/disposable/XEH_postInitClient.sqf b/addons/disposable/XEH_postInitClient.sqf index 1fe598137f..c20dfa886b 100644 --- a/addons/disposable/XEH_postInitClient.sqf +++ b/addons/disposable/XEH_postInitClient.sqf @@ -5,7 +5,6 @@ #include "script_component.hpp" ["inventoryDisplayLoaded",{ - _player = ACE_player; - [_player] call FUNC(takeLoadedATWeapon); - [_player, (_this select 0)] call FUNC(updateInventoryDisplay); + [ACE_player] call FUNC(takeLoadedATWeapon); + [ACE_player, (_this select 0)] call FUNC(updateInventoryDisplay); }] call EFUNC(common,addEventHandler); \ No newline at end of file diff --git a/addons/disposable/stringtable.xml b/addons/disposable/stringtable.xml index 86c4b2d8e8..0dc86c306c 100644 --- a/addons/disposable/stringtable.xml +++ b/addons/disposable/stringtable.xml @@ -1,35 +1,41 @@ - + - - - Used Tube - Benutze Einwegwaffe - Tube utilisé - Použitý odpalovač - Zużyta rura - Lanzador utilizado - Használt cső - Отстрелянная труба - - - Used disposable rocket launcher - Benutzter Einweg-Raketenwerfer - Lance-roquette à usage unique utilisé - Použitý raketomet - Zużyta rura granatnika jednorazowego użytku - Lanzador desechable utilizado - Használt rakétavető - Отстрелянная одноразовая пусковая установка - - - Preloaded Missile Dummy - Vorgeladene Racketennachbildung - Missile préchargé Dummy - Přednabitá dummy střela - Wstępnie załadowana atrapa pocisku - Preloaded Missile Dummy - Preloaded Missile Dummy - Заряженная ракетная пустышка - - + + + Used Tube + Benutze Einwegwaffe + Tube utilisé + Použitý odpalovač + Zużyta rura + Lanzador utilizado + Elhasznált kilövőcső + Отстрелянная труба + Tubo utilizzato + Tubo utilizado + + + Used disposable rocket launcher + Benutzter Einweg-Raketenwerfer + Lance-roquette à usage unique utilisé + Použitý raketomet + Zużyta rura granatnika jednorazowego użytku + Lanzador desechable utilizado + Elhasznált eldobható rakétavető + Отстрелянная одноразовая пусковая установка + Lanciarazzi monouso utilizzato + Lança foguetes descartável utilizado + + + Preloaded Missile Dummy + Vorgeladene Racketennachbildung + Missile préchargé + Přednabitá dummy střela + Wstępnie załadowana atrapa pocisku + Precargado misil inerte + Előtöltött műrakéta + Предзаряженная ракетная болванка + Missile stupido precaricato + Míssel dummy pré-carregado + + diff --git a/addons/dragging/CfgMovesBasic.hpp b/addons/dragging/CfgMovesBasic.hpp new file mode 100644 index 0000000000..de15271416 --- /dev/null +++ b/addons/dragging/CfgMovesBasic.hpp @@ -0,0 +1,8 @@ +class CfgMovesBasic { + class Actions { + class MoveWithInjuredManDragger; + class MoveWithInjuredManDraggerRfl: MoveWithInjuredManDragger { + Up = "amovpercmstpsraswrfldnon"; + }; + }; +}; diff --git a/addons/dragging/config.cpp b/addons/dragging/config.cpp index c58aab607e..cc843d4a68 100644 --- a/addons/dragging/config.cpp +++ b/addons/dragging/config.cpp @@ -14,3 +14,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" +#include "CfgMovesBasic.hpp" diff --git a/addons/dragging/functions/fnc_canCarry.sqf b/addons/dragging/functions/fnc_canCarry.sqf index 4067b366d6..6472124aef 100644 --- a/addons/dragging/functions/fnc_canCarry.sqf +++ b/addons/dragging/functions/fnc_canCarry.sqf @@ -22,4 +22,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; // a static weapon has to be empty for dragging if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; -alive _target && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLeftLeg") + (_target getHitPointDamage "HitRightLeg") > 0.4})} +alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})} diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf index dc2d64168b..7eedfce179 100644 --- a/addons/dragging/functions/fnc_canDrag.sqf +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -22,4 +22,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; // a static weapon has to be empty for dragging if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; -alive _target && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLeftLeg") + (_target getHitPointDamage "HitRightLeg") > 0.4})}; \ No newline at end of file +alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})}; \ No newline at end of file diff --git a/addons/dragging/functions/fnc_handleUnconscious.sqf b/addons/dragging/functions/fnc_handleUnconscious.sqf index 41562756a2..31c703f37b 100644 --- a/addons/dragging/functions/fnc_handleUnconscious.sqf +++ b/addons/dragging/functions/fnc_handleUnconscious.sqf @@ -9,8 +9,6 @@ _isUnconscious = _this select 1; private "_player"; _player = ACE_player; -if ((_unit getHitPointDamage "HitLeftLeg") + (_unit getHitPointDamage "HitRightLeg") > 0.4) exitwith {}; - if (_player getVariable [QGVAR(isDragging), false]) then { private "_draggedObject"; @@ -22,9 +20,9 @@ if (_player getVariable [QGVAR(isDragging), false]) then { }; // handle waking up dragged unit - if (_unit == _draggedObject) then { - [_player, _draggedObject] call FUNC(dropObject); - }; + //if (_unit == _draggedObject) then { + // [_player, _draggedObject] call FUNC(dropObject); + //}; }; @@ -39,8 +37,8 @@ if (_player getVariable [QGVAR(isCarrying), false]) then { }; // handle waking up dragged unit - if (_unit == _carriedObject) then { - [_player, _carriedObject] call FUNC(dropObject_carry); - }; + //if (_unit == _carriedObject) then { + // [_player, _carriedObject] call FUNC(dropObject_carry); + //}; }; diff --git a/addons/dragging/stringtable.xml b/addons/dragging/stringtable.xml index 6e518f5068..d95e9e5156 100644 --- a/addons/dragging/stringtable.xml +++ b/addons/dragging/stringtable.xml @@ -7,7 +7,7 @@ Arrastrar Ciągnij Táhnout - Tracter + Trainer Ziehen Arrastar Trascina @@ -21,21 +21,21 @@ Položit Lâcher Loslassen - Largar + Soltar Lascia Elengedés - Item to heavy + Item too heavy Gegenstand ist zu schwer - Articulo demasiado pesado - Przedmiot zbyt ciężki + Objeto demasiado pesado + Przedmiot jest zbyt ciężki Objet trop lourd Não é possível carregar o item devido a seu peso Non è possibile trascinare l'oggetto a causa del suo peso - Túl nehéz ahhoz, hogy elhúzd - Слишком тяжело + Предмет слишком тяжёлый Moc težké + Az objektum túl nehéz Carry @@ -46,7 +46,7 @@ Nést Carregar Trascina - Felvesz + Felvevés Нести diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index a4a55f8609..998f73ccaf 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -37,7 +37,7 @@ player addEventHandler ["Killed", { } count _deadman; }]; player addEventHandler ["Take", { - private ["_item", "_getter", "_giver", "_config"]; + private ["_item", "_getter", "_giver", "_config", "_detonators"]; _item = _this select 2; _getter = _this select 0; _giver = _this select 1; diff --git a/addons/explosives/functions/fnc_addCellphoneIED.sqf b/addons/explosives/functions/fnc_addCellphoneIED.sqf index 3be21df559..953476861b 100644 --- a/addons/explosives/functions/fnc_addCellphoneIED.sqf +++ b/addons/explosives/functions/fnc_addCellphoneIED.sqf @@ -17,7 +17,11 @@ * Public: No */ #include "script_component.hpp" + EXPLODE_4_PVT(_this,_unit,_explosive,_magazineClass,_extra); + +private["_config", "_detonators", "_hasRequired", "_requiredItems", "_code", "_count", "_codeSet"]; + // Config is the last item in the list of passed in items. _config = (_this select 3) select (count (_this select 3) - 1); @@ -29,7 +33,7 @@ _detonators = [_unit] call FUNC(getDetonators); _hasRequired = false; }; } count _requiredItems; -private ["_code", "_count", "_codeSet"]; + _codeSet = false; while {!_codeSet} do { _code = str(round (random 9999)); diff --git a/addons/explosives/functions/fnc_addClacker.sqf b/addons/explosives/functions/fnc_addClacker.sqf index 7e3529f931..b25c1e1bcd 100644 --- a/addons/explosives/functions/fnc_addClacker.sqf +++ b/addons/explosives/functions/fnc_addClacker.sqf @@ -17,7 +17,7 @@ * Public: Yes */ #include "script_component.hpp" -private ["_clacker", "_config", "_requiredItems", "_hasRequired"]; +private ["_clacker", "_config", "_requiredItems", "_hasRequired", "_detonators"]; EXPLODE_3_PVT(_this,_unit,_explosive,_magazineClass); // Config is the last item in the list of passed in items. _config = (_this select 3) select (count (_this select 3) - 1); diff --git a/addons/explosives/functions/fnc_addDetonateActions.sqf b/addons/explosives/functions/fnc_addDetonateActions.sqf index 5081040233..5c94649608 100644 --- a/addons/explosives/functions/fnc_addDetonateActions.sqf +++ b/addons/explosives/functions/fnc_addDetonateActions.sqf @@ -15,7 +15,7 @@ * Public: No */ #include "script_component.hpp" -private ["_result", "_item", "_children"]; +private ["_result", "_item", "_children", "_range", "_required"]; EXPLODE_2_PVT(_this,_unit,_detonator); _range = GetNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range"); diff --git a/addons/explosives/functions/fnc_addExplosiveActions.sqf b/addons/explosives/functions/fnc_addExplosiveActions.sqf index 29a2eed608..214b41602c 100644 --- a/addons/explosives/functions/fnc_addExplosiveActions.sqf +++ b/addons/explosives/functions/fnc_addExplosiveActions.sqf @@ -11,7 +11,7 @@ * Public: No */ #include "script_component.hpp" -private ["_mags", "_item", "_index", "_children"]; +private ["_mags", "_item", "_index", "_children", "_itemCount", "_list"]; EXPLODE_1_PVT(_this,_unit); diff --git a/addons/explosives/functions/fnc_addTransmitterActions.sqf b/addons/explosives/functions/fnc_addTransmitterActions.sqf index 6408eb2ec7..abaa57decc 100644 --- a/addons/explosives/functions/fnc_addTransmitterActions.sqf +++ b/addons/explosives/functions/fnc_addTransmitterActions.sqf @@ -14,7 +14,7 @@ * Public: No */ #include "script_component.hpp" -private ["_items", "_unit", "_children", "_config"]; +private ["_unit", "_children", "_config", "_detonators"]; _unit = _this select 0; _detonators = [_unit] call FUNC(getDetonators); _children = []; diff --git a/addons/explosives/functions/fnc_addTriggerActions.sqf b/addons/explosives/functions/fnc_addTriggerActions.sqf index e9c2dca0e6..6f4ece163c 100644 --- a/addons/explosives/functions/fnc_addTriggerActions.sqf +++ b/addons/explosives/functions/fnc_addTriggerActions.sqf @@ -15,8 +15,7 @@ * Public: No */ #include "script_component.hpp" -private ["_hasRequiredItems","_triggerTypes", "_children", - "_detonators", "_required", "_magTriggers"]; +private ["_hasRequiredItems","_triggerTypes", "_children", "_detonators", "_required", "_magTriggers"]; EXPLODE_2_PVT(_this,_magazine,_explosive); _detonators = [ACE_player] call FUNC(getDetonators); diff --git a/addons/explosives/functions/fnc_canDefuse.sqf b/addons/explosives/functions/fnc_canDefuse.sqf index cd04564a9f..ef4bd10a83 100644 --- a/addons/explosives/functions/fnc_canDefuse.sqf +++ b/addons/explosives/functions/fnc_canDefuse.sqf @@ -14,7 +14,7 @@ * Public: Yes */ #include "script_component.hpp" -private ["_specialist"]; +private ["_isSpecialist"]; EXPLODE_2_PVT(_this,_unit,_target); if (isNull(_target getVariable [QGVAR(Explosive),objNull])) exitWith { deleteVehicle _target; diff --git a/addons/explosives/functions/fnc_detonateExplosive.sqf b/addons/explosives/functions/fnc_detonateExplosive.sqf index f05a265c3a..917c874af6 100644 --- a/addons/explosives/functions/fnc_detonateExplosive.sqf +++ b/addons/explosives/functions/fnc_detonateExplosive.sqf @@ -19,18 +19,18 @@ * Public: Yes */ #include "script_component.hpp" -private ["_result", "_ignoreRange", "_helper"]; +private ["_result", "_ignoreRange", "_helpers", "_pos"]; EXPLODE_3_PVT(_this,_unit,_range,_item); _ignoreRange = (_range == -1); _result = true; if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {false}; -_helper = (attachedTo (_item select 0)); -if (!isNull(_helper)) then { - detach (_item select 0); - deleteVehicle _helper; -}; +_helpers = attachedObjects (_item select 0); +{ + detach _x; + deleteVehicle _x; +} forEach _helpers; if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhenDestroyed") == 0) then { private ["_exp", "_previousExp"]; @@ -46,10 +46,11 @@ if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhe }; }; [{ - _explosive = _this; - if (!isNull _explosive) then { - _explosive setDamage 1; - }; + private ["_explosive"]; + _explosive = _this; + if (!isNull _explosive) then { + _explosive setDamage 1; + }; }, _item select 0, _item select 1, 0] call EFUNC(common,waitAndExecute); _result diff --git a/addons/explosives/functions/fnc_dialPhone.sqf b/addons/explosives/functions/fnc_dialPhone.sqf index f00fa8a970..aa163b027f 100644 --- a/addons/explosives/functions/fnc_dialPhone.sqf +++ b/addons/explosives/functions/fnc_dialPhone.sqf @@ -15,7 +15,7 @@ * Public: Yes */ #include "script_component.hpp" -private ["_arr", "_ran", "_i","_speedDial"]; +private ["_arr", "_ran", "_i"]; EXPLODE_2_PVT(_this,_unit,_code); if (_unit getVariable [QGVAR(Dialing),false]) exitWith {}; if !(alive _unit) exitWith {}; diff --git a/addons/explosives/functions/fnc_getDetonators.sqf b/addons/explosives/functions/fnc_getDetonators.sqf index 26bde9b190..da0bdc93d2 100644 --- a/addons/explosives/functions/fnc_getDetonators.sqf +++ b/addons/explosives/functions/fnc_getDetonators.sqf @@ -14,6 +14,8 @@ * Public: Yes */ #include "script_component.hpp" +// IGNORE_PRIVATE_WARNING(_detonators); + private ["_unit", "_items", "_result", "_config"]; _unit = _this select 0; _items = (items _unit); @@ -21,7 +23,7 @@ _result = []; { _config = ConfigFile >> "CfgWeapons" >> _x; - if (getNumber (_config >> "ACE_Detonator") == 1) then { + if (getNumber (_config >> "ACE_Detonator") == 1 && {!(_x in _result)}) then { _result pushBack _x; }; } forEach _items; diff --git a/addons/explosives/functions/fnc_getPlacedExplosives.sqf b/addons/explosives/functions/fnc_getPlacedExplosives.sqf index 1164972047..0c2080923a 100644 --- a/addons/explosives/functions/fnc_getPlacedExplosives.sqf +++ b/addons/explosives/functions/fnc_getPlacedExplosives.sqf @@ -16,6 +16,8 @@ * Public: Yes */ #include "script_component.hpp" +// IGNORE_PRIVATE_WARNING(_allExplosives,_deadmanExplosives); + private ["_unit", "_clackerList", "_adjustedList", "_list", "_filter"]; _unit = _this select 0; _filter = nil; diff --git a/addons/explosives/functions/fnc_hasExplosives.sqf b/addons/explosives/functions/fnc_hasExplosives.sqf index 794cebc57d..bd790bd12f 100644 --- a/addons/explosives/functions/fnc_hasExplosives.sqf +++ b/addons/explosives/functions/fnc_hasExplosives.sqf @@ -14,6 +14,8 @@ * Public: Yes */ #include "script_component.hpp" +// IGNORE_PRIVATE_WARNING(_hasExplosives); + private ["_unit", "_result", "_magazines"]; _result = false; _unit = _this select 0; diff --git a/addons/explosives/functions/fnc_hasPlacedExplosives.sqf b/addons/explosives/functions/fnc_hasPlacedExplosives.sqf index 4a6ccc9de8..174bc07fbc 100644 --- a/addons/explosives/functions/fnc_hasPlacedExplosives.sqf +++ b/addons/explosives/functions/fnc_hasPlacedExplosives.sqf @@ -14,4 +14,6 @@ * Public: Yes */ #include "script_component.hpp" +// IGNORE_PRIVATE_WARNING(_hasPlacedExplosives); + (count (_this call FUNC(getPlacedExplosives)) > 0) diff --git a/addons/explosives/functions/fnc_module.sqf b/addons/explosives/functions/fnc_module.sqf index 3e522e9a70..4080b41bde 100644 --- a/addons/explosives/functions/fnc_module.sqf +++ b/addons/explosives/functions/fnc_module.sqf @@ -15,6 +15,9 @@ */ #include "script_component.hpp" if !(isServer) exitWith {}; + +private["_activated", "_logic"]; + _logic = _this select 0; _activated = _this select 2; diff --git a/addons/explosives/functions/fnc_onLanded.sqf b/addons/explosives/functions/fnc_onLanded.sqf index 59487e651c..f2ed729b1a 100644 --- a/addons/explosives/functions/fnc_onLanded.sqf +++ b/addons/explosives/functions/fnc_onLanded.sqf @@ -1,7 +1,10 @@ /* * Author: Garth 'L-H' de Wet + * Handles the "EpeContactStart" event when placing the explosive. * * Arguments: + * 0: Explosive Placing Object + * 1: Colliding Object * * Return Value: * None @@ -14,19 +17,23 @@ #include "script_component.hpp" EXPLODE_2_PVT(_this,_explosive,_hitTarget); +TRACE_2("Explosive EpeContactStart",_explosive,_hitTarget); + if ((_explosive getVariable [QGVAR(Handled), false])) exitWith {}; _explosive setVariable [QGVAR(Handled), true]; if (!isNull _hitTarget && {_hitTarget isKindOf "AllVehicles"}) then { + TRACE_1("Attaching to",_hitTarget); _explosive attachTo [_hitTarget]; private "_dir"; - _dir = _setup getVariable [QGVAR(Direction), 0]; + _dir = _explosive getVariable [QGVAR(Direction), 0]; _dir = _dir - (getDir _hitTarget); [[_explosive, _dir, 0], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc); } else { [{ EXPLODE_2_PVT(_this,_player,_explosive); private "_pos"; + _pos = getPosASL _explosive; if (surfaceIsWater _pos) then { _pos = getPosASL _explosive; _explosive setPosASL _pos; diff --git a/addons/explosives/functions/fnc_placeExplosive.sqf b/addons/explosives/functions/fnc_placeExplosive.sqf index 228e8eef23..4bed019d47 100644 --- a/addons/explosives/functions/fnc_placeExplosive.sqf +++ b/addons/explosives/functions/fnc_placeExplosive.sqf @@ -21,10 +21,14 @@ * Public: Yes */ #include "script_component.hpp" -private ["_ammo", "_explosive"]; +private ["_ammo", "_explosive", "_attachedTo", "_expPos", "_magazineTrigger"]; EXPLODE_6_PVT(_this,_unit,_pos,_dir,_magazineClass,_triggerConfig,_triggerSpecificVars); -if (count _this > 6) then { - deleteVehicle (_this select 6); +DEFAULT_PARAM(6,_setupPlaceholderObject,objNull); + +_attachedTo = objNull; +if (!isNull _setupPlaceholderObject) then { + _attachedTo = attachedTo _setupPlaceholderObject; + deleteVehicle _setupPlaceholderObject; }; if (isNil "_triggerConfig") exitWith { @@ -57,6 +61,11 @@ _expPos = getPosATL _explosive; _defuseHelper setPosATL (((getPosATL _defuseHelper) vectorAdd (_pos vectorDiff _expPos))); _explosive setPosATL _pos; +if (!isNull _attachedTo) then { + TRACE_1("Attaching Live Explosive",_attachedTo); + _explosive attachTo [_attachedTo]; +}; + if (isText(_triggerConfig >> "onPlace") && {[_unit,_explosive,_magazineClass,_triggerSpecificVars] call compile (getText (_triggerConfig >> "onPlace"))}) exitWith {_explosive}; [[_explosive, _dir, getNumber (_magazineTrigger >> "pitch")], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc); diff --git a/addons/explosives/functions/fnc_place_Approve.sqf b/addons/explosives/functions/fnc_place_Approve.sqf index 0082a9bd6a..f133dbb080 100644 --- a/addons/explosives/functions/fnc_place_Approve.sqf +++ b/addons/explosives/functions/fnc_place_Approve.sqf @@ -19,7 +19,7 @@ if (GVAR(pfeh_running)) then { [QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler); GVAR(pfeh_running) = false; }; -private ["_mag", "_setup", "_player"]; +private ["_setup", "_player", "_dir"]; _setup = GVAR(Setup); GVAR(Setup) = objNull; [GVAR(placer), "ACE_Explosives", false] call EFUNC(Common,setForceWalkStatus); diff --git a/addons/explosives/functions/fnc_setupExplosive.sqf b/addons/explosives/functions/fnc_setupExplosive.sqf index ea3a086274..a0aad3d1ab 100644 --- a/addons/explosives/functions/fnc_setupExplosive.sqf +++ b/addons/explosives/functions/fnc_setupExplosive.sqf @@ -28,7 +28,7 @@ GVAR(Setup) setVariable [QGVAR(class), _class, true]; GVAR(TweakedAngle) = 180; [QGVAR(Placement),"OnEachFrame", { - private "_player"; + private ["_player", "_pos"]; _player = ACE_player; if (GVAR(placer) != _player) exitWith { call FUNC(place_Cancel); diff --git a/addons/explosives/functions/fnc_startDefuse.sqf b/addons/explosives/functions/fnc_startDefuse.sqf index 7eacdd33e1..11ca95f894 100644 --- a/addons/explosives/functions/fnc_startDefuse.sqf +++ b/addons/explosives/functions/fnc_startDefuse.sqf @@ -16,11 +16,14 @@ */ #include "script_component.hpp" EXPLODE_2_PVT(_this,_unit,_target); + +private["_actionToPlay", "_defuseTime", "_isEOD"]; + _target = attachedTo (_target); _fnc_DefuseTime = { EXPLODE_2_PVT(_this,_specialist,_target); - + private ["_defuseTime"]; _defuseTime = 5; if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime")) then { _defuseTime = getNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime"); @@ -40,23 +43,22 @@ if (ACE_player != _unit) then { if (isPlayer _unit) then { [[_unit, _target], QFUNC(startDefuse), _unit] call EFUNC(common,execRemoteFnc); } else { - // TODO: use scheduled delay execution - [_unit, _target, [[_unit] call EFUNC(Common,isEOD), _target] call _fnc_DefuseTime] spawn { - (_this select 0) playActionNow _actionToPlay; - (_this select 0) disableAI "MOVE"; - (_this select 0) disableAI "TARGET"; - sleep (_this select 2); - [(_this select 0), (_this select 1)] call FUNC(defuseExplosive); - (_this select 0) enableAI "MOVE"; - (_this select 0) enableAI "TARGET"; - }; + _unit playActionNow _actionToPlay; + _unit disableAI "MOVE"; + _unit disableAI "TARGET"; + _defuseTime = [[_unit] call EFUNC(Common,isEOD), _target] call _fnc_DefuseTime; + [{ + PARAMS_2(_unit,_target); + [_unit, _target] call FUNC(defuseExplosive); + _unit enableAI "MOVE"; + _unit enableAI "TARGET"; + }, [_unit, _target], _defuseTime, 0] call EFUNC(common,waitAndExecute); }; } else { _unit playActionNow _actionToPlay; - private ["_defuseSeconds", "_isEOD"]; _isEOD = [_unit] call EFUNC(Common,isEOD); - _defuseSeconds = [_isEOD, _target] call _fnc_DefuseTime; + _defuseTime = [_isEOD, _target] call _fnc_DefuseTime; if (_isEOD || {!GVAR(RequireSpecialist)}) then { - [_defuseSeconds, [_unit,_target], {(_this select 0) call FUNC(defuseExplosive)}, {}, (localize "STR_ACE_Explosives_DefusingExplosive")] call EFUNC(common,progressBar); + [_defuseTime, [_unit,_target], {(_this select 0) call FUNC(defuseExplosive)}, {}, (localize "STR_ACE_Explosives_DefusingExplosive")] call EFUNC(common,progressBar); }; }; diff --git a/addons/explosives/functions/fnc_startTimer.sqf b/addons/explosives/functions/fnc_startTimer.sqf index 13da62ec29..9d2ca0aee4 100644 --- a/addons/explosives/functions/fnc_startTimer.sqf +++ b/addons/explosives/functions/fnc_startTimer.sqf @@ -19,6 +19,7 @@ EXPLODE_2_PVT(_this,_explosive,_delay); [{ + private ["_explosive"]; _explosive = _this; if (!isNull _explosive) then { [_explosive, -1, [_explosive, 0]] call FUNC(detonateExplosive); diff --git a/addons/explosives/functions/fnc_triggerType.sqf b/addons/explosives/functions/fnc_triggerType.sqf index fc6a0b90c1..f9d8790a56 100644 --- a/addons/explosives/functions/fnc_triggerType.sqf +++ b/addons/explosives/functions/fnc_triggerType.sqf @@ -14,7 +14,10 @@ * Public: Yes */ #include "script_component.hpp" -private "_result"; + +private["_result", "_config", "_count", "_index", "_supports"]; +// IGNORE_PRIVATE_WARNING(_supports); + _result = []; _config = getArray (ConfigFile >> "CfgMagazines" >> (_this select 0) >> "ACE_Triggers" >> "SupportedTriggers"); _count = count _config; diff --git a/addons/explosives/script_component.hpp b/addons/explosives/script_component.hpp index 60c7e88d06..5ff12b8ba3 100644 --- a/addons/explosives/script_component.hpp +++ b/addons/explosives/script_component.hpp @@ -1,6 +1,8 @@ #define COMPONENT explosives #include "\z\ace\addons\main\script_mod.hpp" +// #define DEBUG_MODE_FULL + #ifdef DEBUG_ENABLED_EXPLOSIVES #define DEBUG_MODE_FULL #endif diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index 44dde34452..0c088df962 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -21,7 +21,7 @@ Placer >> Položit >> Piazza >> - Lerakás >> + Elhelyezés >> Colocar >> Установить >> @@ -42,12 +42,12 @@ Sprengstoffcode: %1 Código del explosivo: %1 Kod ładunku: %1 - Code explosif: %1 + Code de l'explosif: %1 Kód výbušniny: %1 - Codice dell'esplosivo : %1 Robbanóanyag kódja: %1 Código do explosivo: %1 Код подрыва: %1 + Codice esplosivo: %1 Place @@ -114,10 +114,10 @@ Mobiltelefon Télefono móvil Telefon komórkowy - Téléphone Portable + Téléphone portable Telefon Cellulare - Mobil + Mobiltelefon Celular Сотовый телефон @@ -129,7 +129,7 @@ Utilisé pour déclencher des explosifs à distance Používaný ke vzdálenému odpalování výbušnin Usato per l'attivazione a distanza degli esplosivi - Robbanóanyagok távoli robbantásához + Robbanóanyagok távoli robbantásához való Usado para acionar explosivos remotamente Используется для удаленной детонации СВУ @@ -138,10 +138,10 @@ M57 Zündvorrichtung Dispositivo de detonación M57 Zapalnik M57 - M57 Dispositif de mise à feu + Dispositif de mise à feu M57 Odpalovací zařízení M57 Detonatore M57 - M57 Detonátor + M57 Gyújtóeszköz M57 Dispositivo de Detonação Взрыватель M57 @@ -162,10 +162,10 @@ M26 Zündvorrichtung Dispositivo de detonación MK26 Zapalnik M26 - M26 Dispositif de mise à feu + Dispositif de mise à feu M26 Odpalovací zařízení M26 Detonatore M26 - M26 Detonátor + M26 Gyújtóeszköz M26 Dispositivo de Detonação Взрыватель M26 @@ -201,28 +201,28 @@ Permet de désamorçer des explosifs Dovoluje zneškodňování výbušnin Consente la disattivazione degli ordigni esplosivi - Robbanóanyagok hatástalanításához + Robbanóanyagok hatástalanítását teszi lehetővé Permite o desarme de explosivos - Позволяет обезвреживать ВУ + Позволяет обезвреживать взрывчатку Add to Speed Dial Zur Schnellauswahl hinzufügen - Agregar a marcado rápido + Añadir a marcado rápido Dodaj do szybkiego wybierania Ajouter à la composition rapide Přidat jako rychlou volbu Aggiungi alla selezione rapida - Hozzáadás gyorshíváshoz + Hozzáadás a gyorstárcsázóhoz Adicionar à ligação rápida - Добавить в ускоренный набор + Добавить в быстрый вызов Clear Löschen Borrar Usuń - Désamorçé + Effacer Čistý Libera Törlés @@ -233,7 +233,7 @@ Dial Wählen Marcar - Wybierz mumer + Wybierz numer Composer Vytočit Composizione numero @@ -281,11 +281,11 @@ Detonate Menu "Zünden"-Menü Menú de detonación - Menu detonowania - Menu de mise à feu + Menu detonacji + Menu de mise à feux Menu Detonace Menù di detonazione - Robbantás menü + Robbantási menü Menu de detonação Меню подрыва @@ -294,12 +294,12 @@ "Platzieren"-Menü Menú de colocación Menu umieszczania - Menu Placement + Menu de placement Menu Umístění Menù di collocamento - Lerakás menü + Elhelyezési menü Menu de posicionamento - Меню детонации + Меню установки Defuse @@ -321,7 +321,7 @@ Désamorçage des explosifs... Zneškodňuji Výbušninu... Esposivo in fase di disattivazione... - Robbanóanyag hatástalaníása... + Robbanóanyag hatástalanítása... Desarmando Explosivo... Обезвреживание... @@ -333,7 +333,7 @@ Minuteur Časovač Cronometro - Időzített + Időzítő Timer Таймер @@ -357,19 +357,19 @@ Régler minuteur Nastavit Čas Modifica il conto alla rovescia - Idő állítása + Idő beállítása Configurar Tempo Установить время Select a Trigger Wähle einen Zünder - Seleccionar un disparador + Seleccionar un detonador Wybierz zapalnik Sélectionner une mise à feu Zvolit Detonátor Seleziona un Attivatore - Detonátor kiválasztása + Gyújtóeszköz kiválasztása Selecionar um Gatilho Выберите детонатор @@ -395,7 +395,7 @@ Piastra a Pressione Nyomólap Placa de pressão - Давление + Нажимная плита Tripwire @@ -417,7 +417,7 @@ Capteur IR IR Značkovač Sensore IR - IR szenzor + Infravörös szenzor Sensor IV ИК сенсор @@ -429,7 +429,7 @@ Pas de mise à feu disponible pour %1 Žádný detonátor k dispozici pro %1 Nessun attivatore disponibile per %1 - Nincs detonátor a %1 + Nincs elérhető gyújtóeszköz ide: %1 Nenhum gatilho disponível para %1 Нет доступных взрывателей для %1 @@ -441,21 +441,21 @@ Capteur IR (de flanc) IR Značkovač (Výbuch stranou) Sensore IR (Attacco laterale) - IR Sensor (Side Attack) + Infravörös szenzor (Side Attack) Sensor infravermelho (ataque lateral) - ИК (детонация вбок) + ИК сенсор (детонация вбок) Magnetic Influence Sensor (Bottom Attack) Czujnik magnetyczny (wybuch w górę) Sensor IM (ataque inferior) Magnetfeldsensor (Bodenangriff) - Capteur Magnétique (par le bas) + Capteur magnétique (par le bas) Magnetický Senzor (Výbuch ze spoda) Sensore Magnetico di Prossimità (Attacco inferiore) - Mágneses (Bottom Attack) + Mágneses mező érzékelő (Bottom Attack) Influência magnética (ataque inferior) - Магнитный (детонация вверх) + Магнитный сенсор (детонация вверх) No explosives on trigger. @@ -464,10 +464,10 @@ Pas d'explosif à mettre à feu. Nessun esplosivo sul sensore. Žádná výbušnina k odpálení. - Nincs robbanóanyag a detonátorhoz. + Nincs robbanóanyag a gyújtóeszközhöz kötve. Brak ładunków na zapalnik. Nenhum explosivo no gatilho. - Нет доступных ВУ для взрывателя. + Взрыватель не подсоединён к взрывчатке Dead Man's Switch @@ -477,17 +477,21 @@ Czuwak Detonador de hombre muerto Dead Man's Switch - Ловушка мертвеца + Detonador do homem morto + Кнопка мертвеца + Detonatore a rilascio Used to remotely trigger explosives when released. Zündet Sprengladungen wenn losgelassen. Déclenche la mise à feu d'un explosif lorsqu'il est libéré. Používaný k vzdálenému odpálení, při uvolnění odpálí výbušniny - Używany w celu zdalnej detonacji ładunków kiedy jego operator zostanie zabity. + Używany w celu zdalnej detonacji ładunków, kiedy jego operator zostanie zabity. Utilizado para detonar explosivos remotamente al soltarlo. Robbanóanyagok távoli robbantásához + Usado para detonar remotamente o explosivo quando solto. Используется для дистанционного подрыва, после смерти оператора. + Usato per attivare esplosivi al momento del rilascio Pick up @@ -496,6 +500,10 @@ Sebrat Podnieś Ramasser + Felszedés + Поднять + Raccogli + Pegar diff --git a/addons/fcs/CfgOptics.hpp b/addons/fcs/CfgOptics.hpp index c9704081f9..91f83dd6f6 100644 --- a/addons/fcs/CfgOptics.hpp +++ b/addons/fcs/CfgOptics.hpp @@ -35,13 +35,6 @@ class RscInGameUI { }; }; }; - class RscOptics_LaserDesignator { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; class RscWeaponRangeFinderMAAWS { class CA_IGUI_elements_group: RscControlsGroup { class controls { diff --git a/addons/fcs/config.cpp b/addons/fcs/config.cpp index 711cbbbd25..12edf02ba3 100644 --- a/addons/fcs/config.cpp +++ b/addons/fcs/config.cpp @@ -20,3 +20,7 @@ class CfgPatches { #include "CfgWeapons.hpp" #include "CfgOptics.hpp" + +class ACE_Extensions { + extensions[] += {"ace_fcs"}; +}; diff --git a/addons/fcs/initKeybinds.sqf b/addons/fcs/initKeybinds.sqf index 3f1a5707a8..96482ddd1c 100644 --- a/addons/fcs/initKeybinds.sqf +++ b/addons/fcs/initKeybinds.sqf @@ -1,6 +1,6 @@ // by commy2 -["ACE3", QGVAR(lazeTarget), localize "STR_ACE_FCS_LaseTarget", +["ACE3 Vehicles", QGVAR(lazeTarget), localize "STR_ACE_FCS_LaseTarget", { // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -30,12 +30,12 @@ }, [15, [false, false, false]], false] call cba_fnc_addKeybind; //Tab Key -["ACE3", QGVAR(adjustRangeUp), localize "STR_ACE_FCS_AdjustRangeUp", +["ACE3 Vehicles", QGVAR(adjustRangeUp), localize "STR_ACE_FCS_AdjustRangeUp", { // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; + if !(call FUNC(canUseFCS)) exitWith {false}; // Statement [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange); @@ -44,12 +44,12 @@ {false}, [201, [false, false, false]], false] call cba_fnc_addKeybind; //PageUp Key -["ACE3", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown", +["ACE3 Vehicles", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown", { // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; + if !(call FUNC(canUseFCS)) exitWith {false}; // Statement [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange); diff --git a/addons/fcs/stringtable.xml b/addons/fcs/stringtable.xml index 1f1b0d3acf..d62a5d85ea 100644 --- a/addons/fcs/stringtable.xml +++ b/addons/fcs/stringtable.xml @@ -9,16 +9,19 @@ Označit cíl / Změřit vzdálenost Iluminar objetivo / Medir distancia Подсветить цель / Замерить расстояние + Célpont lézerezése / Távolság Bemérése + Misura la distanza + Marcar com laser / Medir Distância Zeroed To Haltepunkt - Fijado a + Ajustado a Wyzerowany na Nastaveno na Zéroté à Выставлено на - Nullázás + Nullázási táv Fixado em Azzeramento a @@ -65,7 +68,7 @@ SCT réinitialisé. SKO został zresetowany. FCS byl resetován. - Az FCS visszaállítva + FCS visszaállítva. FCS reiniciado. L'FCS è stato azzerato СУО обнулен. diff --git a/addons/flashsuppressors/stringtable.xml b/addons/flashsuppressors/stringtable.xml index d3185fc2b0..75641b8e01 100644 --- a/addons/flashsuppressors/stringtable.xml +++ b/addons/flashsuppressors/stringtable.xml @@ -1,5 +1,4 @@  - @@ -12,7 +11,7 @@ Tlumič plamene (6,5 mm) Cache-flamme (6,5 mm) Пламегаситель (6,5 мм) - Supresor (6,5 mm) + Bocacha (6,5 mm) Flash Suppressor (7.62 mm) @@ -24,7 +23,7 @@ Tlumič plamene (7,62 mm) Cache-flamme (7,62 mm) Пламегаситель (7,62 мм) - Supresor (7,62 mm) + Bocacha (7,62 mm) Flash Suppressor (5.56 mm) @@ -36,7 +35,7 @@ Tlumič plamene (5,56 mm) Cache-flamme (5,56 mm) Пламегаситель (5,56 мм) - Supresor (5,56 mm) + Bocacha (5,56 mm) Flash Suppressor (.45 ACP) @@ -48,7 +47,7 @@ Tlumič plamene (.45 ACP) Cache-flamme (.45 ACP) Пламегаситель (.45 ACP) - Supresor (.45 ACP) + Bocacha (.45 ACP) Flash Suppressor (9 mm) @@ -60,7 +59,7 @@ Tlumič plamene (9 mm) Cache-flamme (9 mm) Пламегаситель (9 мм) - Supresor (9 mm) + Bocacha (9 mm) Flash Suppressor (.338) @@ -72,7 +71,7 @@ Tlumič záblesku (.338) Cache-flamme (.338) Пламегаситель (.338) - Supresor (.338) + Bocacha (.338) Flash Suppressor (9.3 mm) @@ -84,7 +83,7 @@ Tlumič záblesku (9,3 mm) Cache-flamme (9,3 mm) Пламегаситель (9,3 мм) - Supresor (9,3 mm) + Bocacha (9,3 mm) \ No newline at end of file diff --git a/addons/frag/ACE_Settings.hpp b/addons/frag/ACE_Settings.hpp new file mode 100644 index 0000000000..b160a127f3 --- /dev/null +++ b/addons/frag/ACE_Settings.hpp @@ -0,0 +1,8 @@ +class ACE_Settings { + class GVAR(enabled) { + displayName = "Frag System"; + description = "Enables the shrapnel system for explosives"; + typeName = "BOOL"; + value = 1; + }; +}; diff --git a/addons/frag/CfgAmmo.hpp b/addons/frag/CfgAmmo.hpp index 8ad76e6ae8..ac20dabf5e 100644 --- a/addons/frag/CfgAmmo.hpp +++ b/addons/frag/CfgAmmo.hpp @@ -6,99 +6,190 @@ class CfgAmmo { //class ace_arty_105mm_m1_m782_time; //class ace_arty_105mm_m1_m782_prox: ace_arty_105mm_m1_m782_time {}; //class ace_arty_105mm_m1_m782_delay: ace_arty_105mm_m1_m782_prox { - // ACE_FRAG_SKIP = 1; + // GVAR(skip) = 1; //}; class Bo_GBU12_LGB; - class Nou_GBU12 : Bo_GBU12_LGB { - ACE_FRAG_CLASSES[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; - ACE_FRAG_METAL = 140000; - ACE_FRAG_CHARGE = 87000; - ACE_FRAG_GURNEY_C = 2320; - ACE_FRAG_GURNEY_K = 1/2; + class ACE_GBU12 : Bo_GBU12_LGB { + GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; + GVAR(metal) = 140000; + GVAR(charge) = 87000; + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = 1/2; sideAirFriction = 0.04; airFriction = 0.04; laserLock = 0; }; - + class GrenadeBase; class Grenade; class GrenadeHand: Grenade { - ACE_FRAG_SKIP = 0; - ACE_FRAG_FORCE = 1; + GVAR(skip) = 0; + GVAR(force) = 1; // This is a good high-drag frag type for grenades. - ACE_FRAG_CLASSES[] = {"ACE_frag_tiny_HD"}; + GVAR(classes)[] = {"ACE_frag_tiny_HD"}; /* These values are based on the M67 Grenade, should be tweaked for individual grenades. */ - ACE_FRAG_METAL = 210; // metal in grams - ACE_FRAG_CHARGE = 185; // explosive in grams - ACE_FRAG_GURNEY_C = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations - ACE_FRAG_GURNEY_K = 3/5; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations + GVAR(metal) = 210; // metal in grams + GVAR(charge) = 185; // explosive in grams + GVAR(gurney_c) = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations + GVAR(gurney_k) = 3/5; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations }; class GrenadeHand_stone: GrenadeHand { - ACE_FRAG_SKIP = 1; + GVAR(skip) = 1; }; class SmokeShell: GrenadeHand { - ACE_FRAG_SKIP = 1; + GVAR(skip) = 1; }; - + class RocketBase; - //class R_Hydra_HE: RocketBase { - // ACE_FRAG_SKIP = 1; - //}; - - //class R_57mm_HE: RocketBase { - // ACE_FRAG_SKIP = 1; - //}; - - class R_80mm_HE: RocketBase { - ACE_FRAG_SKIP = 1; + class R_Hydra_HE: RocketBase { + // Source: http://fas.org/man/dod-101/sys/missile/hydra-70.htm + GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; + GVAR(metal) = 3850; + GVAR(charge) = 1040; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = 1/2; }; - - //class R_S8T_AT: RocketBase { - // ACE_FRAG_SKIP = 1; + //class R_57mm_HE: RocketBase { + // GVAR(skip) = 1; //}; - + + class R_80mm_HE: RocketBase { + GVAR(skip) = 1; + }; + + //class R_S8T_AT: RocketBase { + // GVAR(skip) = 1; + //}; + class BombCore; class Bo_Mk82: BombCore { - ACE_FRAG_CLASSES[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; - ACE_FRAG_METAL = 140000; - ACE_FRAG_CHARGE = 87000; - ACE_FRAG_GURNEY_C = 2320; - ACE_FRAG_GURNEY_K = 1/2; + GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; + GVAR(metal) = 140000; + GVAR(charge) = 87000; + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = 1/2; }; - class G_40mm_HE: GrenadeBase { - ACE_FRAG_SKIP = 0; - ACE_FRAG_FORCE = 1; + // Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M441 + GVAR(classes)[] = {"ACE_frag_tiny_HD"}; + GVAR(metal) = 200; + GVAR(charge) = 32; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = 1/2; + }; + class G_40mm_HEDP: G_40mm_HE { + // Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M433 + GVAR(classes)[] = {"ACE_frag_tiny_HD"}; + GVAR(metal) = 200; + GVAR(charge) = 45; + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = 1/2; }; - class ACE_G_40mm_HEDP: G_40mm_HE { + class ACE_G_40mm_HEDP: G_40mm_HEDP { }; - class ACE_G_40mm_HE: ACE_G_40mm_HEDP { + class ACE_G_40mm_HE: G_40mm_HE { }; class ACE_G_40mm_Practice: ACE_G_40mm_HE { - ACE_FRAG_SKIP = 1; + GVAR(skip) = 1; }; class ACE_G40mm_HE_VOG25P: G_40mm_HE { - ACE_FRAG_SKIP = 0; - ACE_FRAG_FORCE = 1; + GVAR(skip) = 0; + GVAR(force) = 1; }; - + + // curator ammo entries + class ShellBase; + class Sh_125mm_HEAT; + class Sh_155mm_AMOS: ShellBase { + // Source: http://www.globalsecurity.org/military/systems/munitions/m795.htm + GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; + GVAR(metal) = 36000; + GVAR(charge) = 9979; + GVAR(gurney_c) = 2440; + GVAR(gurney_k) = 1/2; + }; + class Sh_82mm_AMOS : Sh_155mm_AMOS { + // Source: http://www.arsenal-bg.com/defense_police/mortar_bombs_82mm.htm + GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; + GVAR(metal) = 3200; + GVAR(charge) = 420; + GVAR(gurney_c) = 2440; + GVAR(gurney_k) = 1/2; + }; + class ModuleOrdnanceMortar_F_Ammo: Sh_82mm_AMOS { + GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; + GVAR(metal) = 800; + GVAR(charge) = 4200; + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = 1/2; + }; + class Sh_105mm_HEAT_MP : Sh_125mm_HEAT { + GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; + GVAR(metal) = 11400; + GVAR(charge) = 7100; + GVAR(gurney_c) = 2800; + GVAR(gurney_k) = 1/2; + }; + class Sh_120mm_HE : ShellBase { + GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; + GVAR(metal) = 23000; + GVAR(charge) = 3148; + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = 1/2; + }; + class Sh_125mm_HE: Sh_120mm_HE { + GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; + GVAR(metal) = 16000; + GVAR(charge) = 3200; + GVAR(gurney_c) = 2440; + GVAR(gurney_k) = 1/2; + }; + class ModuleOrdnanceHowitzer_F_ammo: Sh_155mm_AMOS { + GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; + GVAR(metal) = 1950; + GVAR(charge) = 15800; + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = 1/2; + }; + + //class R_230mm_HE; + //class ModuleOrdnanceRocket_F_ammo: R_230mm_HE { + //}; + + //class R_230mm_fly; + //class ModuleOrdnanceRocket_F_subammo: R_230mm_fly { + //}; + // end of curator ammo entries + //class R_SMAW_HEDP; //class R_MEEWS_HEDP : R_SMAW_HEDP { - // ACE_FRAG_FORCE = 1; - // ACE_FRAG_MULTIPLIER = 1.2; + // GVAR(force) = 1; + // GVAR(multiplier) = 1.2; //}; - - //class MissileBase; - //class M_Hellfire_AT: MissileBase { - // ACE_FRAG_FORCE = 1; - // ACE_FRAG_MULTIPLIER = 1.75; - //}; - + + class MissileBase; + class Missile_AGM_02_F : MissileBase { + // Source: http://fas.org/man/dod-101/sys/smart/agm-65.htm + GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; + GVAR(metal) = 56250; + GVAR(charge) = 39000; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = 1/2; + }; + class M_Hellfire_AT: MissileBase { + // Source: http://www.designation-systems.net/dusrm/m-114.html + GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; + GVAR(metal) = 8000; + GVAR(charge) = 2400; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = 1/2; + }; + /* class B_762x51_Ball; class ACE_frag_base: B_762x51_Ball { ////TODO: B_762x45_Ball no longer exists, is this a valid replacement? @@ -253,51 +344,51 @@ class CfgAmmo { bulletFly8[] = {"A3\sounds_f\weapons\hits\bullet_by_8.wav",1,1,35}; bulletFly[] = {"bulletFly1",0.166,"bulletFly2",0.166,"bulletFly3",0.166,"bulletFly4",0.166,"bulletFly5",0.166,"bulletFly6",0.167,"bulletFly7",0.166,"bulletFly8",0.167}; supersonicCrackNear[] = {"A3\sounds_f\weapons\hits\sscrack1.wav",1,1,35}; - supersonicCrackFar[] = {"A3\sounds_f\weapons\hits\sscrack2.wav",1,1,135}; + supersonicCrackFar[] = {"A3\sounds_f\weapons\hits\sscrack2.wav",1,1,135}; }; */ - + class B_65x39_Caseless; class ACE_frag_base: B_65x39_Caseless { timeToLive = 12; typicalSpeed = 1500; deflecting = 65; }; - + class ACE_frag_tiny: ACE_frag_base { hit = 6; airFriction = BASE_DRAG; caliber = 0.75; }; - + class ACE_frag_tiny_HD: ACE_frag_base { hit = 6; airFriction = BASE_DRAG_HD; caliber = 0.75; }; - + class ACE_frag_small: ACE_frag_base { hit = 12; airFriction = BASE_DRAG*0.9; }; - + class ACE_frag_small_HD: ACE_frag_base { hit = 12; airFriction = BASE_DRAG_HD*0.9; }; - + class ACE_frag_medium: ACE_frag_base { hit = 14; airFriction = BASE_DRAG*0.75; caliber = 1.2; }; - + class ACE_frag_medium_HD: ACE_frag_base { hit = 14; airFriction = BASE_DRAG_HD*0.75; caliber = 1.2; }; - + class ACE_frag_large: ACE_frag_base { hit = 28; indirectHit = 2; @@ -305,19 +396,19 @@ class CfgAmmo { airFriction = BASE_DRAG*0.65; caliber = 2; explosive = 0; - + }; - + class ACE_frag_large_HD: ACE_frag_large { hit = 28; indirectHit = 2; indirectHitRange = 0.25; airFriction = BASE_DRAG_HD*0.65; caliber = 2; - - + + }; - + class ACE_frag_huge: ACE_frag_large { hit = 40; indirectHit = 4; @@ -325,7 +416,7 @@ class CfgAmmo { airFriction = BASE_DRAG*0.5; caliber = 2.8; }; - + class ACE_frag_huge_HD: ACE_frag_large { hit = 40; indirectHit = 4; @@ -333,19 +424,19 @@ class CfgAmmo { airFriction = BASE_DRAG_HD*0.5; caliber = 2.8; }; - + class ACE_frag_spall_small: ACE_frag_small { timeToLive = 0.1; }; - + class ACE_frag_spall_medium: ACE_frag_medium { timeToLive = 0.15; }; - + class ACE_frag_spall_large: ACE_frag_large { timeToLive = 0.25; }; - + class ACE_frag_spall_huge: ACE_frag_huge { timeToLive = 0.3; }; diff --git a/addons/frag/CfgEventhandlers.hpp b/addons/frag/CfgEventhandlers.hpp index 1e631e07eb..df7eaeacd1 100644 --- a/addons/frag/CfgEventhandlers.hpp +++ b/addons/frag/CfgEventhandlers.hpp @@ -1,12 +1,12 @@ class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_pre_init)); + init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_post_init)); + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; diff --git a/addons/frag/CfgVehicles.hpp b/addons/frag/CfgVehicles.hpp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf new file mode 100644 index 0000000000..6c8d64d1fb --- /dev/null +++ b/addons/frag/XEH_postInit.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +if(isServer) then { + [QGVAR(frag_eh), { _this call FUNC(frago); }] call ace_common_fnc_addEventHandler; +}; \ No newline at end of file diff --git a/addons/frag/XEH_post_init.sqf b/addons/frag/XEH_post_init.sqf deleted file mode 100644 index 9769148871..0000000000 --- a/addons/frag/XEH_post_init.sqf +++ /dev/null @@ -1,18 +0,0 @@ -#include "script_component.hpp" -if(isServer) then { - [QGVAR(frag_eh), { _this call FUNC(frago); }] call ace_common_fnc_addEventHandler; -}; -/* -GVAR(replacedBisArtyWrapper) = false; -[] spawn { - waitUntil { - if(!(isNil "BIS_ARTY_F_ShellFlight")) then { - ACE_WRAPPER_BIS_ARTY_F_ShellFlight = BIS_ARTY_F_ShellFlight; - BIS_ARTY_F_ShellFlight = FUNC(BIS_ARTY_WRAPPER); - GVAR(replacedBisArtyWrapper) = true; - }; - sleep 4; - GVAR(replacedBisArtyWrapper) - }; -}; -*/ \ No newline at end of file diff --git a/addons/frag/XEH_pre_Init.sqf b/addons/frag/XEH_preInit.sqf similarity index 73% rename from addons/frag/XEH_pre_Init.sqf rename to addons/frag/XEH_preInit.sqf index 5b3aa36b18..906a696ebf 100644 --- a/addons/frag/XEH_pre_Init.sqf +++ b/addons/frag/XEH_preInit.sqf @@ -1,45 +1,35 @@ #include "script_component.hpp" - ADDON = false; +PREP(doSpall); PREP(fired); PREP(frago); -PREP(trackFragRound); PREP(spallTrack); -PREP(doSpall); -PREP(vectorDiffFast); +PREP(trackFragRound); -GVAR(trackedObjects) = []; GVAR(blackList) = []; GVAR(traceFrags) = false; - -GVAR(replacedBisArtyWrapper) = true; +GVAR(trackedObjects) = []; GVAR(TOTALFRAGS) = 0; -GVAR(spallIsTrackingCount) = 0; GVAR(spallHPData) = []; +GVAR(spallIsTrackingCount) = 0; +GVAR(autoTrace) = true; +GVAR(traceID) = -1; GVAR(traces) = []; GVAR(tracesStarted) = false; -GVAR(traceID) = -1; -GVAR(autoTrace) = true; - // * Other Shit */ -PREP(frag_trace); -PREP(denyFrag); -PREP(BIS_ARTY_WRAPPER); -PREP(startTracing); -PREP(stopTracing); -PREP(clearTraces); -PREP(trackTrace); +PREP(addBlackList); PREP(addTrack); PREP(drawTraces); PREP(removeTrack); PREP(spallHP); -PREP(addBlackList); -PREP(addManualTrack); +PREP(startTracing); +PREP(stopTracing); +PREP(trackTrace); ADDON = true; diff --git a/addons/frag/config.cpp b/addons/frag/config.cpp index 4c1fb71e15..16af88bfc4 100644 --- a/addons/frag/config.cpp +++ b/addons/frag/config.cpp @@ -10,7 +10,6 @@ class CfgPatches { }; }; -//PRELOAD_ADDONS; - #include "CfgEventhandlers.hpp" #include "CfgAmmo.hpp" +#include "ACE_Settings.hpp" \ No newline at end of file diff --git a/addons/frag/functions/fnc_BIS_ARTY_WRAPPER.sqf b/addons/frag/functions/fnc_BIS_ARTY_WRAPPER.sqf deleted file mode 100644 index 0d71cf58ac..0000000000 --- a/addons/frag/functions/fnc_BIS_ARTY_WRAPPER.sqf +++ /dev/null @@ -1,13 +0,0 @@ -#include "script_component.hpp" -_ret = [(_this select 6)] call FUNC(removeTrack); -if(!_ret) then { - [(_this select 6)] call FUNC(addBlackList); -}; -_this call ACE_WRAPPER_BIS_ARTY_F_ShellFlight; -_catEntry = BIS_ARTY_SHELLCAT select ((count BIS_ARTY_SHELLCAT) - 1); -_shell = _catEntry select 0; -_ARTY_DeployOnImpact = getText (configFile >> "CfgAmmo" >> "ARTY_DeployOnImpact"); -if(_ARTY_DeployOnImpact == "") then { - _this set[6, _shell]; - _this call FUNC(fired); -}; \ No newline at end of file diff --git a/addons/frag/functions/fnc_addBlackList.sqf b/addons/frag/functions/fnc_addBlackList.sqf index f7b3faf902..95edcd1590 100644 --- a/addons/frag/functions/fnc_addBlackList.sqf +++ b/addons/frag/functions/fnc_addBlackList.sqf @@ -1,4 +1,4 @@ -#include "script_component.hpp" -private ["_round"]; -_round = _this select 0; +#include "script_component.hpp" +private ["_round"]; +_round = _this select 0; GVAR(blackList) set[(count GVAR(blackList)), _round]; \ No newline at end of file diff --git a/addons/frag/functions/fnc_addManualTrack.sqf b/addons/frag/functions/fnc_addManualTrack.sqf deleted file mode 100644 index 3dc14cc748..0000000000 --- a/addons/frag/functions/fnc_addManualTrack.sqf +++ /dev/null @@ -1,7 +0,0 @@ -#include "script_component.hpp" -private ["_round"]; -_round = _this select 0; -if(alive _round) then { - GVAR(trackedObjects) set[(count GVAR(trackedObjects)), _round]; - [DFUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), (typeOf _round), time, objNull, false, 0, 0]] call cba_fnc_addPerFrameHandler; -}; \ No newline at end of file diff --git a/addons/frag/functions/fnc_addTrack.sqf b/addons/frag/functions/fnc_addTrack.sqf index 2beea1dd56..d4a4272a9c 100644 --- a/addons/frag/functions/fnc_addTrack.sqf +++ b/addons/frag/functions/fnc_addTrack.sqf @@ -1,5 +1,8 @@ #include "script_component.hpp" -if(GVAR(autoTrace)) then { + +private ["_color", "_data", "_index", "_obj", "_objSpd", "_origin", "_positions"]; + +if (GVAR(autoTrace)) then { [] call FUNC(startTracing); }; @@ -12,9 +15,9 @@ if((count _this) > 2) then { _color = _this select 2; }; _positions = []; -_objVel = velocity _obj; -_objTVel = sqrt((_objVel select 0)^2 + (_objVel select 1)^2 + (_objVel select 2)^2); -_positions set[(count _positions), [(getPos _obj), _objTVel]]; -_data = [_origin, typeOf _origin, typeOf _obj, _objTVel, _positions, _color]; +_objSpd = vectorMagnitude (velocity _obj); +_positions set[(count _positions), [(getPos _obj), _objSpd]]; +_data = [_origin, typeOf _origin, typeOf _obj, _objSpd, _positions, _color]; + GVAR(traces) set[_index, _data]; -[DFUNC(trackTrace), 0, [_obj, _index, time]] call cba_fnc_addPerFrameHandler; \ No newline at end of file +[DFUNC(trackTrace), 0, [_obj, _index, time]] call cba_fnc_addPerFrameHandler; diff --git a/addons/frag/functions/fnc_denyFrag.sqf b/addons/frag/functions/fnc_denyFrag.sqf deleted file mode 100644 index 6c4aa9bf8d..0000000000 --- a/addons/frag/functions/fnc_denyFrag.sqf +++ /dev/null @@ -1,7 +0,0 @@ -#include "script_component.hpp" - -private ["_ret"]; -_ret = [(_this select 0)] call FUNC(removeTrack); -if(!_ret) then { - [(_this select 0)] call FUNC(addBlackList); -}; \ No newline at end of file diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf index 761490fa90..990fb80f8d 100644 --- a/addons/frag/functions/fnc_doSpall.sqf +++ b/addons/frag/functions/fnc_doSpall.sqf @@ -3,13 +3,12 @@ #ifdef DEBUG_MODE_FULL GVAR(traceFrags) = true; #endif -// player sideChat "WAAAAAAAAAAAAAAAAAAAAA"; -private ["_params", "_initialData", "_hpData", "_roundType", "_round", "_object", "_caliber", "_explosive", - "_idh", "_alive", "_exit", "_vm", "_velocity", "_unitDir", "_oldVelocity", "_curVelocity", "_diff", "_polar", - "_pos", "_spallPos", "_i", "_pos1", "_pos2", "_blah", "_data", "_spallPolar", "_c", "_warn", "_m", "_k", - "_gC", "_shellType", "_fragPower", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", - "_fragment"]; - +// ACE_player sideChat "WAAAAAAAAAAAAAAAAAAAAA"; +private ["_params", "_initialData", "_hpData", "_roundType", "_round", "_object", "_caliber", "_explosive", + "_idh", "_alive", "_exit", "_vm", "_velocity", "_unitDir", "_oldVelocity", "_curVelocity", "_diff", "_polar", + "_pos", "_spallPos", "_i", "_pos1", "_pos2", "_blah", "_data", "_spallPolar", "_c", "_warn", "_m", "_k", + "_gC", "_shellType", "_fragPower", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", + "_fragment", "_index", "_hitData", "_fragTypes", "_fragType", "_foundObjects"]; _params = _this select 0; [(_this select 1)] call cba_fnc_removePerFrameHandler; @@ -40,21 +39,21 @@ if(!alive _round && (_initialData select 6) == 1) then { }; if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { - // player sideChat format["BBBB"]; + // ACE_player sideChat format["BBBB"]; _exit = false; _vm = 1; _velocity = _initialData select 5; - - _oldVelocity = _velocity call BIS_fnc_magnitude; - _curVelocity = (velocity _round) call BIS_fnc_magnitude; - + + _oldVelocity = vectorMagnitude _velocity; + _curVelocity = vectorMagnitude (velocity _round); + if(alive _round) then { _diff = _velocity vectorDiff (velocity _round); _polar = _diff call CBA_fnc_vect2polar; - // player sideChat format["polar: %1", _polar]; + // ACE_player sideChat format["polar: %1", _polar]; if((abs(_polar select 1) > 45 || abs(_polar select 2) > 45)) then { if(_caliber < 2.5) then { - // player sideChat format["exit!"]; + // ACE_player sideChat format["exit!"]; _exit = true; } else { _vm = 1-(_curVelocity/_oldVelocity); @@ -66,32 +65,24 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { _pos = _hpData select 3; _spallPos = nil; for "_i" from 0 to 100 do { - _pos1 = [ - (_pos select 0) + (((_unitDir select 0)*0.01)*_i), - (_pos select 1) + (((_unitDir select 1)*0.01)*_i), - (_pos select 2) + (((_unitDir select 2)*0.01)*_i) - ]; - _pos2 = [ - (_pos select 0) + (((_unitDir select 0)*0.01)*(_i+1)), - (_pos select 1) + (((_unitDir select 1)*0.01)*(_i+1)), - (_pos select 2) + (((_unitDir select 2)*0.01)*(_i+1)) - ]; + _pos1 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * _i)); + _pos2 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * (_i + 1))); // _blah = [_object, "FIRE"] intersect [_object worldToModel (ASLtoATL _pos1), _object worldToModel (ASLtoATL _pos2)]; // diag_log text format["b: %1", _blah]; - + // _data = [nil, nil, nil, 1, [[ASLtoATL _pos1, 1], [ASLtoATL _pos2, 1]]]; // NOU_TRACES set[(count NOU_TRACES), _data]; - + if(!lineIntersects [_pos1, _pos2]) exitWith { - // player sideChat format["FOUND!"]; + // ACE_player sideChat format["FOUND!"]; _spallPos = _pos2; }; }; if(!isNil "_spallPos") then { _spallPolar = _velocity call CBA_fnc_vect2polar; - + if(_explosive > 0) then { - // player sideChat format["EXPLOSIVE!"]; + // ACE_player sideChat format["EXPLOSIVE!"]; _warn = false; _c = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_CHARGE"); if(_c == 0) then { _c = 1; _warn = true;}; @@ -109,7 +100,7 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { _fragPower = (((_m/_c)+_k)^-(1/2))*_gC; _spallPolar set[0, _fragPower*0.66]; }; - + _fragTypes = [ "ACE_frag_spall_small", "ACE_frag_spall_small", "ACE_frag_spall_small", "ACE_frag_spall_small","ACE_frag_spall_medium","ACE_frag_spall_medium","ACE_frag_spall_medium", @@ -117,7 +108,7 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { "ACE_frag_spall_huge" ]; - + // diag_log text format["SPALL POWER: %1", _spallPolar select 0]; _spread = 15+(random 25); _spallCount = 5+(random 10); @@ -130,14 +121,14 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { _dir = _dir % 360; _vel = (_spallPolar select 0)*0.33*_vm; _vel = (_vel-(_vel*0.25))+(random (_vel*0.5)); - + _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; _fragType = round (random ((count _fragTypes)-1)); _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; _fragment setPosASL _spallPos; _fragment setVelocity _spallFragVect; if(GVAR(traceFrags)) then { - [player, _fragment, [1,0.5,0,1]] call FUNC(addTrack); + [ACE_player, _fragment, [1,0.5,0,1]] call FUNC(addTrack); }; }; _spread = 5+(random 5); @@ -151,14 +142,14 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { _dir = _dir % 360; _vel = (_spallPolar select 0)*0.55*_vm; _vel = (_vel-(_vel*0.25))+(random (_vel*0.5)); - + _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; _fragType = round (random ((count _fragTypes)-1)); _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; _fragment setPosASL _spallPos; _fragment setVelocity _spallFragVect; if(GVAR(traceFrags)) then { - [player, _fragment, [1,0,0,1]] call FUNC(addTrack); + [ACE_player, _fragment, [1,0,0,1]] call FUNC(addTrack); }; }; }; diff --git a/addons/frag/functions/fnc_drawTraces.sqf b/addons/frag/functions/fnc_drawTraces.sqf index b9645bab97..e61fc9b5ba 100644 --- a/addons/frag/functions/fnc_drawTraces.sqf +++ b/addons/frag/functions/fnc_drawTraces.sqf @@ -1,13 +1,13 @@ #include "script_component.hpp" + +private ["_color", "_index", "_lastPos", "_lastSpd", "_max", "_positions", "_startSpeed"]; + { _positions = _x select 4; _color = _x select 5; _index = 0; _max = count _positions; - _startSpeed = (_positions select 0) select 1; - if(_startSpeed <= 0) then { - _startSpeed = 0.01; - }; + _startSpeed = 0.01 max ((_positions select 0) select 1); _lastSpd = []; _lastPos = []; while {_index < _max} do { @@ -29,4 +29,4 @@ _lastSpd = _data1 select 1; }; // drawIcon3D ["", [1,0,0,1], _lastPos, 0, 0, 0, format["%1m/s", _lastSpd], 1, 0.05, "PuristaMedium"]; -} forEach GVAR(traces); \ No newline at end of file +} forEach GVAR(traces); diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index e7d7d09682..7ed717c2b8 100644 --- a/addons/frag/functions/fnc_fired.sqf +++ b/addons/frag/functions/fnc_fired.sqf @@ -1,6 +1,8 @@ #include "script_component.hpp" -private ["_gun", "_type", "_round", "_doFragTrack", "_doSpall"]; -if !(isNil QGVAR(enabled) && {GVAR(enabled)}) exitWith {}; + +private ["_gun", "_type", "_round", "_doFragTrack", "_doSpall", "_spallTrack", "_spallTrackID"]; + +if (!GVAR(enabled)) exitWith {}; _gun = _this select 0; _type = _this select 4; @@ -11,10 +13,10 @@ if(_round in GVAR(blackList)) exitWith { }; _doFragTrack = false; -if(_gun == player) then { +if(_gun == ACE_player) then { _doFragTrack = true; } else { - if((gunner _gun) == player) then { + if((gunner _gun) == ACE_player) then { _doFragTrack = true; } else { if(local _gun && {!(isPlayer (gunner _gun))} && {!(isPlayer _gun)}) then { @@ -28,14 +30,18 @@ if(_doSpall) then { GVAR(spallHPData) = []; }; if(GVAR(spallIsTrackingCount) > 5) then { - // player sideChat "LIMT!"; + // ACE_player sideChat "LIMT!"; _doSpall = false; } else { GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1; }; }; -// player sideChat format["c: %1", GVAR(spallIsTrackingCount)]; -[player, _round, [1,0,0,1]] call nou_fnc_addTrack; +// ACE_player sideChat format["c: %1", GVAR(spallIsTrackingCount)]; + +#ifdef DEBUG_MODE_FULL +[ACE_player, _round, [1,0,0,1]] call FUNC(addTrack); +#endif + if(_doFragTrack && alive _round) then { GVAR(trackedObjects) pushBack _round; _spallTrack = []; @@ -44,5 +50,5 @@ if(_doFragTrack && alive _round) then { if(_doSpall) then { [_round, 2, _spallTrack, _spallTrackID] call FUNC(spallTrack); }; - // player sideChat "WTF2"; + // ACE_player sideChat "WTF2"; }; diff --git a/addons/frag/functions/fnc_frag_trace.sqf b/addons/frag/functions/fnc_frag_trace.sqf deleted file mode 100644 index 664e117793..0000000000 --- a/addons/frag/functions/fnc_frag_trace.sqf +++ /dev/null @@ -1,10 +0,0 @@ -#include "script_component.hpp" - -private ["_params", "_shell"]; -_params = _this select 0; -_shell = _params select 0; -if(alive _shell) then { - drop ["\Ca\Data\Cl_basic","","Billboard",1,30,(getPos _shell),[0,0,0],1,1.275,1.0,0.0,[0.5],[[0,1,0,1]],[0],0.0,2.0,"","",""]; -} else { - [_this select 1] call cba_fnc_removePerFrameHandler; -}; \ No newline at end of file diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index 1b737dc70d..de7c6986d9 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -9,14 +9,14 @@ if(!isServer) exitWith { }; // _startTime = diag_tickTime; -private ["_round", "_lastPos", "_lastVel", "_shellType", "_gun", "_fragTypes", "_warn", "_atlPos", "_isArmed", - "_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom", - "_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_target", "_boundingBox", - "_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir", - "_currentCount", "_count", "_vecVar", "_i", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount", - "_sectorSize", "_sectorOffset", "_randomDir"]; - - +private ["_round", "_lastPos", "_lastVel", "_shellType", "_gun", "_fragTypes", "_warn", "_atlPos", "_isArmed", + "_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom", + "_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_target", "_boundingBox", + "_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir", + "_currentCount", "_count", "_vecVar", "_i", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount", + "_sectorSize", "_sectorOffset", "_randomDir", "_endTime"]; + + _round = _this select 0; _lastPos = _this select 1; _lastVel = _this select 2; @@ -108,8 +108,8 @@ _fragArcs = []; _fragArcs set[360, 0]; #ifdef DEBUG_MODE_FULL - player sideChat format["_fragRange: %1", _fragRange]; - player sideChat format["_objects: %1", _objects]; + ACE_player sideChat format["_fragRange: %1", _fragRange]; + ACE_player sideChat format["_objects: %1", _objects]; #endif _doRandom = false; if(_isArmed && (count _objects) > 0) then { @@ -127,16 +127,16 @@ if(_isArmed && (count _objects) > 0) then { _cubic = _bbX*_bbY*_bbZ; if(_cubic > 1) then { _doRandom = true; - + _targetVel = (velocity _target); - - + + _targetPos set[0, (_targetPos select 0)+((_targetVel select 0)*(_distance/_fragPower))]; _targetPos set[1, (_targetPos select 1)+((_targetVel select 1)*(_distance/_fragPower))]; _targetPos set[2, (_targetPos select 2)+_add]; - + _baseVec = _lastPos vectorFromTo _targetPos; - + _dir = floor(_baseVec call CBA_fnc_vectDir); _currentCount = _fragArcs select _dir; if(isNil "_currentCount") then { @@ -153,18 +153,14 @@ if(_isArmed && (count _objects) > 0) then { }; for "_i" from 1 to _count do { _vec = +_baseVec; - + _vec set[0, (_vec select 0)-(_vecVar/2)+(random _vecVar)]; _vec set[1, (_vec select 1)-(_vecVar/2)+(random _vecVar)]; _vec set[2, (_vec select 2)-(_vecVar/2)+(random _vecVar)]; - + _fp = (_fragPower-(random (_fragPowerRandom))); - _vel = [ - (_vec select 0)*_fp, - (_vec select 1)*_fp, - (_vec select 2)*_fp - ]; - + _vel = _vec vectorMultiply _fp; + _fragType = round (random ((count _fragTypes)-1)); _fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; // diag_log text format["fp: %1 %2", _fp, typeOf _fragObj]; @@ -176,7 +172,7 @@ if(_isArmed && (count _objects) > 0) then { GVAR(traceFrags) = true; #endif if(GVAR(traceFrags)) then { - [player, _fragObj, [1,0,0,1]] call FUNC(addTrack); + [ACE_player, _fragObj, [1,0,0,1]] call FUNC(addTrack); }; _fragCount = _fragCount + 1; _currentCount = _currentCount + 1; @@ -201,12 +197,8 @@ if(_isArmed && (count _objects) > 0) then { _fp = (_fragPower-(random (_fragPowerRandom))); - _vel = [ - (_vec select 0)*_fp, - (_vec select 1)*_fp, - (_vec select 2)*_fp - ]; - + _vel = _vec vectorMultiply _fp; + _fragType = round (random ((count _fragTypes)-1)); _fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; _fragObj setPosASL _lastPos; @@ -217,14 +209,14 @@ if(_isArmed && (count _objects) > 0) then { GVAR(traceFrags) = true; #endif if(GVAR(traceFrags)) then { - [player, _fragObj, [1,0.5,0,1]] call FUNC(addTrack); + [ACE_player, _fragObj, [1,0.5,0,1]] call FUNC(addTrack); }; _fragCount = _fragCount + 1; }; }; }; // #ifdef DEBUG_MODE_FULL - // player sideChat format["total frags: %1", GVAR(TOTALFRAGS)]; - // player sideChat format["tracks: %1", (count GVAR(trackedObjects))]; + // ACE_player sideChat format["total frags: %1", GVAR(TOTALFRAGS)]; + // ACE_player sideChat format["tracks: %1", (count GVAR(trackedObjects))]; // #endif // _endTime = diag_tickTime; diff --git a/addons/frag/functions/fnc_spallHP.sqf b/addons/frag/functions/fnc_spallHP.sqf index fb894be499..5e3719cb47 100644 --- a/addons/frag/functions/fnc_spallHP.sqf +++ b/addons/frag/functions/fnc_spallHP.sqf @@ -1,15 +1,15 @@ #include "script_component.hpp" -private ["_initialData", "_currentCount", "_hpData", "_round", "_hpRound"]; +private ["_initialData", "_hpData", "_round", "_hpRound", "_hpDirect"]; //player sideChat format["f: %1 c: %2", (_this select 0), (count GVAR(spallHPData))]; -if((_this select 0) <= (count GVAR(spallHPData))) then { + +if ((_this select 0) <= (count GVAR(spallHPData))) then { _initialData = GVAR(spallHPData) select (_this select 0); - if(!isNil "_initialData") then { + if (!isNil "_initialData") then { _hpRound = ((_this select 1) select 0) select 2; _round = _initialData select 3; _hpDirect = ((_this select 1) select 0) select 10; - if(_hpDirect && {_round == _hpRound}) then { - + if (_hpDirect && {_round == _hpRound}) then { { _hpData = _x; _round = _initialData select 3; @@ -26,4 +26,4 @@ if((_this select 0) <= (count GVAR(spallHPData))) then { } forEach (_this select 1); }; }; -}; \ No newline at end of file +}; diff --git a/addons/frag/functions/fnc_spallTrack.sqf b/addons/frag/functions/fnc_spallTrack.sqf index a264e1ded9..4b7a06bc65 100644 --- a/addons/frag/functions/fnc_spallTrack.sqf +++ b/addons/frag/functions/fnc_spallTrack.sqf @@ -1,30 +1,22 @@ //fnc_spallTrack.sqf #include "script_component.hpp" -private ["_params", "_round", "_multiplier", "_delta", "_curPos", "_velocity", "_velocityStep", "_forwardPos", "_intersectsWith", "_index", "_i", "_test", "_hpId", "_data"]; -// setAccTime 0; + +private ["_round", "_multiplier", "_foundObjects", "_foundObjectHPIds", "_delta", "_curPos", "_velocity", "_velocityStep", "_forwardPos", "_intersectsWith", "_index", "_hpId", "_data"]; _round = _this select 0; _multiplier = _this select 1; _foundObjects = _this select 2; _foundObjectHPIds = _this select 3; -_delta = (1/diag_fps)*_multiplier; +_delta = (1/diag_fps) * _multiplier; _curPos = getPosASL _round; _velocity = velocity _round; -_velocityStep = [ - (_velocity select 0)*_delta, - (_velocity select 1)*_delta, - (_velocity select 2)*_delta - ]; -_forwardPos = [ - (_curPos select 0) + (_velocityStep select 0), - (_curPos select 1) + (_velocityStep select 1), - (_curPos select 2) + (_velocityStep select 2) - ]; - +_velocityStep = _velocity vectorMultiply _delta; +_forwardPos = _curPos vectorAdd _velocityStep; + _intersectsWith = lineIntersectsWith [_curPos, _forwardPos]; -if(count _intersectsWith > 0) then { +if (count _intersectsWith > 0) then { // player sideChat format["inter: %1", _intersectsWith]; { if(!(_x in _foundObjects)) then { @@ -37,4 +29,4 @@ if(count _intersectsWith > 0) then { GVAR(spallHPData) set[_index, _data]; }; } forEach _intersectsWith; -}; \ No newline at end of file +}; diff --git a/addons/frag/functions/fnc_trackFragRound.sqf b/addons/frag/functions/fnc_trackFragRound.sqf index 586bbc0166..8db68c99e8 100644 --- a/addons/frag/functions/fnc_trackFragRound.sqf +++ b/addons/frag/functions/fnc_trackFragRound.sqf @@ -1,6 +1,6 @@ //fnc_trackFragRound.sqf #include "script_component.hpp" -private ["_params", "_round", "_lastPos", "_lastVel", "_type", "_time", "_doSpall", "_skip", "_explosive", "_indirectRange", "_force", "_fragPower"]; +private ["_params", "_round", "_lastPos", "_lastVel", "_type", "_time", "_doSpall", "_spallTrack", "_foundObjectHPIds", "_skip", "_explosive", "_indirectRange", "_force", "_fragPower"]; _params = _this select 0; _round = _params select 0; _lastPos = _params select 1; @@ -15,11 +15,11 @@ if (!alive _round) then { [_this select 1] call cba_fnc_removePerFrameHandler; if(_time != time && {_round in GVAR(trackedObjects)} && {!(_round in GVAR(blackList))}) then { GVAR(trackedObjects) = GVAR(trackedObjects) - [_round]; - _skip = getNumber (configFile >> "CfgAmmo" >> _type >> "ACE_FRAG_SKIP"); + _skip = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip)); if(_skip == 0) then { _explosive = getNumber (configFile >> "CfgAmmo" >> _type >> "explosive"); _indirectRange = getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"); - _force = getNumber (configFile >> "CfgAmmo" >> _type >> "ACE_FRAG_FORCE"); + _force = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force)); _fragPower = getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt(_indirectRange)); if((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1} ) then { [QGVAR(frag_eh), _params] call ace_common_fnc_serverEvent; diff --git a/addons/frag/functions/fnc_trackTrace.sqf b/addons/frag/functions/fnc_trackTrace.sqf index b0f3f06633..371d58b3b1 100644 --- a/addons/frag/functions/fnc_trackTrace.sqf +++ b/addons/frag/functions/fnc_trackTrace.sqf @@ -1,14 +1,14 @@ #include "script_component.hpp" + +private ["_params", "_tracerObj", "_index", "_positions", "_data"]; _params = _this select 0; _tracerObj = _params select 0; _index = _params select 1; -if(alive _tracerObj && (count GVAR(traces)) > 0) then { +if (alive _tracerObj && (count GVAR(traces)) > 0) then { _data = GVAR(traces) select _index; _positions = _data select 4; - _objVel = velocity _tracerObj; - _objTVel = sqrt((_objVel select 0)^2 + (_objVel select 1)^2 + (_objVel select 2)^2); - _positions set[(count _positions), [(getPos _tracerObj), _objTVel]]; + _positions set[(count _positions), [(getPos _tracerObj), vectorMagnitude (velocity _tracerObj)]]; } else { [(_this select 1)] call cba_fnc_removePerFrameHandler; -}; \ No newline at end of file +}; diff --git a/addons/frag/functions/fnc_vectorDiffFast.sqf b/addons/frag/functions/fnc_vectorDiffFast.sqf deleted file mode 100644 index 0a41860727..0000000000 --- a/addons/frag/functions/fnc_vectorDiffFast.sqf +++ /dev/null @@ -1,15 +0,0 @@ -#include "script_component.hpp" -private["_p1","_p2","_return"]; - -_p1 = _this select 0; -_p2 = _this select 1; - -if ((count _p1) != (count _p2)) then {textLogFormat ["BIS_FNC Error: vectors not of same size"]}; - -_return = []; - -{ - _return set[_forEachIndex, (_p2 select _forEachIndex) - _x]; -} forEach _p1; - -_return diff --git a/addons/frag/stringtable.xml b/addons/frag/stringtable.xml index 3fa60aacf7..2e4f86249a 100644 --- a/addons/frag/stringtable.xml +++ b/addons/frag/stringtable.xml @@ -1,14 +1,17 @@ - - - - - Disable Fragmentation - Keine Schrapnelle - Zakázat fragmentaci granátů - Desactivar fragmentación - Wyłącz fragmentację odłamków - Выключить разлёт осколков - Désactive la fragmentation - - - + + + + + Disable Fragmentation + Keine Schrapnelle + Zakázat fragmentaci granátů + Desactivar fragmentación + Wyłącz fragmentację odłamków + Выключить разлёт осколков + Désactive la fragmentation + Repeszek letiltása + Disattiva la frammentazione + Disabilitar Fragmentação + + + diff --git a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf index 01c00511cf..29a4859651 100644 --- a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf +++ b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf @@ -13,6 +13,8 @@ */ #include "script_component.hpp" +private ["_interval", "_player", "_newVel", "_accel", "_currentGForce", "_average", "_sum", "_classCoef", "_suitCoef", "_gBlackOut", "_gRedOut", "_g", "_gBO", "_coef", "_strength"]; + EXPLODE_2_PVT(_this,_params,_pfhId); _interval = time - GVAR(lastUpdateTime); diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index ee62dfdd66..a6fe7c415f 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -17,7 +17,7 @@ #include "script_component.hpp" if (!hasInterface) exitWith {}; -["ACE3", QGVAR(wipeGlasses), localize "STR_ACE_Goggles_WipeGlasses", +["ACE3 Common", QGVAR(wipeGlasses), localize "STR_ACE_Goggles_WipeGlasses", { if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith { call FUNC(clearGlasses); @@ -56,6 +56,7 @@ FUNC(CheckGlasses) = { }; player addEventHandler ["Explosion", { + private "_effects"; if (alive ace_player) then { call FUNC(ApplyDirtEffect); if (GETBROKEN) exitWith {}; diff --git a/addons/goggles/config.cpp b/addons/goggles/config.cpp index efda9b5436..7e8afe4d3d 100644 --- a/addons/goggles/config.cpp +++ b/addons/goggles/config.cpp @@ -247,7 +247,7 @@ class ACE_Settings { class GVAR(showInThirdPerson) { value = 0; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Goggles_ShowInThirdPerson"; }; }; diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirtEffect.sqf index 182ffac910..068f7639d2 100644 --- a/addons/goggles/functions/fnc_applyDirtEffect.sqf +++ b/addons/goggles/functions/fnc_applyDirtEffect.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" if (cameraOn != ace_player || {call FUNC(externalCamera)}) exitWith{false}; -private "_dirtImage"; +private ["_dirtImage", "_applied", "_effects"]; _effects = GETGLASSES(ace_player); _effects set [DIRT, true]; SETGLASSES(ace_player,_effects); diff --git a/addons/goggles/functions/fnc_clearGlasses.sqf b/addons/goggles/functions/fnc_clearGlasses.sqf index b70b962940..7fcb05a511 100644 --- a/addons/goggles/functions/fnc_clearGlasses.sqf +++ b/addons/goggles/functions/fnc_clearGlasses.sqf @@ -16,7 +16,8 @@ */ #include "script_component.hpp" -private "_broken"; +private ["_broken", "_effects"]; + _broken = GETBROKEN; _effects = GLASSESDEFAULT; _effects set [BROKEN, _broken]; diff --git a/addons/goggles/functions/fnc_getExplosionIndex.sqf b/addons/goggles/functions/fnc_getExplosionIndex.sqf index 5519bf397c..6e16085b2c 100644 --- a/addons/goggles/functions/fnc_getExplosionIndex.sqf +++ b/addons/goggles/functions/fnc_getExplosionIndex.sqf @@ -9,7 +9,7 @@ * The rating [0-3] * * Example: - * _rating = 0.05 call ace_goggles_fnc_getExplosionIndex; + * 0.05 call ace_goggles_fnc_getExplosionIndex; * * Public: No */ diff --git a/addons/goggles/functions/fnc_isGogglesVisible.sqf b/addons/goggles/functions/fnc_isGogglesVisible.sqf index 9206965995..253a82f0a3 100644 --- a/addons/goggles/functions/fnc_isGogglesVisible.sqf +++ b/addons/goggles/functions/fnc_isGogglesVisible.sqf @@ -14,8 +14,10 @@ * Public: Yes */ #include "script_component.hpp" -private ["_currentGlasses", "_result", "_unit"]; -_unit = _this select 0; + +PARAMS_1(_unit); + +private ["_currentGlasses", "_result", "_position", "_visible"]; _currentGlasses = goggles _unit; _result = false; diff --git a/addons/goggles/stringtable.xml b/addons/goggles/stringtable.xml index 952a1320a0..ce337760d7 100644 --- a/addons/goggles/stringtable.xml +++ b/addons/goggles/stringtable.xml @@ -1,29 +1,29 @@  - - - Show Goggle Effects in Third Person - Brilleneffekt in dritter Person anzeigen - Mostrar efectos de las gafas en tercera persona - Zobrazit efekt brýlí v třetí osobě - Effets de lunettes à la 3ème personne - Отображать эффект очков от третьего лица - Szemüveg effekt mutatása külső nézetből - Włącz efekty gogli w trzeciej osobie - Mostrar efeitos de óculos em Terceira Pessoa - Attiva l'effetto degli occhiali in terza persona - - - Wipe Goggles - Brille abwischen - Limpiar gafas - Vyčistit brýle - Essuyer les lunettes - Протереть очки - Szemüveg törlése - Wytrzyj gogle - Limpar Óculos - Pulisci gli occhiali - - - + + + Show Goggle Effects in Third Person + Brilleneffekt in dritter Person anzeigen + Mostrar efectos de las gafas en tercera persona + Zobrazit efekt brýlí v třetí osobě + Effets de lunettes à la 3ème personne + Отображать эффект очков от третьего лица + Szemüveg-effekt mutatása külső nézetből + Włącz efekty gogli w trzeciej osobie + Mostrar efeitos de óculos em Terceira Pessoa + Attiva l'effetto degli occhiali in terza persona + + + Wipe Goggles + Brille abwischen + Limpiar gafas + Vyčistit brýle + Essuyer les lunettes + Протереть очки + Szemüveg letörlése + Wytrzyj gogle + Limpar Óculos + Pulisci gli occhiali + + + \ No newline at end of file diff --git a/addons/grenades/CfgAmmo.hpp b/addons/grenades/CfgAmmo.hpp index 0f86230784..0c74f33940 100644 --- a/addons/grenades/CfgAmmo.hpp +++ b/addons/grenades/CfgAmmo.hpp @@ -82,7 +82,7 @@ class CfgAmmo { SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; - timeToLive = 60; + timeToLive = 6; fuseDistance = 2.3; model = PATHTOF(models\ACE_m84_thrown.p3d); }; diff --git a/addons/grenades/CfgMagazines.hpp b/addons/grenades/CfgMagazines.hpp index 33392f41ee..23eb4cb759 100644 --- a/addons/grenades/CfgMagazines.hpp +++ b/addons/grenades/CfgMagazines.hpp @@ -1,6 +1,7 @@ class CfgMagazines { class HandGrenade; class ACE_HandFlare_Base: HandGrenade { + scope = 1; value = 2; nameSoundWeapon = "smokeshell"; nameSound = "smokeshell"; @@ -8,6 +9,8 @@ class CfgMagazines { initSpeed = 22; }; class ACE_HandFlare_White: ACE_HandFlare_Base { + author = "$STR_ACE_Common_ACETeam"; + scope = 2; ammo = "ACE_F_Hand_White"; displayname = "$STR_ACE_Grenades_M127A1_White_Name"; descriptionshort = "$STR_ACE_Grenades_M127A1_White_Description"; @@ -16,6 +19,8 @@ class CfgMagazines { picture = "\A3\Weapons_F\Data\UI\gear_flare_white_ca.paa"; }; class ACE_HandFlare_Red: ACE_HandFlare_Base { + author = "$STR_ACE_Common_ACETeam"; + scope = 2; ammo = "ACE_F_Hand_Red"; displayname = "$STR_ACE_Grenades_M127A1_Red_Name"; descriptionshort = "$STR_ACE_Grenades_M127A1_Red_Description"; @@ -24,6 +29,8 @@ class CfgMagazines { picture = "\A3\Weapons_F\Data\UI\gear_flare_red_ca.paa"; }; class ACE_HandFlare_Green: ACE_HandFlare_Base { + author = "$STR_ACE_Common_ACETeam"; + scope = 2; ammo = "ACE_F_Hand_Green"; displayname = "$STR_ACE_Grenades_M127A1_Green_Name"; descriptionshort = "$STR_ACE_Grenades_M127A1_Green_Description"; @@ -32,6 +39,8 @@ class CfgMagazines { picture = "\A3\Weapons_F\Data\UI\gear_flare_green_ca.paa"; }; class ACE_HandFlare_Yellow: ACE_HandFlare_Base { + author = "$STR_ACE_Common_ACETeam"; + scope = 2; ammo = "ACE_F_Hand_Yellow"; displayname = "$STR_ACE_Grenades_M127A1_Yellow_Name"; descriptionshort = "$STR_ACE_Grenades_M127A1_Yellow_Description"; @@ -40,20 +49,24 @@ class CfgMagazines { picture = "\A3\Weapons_F\Data\UI\gear_flare_yellow_ca.paa"; }; class ACE_M84: HandGrenade { + author = "$STR_ACE_Common_ACETeam"; ammo = "ACE_G_M84"; displayname = "$STR_ACE_Grenades_M84_Name"; descriptionshort = "$STR_ACE_Grenades_M84_Description"; displayNameShort = "M84"; + mass = 4; model = PATHTOF(models\ACE_m84.p3d); picture = PATHTOF(UI\ACE_m84_x_ca.paa); }; class 3Rnd_UGL_FlareGreen_F; class 6Rnd_GreenSignal_F: 3Rnd_UGL_FlareGreen_F { + author = "$STR_ACE_Common_ACETeam"; ammo = "F_40mm_Green"; initSpeed = 120; }; class 6Rnd_RedSignal_F: 6Rnd_GreenSignal_F { + author = "$STR_ACE_Common_ACETeam"; ammo = "F_40mm_Red"; initSpeed = 120; }; diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index 7572a41c10..63516407f3 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -10,7 +10,7 @@ GVAR(flashbangPPEffectCC) = ppEffectCreate ["ColorCorrections", 4265]; GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; // Add keybinds -["ACE3", QGVAR(switchGrenadeMode), localize "STR_ACE_Grenades_SwitchGrenadeMode", +["ACE3 Weapons", QGVAR(switchGrenadeMode), localize "STR_ACE_Grenades_SwitchGrenadeMode", { // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index 3868994bee..9be24bcc47 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -15,63 +15,74 @@ */ #include "script_component.hpp" -private ["_affected", "_strength", "_posGrenade", "_posUnit", "_angleGrenade", "_angleView", "_angleDiff", "_light"]; +private ["_affected", "_strength", "_posGrenade", "_posUnit", "_angleGrenade", "_angleView", "_angleDiff", "_light", "_losCount", "_dirToUnitVector", "_eyeDir", "_eyePos"]; PARAMS_1(_grenade); -_affected = _grenade nearEntities ["CAManBase", 50]; +_affected = _grenade nearEntities ["CAManBase", 20]; { if ((local _x) && {alive _x}) then { _strength = 1 - ((_x distance _grenade) min 15) / 15; + TRACE_3("FlashBangEffect Start",_x,(_x distance _grenade),_strength); + if (_x != ACE_player) then { //must be AI - _x disableAI "MOVE"; - _x disableAI "ANIM"; - _x disableAI "AUTOTARGET"; - _x disableAI "TARGET"; - _x disableAI "FSM"; + [_x, true] call EFUNC(common,disableAI); _x setSkill ((skill _x) / 50); [{ PARAMS_1(_unit); - _unit enableAI "MOVE"; - _unit enableAI "ANIM"; - _unit enableAI "AUTOTARGET"; - _unit enableAI "TARGET"; - _unit enableAI "FSM"; + //Make sure we don't enable AI for unconscious units + if (!(_unit getVariable ["ace_isunconscious", false])) then { + [_unit, false] call EFUNC(common,disableAI); + }; _unit setSkill (skill _unit * 50); }, [_x], (7 * _strength), 0.1] call EFUNC(common,waitAndExecute); //0.1 precision is fine for AI } else { //Do effects for player // is there line of sight to the grenade? _posGrenade = getPosASL _grenade; + _eyePos = eyePos ACE_player; //PositionASL _posGrenade set [2, (_posGrenade select 2) + 0.2]; // compensate for grenade glitching into ground - if (lineIntersects [_posGrenade, getPosASL _x, _grenade, _x]) then { + + _losCount = 0; + //Check for line of sight (check 4 points in case grenade is stuck in an object or underground) + { + if (!lineIntersects [(_posGrenade vectorAdd _x), _eyePos, _grenade, ACE_player]) then { + _losCount = _losCount + 1; + }; + } forEach [[0,0,0], [0,0,0.2], [0.1, 0.1, 0.1], [-0.1, -0.1, 0.1]]; + TRACE_1("Line of sight count (out of 4)",_losCount); + if (_losCount <= 1) then { _strength = _strength / 10; }; - // beeeeeeeeeeeeeeeeeeeeeeeeeeeeep - if (isClass (configFile >> "CfgPatches" >> "ACE_Hearing") and _strength > 0) then { + //Add ace_hearing ear ringing sound effect + if ((isClass (configFile >> "CfgPatches" >> "ACE_Hearing")) && {_strength > 0}) then { [_x, 0.5 + (_strength / 2)] call EFUNC(hearing,earRinging); }; // account for people looking away by slightly // reducing the effect for visual effects. - _posUnit = getPos _x; - _posGrenade = getPos _grenade; - _angleGrenade = ((_posGrenade select 0) - (_posUnit select 0)) atan2 ((_posGrenade select 1) - (_posUnit select 1)); - _angleGrenade = (_angleGrenade + 360) % 360; + _eyeDir = (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]); + _dirToUnitVector = _eyePos vectorFromTo _posGrenade; + _angleDiff = acos (_eyeDir vectorDotProduct _dirToUnitVector); - _angleView = (eyeDirection ACE_player select 0) atan2 (eyeDirection ACE_player select 1); - _angleView = (_angleView + 360) % 360; + //From 0-45deg, full effect + if (_angleDiff > 45) then { + _strength = _strength - _strength * ((_angleDiff - 45) / 120); + }; - _angleDiff = 180 - abs (abs (_angleGrenade - _angleView) - 180); - _angleDiff = ((_angleDiff - 45) max 0); + TRACE_1("Final strength for player",_strength); - _strength = _strength - _strength * (_angleDiff / 135); + + //Add ace_medical pain effect: + if ((isClass (configFile >> "CfgPatches" >> "ACE_Medical")) && {_strength > 0.1}) then { + [ACE_player, (_strength / 2)] call EFUNC(medical,adjustPainLevel); + }; // create flash to illuminate environment _light = "#lightpoint" createVehicleLocal (getPos _grenade); diff --git a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf index a83c81e660..377793ca7b 100644 --- a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf +++ b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf @@ -19,7 +19,8 @@ PARAMS_1(_projectile); if (alive _projectile) then { playSound3D ["A3\Sounds_F\weapons\Explosion\explosion_mine_1.wss", _projectile, false, getPosASL _projectile, 5, 1.2, 400]; - + + private "_affected"; _affected = _projectile nearEntities ["CAManBase", 50]; ["flashbangExplosion", _affected, [_projectile]] call EFUNC(common,targetEvent); }; diff --git a/addons/grenades/stringtable.xml b/addons/grenades/stringtable.xml index 41c699af5f..522c370777 100644 --- a/addons/grenades/stringtable.xml +++ b/addons/grenades/stringtable.xml @@ -1,5 +1,4 @@  - @@ -10,7 +9,7 @@ Změnit styl hodu granátu Changer type de lancer de grenade Сменить режим броска гранаты - Gránátdobás mód váltás + Gránátkezelési mód váltása Cambia tipo di granata Alternar Modo de Granada @@ -20,7 +19,7 @@ Lanzamiento normal Normalny rzut Normální hod - Lancer Normal + Lancer normal Нормальный бросок Normál dobás Lancio normale @@ -32,7 +31,7 @@ Lanzamiento alto Wysoki rzut Vysoký hod - Lancer Haut + Lancer haut Высокий бросок Magas dobás Lancio verso l'alto @@ -44,7 +43,7 @@ Lanzamiento preciso Precyzyjny rzut Přesný hod - Lancer Précis + Lancer précis Точный бросок Pontos dobás Lancio preciso @@ -53,12 +52,12 @@ Roll Grenade Granate rollen - Rodar granada + Lanzamiento raso Po ziemi Po zemi - Lancer Roulé + Lancer roulé Катить гранату - Gurítás + Gránát gurítása Fai rotolare la granata Rolar Granada @@ -70,7 +69,7 @@ Upustit granát Lâcher la grenade Бросить себе под ноги - Ejtés + Gránát ejtése Lascia la granata Largar Granada @@ -78,31 +77,31 @@ M84 Stun Grenade M84 Blendgranate Granada aturdidora M84 - M84 Grenade Incapacitante + M84 Grenade incapacitante Granat hukowy M84 Omračující granát M84 M84 светозвуковая граната - M84 Villanógránát + M84 Kábítógránát Granata Stordente M84 M84 granada de atordoamento Also known as flashbang. Causes immediate flash blindness, deafness, tinnitus, and inner ear disturbance. Verursacht temporäre Blind- und Taubheit. - Produce de manera inmediata ceguera, sordera, tinitus y afecta el oído interior. + Tambien conocida como granada cegadora. Produce de manera inmediata ceguera, sordera, tinitus y afecta el oído interior. Les grenades incapacitantes servent à désorienter ou distraire une menace pendant quelques secondes. Znany też jako flashbang. Powoduje natychmiastową tymczasową ślepotę, głuchotę, dzwonienie w uszach i inne zaburzenia ucha wewnętrznego. Omračující granát je taktická nesmrtící zbraň používaná při záchraně rukojmí a zvládání davu. XM84 (M84) - граната нелетального действия, и предназначена для отвлечения и временного вывода из строя, либо дезориентации противника. Основное использование нашла при освобождении заложников, захвате преступников и террористов, а также проведении диверсионных миссий. - Eldobás után felrobban és éles hang, valamint fényhatással zavarja össze a környezetében tartózkodókat. + Villanógránát néven is ismert. Azonnali villanási vakságot, süketséget, fülzúgást, és belső füli zavart okoz. Anche conosciuta come flashbang. Causa accecamento immediato, sensazioni di sposatezza, mancanza d'equilibrio e disturbi al timpano. - Um tipo de granada não-letal destinado a confundir, desorientar e distrair uma potencial ameaça. + Também conhecida como flashbang. Causa uma clarão imediato, cegueira, surdez, zumbido e distúrbio no tímpano. M127A1 Hand Held Signal (White) M127A1 Leuchtmittel (Weiß) Světlice M127A1 (Bílá) - M127A1 Jelzőrakéta (Fehér) + M127A1 Kézi Jelzőrakéta (Fehér) M127A1 Bengala (Bianco) Flara ręczna sygnałowa M127A1 (biała) M127A1 Sinalizador (Branco) @@ -114,7 +113,7 @@ M127A1 Hand Held Signal (Red) M127A1 Leuchtmittel (Rot) Světlice M127A1 (Červená) - M127A1 Jelzőrakéta (Piros) + M127A1 Kézi Jelzőrakéta (Piros) M127A1 Bengala (Rosso) Flara ręczna sygnałowa M127A1 (czerwona) M127A1 Sinalizador (Vermelho) @@ -126,7 +125,7 @@ M127A1 Hand Held Signal (Green) M127A1 Leuchtmittel (Grün) Světlice M127A1 (Zelená) - M127A1 Jelzőrakéta (Zöld) + M127A1 Kézi Jelzőrakéta (Zöld) M127A1 Bengala (Verde) Flara ręczna sygnałowa M127A1 (zielona) M127A1 Sinalizador (Verde) @@ -138,7 +137,7 @@ M127A1 Hand Held Signal (Yellow) M127A1 Leuchtmittel (Gelb) Světlice M127A1 (Žlutá) - M127A1 Jelzőrakéta (Sárga) + M127A1 Kézi Jelzőrakéta (Sárga) M127A1 Bengala (Giallo) Flara ręczna sygnałowa M127A1 (żółta) M127A1 Sinalizador (Amarelo) @@ -150,10 +149,10 @@ White Hand Flare Weiße Leuchtkugel, wird wie eine Granate geworfen. Světlice (Bílá) - Jelzőrakéta (Fehér) + Kézi jelzőrakéta, Fehér színű Bengala (Bianco) Flara ręczna (biała) - Sinalizador (Branco) + Sinalizador de Mão (Branco) Фальшфейер (Белый) Bengala (Blanca) Feux à main (Blanc) @@ -162,10 +161,10 @@ Red Hand Flare Rote Leuchtkugel, wird wie eine Granate geworfen. Světlice (Červená) - Jelzőrakéta (Piros) + Kézi jelzőrakéta, Piros színű Bengala (Rosso) Flara ręczna (czerwona) - Sinalizador (Vermelho) + Sinalizador de Mão (Vermelho) Фальшфейер (Красный) Bengala (Roja) Feux à main (Rouge) @@ -174,10 +173,10 @@ Green Hand Flare Grüne Leuchtkugel, wird wie eine Granate geworfen. Světlice (Zelená) - Jelzőrakéta (Zöld) + Kézi jelzőrakéta, Zöld színű Bengala (Verde) Flara ręczna (zielona) - Sinalizador (Verde) + Sinalizador de Mão (Verde) Фальшфейер (Зелёный) Bengala (Verde) Feux à main (Vert) @@ -186,10 +185,10 @@ Yellow Hand Flare Gelbe Leuchtkugel, wird wie eine Granate geworfen. Světlice (Žlutá) - Jelzőrakéta (Sárga) + Kézi jelzőrakéta, Sárga színű Bengala (Giallo) Flara ręczna (żółta) - Sinalizador (Amarelo) + Sinalizador de Mão (Amarelo) Фальшфейер (Жёлтые) Bengala (Amarilla) Feux à main (Jaune) @@ -243,4 +242,4 @@ M127A1 (Amarilla) - \ No newline at end of file + diff --git a/addons/hearing/CfgEventHandlers.hpp b/addons/hearing/CfgEventHandlers.hpp index 94b1ab0703..ce968ed2ca 100644 --- a/addons/hearing/CfgEventHandlers.hpp +++ b/addons/hearing/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit) ); @@ -20,9 +19,9 @@ class Extended_Init_EventHandlers { }; class Extended_FiredNear_EventHandlers { - class CAManBase { + class AllVehicles { class GVAR(FiredNear) { - clientFiredNear = QUOTE( if (GVAR(enableCombatDeafness) && {_this select 0 == ACE_player}) then {_this call FUNC(firedNear)}; ); + clientFiredNear = QUOTE(_this call FUNC(firedNear);); }; }; }; diff --git a/addons/hearing/XEH_postInit.sqf b/addons/hearing/XEH_postInit.sqf index adb7827ce7..7b584f8397 100644 --- a/addons/hearing/XEH_postInit.sqf +++ b/addons/hearing/XEH_postInit.sqf @@ -1,7 +1,14 @@ #include "script_component.hpp" +if (!hasInterface) exitWith {}; + GVAR(currentDeafness) = 0; GVAR(newStrength) = 0; +GVAR(playerVehAttenuation) = 1; // Spawn volume updating process [FUNC(updateVolume), 0.1, [] ] call CBA_fnc_addPerFrameHandler; + +//Update veh attunation when player veh changes +["playerVehicleChanged", {_this call FUNC(updatePlayerVehAttenuation);}] call EFUNC(common,addEventHandler); +["playerTurretChanged", {_this call FUNC(updatePlayerVehAttenuation);}] call EFUNC(common,addEventHandler); diff --git a/addons/hearing/XEH_preInit.sqf b/addons/hearing/XEH_preInit.sqf index 0785a32aff..16b9f35f80 100644 --- a/addons/hearing/XEH_preInit.sqf +++ b/addons/hearing/XEH_preInit.sqf @@ -10,6 +10,7 @@ PREP(hasEarPlugsIn); PREP(moduleHearing); PREP(putInEarPlugs); PREP(removeEarPlugs); +PREP(updatePlayerVehAttenuation); PREP(updateVolume); ADDON = true; diff --git a/addons/hearing/config.cpp b/addons/hearing/config.cpp index 6aab92b9bf..0813d0648e 100644 --- a/addons/hearing/config.cpp +++ b/addons/hearing/config.cpp @@ -38,7 +38,7 @@ class ACE_Settings { class GVAR(DisableEarRinging) { value = 0; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Hearing_DisableEarRinging"; }; }; diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index c66361801e..b456b3b872 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -21,18 +21,19 @@ */ #include "script_component.hpp" -private ["_unit", "_firer", "_distance", "_weapon", "_muzzle", "_mode", "_ammo", "_silencer", "_audibleFireCoef", "_loudness", "_strength"]; +private ["_silencer", "_audibleFireCoef", "_audibleFire", "_loudness", "_strength", "_vehAttenuation"]; -_unit = _this select 0; -_firer = _this select 1; -_distance = (_this select 2) max 1; -_weapon = _this select 3; -_muzzle = _this select 4; -_mode = _this select 5; -_ammo = _this select 6; +PARAMS_7(_object,_firer,_distance,_weapon,_muzzle,_mode,_ammo); +//Only run if combatDeafness enabled: +if (!GVAR(enableCombatDeafness)) exitWith {}; +//Only run if firedNear object is player or player's vehicle: +if ((ACE_player != _object) && {(vehicle ACE_player) != _object}) exitWith {}; if (_weapon in ["Throw", "Put"]) exitWith {}; -if (_unit != vehicle _unit && {!([_unit] call EFUNC(common,isTurnedOut))}) exitWith {}; + +_vehAttenuation = if ((ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_player}) then {1} else {GVAR(playerVehAttenuation)}; + +if (_distance < 1) then {_distance = 1;}; _silencer = switch (_weapon) do { case (primaryWeapon _firer) : {(primaryWeaponItems _firer) select 0}; @@ -42,18 +43,15 @@ _silencer = switch (_weapon) do { }; _audibleFireCoef = 1; -//_audibleFireTimeCoef = 1; if (_silencer != "") then { _audibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFire"); - //_audibleFireTimeCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFireTime"); }; _audibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "audibleFire"); -//_audibleFireTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "audibleFireTime"); _loudness = _audibleFireCoef * _audibleFire / 64; -_strength = _loudness - (_loudness/50 * _distance); // linear drop off +_strength = _vehAttenuation * (_loudness - (_loudness/50 * _distance)); // linear drop off if (_strength < 0.01) exitWith {}; -[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2, 0] call EFUNC(common,waitAndExecute); +[{_this call FUNC(earRinging)}, [ACE_player, _strength], 0.2, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/hearing/functions/fnc_moduleHearing.sqf b/addons/hearing/functions/fnc_moduleHearing.sqf index d7b43e0092..a560a712a6 100644 --- a/addons/hearing/functions/fnc_moduleHearing.sqf +++ b/addons/hearing/functions/fnc_moduleHearing.sqf @@ -10,8 +10,7 @@ */ #include "script_component.hpp" -_logic = _this select 0; -_activated = _this select 2; +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; diff --git a/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf b/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf new file mode 100644 index 0000000000..a7285d5e2b --- /dev/null +++ b/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf @@ -0,0 +1,57 @@ +/* + * Author: PabstMirror + * Gets the sound attenuation of a player to the outside. + * + * Arguments: + * None + * + * Return Value: + * Ammount that unit can hear outside + * + * Example: + * [] call ace_hearing_fnc_updatePlayerVehAttenuation + * + * Public: No + */ +#include "script_component.hpp" + +_vehicle = vehicle ACE_player; + +if (isNull _vehicle) exitWith {}; + +_newAttenuation = 1; +if (ACE_player != _vehicle) then { + _effectType = ""; + _turretPath = [ACE_player] call EFUNC(common,getTurretIndex); + _effectType = getText (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "attenuationEffectType"); + + if (!(_turretPath isEqualTo [])) then { + _turretConfig = [(configFile >> "CfgVehicles" >> (typeOf _vehicle)), _turretPath] call EFUNC(common,getTurretConfigPath); + + if ((getNumber (_turretConfig >> "disableSoundAttenuation")) == 1) then { + _effectType = ""; + } else { + if (isText (_turretConfig >> "soundAttenuationTurret")) then { + _effectType = getText (_turretConfig >> "soundAttenuationTurret"); + }; + }; + }; + + _newAttenuation = switch (true) do { + case (_effectType == ""): {1}; + case (_effectType == "CarAttenuation"): {0.5}; + case (_effectType == "RHS_CarAttenuation"): {0.5}; + case (_effectType == "OpenCarAttenuation"): {1}; + case (_effectType == "TankAttenuation"): {0.1}; + case (_effectType == "HeliAttenuation"): {0.3}; + case (_effectType == "OpenHeliAttenuation"): {0.9}; + case (_effectType == "SemiOpenHeliAttenuation"): {0.6}; + case (_effectType == "HeliAttenuationGunner"): {0.85}; + case (_effectType == "HeliAttenuationRamp"): {0.85}; + default {1}; + }; +}; + +TRACE_2("New vehicle attenuation",_vehicle,_newAttenuation); + +GVAR(playerVehAttenuation) = _newAttenuation; diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index 1aa38848a5..a0ca6af457 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -18,6 +18,8 @@ #define STRENGHTODEAFNESS 3 #define MAXDEAFNESS 1.1 +private ["_recoverRate", "_volume"]; + // Exit if combat deafness is disabled if !(GVAR(enableCombatDeafness)) exitWith {}; @@ -56,7 +58,7 @@ if (!(missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false])) then { 0.1 fadeSound _volume; 0.1 fadeSpeech _volume; ACE_player setVariable ["tf_globalVolume", _volume]; - if (!isNil "acre_api_fnc_setGlobalVolume") then {[_volume] call acre_api_fnc_setGlobalVolume;}; + if (!isNil "acre_api_fnc_setGlobalVolume") then {[_volume^(0.33)] call acre_api_fnc_setGlobalVolume;}; }; //hintSilent format ["GVAR(currentDeafness), _Volume = %1, %2", GVAR(currentDeafness), _volume]; diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index a29915d5f8..9bc9063c8d 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -19,7 +19,7 @@ Los tapones para los oídos permiten al usuario operar armamento ruidoso sin sufrir pérdida de audición. Stopery do uszu umożliwiają użytkownikowi przebywać w pobliżu głośnej broni bez poniesienia konsekwencji jaką jest utrata słuchu. Ochranné špunty umožňují uživateli, aby neutrpěl zranění jeho sluchu v blízkosti hlasitých zbraní. - Беруши позволяют избежать потери слуха при близкой громкой стрельбе. + Беруши позволяют носителю находиться возле громкого вооружения без потери слуха. Bouchons Anti-Bruits pour la prévention des traumatismes sonores aigus. Erősebb hanghatásoktól védő füldugó, megakadályozza a nagy hanggal járó fegyverzettől való halláskárosodást. Protetor para ouvidos permitem que o usuário esteja próximo a ruídos sem danificar sua audição. @@ -31,7 +31,7 @@ Poner tapones Włóż stopery Dát špunty do uší - Беруши надеты + Надеть беруши Bouchons mis Füldugó berakva Protetores colocados @@ -43,7 +43,7 @@ Quitar tapones Wyjmij stopery Vyndat špunty z uší - Беруши сняты + Снять беруши Bouchons enlevés Füldugó kivéve Protetores retirados @@ -80,8 +80,8 @@ Nie masz stoperów Nemáš žádné špunty У вас нет беруш - Vous n'avez pas de Bouchons Anti-Bruits - Nincs füldugód + Vous n'avez pas de bouchons anti-bruits + Nincsen füldugód Você não possui protetores auriculares Non hai i tappi auricolari @@ -105,6 +105,8 @@ Knalltrauma deaktivieren Vypnout pískání v uších Wyłącz dzwonienie w uszach + Fülcsengés letiltása + Disabilita il ronzio diff --git a/addons/interact_menu/CfgActions.hpp b/addons/interact_menu/CfgActions.hpp new file mode 100644 index 0000000000..79af4f09b2 --- /dev/null +++ b/addons/interact_menu/CfgActions.hpp @@ -0,0 +1,7 @@ + +class CfgActions { + class None; + class OpenBag: None { + showWindow = 0; + }; +}; diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index 60fce6f4da..8639483537 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -3,6 +3,17 @@ if (!hasInterface) exitWith {}; +GVAR(ParsedTextCached) = []; + +//Setup text/shadow/size/color settings matrix +[] call FUNC(setupTextColors); +["SettingChanged", { + PARAMS_1(_name); + if (_name in [QGVAR(colorTextMax), QGVAR(colorTextMin), QGVAR(colorShadowMax), QGVAR(colorShadowMin), QGVAR(textSize), QGVAR(shadowSetting)]) then { + [] call FUNC(setupTextColors); + }; +}] call EFUNC(common,addEventhandler); + // Install the render EH on the main display addMissionEventHandler ["Draw3D", DFUNC(render)]; @@ -20,24 +31,22 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; }; -["ACE3", QGVAR(InteractKey), (localize "STR_ACE_Interact_Menu_InteractKey"), +["ACE3 Common", QGVAR(InteractKey), (localize "STR_ACE_Interact_Menu_InteractKey"), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Statement [0] call FUNC(keyDown) -}, -{[0] call FUNC(keyUp)}, +},{[0,false] call FUNC(keyUp)}, [219, [false, false, false]], false] call cba_fnc_addKeybind; //Left Windows Key -["ACE3", QGVAR(SelfInteractKey), (localize "STR_ACE_Interact_Menu_SelfInteractKey"), +["ACE3 Common", QGVAR(SelfInteractKey), (localize "STR_ACE_Interact_Menu_SelfInteractKey"), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Statement [1] call FUNC(keyDown) -}, -{[1] call FUNC(keyUp)}, +},{[1,false] call FUNC(keyUp)}, [219, [false, true, false]], false] call cba_fnc_addKeybind; //Left Windows Key + Ctrl/Strg @@ -53,3 +62,6 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; GVAR(actionSelected) = false; [] call FUNC(keyUp); }] call EFUNC(common,addEventhandler); + +// disable firing while the interact menu is is is opened +["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventHandler); diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index dc9b539e6f..937904b471 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -9,7 +9,9 @@ PREP(compileMenu); PREP(compileMenuSelfAction); PREP(collectActiveActionTree); PREP(createAction); +PREP(ctrlSetParsedTextCached); PREP(findActionNode); +PREP(handlePlayerChanged); PREP(isSubPath); PREP(keyDown); PREP(keyUp); @@ -21,6 +23,7 @@ PREP(renderBaseMenu); PREP(renderIcon); PREP(renderMenu); PREP(renderSelector); +PREP(setupTextColors); PREP(splitPath); GVAR(keyDown) = false; @@ -49,4 +52,7 @@ GVAR(expandedTime) = diag_tickTime; GVAR(iconCtrls) = []; GVAR(iconCount) = 0; +GVAR(foundActions) = []; +GVAR(lastTimeSearchedActions) = -1000; + ADDON = true; diff --git a/addons/interact_menu/config.cpp b/addons/interact_menu/config.cpp index 17900c2f6b..52f2f6b9f9 100644 --- a/addons/interact_menu/config.cpp +++ b/addons/interact_menu/config.cpp @@ -14,13 +14,83 @@ class CfgPatches { #include "CfgEventHandlers.hpp" +#include "CfgActions.hpp" + #include "CursorMenus.hpp" class ACE_Settings { class GVAR(AlwaysUseCursorSelfInteraction) { value = 0; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Interact_Menu_AlwaysUseCursorSelfInteraction"; + }; + class GVAR(cursorKeepCentered) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_cursorKeepCentered"; + description = "$STR_ACE_Interact_cursorKeepCenteredDescription"; + }; + class GVAR(AlwaysUseCursorInteraction) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_Menu_AlwaysUseCursorInteraction"; + }; + class GVAR(UseListMenu) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_Menu_UseListMenu"; + }; + class GVAR(colorTextMax) { + value[] = {1, 1, 1, 1}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_Menu_ColorTextMax"; + }; + class GVAR(colorTextMin) { + value[] = {1, 1, 1, 0.25}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_Menu_ColorTextMin"; + }; + class GVAR(colorShadowMax) { + value[] = {0, 0, 0, 1}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_Menu_ColorShadowMax"; + }; + class GVAR(colorShadowMin) { + value[] = {0, 0, 0, 0.25}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_Menu_ColorShadowMin"; + }; + class GVAR(textSize) { + value = 2; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_textSize"; + values[] = {"$str_very_small", "$str_small", "$str_medium", "$str_large", "$str_very_large"}; + }; + class GVAR(shadowSetting) { + value = 2; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_shadowSetting"; + description = "$STR_ACE_Interact_shadowSettingDescription"; + values[] = {"$STR_A3_OPTIONS_DISABLED", "$STR_A3_OPTIONS_ENABLED", "$STR_ACE_Interact_shadowOutline"}; + }; + class GVAR(actionOnKeyRelease) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = "$STR_ACE_Interact_Menu_ActionOnKeyRelease"; }; }; + +class ACE_Extensions { + extensions[] += {"ace_break_line"}; +}; diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index 582fe750a8..6abcebf47e 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -22,6 +22,13 @@ private ["_target","_player","_fullPath","_activeChildren","_dynamicChildren","_ _target = _object; _player = ACE_player; +// Check if the function should be modified first +if !((_origActionData select 10) isEqualTo {}) then { + // It should, so make a copy and pass it to the modifierFunction + _origActionData = +_origActionData; + [_target, ACE_player, _origActionData select 6, _origActionData] call (_origActionData select 10); +}; + // Return nothing if the action itself is not active if !([_target, ACE_player, _origActionData select 6] call (_origActionData select 4)) exitWith { [] diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index a0b9b31dd4..7b995375b7 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -26,8 +26,7 @@ if !(isNil {missionNamespace getVariable [_actionsVarName, nil]}) exitWith {}; private "_recurseFnc"; _recurseFnc = { - private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled", - "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren"]; + private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_position", "_condition", "_showDisabled", "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren", "_modifierFunction", "_i"]; EXPLODE_1_PVT(_this,_actionsCfg); _actions = []; @@ -38,17 +37,32 @@ _recurseFnc = { _distance = getNumber (_entryCfg >> "distance"); _icon = getText (_entryCfg >> "icon"); _statement = compile (getText (_entryCfg >> "statement")); - _selection = getText (_entryCfg >> "selection"); - if (_selection == "") then { - _selection = [0,0,0]; + + // If the position entry is present, compile it + _position = getText (_entryCfg >> "position"); + if (_position != "") then { + _position = compile _position; + } else { + // If the not, but the selection entry is present use that + _position = getText (_entryCfg >> "selection"); + if (_position != "") then { + _position = compile format ["_target selectionPosition '%1'", _position]; + } else { + // Otherwise, just use the origin + _position = {[0,0,0]}; + }; }; + _condition = getText (_entryCfg >> "condition"); if (_condition == "") then {_condition = "true"}; // Add canInteract (including exceptions) and canInteractWith to condition - _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, _target, %1)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; + if ((configName _entryCfg) != "ACE_MainActions") then { + _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, _target, %1)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; + }; _insertChildren = compile (getText (_entryCfg >> "insertChildren")); + _modifierFunction = compile (getText (_entryCfg >> "modifierFunction")); _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; @@ -67,9 +81,10 @@ _recurseFnc = { _condition, _insertChildren, [], - _selection, + _position, _distance, - [_showDisabled,_enableInside,_canCollapse,_runOnHover] + [_showDisabled,_enableInside,_canCollapse,_runOnHover], + _modifierFunction ], _children ]; @@ -95,7 +110,7 @@ missionNamespace setVariable [_actionsVarName, [_actionsCfg] call _recurseFnc]; { true }, {}, [], - [0,0,0], + {[0,0,0]}, 1, [false,false,false] ], diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 968b143701..e767c3525d 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -14,7 +14,7 @@ EXPLODE_1_PVT(_this,_target); -private ["_objectType","_actionsVarName"]; +private ["_objectType","_actionsVarName", "_canCollapse", "_children", "_enableInside", "_entry", "_entryCfg", "_i", "_insertChildren", "_modifierFunction", "_runOnHover"]; _objectType = _target; if (typeName _target == "OBJECT") then { _objectType = typeOf _target; @@ -26,8 +26,8 @@ if !(isNil {missionNamespace getVariable [_actionsVarName, nil]}) exitWith {}; private "_recurseFnc"; _recurseFnc = { - private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled", - "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren"]; + private ["_actions", "_displayName", "_icon", "_statement", "_condition", "_showDisabled", + "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren", "_modifierFunction"]; EXPLODE_1_PVT(_this,_actionsCfg); _actions = []; @@ -46,6 +46,7 @@ _recurseFnc = { _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, _target, %1)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; _insertChildren = compile (getText (_entryCfg >> "insertChildren")); + _modifierFunction = compile (getText (_entryCfg >> "modifierFunction")); _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; @@ -63,10 +64,11 @@ _recurseFnc = { _statement, _condition, _insertChildren, - [], + {}, [0,0,0], 10, //distace - [_showDisabled,_enableInside,_canCollapse,_runOnHover] + [_showDisabled,_enableInside,_canCollapse,_runOnHover], + _modifierFunction ], _children ]; @@ -111,7 +113,7 @@ _actions = [ }, {[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)}, {}, - [], + {}, "Spine3", 10, [false,true,false] diff --git a/addons/interact_menu/functions/fnc_createAction.sqf b/addons/interact_menu/functions/fnc_createAction.sqf index 172bbea3a4..b26cb186f3 100644 --- a/addons/interact_menu/functions/fnc_createAction.sqf +++ b/addons/interact_menu/functions/fnc_createAction.sqf @@ -11,15 +11,16 @@ * 4: Condition * 5: Insert children code (Optional) * 6: Action parameters (Optional) - * 7: Position (Position or Selection Name) or (Optional) + * 7: Position (Position array, Position code or Selection Name) , or (Optional) * 8: Distance (Optional) * 9: Other parameters (Optional) + * 10: Modifier function (Optional) * * Return value: * Action * * Example: - * [VulcanPinch","Vulcan Pinch","",{_target setDamage 1;},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction; + * ["VulcanPinch","Vulcan Pinch","",{_target setDamage 1;},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction; * * Public: No */ @@ -27,7 +28,8 @@ EXPLODE_5_PVT(_this,_actionName,_displayName,_icon,_statement,_condition); -private ["_insertChildren","_customParams","_position","_distance","_params"]; +// IGNORE_PRIVATE_WARNING(_target); +private ["_insertChildren","_customParams","_position","_distance","_params", "_modifierFunction"]; _insertChildren = if (count _this > 5) then { _this select 5 @@ -42,9 +44,19 @@ _customParams = if (count _this > 6) then { }; _position = if (count _this > 7) then { - _this select 7 + if (typeName (_this select 7) == "STRING") then { + // If the action is set to a selection, create the suitable code + compile format ["_target selectionPosition '%1'", _this select 7]; + } else { + if (typeName (_this select 7) == "ARRAY") then { + // If the action is set to a array position, create the suitable code + compile format ["%1", _this select 7]; + } else { + _this select 7 + }; + } } else { - [0,0,0] + {[0,0,0]} }; _distance = if (count _this > 8) then { @@ -59,6 +71,12 @@ _params = if (count _this > 9) then { [false,false,false,false] }; +_modifierFunction = if (count _this > 10) then { + _this select 10 +} else { + {} +}; + [ _actionName, _displayName, @@ -70,5 +88,6 @@ _params = if (count _this > 9) then { _customParams, _position, _distance, - _params + _params, + _modifierFunction ] diff --git a/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf b/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf new file mode 100644 index 0000000000..b5d6a4e967 --- /dev/null +++ b/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf @@ -0,0 +1,15 @@ +// by commy2 +#include "script_component.hpp" + +private ["_ctrl", "_index", "_text"]; + +_ctrl = _this select 0; +_index = _this select 1; +_text = _this select 2; + +//systemChat str (_text != ARR_SELECT(GVAR(ParsedTextCached),_index,"-1")); + +if (_text != ARR_SELECT(GVAR(ParsedTextCached),_index,"-1")) then { + GVAR(ParsedTextCached) set [_index, _text]; + _ctrl ctrlSetStructuredText parseText _text; +}; diff --git a/addons/interact_menu/functions/fnc_findActionNode.sqf b/addons/interact_menu/functions/fnc_findActionNode.sqf index 4027b7a852..b8639754d2 100644 --- a/addons/interact_menu/functions/fnc_findActionNode.sqf +++ b/addons/interact_menu/functions/fnc_findActionNode.sqf @@ -19,7 +19,7 @@ EXPLODE_2_PVT(_this,_actionTreeList,_parentPath); -private ["_parentNode", "_foundParentNode", "_fnc_findFolder"]; +private ["_parentNode", "_foundParentNode", "_fnc_findFolder", "_actionTree"]; // Hack to make this work on the root node too if (count _parentPath == 0) exitWith { diff --git a/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf b/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf new file mode 100644 index 0000000000..cff8bb1048 --- /dev/null +++ b/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf @@ -0,0 +1,31 @@ +/* + * Author: commy2 + * Disables firing while the menu is opened. Called from playerChanged eh. + * + * Argument: + * 0: New unit to add the addAction eh + * 1: Old unit to remove the addAction eh + * + * Return value: + * None + */ +#include "script_component.hpp" + +EXPLODE_2_PVT(_this,_newUnit,_oldUnit); + +// add to new unit +private "_ehid"; +_ehid = [_newUnit, "DefaultAction", {GVAR(openedMenuType) >= 0}, { + if !(GVAR(actionOnKeyRelease)) then { + [GVAR(openedMenuType),true] call FUNC(keyUp); + }; +}] call EFUNC(common,addActionEventHandler); + +_newUnit setVariable [QGVAR(AAEHID), _ehid]; + +// remove from old unit +_ehid = _oldUnit getVariable [QGVAR(AAEHID), -1]; + +[_oldUnit, "DefaultAction", _ehid] call EFUNC(common,removeActionEventHandler); + +_oldUnit setVariable [QGVAR(AAEHID), -1]; diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 47fdfb1951..d4e460c10f 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -29,18 +29,34 @@ if (_menuType == 0) then { }; GVAR(keyDownTime) = diag_tickTime; GVAR(openedMenuType) = _menuType; +GVAR(lastTimeSearchedActions) = -1000; +GVAR(ParsedTextCached) = []; GVAR(useCursorMenu) = (vehicle ACE_player != ACE_player) || visibleMap || - {(_menuType == 1) && {(isWeaponDeployed ACE_player) || GVAR(AlwaysUseCursorSelfInteraction) || {cameraView == "GUNNER"}}}; + {(_menuType == 1) && {(isWeaponDeployed ACE_player) || GVAR(AlwaysUseCursorSelfInteraction) || {cameraView == "GUNNER"}}} || + {(_menuType == 0) && GVAR(AlwaysUseCursorInteraction)}; + if (GVAR(useCursorMenu)) then { createDialog QGVAR(cursorMenu); // The dialog sets: // uiNamespace getVariable QGVAR(dlgCursorMenu); // uiNamespace getVariable QGVAR(cursorMenuOpened); ctrlEnable [91921, true]; + GVAR(cursorPos) = [0.5,0.5,0]; ((finddisplay 91919) displayctrl 91921) ctrlAddEventHandler ["MouseMoving", { - GVAR(cursorPos) = [_this select 1, _this select 2, 0]; + if (GVAR(cursorKeepCentered)) then { + GVAR(cursorPos) = GVAR(cursorPos) vectorAdd [_this select 1, _this select 2, 0] vectorDiff [0.5, 0.5, 0]; + setMousePosition [0.5, 0.5]; + } else { + GVAR(cursorPos) = [_this select 1, _this select 2, 0]; + }; + }]; + // handles LMB in cursor mode when action on keyrelease is disabled + ((finddisplay 91919) displayctrl 91921) ctrlAddEventHandler ["MouseButtonDown", { + if !(GVAR(actionOnKeyRelease)) then { + [GVAR(openedMenuType),true] call FUNC(keyUp); + }; }]; setMousePosition [0.5, 0.5]; }; diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index 735130e69a..7b24497802 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -12,6 +12,9 @@ */ #include "script_component.hpp" +private "_calledByClicking"; +_calledByClicking = _this select 1; + // Exit if there's no menu opened if (GVAR(openedMenuType) < 0) exitWith {true}; @@ -29,6 +32,9 @@ if(GVAR(actionSelected)) then { // Clear the conditions caches ["clearConditionCaches", []] call EFUNC(common,localEvent); + // exit scope if selecting an action on key release is disabled + if (!(GVAR(actionOnKeyRelease)) && !_calledByClicking) exitWith {}; + // Check the action conditions _actionData = GVAR(selectedAction) select 0; if ([_target, _player, _actionData select 6] call (_actionData select 4)) then { diff --git a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf index 898228d6d8..c407273258 100644 --- a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf +++ b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf @@ -19,7 +19,7 @@ EXPLODE_3_PVT(_this,_objectType,_typeNum,_fullPath); -private ["_res","_varName","_actionTrees"]; +private ["_res","_varName","_actionTrees", "_actionIndex", "_parentLevel", "_parentNode"]; _res = _fullPath call FUNC(splitPath); EXPLODE_2_PVT(_res,_parentPath,_actionName); diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index b9afa75616..06c155ac54 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -14,7 +14,7 @@ BEGIN_COUNTER(fnc_render); -private ["_cursorPos1", "_cursorPos2", "_cursorVec", "_p1", "_p2", "_p", "_v", "_cp", "_forEachIndex", "_renderTargets", "_x", "_cursorScreenPos", "_closestDistance", "_closestSelection", "_pos", "_sPos", "_disSq", "_closest", "_cTime", "_delta", "_foundTarget", "_misMatch", "_hoverPath", "_i"]; +private ["_cursorPos1", "_cursorPos2", "_p1", "_p2", "_forEachIndex", "_x", "_cursorScreenPos", "_closestDistance", "_closestSelection", "_sPos", "_disSq", "_closest", "_cTime", "_delta", "_foundTarget", "_misMatch", "_hoverPath", "_i", "_actionData", "_player", "_target"]; _foundTarget = false; _cursorPos1 = positionCameraToWorld [0, 0, 0]; _cursorPos2 = positionCameraToWorld [0, 0, 2]; @@ -119,6 +119,7 @@ if(!_foundTarget && GVAR(actionSelected)) then { }; for "_i" from GVAR(iconCount) to (count GVAR(iconCtrls))-1 do { ctrlDelete (GVAR(iconCtrls) select _i); + GVAR(ParsedTextCached) set [_i, ""]; }; GVAR(iconCtrls) resize GVAR(iconCount); GVAR(iconCount) = 0; diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 45c0c46a61..8e6cb7d390 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -14,50 +14,61 @@ GVAR(currentOptions) = []; -private ["_player","_numInteractObjects","_numInteractions","_actionsVarName","_classActions","_objectActions","_target","_player","_action","_actionData","_active"]; +private ["_player","_numInteractObjects","_numInteractions","_actionsVarName","_classActions","_target","_player","_action","_cameraPos","_cameraDir", "_lambda", "_nearestObjects", "_pos"]; _player = ACE_player; - _fnc_renderNearbyActions = { // Render all nearby interaction menus #define MAXINTERACTOBJECTS 3 + _cameraPos = (positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL); + _cameraDir = ((positionCameraToWorld [0, 0, 1]) call EFUNC(common,positionToASL)) vectorDiff _cameraPos; + + GVAR(foundActions) = []; + GVAR(lastTimeSearchedActions) = diag_tickTime; + _numInteractObjects = 0; - _nearestObjects = nearestObjects [ACE_player, ["All"], 15]; + _nearestObjects = nearestObjects [ACE_player, ["All"], 13]; { _target = _x; - _numInteractions = 0; - // Prevent interacting with yourself or your own vehicle - if (_target != ACE_player && {_target != vehicle ACE_player}) then { + // Quick oclussion test. Skip objects more than 1 m behind the camera plane + _lambda = ((getPosASL _x) vectorDiff _cameraPos) vectorDotProduct _cameraDir; + if (_lambda > -1) then { + _numInteractions = 0; + // Prevent interacting with yourself or your own vehicle + if (_target != ACE_player && {_target != vehicle ACE_player}) then { - // Iterate through object actions, find base level actions and render them if appropiate - _actionsVarName = format [QGVAR(Act_%1), typeOf _target]; - GVAR(objectActionList) = _target getVariable [QGVAR(actions), []]; - { - // Only render them directly if they are base level actions - if (count (_x select 1) == 0) then { - // Try to render the menu + // Iterate through object actions, find base level actions and render them if appropiate + _actionsVarName = format [QGVAR(Act_%1), typeOf _target]; + GVAR(objectActionList) = _target getVariable [QGVAR(actions), []]; + { + // Only render them directly if they are base level actions + if (count (_x select 1) == 0) then { + // Try to render the menu + _action = _x; + if ([_target, _action] call FUNC(renderBaseMenu)) then { + _numInteractions = _numInteractions + 1; + GVAR(foundActions) pushBack [_target, _action]; + }; + }; + } forEach GVAR(objectActionList); + + // Iterate through base level class actions and render them if appropiate + _classActions = missionNamespace getVariable [_actionsVarName, []]; + { _action = _x; + // Try to render the menu if ([_target, _action] call FUNC(renderBaseMenu)) then { _numInteractions = _numInteractions + 1; + GVAR(foundActions) pushBack [_target, _action]; }; - }; - } forEach GVAR(objectActionList); + } forEach _classActions; - // Iterate through base level class actions and render them if appropiate - _classActions = missionNamespace getVariable [_actionsVarName, []]; - { - _action = _x; - // Try to render the menu - if ([_target, _action] call FUNC(renderBaseMenu)) then { - _numInteractions = _numInteractions + 1; + // Limit the amount of objects the player can interact with + if (_numInteractions > 0) then { + _numInteractObjects = _numInteractObjects + 1; }; - } forEach _classActions; - - // Limit the amount of objects the player can interact with - if (_numInteractions > 0) then { - _numInteractObjects = _numInteractObjects + 1; }; }; if (_numInteractObjects >= MAXINTERACTOBJECTS) exitWith {}; @@ -65,7 +76,11 @@ _fnc_renderNearbyActions = { } forEach _nearestObjects; }; - +_fnc_renderLastFrameActions = { + { + _x call FUNC(renderBaseMenu); + } forEach GVAR(foundActions); +}; _fnc_renderSelfActions = { _target = _this; @@ -103,7 +118,13 @@ _fnc_renderSelfActions = { if (GVAR(openedMenuType) == 0) then { if (vehicle ACE_player == ACE_player) then { - call _fnc_renderNearbyActions; + if (diag_tickTime > GVAR(lastTimeSearchedActions) + 0.20) then { + // Once every 0.2 secs, collect nearby objects active and visible action points and render them + call _fnc_renderNearbyActions; + } else { + // The rest of the frames just draw the same action points rendered the last frame + call _fnc_renderLastFrameActions; + }; } else { (vehicle ACE_player) call _fnc_renderSelfActions; }; diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index 9a20962a8f..4daa4a5c90 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -16,7 +16,7 @@ BEGIN_COUNTER(fnc_renderBaseMenu) -private ["_distance","_pos","_weaponDir","_ref","_cameraPos","_sPos","_activeActionTree"]; +private ["_distance","_pos","_weaponDir","_ref","_sPos","_activeActionTree", "_line"]; EXPLODE_2_PVT(_this,_object,_baseActionNode); EXPLODE_1_PVT(_baseActionNode,_actionData); @@ -24,26 +24,33 @@ EXPLODE_1_PVT(_baseActionNode,_actionData); _distance = _actionData select 8; // Obtain a 3D position for the action -if((count _this) > 2) then { - _pos = _this select 2; +_pos = if((count _this) > 2) then { + _this select 2 } else { - if(typeName (_actionData select 7) == "ARRAY") then { - _pos = _object modelToWorldVisual (_actionData select 7); - } else { - if ((_actionData select 7) == "weapon") then { - // Craft a suitable position for weapon interaction - _weaponDir = _object weaponDirection currentWeapon _object; - _ref = _weaponDir call EFUNC(common,createOrthonormalReference); - _pos = (_object modelToWorldVisual (_object selectionPosition "righthand")) vectorAdd ((_ref select 2) vectorMultiply 0.1); - } else { - _pos = _object modelToWorldVisual (_object selectionPosition (_actionData select 7)); - }; - }; + // Setup scope variables for position code + private ["_target"]; + _target = _object; + + // Get action position + _object modelToWorldVisual (call (_actionData select 7)) }; -// For non-self actions, exit if the action is too far away +// For non-self actions, exit if the action is too far away or ocluded if (GVAR(openedMenuType) == 0 && vehicle ACE_player == ACE_player && - {(ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot")) distance _pos >= _distance}) exitWith {false}; + { + private ["_headPos","_actualDistance"]; + _headPos = ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot"); + _actualDistance = _headPos distance _pos; + + if (_actualDistance > _distance) exitWith {true}; + + if (_actualDistance > 1.0) exitWith { + // If distance to action is greater than 1.0 m, check LOS + _line = [_headPos call EFUNC(common,positionToASL), _pos call EFUNC(common,positionToASL), _object, ACE_player]; + lineIntersects _line + }; + false + }) exitWith {false}; // Exit if the action is behind you _sPos = if (count _pos != 2) then { diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index 1cfc13923e..180b5a3c36 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -4,12 +4,9 @@ * * Argument: * 0: Text - * 1: Color + * 1: Icon * 2: 2d position - * 3: ? - * 4: ? - * 5: ? - * 6: Icon + * 3: Text Settings * * Return value: * None @@ -18,11 +15,8 @@ */ #include "script_component.hpp" #define DEFAULT_ICON QUOTE(\z\ace\addons\interaction\ui\dot_ca.paa) -private ["_color", "_sPos", "_ctrl", "_icon"]; -_text = _this select 0; -_color = _this select 1; -_sPos = _this select 2; -_icon = _this select 6; +private ["_ctrl", "_pos", "_displayNum"]; +PARAMS_4(_text,_icon,_sPos,_textSettings); //systemChat format ["Icon %1 - %2,%3", _text, _sPos select 0, _sPos select 1]; @@ -31,12 +25,31 @@ if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]); }; _ctrl = GVAR(iconCtrls) select GVAR(iconCount); -GVAR(iconCount) = GVAR(iconCount) + 1; + if(_icon == "") then { _icon = DEFAULT_ICON; }; -_text = format ["
%4", _icon, _color, _color, _text]; -_ctrl ctrlSetStructuredText (parseText _text); -_ctrl ctrlSetPosition [(_sPos select 0)-(0.125*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.25*SafeZoneW, 0.1*SafeZoneW]; -//_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1]; + +_text = if (GVAR(UseListMenu)) then { + format ["%3", _icon, _textSettings, _text] +} else { + format ["
%3", _icon, _textSettings, "ace_break_line" callExtension _text]; +}; + +//_ctrl ctrlSetStructuredText parseText _text; +[_ctrl, GVAR(iconCount), _text] call FUNC(ctrlSetParsedTextCached); +GVAR(iconCount) = GVAR(iconCount) + 1; + +_pos = if (GVAR(UseListMenu)) then { + [(_sPos select 0)-(0.0095*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.20*SafeZoneW, 0.035*SafeZoneW] +} else { + [(_sPos select 0)-(0.0750*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.15*SafeZoneW, 0.100*SafeZoneW] +}; + +if (GVAR(cursorKeepCentered) && {uiNamespace getVariable [QGVAR(cursorMenuOpened),false]}) then { + _pos set [0, ((_pos select 0) - (GVAR(cursorPos) select 0) + 0.5)]; + _pos set [1, ((_pos select 1) - (GVAR(cursorPos) select 1) + 0.5)]; +}; + +_ctrl ctrlSetPosition _pos; _ctrl ctrlCommit 0; diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index 42e8de16a2..84c7799684 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -private ["_menuInSelectedPath", "_path", "_menuDepth", "_currentRenderDepth", "_x", "_offset", "_newPos", "_forEachIndex"]; +private ["_menuInSelectedPath", "_path", "_menuDepth", "_x", "_offset", "_newPos", "_forEachIndex", "_player", "_pos", "_target", "_textSettings"]; EXPLODE_4_PVT(_this,_parentPath,_action,_sPos,_angles); EXPLODE_3_PVT(_action,_actionData,_activeChildren,_actionObject); @@ -43,21 +43,16 @@ _menuInSelectedPath = true; //END_COUNTER(constructing_paths); //BEGIN_COUNTER(constructing_colors); -// Render icon -// ARGB Color (First Hex Pair is transparancy) -_color = "#FFFFFFFF"; +//Get text color settings string +_textSettings = GVAR(colorSelectedSettings); if(!_menuInSelectedPath) then { - if (_menuDepth > 0) then { - _color = format ["#%1FFFFFF", [255 * ((((count _path) - 1)/_menuDepth) max 0.25)] call EFUNC(common,toHex)]; - } else { - _color = format ["#%1FFFFFF", [255 * 0.75] call EFUNC(common,toHex)]; - }; + _textSettings = (GVAR(textSettingsMatrix) select (count _path)) select _menuDepth; }; //END_COUNTER(constructing_colors); //BEGIN_COUNTER(fnc_renderIcons); -[_actionData select 1, _color, _sPos, 1, 1, 0, _actionData select 2, 0.5, 0.025, "TahomaB"] call FUNC(renderIcon); +[_actionData select 1, _actionData select 2, _sPos, _textSettings] call FUNC(renderIcon); //END_COUNTER(fnc_renderIcons); @@ -73,7 +68,7 @@ if !(_menuInSelectedPath) exitWith {true}; //BEGIN_COUNTER(children); -private ["_numChildren","_angleSpan","_angle","_angleInterval","_scale","_offset"]; +private ["_numChildren","_angleSpan","_angle","_angleInterval","_scaleX", "_scaleY", "_offset", "_textSize"]; _numChildren = count _activeChildren; _angleSpan = _maxAngleSpan min (55 * ((_numChildren) - 1)); if (_angleSpan >= 305) then { @@ -92,10 +87,23 @@ if (_numChildren == 1) then { }; // Scale menu based on the amount of children -_scale = 0.17 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5); +_scaleX = 1; +_scaleY = 1; + +if (GVAR(UseListMenu)) then { + _textSize = [0.75, 0.875, 1, 1.2, 1.4] select GVAR(textSize); + _scaleX = _textSize * 0.17 * 1.1; + _scaleY = 0.17 * 0.30 * 4/3; +} else { + _textSize = if (GVAR(textSize) > 2) then {1.3} else {1}; + _scaleX = _textSize * 0.17 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5); + _scaleY = _textSize * 0.17 * 4/3 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5); +}; + // Animate menu scale if (_menuInSelectedPath && (_menuDepth == count _path)) then { - _scale = _scale * (0.3 + 0.7 * (((diag_tickTime - GVAR(expandedTime)) * 8) min 1)); + _scaleX = _scaleX * (0.3 + 0.7 * (((diag_tickTime - GVAR(expandedTime)) * 8) min 1)); + _scaleY = _scaleY * (0.3 + 0.7 * (((diag_tickTime - GVAR(expandedTime)) * 8) min 1)); }; _target = _actionObject; @@ -106,8 +114,13 @@ _angle = _centerAngle - _angleSpan / 2; { //BEGIN_COUNTER(children); private ["_offset","_newPos"]; - _newPos = [(_sPos select 0) -_scale * cos _angle, - (_sPos select 1) +_scale * (sin _angle) * 4/3]; + _newPos = if (GVAR(UseListMenu)) then { + [(_sPos select 0) + _scaleX, + (_sPos select 1) + _scaleY * (_foreachindex - _numChildren/2 + 0.5)]; + } else { + [(_sPos select 0) - _scaleX * (cos _angle), + (_sPos select 1) + _scaleY * (sin _angle)]; + }; //drawLine3D [_pos, _newPos, [1,0,0,0.8]]; //END_COUNTER(children); diff --git a/addons/interact_menu/functions/fnc_renderSelector.sqf b/addons/interact_menu/functions/fnc_renderSelector.sqf index 44ed15e9c4..7ac9559297 100644 --- a/addons/interact_menu/functions/fnc_renderSelector.sqf +++ b/addons/interact_menu/functions/fnc_renderSelector.sqf @@ -15,16 +15,29 @@ EXPLODE_2_PVT(_this,_sPos,_icon); +private ["_displayNum", "_ctrl", "_pos"]; + if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { _displayNum = [[46, 12] select visibleMap,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]); GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]); }; -private "_ctrl"; _ctrl = GVAR(iconCtrls) select GVAR(iconCount); + +_pos = if (GVAR(UseListMenu)) then { + [_ctrl, GVAR(iconCount), format ["", _icon]] call FUNC(ctrlSetParsedTextCached); + [(_sPos select 0)-(0.014*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.05*SafeZoneW, 0.035*SafeZoneW] +} else { + [_ctrl, GVAR(iconCount), format ["", _icon]] call FUNC(ctrlSetParsedTextCached); + [(_sPos select 0)-(0.050*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.1*SafeZoneW, 0.035*SafeZoneW] +}; + GVAR(iconCount) = GVAR(iconCount) + 1; -_ctrl ctrlSetStructuredText (parseText format ["", _icon]); -_ctrl ctrlSetPosition [(_sPos select 0)-(0.05*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.1*SafeZoneW, 0.035*SafeZoneW]; -//_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1]; +if (GVAR(cursorKeepCentered) && {uiNamespace getVariable [QGVAR(cursorMenuOpened),false]}) then { + _pos set [0, ((_pos select 0) - (GVAR(cursorPos) select 0) + 0.5)]; + _pos set [1, ((_pos select 1) - (GVAR(cursorPos) select 1) + 0.5)]; +}; + +_ctrl ctrlSetPosition _pos; _ctrl ctrlCommit 0; diff --git a/addons/interact_menu/functions/fnc_setupTextColors.sqf b/addons/interact_menu/functions/fnc_setupTextColors.sqf new file mode 100644 index 0000000000..e26ef9dad8 --- /dev/null +++ b/addons/interact_menu/functions/fnc_setupTextColors.sqf @@ -0,0 +1,59 @@ +/* + * Author: PabstMirror + * Builds color strings needed for displaying interaction text + * + * Argument: + * None + * + * Return value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +private ["_menuDepth", "_mixColor", "_pathCount", "_row", "_shadowColor", "_textColor", "_textSize"]; + +//Mixes 2 colors (number arrays) and makes a color string "#AARRGGBB" for structured text +_mixColor = { + PARAMS_3(_color1,_color2,_ratio); + private ["_return", "_mix", "_index"]; + _return = ""; + for "_index" from 0 to 3 do { + _mix = linearConversion [0, 1, _ratio, (_color1 select _index), (_color2 select _index)]; + if (_index != 3) then { + _return = _return + ([255 * _mix] call EFUNC(common,toHex)); + } else { + _return = "#" + ([255 * _mix] call EFUNC(common,toHex)) + _return; + }; + }; + _return +}; + +_textColor = [GVAR(colorTextMin), GVAR(colorTextMax), 1] call _mixColor; +_shadowColor = [GVAR(colorShadowMin), GVAR(colorShadowMax), 1] call _mixColor; +_textSize = switch (GVAR(textSize)) do { + case (0): {0.4}; + case (1): {0.6}; + case (2): {0.8}; + case (3): {1}; + case (4): {1.2}; +}; + +GVAR(colorSelectedSettings) = format ["color='%1' size='%2' shadow='%3' shadowColor='%4' shadowOffset='0.06'", _textColor, _textSize, GVAR(shadowSetting), _shadowColor]; + +GVAR(textSettingsMatrix) = []; +for "_pathCount" from 0 to 15 do { + _row = []; + for "_menuDepth" from 0 to 15 do { + if (_menuDepth > 0) then { + _textColor = [GVAR(colorTextMin), GVAR(colorTextMax), (((_pathCount - 1) / _menuDepth) max 0.25)] call _mixColor; + _shadowColor = [GVAR(colorShadowMin), GVAR(colorShadowMax), (((_pathCount - 1) / _menuDepth) max 0.25)] call _mixColor; + } else { + _textColor = [GVAR(colorTextMin), GVAR(colorTextMax), 0] call _mixColor; + _shadowColor = [GVAR(colorShadowMin), GVAR(colorShadowMax), 0] call _mixColor; + }; + _row pushBack format ["color='%1' size='%2' shadow='%3' shadowColor='%4' shadowOffset='0.06'", _textColor, _textSize, GVAR(shadowSetting), _shadowColor]; + }; + GVAR(textSettingsMatrix) pushBack _row; +}; diff --git a/addons/interact_menu/functions/fnc_splitPath.sqf b/addons/interact_menu/functions/fnc_splitPath.sqf index 935e947b30..790ae83466 100644 --- a/addons/interact_menu/functions/fnc_splitPath.sqf +++ b/addons/interact_menu/functions/fnc_splitPath.sqf @@ -13,7 +13,7 @@ */ #include "script_component.hpp" -private ["_parentPath","_actionName"]; +private ["_parentPath","_actionName", "_i"]; _parentPath = []; for [{_i = 0},{_i < (count _this) - 1},{_i = _i + 1}] do { _parentPath pushBack (_this select _i); diff --git a/addons/interact_menu/script_component.hpp b/addons/interact_menu/script_component.hpp index 958d1c802d..3117065ca2 100644 --- a/addons/interact_menu/script_component.hpp +++ b/addons/interact_menu/script_component.hpp @@ -1,6 +1,8 @@ #define COMPONENT interact_menu #include "\z\ace\addons\main\script_mod.hpp" +// #define DEBUG_MODE_FULL + #ifdef DEBUG_ENABLED_INTERACT_MENU #define DEBUG_MODE_FULL #endif @@ -9,4 +11,6 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_INTERACT_MENU #endif -#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" + +#define ENABLE_PERFORMANCE_COUNTERS diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index d10c6c93b7..633aaa3ee9 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -3,13 +3,37 @@ Always display cursor for self interaction - Toujours afficher le curseur pour l'interaction personnelle Immer den Cursor für Selbst-Interaktionen anzeigen. Mostrar siempre el cursor para la interacción propia - Всегда показывать курсор для взаимодействия с собой + Показывать курсор (взаимодействия с собой) Zobrazit kurzor v menu pro vlastní interakci Zawsze wyświetlaj kursor dla własnej interakcji Toujours afficher le curseur pour les interactions sur soi-même + Mindig legyen a saját cselekvés kurzorja látható + Mostra sempre il cursore per le auto interazioni + Sempre mostrar cursor para interação pessoal + + + Always display cursor for interaction + Mostrar siempre el cursor para la interacción + Toujours afficher le curseur pour les interactions + Mostra sempre il cursore per le interazioni + Zawsze wyświetlaj kursor dla interakcji + Показывать курсор (взаимодействие) + Zobrazit kurzor v menu pro interakci + Immer den Cursor für Fremd-Interaktionen anzeigen + Mindig legyen a cselekvés kurzorja látható + + + Display interaction menus as lists + Mostrar los menus de interacción como listas + Меню взаимодействий в виде списка + Afficher le menu d'interaction sous forme de liste + Mostra il menù di interazione come lista + Wyświetlaj menu interakcji jako listę + Zobrazit menu interakce jako seznam + Interaktionsmenü in Listen anzeigen + Cselekvő menük listaként való megjelenítése Interact Key @@ -19,6 +43,9 @@ Klávesa pro interakci Klawisz interakcji Touche d'interaction + Cselekvő gomb + Tasto interazione + Tecla de Interação Self Interaction Key @@ -28,6 +55,9 @@ Klávesa pro vlastní interakci Klawisz własnej interakcji Touche d'interaction personnelle + Saját cselekvő gomb + Tasto per auto interazioni + Tecla de Interação Pessoal Self Actions @@ -37,6 +67,9 @@ Vlastní akce Własne akcje Interaction personnelle + Saját cselekvések + Auto interazioni + Ações Pessoais Vehicle Actions @@ -46,6 +79,118 @@ Interakce s vozidly Akcje pojazdu Interaction véhicule + Járműves cselekvések + Interazioni con veicoli + Ações de Veículos + + + Interaction - Text Max + Interakcja - Tekst max + Interakce - Text Max + Interaction - Texte Max + Interaktionstextfarbe Max + Interazioni - Testo Massimo + Взаимодействие - Текст Макс. + Interacción - Texto al max. + Cselekvés - Szöveg max. + + + Interaction - Text Min + Interakcja - Tekst min + Interakce - Text Min + Interaction - Texte Min + Interaktionstextfarbe Min + Interazioni - Testo Minimo + Взаимодействие - Текст Мин. + Interacción - Texto al min. + Cselekvés - Szöveg min. + + + Interaction - Shadow Max + Interakcja - Cień max + Interakce - Stín Max + Interaction - Ombre Max + Interaktionstextschatten Max + Interazioni - Ombra Massima + Взаимодействие - Тень Макс. + Interacción - Sombras al max. + Cselekvés - Árnyék max. + + + Interaction - Shadow Min + Interakcja - Cień min + Interakce - Stín Min + Interaction - Ombre Min + Interaktionstextschatten Min + Interazioni - Ombra Minima + Взаимодействие - Тень Мин. + Interacción - Sombras al min. + Cselekvés - Árnyék min. + + + Keep cursor centered + Garder le curseur au centre + Центрировать курсор + Cursor zentriert halten + Kurzor középen tartása + Utrzymaj kursor wyśrodkowany + Mantener el cursor centrado + Udržuj kurzor na středu + + + Keeps cursor centered and pans the option menu around. Useful if screen size is limited. + Udržuje kurzor na středu. Užitečné, pokud je velikost obrazovky omezena. + Garde le curseur au milieu et dispose le menu des options autour. Utile si la taille de l'écran est limitée. + Центрирует курсор и двигает само меню опций. Полезно при ограниченном размере экрана. + Hält den Cursor zentriert und verschiebt das Menü beim Bewegen. Nützlich bei kleinen Bildschirmen. + Középen tartja a kurzort, és a menüelemeket mozgatja. Hasznos lehetőség korlátozott képméretnél. + Utrzymuje kursor na środku ekranu, zamiast tego ruch myszą powoduje przesuwanie menu interakcji. Użyteczne w przypadku kiedy rozmiar ekranu jest ograniczony. + Mantiene el cursor centrado y despliega los menús alrededor. Útil si el tamaño de la pantalla es limitado. + + + Do action when releasing menu key + Aktion nach Loslassen der Taste ausführen + Wykonuj akcje po puszczeniu klawisza menu + Provést akci při pustění klávesy menu + Action au relachement de touche + Выполнять действие при отпускании кнопки взаимодействия + Realizar la acción al soltar la tecla menu + + + Interaction Text Size + Velikost textu interakce + Menü-Schriftgröße + Taille du texte d'interaction + Размер текста (меню взаимодействия) + Tamaño del texto de interacción + Rozmiar tekstu interakcji + + + Interaction Text Shadow + Stín textu interakce + Menü-Hintergrundschatten + Ombre du texte d'interaction + Тень от текста (меню взаимодействия) + Sombra del texto de interacción + Cień tekstu interakcji + + + Allows controlling the text's shadow. Outline ignores custom shadow colors. + Umožňuje změnit stíny textu v menu interakce. Barva stínu je u tahu písma ignorována. + Stellt den Hintergrundschatten ein. Die Einstellung 'Kontur' ignoriert die Farbe des Schattens. + Permet de controler l'ombre du texte. Le contour ne prend pas en compte la couleur des ombres. + Дает возможность изменять тень, отбрасываемую текстом. Контур не зависит от выбранного цвета тени. + Permite contolar la sombra del texto. El contorno ignora los colores personalizados de la sombra. + Pozwala kontrolować cień tekstu. Kontury ignorują niestandardowe kolory cienia. + + + Outline + Kontura + Kontur + Contour + Контур + Contorno + Kontur diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index bd36f42703..5548311718 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -27,7 +27,7 @@ class CfgVehicles { class ACE_Actions { class ACE_MainActions { displayName = "$STR_ACE_Interaction_MainAction"; - distance = 5; + distance = 4; condition = QUOTE(true); statement = ""; icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa"; @@ -35,48 +35,43 @@ class CfgVehicles { class ACE_TeamManagement { displayName = "$STR_ACE_Interaction_TeamManagement"; - distance = 5; - condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player} && {GVAR(EnableTeamManagement)}); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {GVAR(EnableTeamManagement)}); statement = ""; showDisabled = 0; priority = 3.2; icon = PATHTOF(UI\team\team_management_ca.paa); hotkey = "M"; - class ACE_JoinTeamRed { - displayName = "$STR_ACE_Interaction_JoinTeamRed"; - distance = 5; - condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player}); + class ACE_AssignTeamRed { + displayName = "$STR_ACE_Interaction_AssignTeamRed"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); statement = QUOTE([ARR_2(_target,'RED')] call DFUNC(joinTeam)); showDisabled = 1; icon = PATHTOF(UI\team\team_red_ca.paa); priority = 2.4; hotkey = "R"; }; - class ACE_JoinTeamGreen { - displayName = "$STR_ACE_Interaction_JoinTeamGreen"; - distance = 5; - condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player}); + class ACE_AssignTeamGreen { + displayName = "$STR_ACE_Interaction_AssignTeamGreen"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); statement = QUOTE([ARR_2(_target,'GREEN')] call DFUNC(joinTeam)); showDisabled = 1; icon = PATHTOF(UI\team\team_green_ca.paa); priority = 2.3; hotkey = "G"; }; - class ACE_JoinTeamBlue { - displayName = "$STR_ACE_Interaction_JoinTeamBlue"; - distance = 5; - condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player}); + class ACE_AssignTeamBlue { + displayName = "$STR_ACE_Interaction_AssignTeamBlue"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); statement = QUOTE([ARR_2(_target,'BLUE')] call DFUNC(joinTeam)); showDisabled = 1; icon = PATHTOF(UI\team\team_blue_ca.paa); priority = 2.2; hotkey = "B"; }; - class ACE_JoinTeamYellow { - displayName = "$STR_ACE_Interaction_JoinTeamYellow"; - distance = 5; - condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player}); + class ACE_AssignTeamYellow { + displayName = "$STR_ACE_Interaction_AssignTeamYellow"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); statement = QUOTE([ARR_2(_target,'YELLOW')] call DFUNC(joinTeam)); showDisabled = 1; icon = PATHTOF(UI\team\team_yellow_ca.paa); @@ -84,10 +79,9 @@ class CfgVehicles { hotkey = "Y"; }; - class ACE_LeaveTeam { + class ACE_UnassignTeam { displayName = "$STR_ACE_Interaction_LeaveTeam"; - distance = 5; - condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player} && {assignedTeam _player != 'MAIN'}); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'MAIN'}); statement = QUOTE([ARR_2(_target,'MAIN')] call DFUNC(joinTeam)); showDisabled = 1; icon = PATHTOF(UI\team\team_white_ca.paa); @@ -98,9 +92,8 @@ class CfgVehicles { class ACE_JoinGroup { displayName = "$STR_ACE_Interaction_JoinGroup"; - distance = 5; - condition = QUOTE(side group _player == side group _target && {group _player != group _target}); - statement = QUOTE([_player] joinSilent group _target;); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinGroup)); + statement = QUOTE([_player] joinSilent group _target); showDisabled = 0; priority = 2.6; icon = PATHTOF(UI\team\team_management_ca.paa); @@ -109,7 +102,6 @@ class CfgVehicles { class ACE_GetDown { displayName = "$STR_ACE_Interaction_GetDown"; - distance = 5; condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); statement = QUOTE([_target] call DFUNC(getDown)); showDisabled = 0; @@ -117,7 +109,6 @@ class CfgVehicles { }; class ACE_SendAway { displayName = "$STR_ACE_Interaction_SendAway"; - distance = 5; condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); statement = QUOTE([_target] call DFUNC(sendAway)); showDisabled = 0; @@ -125,7 +116,6 @@ class CfgVehicles { }; class ACE_Pardon { displayName = "$STR_ACE_Interaction_Pardon"; - distance = 5; condition = QUOTE(rating _target < -2000 && {alive _target} && {side group _player == side group _target}); statement = QUOTE([ARR_3(_target,'{_this addRating -rating _this}',_target)] call DEFUNC(common,execRemoteFnc)); showDisabled = 0; @@ -176,7 +166,7 @@ class CfgVehicles { }; class ACE_Weapon { displayName = "$STR_ACE_Interaction_Weapon"; - selection = "weapon"; + position = QUOTE(call FUNC(getWeaponPos)); distance = 1.50; condition = ""; statement = ""; @@ -233,7 +223,7 @@ class CfgVehicles { displayName = "$STR_ACE_Interaction_JoinTeamBlue"; condition = QUOTE(true); exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'BLUE')] call FUNC(joinTeam)); + statement = QUOTE([ARR_2(_player,'BLUE')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.2; icon = PATHTOF(UI\team\team_blue_ca.paa); @@ -243,7 +233,7 @@ class CfgVehicles { displayName = "$STR_ACE_Interaction_JoinTeamYellow"; condition = QUOTE(true); exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'YELLOW')] call FUNC(joinTeam)); + statement = QUOTE([ARR_2(_player,'YELLOW')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.1; icon = PATHTOF(UI\team\team_yellow_ca.paa); @@ -254,7 +244,7 @@ class CfgVehicles { displayName = "$STR_ACE_Interaction_LeaveTeam"; condition = QUOTE(assignedTeam _player != 'MAIN'); exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'MAIN')] call FUNC(joinTeam)); + statement = QUOTE([ARR_2(_player,'MAIN')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.5; icon = PATHTOF(UI\team\team_white_ca.paa); @@ -262,9 +252,9 @@ class CfgVehicles { }; class ACE_BecomeLeader { displayName = "$STR_ACE_Interaction_BecomeLeader"; - condition = QUOTE(_this call FUNC(canBecomeLeader)); + condition = QUOTE(_this call DFUNC(canBecomeLeader)); exceptions[] = {"isNotInside"}; - statement = QUOTE(_this call FUNC(doBecomeLeader)); + statement = QUOTE(_this call DFUNC(doBecomeLeader)); showDisabled = 1; priority = 1.0; icon = PATHTOF(UI\team\team_white_ca.paa); @@ -408,6 +398,12 @@ class CfgVehicles { selection = ""; distance = 10; condition = "true"; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; }; }; class ACE_SelfActions { @@ -415,7 +411,7 @@ class CfgVehicles { displayName = "$STR_ACE_Interaction_Passengers"; condition = "true"; statement = ""; - insertChildren = QUOTE(_this call FUNC(addPassengersActions)); + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; }; @@ -426,6 +422,12 @@ class CfgVehicles { selection = ""; distance = 10; condition = "true"; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; }; }; class ACE_SelfActions { @@ -433,7 +435,7 @@ class CfgVehicles { displayName = "$STR_ACE_Interaction_Passengers"; condition = "true"; statement = ""; - insertChildren = QUOTE(_this call FUNC(addPassengersActions)); + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; }; @@ -446,6 +448,12 @@ class CfgVehicles { selection = ""; distance = 10; condition = "true"; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; }; }; class ACE_SelfActions { @@ -453,7 +461,7 @@ class CfgVehicles { displayName = "$STR_ACE_Interaction_Passengers"; condition = "true"; statement = ""; - insertChildren = QUOTE(_this call FUNC(addPassengersActions)); + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; }; @@ -464,6 +472,12 @@ class CfgVehicles { selection = ""; distance = 10; condition = "true"; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; }; }; class ACE_SelfActions { @@ -471,7 +485,7 @@ class CfgVehicles { displayName = "$STR_ACE_Interaction_Passengers"; condition = "true"; statement = ""; - insertChildren = QUOTE(_this call FUNC(addPassengersActions)); + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; }; @@ -489,10 +503,16 @@ class CfgVehicles { displayName = "$STR_ACE_Interaction_Push"; distance = 6; condition = QUOTE(getMass _target < 1000 && {alive _target}); - statement = QUOTE([ARR_2(_target, [ARR_3(2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5)])] call FUNC(push);); + statement = QUOTE([ARR_2(_target, [ARR_3(2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5)])] call DFUNC(push);); showDisabled = 0; priority = -1; }; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; }; }; class ACE_SelfActions { @@ -500,7 +520,7 @@ class CfgVehicles { displayName = "$STR_ACE_Interaction_Passengers"; condition = "true"; statement = ""; - insertChildren = QUOTE(_this call FUNC(addPassengersActions)); + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; }; @@ -512,6 +532,12 @@ class CfgVehicles { selection = "gunnerview"; distance = 2; condition = "true"; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; }; }; class ACE_SelfActions { @@ -519,7 +545,7 @@ class CfgVehicles { displayName = "$STR_ACE_Interaction_Passengers"; condition = "true"; statement = ""; - insertChildren = QUOTE(_this call FUNC(addPassengersActions)); + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; }; diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index 98b1cc1523..6417043df2 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -22,7 +22,7 @@ GVAR(isOpeningDoor) = false; // Add keybinds -["ACE3", QGVAR(openDoor), localize "STR_ACE_Interaction_OpenDoor", +["ACE3 Common", QGVAR(openDoor), localize "STR_ACE_Interaction_OpenDoor", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -42,7 +42,7 @@ GVAR(isOpeningDoor) = false; [57, [false, true, false]], false] call cba_fnc_addKeybind; //Key CTRL+Space -["ACE3", QGVAR(tapShoulder), localize "STR_ACE_Interaction_TapShoulder", +["ACE3 Common", QGVAR(tapShoulder), localize "STR_ACE_Interaction_TapShoulder", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -56,7 +56,7 @@ GVAR(isOpeningDoor) = false; {false}, [20, [true, false, false]], false] call cba_fnc_addKeybind; -["ACE3", QGVAR(modifierKey), localize "STR_ACE_Interaction_ModifierKey", +["ACE3 Common", QGVAR(modifierKey), localize "STR_ACE_Interaction_ModifierKey", { // Conditions: canInteract //if !([ACE_player, objNull, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; // not needed diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf index 6f10a4e834..c2534b44b9 100644 --- a/addons/interaction/XEH_preInit.sqf +++ b/addons/interaction/XEH_preInit.sqf @@ -8,12 +8,15 @@ PREP(addSelectableItem); PREP(applyButtons); PREP(canBecomeLeader); PREP(canInteractWithCivilian); +PREP(canJoinGroup); +PREP(canJoinTeam); PREP(canTapShoulder); PREP(doBecomeLeader); PREP(getDoor); PREP(getDoorAnimations); PREP(getDown); PREP(getSelectedButton); +PREP(getWeaponPos); PREP(hideMenu); PREP(hideMouseHint); PREP(isInRange); diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf index 9e577ed7bb..82e3b3b4fb 100644 --- a/addons/interaction/functions/fnc_addPassengerActions.sqf +++ b/addons/interaction/functions/fnc_addPassengerActions.sqf @@ -24,6 +24,10 @@ _actionTrees = missionNamespace getVariable [_varName, []]; _actions = []; // Mount unit MainActions menu -_actions pushBack [(_actionTrees select 0) select 0, (_actionTrees select 0) select 1, _unit]; + +{ + EXPLODE_2_PVT(_x,_actionData,_children); + _actions pushBack [_actionData, _children, _unit]; +} forEach ((_actionTrees select 0) select 1); _actions diff --git a/addons/interaction/functions/fnc_canJoinGroup.sqf b/addons/interaction/functions/fnc_canJoinGroup.sqf new file mode 100644 index 0000000000..d299524925 --- /dev/null +++ b/addons/interaction/functions/fnc_canJoinGroup.sqf @@ -0,0 +1,12 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +alive _target +&& {!(_target getVariable ["ACE_isUnconscious", false])} +&& {side group _unit == side group _target} +&& {group _unit != group _target} diff --git a/addons/interaction/functions/fnc_canJoinTeam.sqf b/addons/interaction/functions/fnc_canJoinTeam.sqf new file mode 100644 index 0000000000..45f96393a9 --- /dev/null +++ b/addons/interaction/functions/fnc_canJoinTeam.sqf @@ -0,0 +1,12 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +alive _target +&& {!(_target getVariable ["ACE_isUnconscious", false])} +&& {!([_target] call EFUNC(common,isPlayer))} +&& {_target in units group _unit} diff --git a/addons/interaction/functions/fnc_getWeaponPos.sqf b/addons/interaction/functions/fnc_getWeaponPos.sqf new file mode 100644 index 0000000000..477e74f9bf --- /dev/null +++ b/addons/interaction/functions/fnc_getWeaponPos.sqf @@ -0,0 +1,21 @@ +/* + * Author: esteldunedain + * Return a suitable position for the action point for the current weapon + * + * Argument: + * None + * + * Return value: + * Children actions + * + * Public: No + */ +#include "script_component.hpp" +// IGNORE_PRIVATE_WARNING(_target); + +private ["_weaponDir","_refSystem"]; + +_weaponDir = _target weaponDirection currentWeapon _target; +_refSystem = _weaponDir call EFUNC(common,createOrthonormalReference); + +(_target selectionPosition "righthand") vectorAdd ((_refSystem select 2) vectorMultiply 0.1); diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index d28756364b..d702e6b2e3 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -9,6 +9,9 @@ Interakcje Interactions Взаимодействия + Cselekvések + Interazioni + Interaçãoes Torso @@ -17,8 +20,10 @@ Torso Trup Tors - Torse Торс + Testtörzs + Torso + Torso Head @@ -27,17 +32,22 @@ Cabeza Hlava Głowa - Tête Голова + Fej + Testa + Cabeça Left Arm + Bras gauche Linker Arm Brazo izquierdo Levá paže Lewe ramię - Bras gauche Левая рука + Bal kar + Braccio sinistro + Braço Esquerdo Right Arm @@ -47,6 +57,9 @@ Prawe ramię Bras droit Правая рука + Jobb kar + Braccio destro + Braço Direito Left Leg @@ -56,6 +69,9 @@ Lewa noga Jambe gauche Левая нога + Bal láb + Gamba sinistra + Perna Esquerda Right Leg @@ -65,6 +81,9 @@ Prawa noga Jambe droite Правая нога + Jobb láb + Gamba destra + Perna Direita Weapon @@ -73,8 +92,10 @@ Arma Zbraň Broń - Arme Оружие + Fegyver + Arma + Arma Interaction Menu @@ -84,21 +105,21 @@ Menu interakce Menu d'interaction Меню взаимодействия - Interakció + Cselekvő menü Menu de Interação - Menù Interattivo + Menù interazione Interaction Menu (Self) Interaktionsmenü (Selbst) - Menú de interacción (Propia) + Menú de interacción (Propio) Menu interakcji (własne) Menu interakce (vlastní) Menu d'interaction (Perso) Меню взаимодействия (с собой) - Interakció (saját) + Cselekvő menü (saját) Menu de Interação (Individual) - Menù Interattivo (Individuale) + Menù interazione (Individuale) Open / Close Door @@ -108,7 +129,7 @@ Otevřít / Zavřít dveře Ouvrir / Fermer Portes Открыть / Закрыть двери - Ajtó nyitás / zárás + Ajtó nyitása / zárása Abrir / Fechar Porta Apri / Chiudi la porta @@ -132,7 +153,7 @@ Sblocca la porta Разблокировать дверь Destrancar Porta - Zár kinyitása + Zár kinyitása Odblokuj drzwi Odemknout dveře @@ -168,7 +189,7 @@ Přidat se do skupiny Rejoindre Groupe Вступить в группу - Csatlakozás + Csatlakozás a csoporthoz Unir-se ao grupo Unisciti alla squadra @@ -190,7 +211,7 @@ Asumir el liderazgo Przejmij dowodzenie Stát se velitelem - Devenir Leader + Devenir Chef de groupe Стать лидером Vezetés átvétele Tornar-se Líder @@ -206,7 +227,7 @@ ТАНЦЕВАТЬ! TÁNC! DANCE! - Balla! + DANZA! Stop Dancing @@ -360,7 +381,7 @@ Ahoj Salut Привет - Szeva + Helló Olá Ciao @@ -417,8 +438,8 @@ Te tocaron el hombro DERECHO Dir wurde auf die rechte Schulter geklopft On te tape sur l'épaule droite - Zostałeś klepnięty po ramieniu - Vállonveregettek + Zostałeś klepnięty w prawe ramię + Megveregették a JOBB válladat. Někdo tě poklepal na PRAVÉ rameno Вас похлопали по ПРАВОМУ плечу Você foi tocado no ombro @@ -429,8 +450,8 @@ Te tocaron el hombro IZQUIERDO. Dir wurde auf die linke Schulter geklopft On te tape sur l'épaule gauche - Zostałeś klepnięty po ramieniu - Vállonveregettek + Zostałeś klepnięty w lewe ramię + Megveregették a BAL válladat. Někdo tě poklepal na LEVÉ rameno Вас похлопали по ЛЕВОМУ плечу Você foi tocado no ombro. @@ -485,16 +506,16 @@ A Terra! - Team<br/>Management - Team<br/>Management - Gestión<br/>de equipo - Gestion<br/>d'équipe - Zarządzanie<br/>oddziałem - Správa<br/>týmu - Управление<br/>группой - Gerenciamento<br/>de Equipe - Organizzazione<br/>Squadra - Csapat<br/>kezelés + Team Management + Team Management + Gestión de equipo + Gestion d'équipe + Zarządzanie oddziałem + Správa týmu + Управление группой + Gerenciamento de Equipe + Organizzazione Squadra + Csapat kezelése Red @@ -539,93 +560,93 @@ Jaune Żółty Žlutý - Желтый + Жёлтый Amarela Giallo Sárga + + Assign Red + Rot zuweisen + Asignar a rojo + Przydziel do czerwonych + + + Assign Green + Grün zuweisen + Asignar a verde + Przydziel do zielonych + + + Assign Blue + Blau zuweisen + Asignar a azul + Przydziel do niebieskich + + + Assign Yellow + Gelb zuweisen + Asignar a amarillo + Przydziel do żółtych + - Join Team<br/>Red - Team Rot<br/>beitreten - Unirse al<br/>equipo rojo - Rejoindre<br/>Rouge - Dołącz do drużyny<br/>czerwonej - Připojit do<br/>Červeného týmu - Присоединиться<br/>к красной группе - Unir-se à<br/>Equipe Vermelha - Entra nella<br/>Squadra Rossa - Csatlakozás a<br/>piros csapathoz + Join Red + Rot beitreten + Unirse a rojo + Dołącz do czerwonych - Join Team<br/>Green - Team Grün<br/>beitreten - Unirse al<br/>equipo verde - Rejoindre<br/>Verte - Dołącz do<br/>drużyny zielonej - Připojit do<br/>Zeleného týmu - Присоединиться<br/>к зеленой группе - Unir-se à<br/>Equipe Verde - Entra nella<br/>Squadra Verde - Csatlakozás a<br/>zöld csapathoz + Join Green + Grün beitreten + Unirse a verde + Dołącz do zielonych - Join Team<br/>Blue - Team Blau<br/>beitreten - Unirse al<br/>equipo azul - Rejoindre<br/>Bleue - Dołącz do<br/>drużyny niebieskiej - Připojit do<br/>Modrého týmu - Присоединиться<br/>к синей группе - Unir-se à<br/>Equipe Azul - Entra nella<br/>Squadra Blu - Csatlakozás a<br/>kék csapathoz + Join Blue + Blau beitreten + Unirse a azul + Dołącz do niebieskich - Join Team<br/>Yellow - Team Gelb<br/>beitreten - Unirse al<br/>equipo amarillo - Rejoindre<br/>Jaune - Dołącz do<br/>drużyny żółtej - Připojit do<br/>Žlutého týmu - Присоединиться<br/>к желтой группе - Unir-se à<br/>Equipe Amarela - Entra nella<br/>Squadra Gialla - Csatlakozás a<br/>sárga csapathoz + Join Yellow + Gelb beitreten + Unirse a amarillo + Dołącz do żółtych You joined Team %1 - Du bist Team %1 beigetreten + Du bist Gruppe %1 beigetreten Te has unido al equipo %1 Tu as rejoint l'équipe %1 Dołączyłeś do drużyny %1 Připojil ses do %1 týmu Вы присоединились к группе %1 Você uniu-se à Equipe %1 - Sei entrato nella Squadra %1 + Sei entrato nel team %1 Csatlakoztál a %1 csapathoz Leave Team - Team verlassen + Gruppe verlassen Dejar equipo Quitter l'équipe Opuść drużynę Opustit tým Покинуть группу Deixar Equipe - Lascia la Squadra + Lascia il team Csapat elhagyása You left the Team - Du hast das Team verlassen + Du hast die Gruppe verlassen Has dejado el equipo Tu as quitté l'équipe Opuściłeś drużynę Opustil si tým Вы покинули группу Você deixou a Equipe - Hai lasciato la squadra + Hai lasciato il team Elhagytad a csapatot @@ -654,13 +675,13 @@ Modifier Key - Modifikator Taste + Modifikator-Taste Modyfikator Modifier la touche Tecla modificadora Клавиша-модификатор Tecla Modificadora - Modifica Tasto + Modifica tasto Módosító billentyű Modifikátor @@ -674,6 +695,7 @@ Hatótávolságon kívül Poza zasięgiem Mimo dosah + Non in raggio Equipment @@ -684,6 +706,8 @@ Vybavení Felszerelés Снаряжение + Equipaggiamento + Equipamento Push @@ -694,25 +718,32 @@ Odstrčit Tolás Толкать + Spingi + Empurrar Interact Interagir Interagiere - Interagir Interakce Взаимодействовать Interakcja Interactuar + Cselekvés + Interagisci + Interagir Passengers - Fahrzeuginsassen + Insassen Pasajeros Пассажиры Pasažéři Pasażerowie Passagers + Utasok + Passeggeri + Passageiros diff --git a/addons/inventory/config.cpp b/addons/inventory/config.cpp index c7b6649be6..622dacc624 100644 --- a/addons/inventory/config.cpp +++ b/addons/inventory/config.cpp @@ -18,10 +18,10 @@ class ACE_Settings { class GVAR(inventoryDisplaySize) { value = 0; typeName = "SCALAR"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Inventory_SettingName"; description = "$STR_ACE_Inventory_SettingDescription"; - values[] = {"Normal (Default Size)", "Medium", "Bigger"}; + values[] = {"$str_medium", "$str_large", "$str_very_large"}; }; }; diff --git a/addons/inventory/stringtable.xml b/addons/inventory/stringtable.xml index 0702f677fa..6ad5ec0408 100644 --- a/addons/inventory/stringtable.xml +++ b/addons/inventory/stringtable.xml @@ -5,19 +5,25 @@ Make Inventory Display Bigger Erhöhe die angezeigte Inventargröße Hacer la pantalla de inventario mas grande - Сделать окно инвентаря больше + Изменить размер окна инвентаря Zvětšit zobrazení inventáře Powiększ UI ekwipunku Agrandir la taille d'affichage de l'inventaire + Legyen a felszerelés menüje nagyobb + Ingrandisci il menù inventario + Aumentar o Tamanho da Tela do Inventário Normally inventory display is scaled by UI size. This allows scaling the Inventory UI size up, but doesn't increase font size allowing more rows displayed. Im Regelfall wird die Inventargröße durch die Größe der Nutzeroberfläche bestimmt. Diese Einstellung erlaubt es das Inventar unter Ausschluss der Schriftgröße zu vergrößern. Dadurch können mehr Gegenstände angezeigt werden. Normalmente la pantalla de inventario se escala por el tamaño de la interfaz de usuario. Esto permite ampliar el tamaño de la interfaz de usuario de inventario, pero no aumenta el tamaño de fuente, permitiendo mostrar más filas. - Обычно, окно инвентаря зависит от размеров пользовательского интерфейса. Эта настройка позволяет увеличить размер окна инвентаря в пользовательском интерфейсе, не увеличивая размера шрифтов, так что отображется большее количество строк. + Обычно, размер окна инвентаря зависит от размеров пользовательского интерфейса. Эта настройка позволяет увеличить размер окна инвентаря, не увеличивая размеры шрифтов, так что отображется большее количество строк. Normálně se velikost invetáře škáluje s velikostí UI. Toto nastavení dovoluje škálování velikost inventáře ale nežvětšuje velikost fontu. To dovoluje zobrazení více řad v inventáři. Ekwipunek skalowany jest poprzez rozmiar UI. Ta opcja pozwala powiększyć rozmiar UI ekwipunku, lecz nie zwiększa rozmiaru fontu pozwalając na wyświetlanie większej ilości wierszy. L'inventaire est normalement affiché en fonction de la taille de l'UI. Cette option permet d'agrandir l'affichage de l'inventaire, mais n'a aucun effet sur la taille des polices permettant d'afficher plus de ligne + Alaphelyzetben a kezelőfelület mérete skálázza a felszerelési menüt. Ez az opció engedélyezi a menü felskálázását, de megtartja a betűméreteket, így növelve a láthatóságot. + Normalmente il menù inventario è scalato in base alle dimensioni interfaccia. Questa opzione di permette di ingrandirlo ulteriormente ma senza aumentare la dimensione del testo. + Normalmente o tamanho da tela do inventário é ditada pelo tamanho da UI. Isso permite aumentar o tamanho da tela de inventário, mas não aumenta o tamanho da fonte, permitindo que mais linhas sejam visualizadas. diff --git a/addons/javelin/CfgEventhandlers.hpp b/addons/javelin/CfgEventhandlers.hpp index 2c44a05e3a..ae7f95b232 100644 --- a/addons/javelin/CfgEventhandlers.hpp +++ b/addons/javelin/CfgEventhandlers.hpp @@ -9,4 +9,10 @@ class Extended_PostInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_post_init)); clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit)); }; +}; + +class Extended_FiredBIS_EventHandlers { + class All { + ADDON = QUOTE(_this call FUNC(onFired)); + }; }; \ No newline at end of file diff --git a/addons/javelin/CfgVehicles.hpp b/addons/javelin/CfgVehicles.hpp new file mode 100644 index 0000000000..48781036ad --- /dev/null +++ b/addons/javelin/CfgVehicles.hpp @@ -0,0 +1,68 @@ +class CfgVehicles { + class LandVehicle; + class StaticWeapon : LandVehicle { + class Turrets; + }; + + class StaticMGWeapon : StaticWeapon { + class Turrets : Turrets { + class MainTurret; + }; + }; + class AT_01_base_F: StaticMGWeapon {}; + + class B_static_AT_F: AT_01_base_F { + class Turrets : Turrets { + class MainTurret : MainTurret { + weapons[] = { QGVAR(Titan_Static) }; + magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"}; + + turretInfoType = "ACE_RscOptics_javelin"; + gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d); + opticsZoomMin = 0.08333; + opticsZoomMax = 0.04167; + opticsZoomInit = 0.08333; + opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"}; + opticsFlare = 0; + discretefov[] = {0.08333,0.04167}; + discreteInitIndex = 0; + }; + }; + }; + class O_static_AT_F: AT_01_base_F { + class Turrets : Turrets { + class MainTurret : MainTurret { + weapons[] = { QGVAR(Titan_Static) }; + magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"}; + + turretInfoType = "ACE_RscOptics_javelin"; + gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d); + opticsZoomMin = 0.08333; + opticsZoomMax = 0.04167; + opticsZoomInit = 0.08333; + opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"}; + opticsFlare = 0; + discretefov[] = {0.08333,0.04167}; + discreteInitIndex = 0; + }; + }; + }; + class I_static_AT_F: AT_01_base_F { + class Turrets : Turrets { + class MainTurret : MainTurret { + weapons[] = { QGVAR(Titan_Static) }; + magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"}; + + turretInfoType = "ACE_RscOptics_javelin"; + gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d); + opticsZoomMin = 0.08333; + opticsZoomMax = 0.04167; + opticsZoomInit = 0.08333; + opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"}; + opticsFlare = 0; + discretefov[] = {0.08333,0.04167}; + discreteInitIndex = 0; + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/javelin/CfgWeapons.hpp b/addons/javelin/CfgWeapons.hpp index cef967e32e..1bbf713b3b 100644 --- a/addons/javelin/CfgWeapons.hpp +++ b/addons/javelin/CfgWeapons.hpp @@ -1,14 +1,72 @@ class CfgWeapons { class Launcher; + class MissileLauncher; + class Launcher_Base_F : Launcher { class WeaponSlotsInfo; - }; + }; + + // @TODO: AA by default, motherfuckers + class missiles_titan : MissileLauncher { + + }; - class launch_Titan_base : Launcher_Base_F { + class missiles_titan_at : missiles_titan { }; + class GVAR(Titan_Static) : missiles_titan_at { + GVAR(enabled) = 1; weaponInfoType = "ACE_RscOptics_javelin"; modelOptics = PATHTOF(data\reticle_titan.p3d); + canLock = 0; + magazines[] = {"1Rnd_GAT_missiles"}; lockingTargetSound[] = {"",0,1}; - lockedTargetSound[] = {"",0,1}; + lockedTargetSound[] = {"",0,1}; + }; + + // @TODO: AA by default, motherfuckers + class launch_Titan_base : Launcher_Base_F {}; + + class launch_Titan_short_base : launch_Titan_base { }; + + class launch_B_Titan_short_F: launch_Titan_short_base { + GVAR(enabled) = 1; + weaponInfoType = "ACE_RscOptics_javelin"; + modelOptics = PATHTOF(data\reticle_titan.p3d); + + canLock = 0; + + lockingTargetSound[] = {"",0,1}; + lockedTargetSound[] = {"",0,1}; + }; + class launch_I_Titan_short_F: launch_Titan_short_base { + GVAR(enabled) = 1; + weaponInfoType = "ACE_RscOptics_javelin"; + modelOptics = PATHTOF(data\reticle_titan.p3d); + + canLock = 0; + + lockingTargetSound[] = {"",0,1}; + lockedTargetSound[] = {"",0,1}; + }; + class launch_O_Titan_short_F: launch_Titan_short_base { + GVAR(enabled) = 1; + weaponInfoType = "ACE_RscOptics_javelin"; + modelOptics = PATHTOF(data\reticle_titan.p3d); + + canLock = 0; + + + lockingTargetSound[] = {"",0,1}; + lockedTargetSound[] = {"",0,1}; + }; + class launch_Titan_short_F: launch_Titan_short_base { + GVAR(enabled) = 1; + weaponInfoType = "ACE_RscOptics_javelin"; + modelOptics = PATHTOF(data\reticle_titan.p3d); + + canLock = 0; + + lockingTargetSound[] = {"",0,1}; + lockedTargetSound[] = {"",0,1}; }; }; \ No newline at end of file diff --git a/addons/javelin/RscInGameUI.hpp b/addons/javelin/RscInGameUI.hpp index 8b33c95c01..ea1e12626c 100644 --- a/addons/javelin/RscInGameUI.hpp +++ b/addons/javelin/RscInGameUI.hpp @@ -14,7 +14,7 @@ class RscInGameUI { idd = 300; controls[] = { "ACE_javelin_elements_group", "ACE_Targeting" }; //, "ACE_TargetingConstrains", "ACE_TargetingGate", "ACE_TargetingLines"}; onLoad = QUOTE(_this call FUNC(onOpticLoad)); - onUnload = "uiNameSpace setVariable ['ACE_RscOptics_javelin',nil];uiNameSpace setVariable ['ACE_RscOptics_javelin_PFH',nil];"; + onUnload = QUOTE(_this call FUNC(onOpticUnload)); class ACE_javelin_elements_group: RscControlsGroup { @@ -255,9 +255,9 @@ class RscInGameUI { idc = 6999; x = "SafezoneX"; - y = "SafezoneY"; - w = "SafezoneW"; - h = "SafezoneH"; + y = "SafezoneY"; + w = "SafezoneW"; + h = "SafezoneH"; enabled = 0; class Controls { diff --git a/addons/javelin/XEH_pre_init.sqf b/addons/javelin/XEH_pre_init.sqf index 2b2e980191..1accd4a8f4 100644 --- a/addons/javelin/XEH_pre_init.sqf +++ b/addons/javelin/XEH_pre_init.sqf @@ -6,6 +6,7 @@ PREP(lockKeyUp); PREP(cycleFireMode); PREP(showFireMode); +PREP(onFired); PREP(onOpticLoad); PREP(onOpticDraw); diff --git a/addons/javelin/config.cpp b/addons/javelin/config.cpp index 9d7c14e448..cb76da0010 100644 --- a/addons/javelin/config.cpp +++ b/addons/javelin/config.cpp @@ -13,4 +13,5 @@ class CfgPatches { #include "CfgEventhandlers.hpp" #include "RscInGameUI.hpp" #include "CfgSounds.hpp" -#include "CfgWeapons.hpp" \ No newline at end of file +#include "CfgWeapons.hpp" +#include "CfgVehicles.hpp" \ No newline at end of file diff --git a/addons/javelin/functions/fnc_onFired.sqf b/addons/javelin/functions/fnc_onFired.sqf new file mode 100644 index 0000000000..4c0f798167 --- /dev/null +++ b/addons/javelin/functions/fnc_onFired.sqf @@ -0,0 +1,28 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + +// Bail on not missile +if( _shooter != ACE_player) exitWith { false }; + +/* +if( ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "launch_Titan_short_base"] call EFUNC(common,inheritsFrom)) + && + { ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "missiles_titan_at"] call EFUNC(common,inheritsFrom)) } +) exitWith { }; +*/ +_configs = configProperties [configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) >> QGVAR(enabled), "true", false]; +if( (count _configs) < 1) exitWith {}; +_config = _configs select 1; + +_pfh_handle = uiNamespace getVariable ["ACE_RscOptics_javelin_PFH", nil]; +if(!isNil "_pfh_handle") then { + //[_pfh_handle] call cba_fnc_removePerFrameHandler; + //uiNamespace setVariable["ACE_RscOptics_javelin_PFH", nil]; + + __JavelinIGUITargeting ctrlShow false; + __JavelinIGUITargetingGate ctrlShow false; + __JavelinIGUITargetingLines ctrlShow false; + __JavelinIGUITargetingConstraints ctrlShow false; +}; \ No newline at end of file diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index 85877f1f16..86e59bf692 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -5,24 +5,17 @@ TRACE_1("enter", _this); #define __TRACKINTERVAL 0 // how frequent the check should be. #define __LOCKONTIME 3 // Lock on won't occur sooner +private["_apos", "_aposX", "_aposY", "_args", "_boundsInput", "_bpos", "_canFire", "_constraintBottom"]; +private["_constraintLeft", "_constraintRight", "_constraintTop", "_currentTarget", "_fireDisabledEH"]; +private["_firedEH", "_fov", "_lastTick", "_lockTime", "_maxX", "_maxY", "_minX", "_minY", "_newTarget"]; +private["_offsetX", "_offsetY", "_pos", "_randomLockInterval", "_randomPosWithinBounds", "_range"]; +private["_runTime", "_soundTime", "_targetArray", "_zamerny", "_currentShooter"]; + +_currentShooter = (vehicle ACE_player); #define __OffsetX ((ctrlPosition __JavelinIGUITargetingLineV) select 0) - 0.5 #define __OffsetY ((ctrlPosition __JavelinIGUITargetingLineH) select 1) - 0.5 -private["_isJavelin", "_args", "_lastTick", "_runTime", "_soundTime", "_lockTime", "_newTarget", "_currentTarget", "_range", "_pos", "_targetArray"]; - -if( ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "launch_Titan_base"] call EFUNC(common,inheritsFrom)) - || { (vehicle ACE_player) != ACE_player } - ) exitWith { - __JavelinIGUITargeting ctrlShow false; - __JavelinIGUITargetingGate ctrlShow false; - __JavelinIGUITargetingLines ctrlShow false; - __JavelinIGUITargetingConstraints ctrlShow false; - - [(_this select 1)] call cba_fnc_removePerFrameHandler; - uiNamespace setVariable["ACE_RscOptics_javelin_PFH", nil]; -}; - // Reset arguments if we havnt rendered in over a second _args = uiNamespace getVariable[QGVAR(arguments), [] ]; if( (count _args) > 0) then { @@ -40,6 +33,28 @@ _runTime = _args select 2; _lockTime = _args select 3; _soundTime = _args select 4; _randomLockInterval = _args select 5; +_fireDisabledEH = _args select 6; + +_configs = configProperties [configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) >> QGVAR(enabled), "true", false]; + +/* +if( ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "launch_Titan_short_base"] call EFUNC(common,inheritsFrom)) + && + { ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "missiles_titan_at"] call EFUNC(common,inheritsFrom)) } +*/ +if((count _config) < 1) exitWith { + __JavelinIGUITargeting ctrlShow false; + __JavelinIGUITargetingGate ctrlShow false; + __JavelinIGUITargetingLines ctrlShow false; + __JavelinIGUITargetingConstraints ctrlShow false; + + if(!isNil "_fireDisabledEH") then { + _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); + }; + + [(_this select 1)] call cba_fnc_removePerFrameHandler; + uiNamespace setVariable["ACE_RscOptics_javelin_PFH", nil]; +}; // Find a target within the optic range _newTarget = objNull; @@ -54,13 +69,21 @@ if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && // bail on not loaded -if (ACE_player ammo (currentWeapon ACE_player) == 0) exitWith { }; - +if( (vehicle ACE_player) != ACE_player) then { + if( (vehicle player) magazineTurretAmmo ["1Rnd_GAT_missiles", [0]] < 1) exitWith { + TRACE_1("No turret ammo, exit", ""); + }; +} else { + if (ACE_player ammo (currentWeapon ACE_player) < 1 ) exitWith { + TRACE_1("No ammo, exit", ""); + }; +}; + _range = parseNumber (ctrlText __JavelinIGUIRangefinder); TRACE_1("Viewing range", _range); if (_range > 50 && {_range < 2500}) then { _pos = positionCameraToWorld [0,0,_range]; - _targetArray = _pos nearEntities ["AllVehicles", _range/25]; + _targetArray = _pos nearEntities ["AllVehicles", _range/100]; TRACE_1("Searching at range", _targetArray); if (count (_targetArray) > 0) then { _newTarget = _targetArray select 0; @@ -106,6 +129,27 @@ if((call CBA_fnc_getFoV) select 1 > 9) then { __JavelinIGUIWFOV ctrlSetTextColor __ColorGreen; }; +FUNC(disableFire) = { + _firedEH = _this select 0; + + if(_firedEH < 0 && difficulty > 0) then { + _firedEH = [ACE_player, "DefaultAction", {true}, { + _canFire = (_this select 1) getVariable["ace_missileguidance_target", nil]; + if(!isNil "_canFire") exitWith { false }; + true + }] call EFUNC(common,addActionEventHandler); + }; + _firedEH +}; +FUNC(enableFire) = { + _firedEH = _this select 0; + + if(_firedEH > 0 && difficulty > 0) then { + [ACE_player, "DefaultAction", _firedEH] call EFUNC(common,removeActionEventHandler); + }; + -1 +}; + if (isNull _newTarget) then { // No targets found _currentTarget = objNull; @@ -117,12 +161,13 @@ if (isNull _newTarget) then { __JavelinIGUITargetingLines ctrlShow false; __JavelinIGUITargetingConstraints ctrlShow false; - ACE_player setVariable ["ace_missileguidance_target",nil, false]; + _currentShooter setVariable ["ace_missileguidance_target",nil, false]; // Disallow fire - if (ACE_player ammo (currentWeapon ACE_player) > 0) then { ACE_player setWeaponReloadingTime [player, (currentWeapon ACE_player), 0.2]; }; - + _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); } else { + _fov = [] call CBA_fnc_getFoV; + TRACE_1("FOV", _fov); if (_newTarget distance ACE_player < 2500 && {(call CBA_fnc_getFoV) select 1 > 9} && { (currentVisionMode ACE_player == 2)} @@ -173,10 +218,10 @@ if (isNull _newTarget) then { {_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL,__JavelinIGUITargetingGateTR,__JavelinIGUITargetingGateBL,__JavelinIGUITargetingGateBR]; - ACE_player setVariable["ace_missileguidance_target", _currentTarget, false]; + _currentShooter setVariable["ace_missileguidance_target", _currentTarget, false]; // Allow fire - ACE_player setWeaponReloadingTime [player, (currentWeapon ACE_player), 0]; + _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); if(diag_tickTime > _soundTime) then { playSound "ACE_Javelin_Locked"; @@ -188,7 +233,7 @@ if (isNull _newTarget) then { __JavelinIGUITargetingConstrains ctrlShow true; __JavelinIGUITargetingLines ctrlShow false; - ACE_player setVariable["ace_missileguidance_target", nil, false]; + _currentShooter setVariable["ace_missileguidance_target", nil, false]; _boundsInput = if (_currentTarget isKindOf "CAManBase") then { [_newTarget,[-1,-1,-2],_currentTarget selectionPosition "body"]; @@ -217,7 +262,7 @@ if (isNull _newTarget) then { _soundTime = diag_tickTime + 0.25; }; // Disallow fire - if (ACE_player ammo (currentWeapon ACE_player) > 0) then { ACE_player setWeaponReloadingTime [player, (currentWeapon ACE_player), 0.2]; }; + _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); }; }; } else { @@ -231,10 +276,10 @@ if (isNull _newTarget) then { __JavelinIGUITargetingLines ctrlShow false; __JavelinIGUITargetingConstraints ctrlShow false; - ACE_player setVariable ["ace_missileguidance_target",nil, false]; + _currentShooter setVariable ["ace_missileguidance_target",nil, false]; // Disallow fire - if (ACE_player ammo (currentWeapon ACE_player) > 0) then { ACE_player setWeaponReloadingTime [player, (currentWeapon ACE_player), 0.2]; }; + _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); }; }; @@ -246,5 +291,6 @@ _args set[1, _currentTarget]; _args set[2, _runTime]; _args set[3, _lockTime]; _args set[4, _soundTime]; +_args set[6, _fireDisabledEH]; -uiNamespace setVariable[QGVAR(arguments), _args ]; \ No newline at end of file +uiNamespace setVariable[QGVAR(arguments), _args ]; diff --git a/addons/javelin/functions/fnc_onOpticLoad.sqf b/addons/javelin/functions/fnc_onOpticLoad.sqf index d38e1c3305..8e26806162 100644 --- a/addons/javelin/functions/fnc_onOpticLoad.sqf +++ b/addons/javelin/functions/fnc_onOpticLoad.sqf @@ -25,14 +25,16 @@ uiNameSpace setVariable [QGVAR(arguments), 0, // Run Time 0, // Lock Time 0, // Sound timer - (random __LOCKONTIMERANDOM) // random lock time addition + (random __LOCKONTIMERANDOM), // random lock time addition + -1 ] ]; _pfh_handle = uiNamespace getVariable ["ACE_RscOptics_javelin_PFH", nil]; -if(isNil "_pfh_handle") then { - _pfh_handle = [FUNC(onOpticDraw), 0, []] call CBA_fnc_addPerFrameHandler; - uiNamespace setVariable["ACE_RscOptics_javelin_PFH", _pfh_handle]; -}; \ No newline at end of file +if(!isNil "_pfh_handle") then { + [] call FUNC(onOpticUnload); // Unload optic if it was already loaded +}; +_pfh_handle = [FUNC(onOpticDraw), 0, []] call CBA_fnc_addPerFrameHandler; +uiNamespace setVariable["ACE_RscOptics_javelin_PFH", _pfh_handle]; diff --git a/addons/javelin/functions/fnc_onOpticUnload.sqf b/addons/javelin/functions/fnc_onOpticUnload.sqf new file mode 100644 index 0000000000..187b6cf589 --- /dev/null +++ b/addons/javelin/functions/fnc_onOpticUnload.sqf @@ -0,0 +1,21 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +TRACE_1("enter", _this); +private["_args", "_disableFireEH", "_pfh"]; + +uiNameSpace setVariable ['ACE_RscOptics_javelin',nil]; + +_pfh = uiNamespace getVariable["ACE_RscOptics_javelin_PFH", nil ]; +if(!isNil "_pfh") then { + [_pfh] call CBA_fnc_removePerFrameHandler; + uiNameSpace setVariable ['ACE_RscOptics_javelin_PFH',nil]; +}; + +_args = uiNamespace getVariable[QGVAR(arguments), nil ]; +if(!isNil "_args") then { + _disableFireEH = _args select 6; + if(_disableFireEH > 0 && difficulty > 0) then { + [ACE_player, "DefaultAction", _disableFireEH] call EFUNC(common,removeActionEventHandler); + }; + uiNameSpace setVariable [QGVAR(arguments),nil]; +}; diff --git a/addons/javelin/functions/fnc_showFireMode.sqf b/addons/javelin/functions/fnc_showFireMode.sqf index 35dff9dbd3..88374548c0 100644 --- a/addons/javelin/functions/fnc_showFireMode.sqf +++ b/addons/javelin/functions/fnc_showFireMode.sqf @@ -4,8 +4,8 @@ TRACE_1("enter", _this); private["_player", "_currentFireMode"]; -_currentFireMode = ACE_player getVariable["ace_missileguidance_attackProfile", "TOP"]; -if(_currentFireMode == "TOP") then { +_currentFireMode = ACE_player getVariable["ace_missileguidance_attackProfile", "JAV_TOP"]; +if(_currentFireMode == "JAV_TOP") then { __JavelinIGUITop ctrlSetTextColor __ColorGreen; __JavelinIGUIDir ctrlSetTextColor __ColorGray; } else { diff --git a/addons/javelin/initKeybinds.sqf b/addons/javelin/initKeybinds.sqf index ecce40bbf0..2c095b93fc 100644 --- a/addons/javelin/initKeybinds.sqf +++ b/addons/javelin/initKeybinds.sqf @@ -1,9 +1,9 @@ // by commy2 -["ACE3", QGVAR(lockTarget), localize "STR_ACE_JAVELIN_LockTarget", +["ACE3 Weapons", QGVAR(lockTarget), localize "STR_ACE_JAVELIN_LockTarget", { if (GETGVAR(isLockKeyDown,false)) exitWith {false}; - + GVAR(isLockKeyDown) = true; // Statement @@ -14,16 +14,16 @@ { // prevent holding down GVAR(isLockKeyDown) = false; - + // Statement [ACE_player] call FUNC(lockKeyUp); false }, [15, [false, false, false]], false] call cba_fnc_addKeybind; //Tab Key -["ACE3", QGVAR(cycleFireMode), localize "STR_ACE_JAVELIN_CycleFireMode", +["ACE3 Weapons", QGVAR(cycleFireMode), localize "STR_ACE_JAVELIN_CycleFireMode", { false }, -{ +{ [ACE_player] call FUNC(cycleFireMode); false }, diff --git a/addons/javelin/stringtable.xml b/addons/javelin/stringtable.xml index f0e933ad0d..0557968115 100644 --- a/addons/javelin/stringtable.xml +++ b/addons/javelin/stringtable.xml @@ -1,21 +1,29 @@ - - - - - Lock Target (Hold) - Ziel aufschalten - Захватить цель (удерживать) - Zamknout cíl(držet) - Namierz cel (przytrzymaj) - Verrouiller cible (maintenir) - - - Cycle Fire Mode - Wechsle Feuermodus - Переключение режимов огня - Cyklování režimů palby - Przełącz tryb ognia - Cycle mode de tir - - - + + + + + Lock Target (Hold) + Ziel aufschalten + Захватить цель (удерживать) + Zamknout cíl (držet) + Namierz cel (przytrzymaj) + Verrouiller la cible (maintenir) + Célpontra állás (Lenyomva tartott) + Aggangia il bersagio + Fijar objetivo (Mantener) + Travar Alvo(Segurar) + + + Cycle Fire Mode + Wechsle Feuermodus + Переключение режимов огня + Přepínání režimů palby + Przełącz tryb ognia + Cycle mode de tir + Tüzelési mód váltása + Alterna le modalità di fuoco + Cambiar modo de disparo + Alterar Modo de Disparo + + + \ No newline at end of file diff --git a/addons/kestrel4500/XEH_postInit.sqf b/addons/kestrel4500/XEH_postInit.sqf index 878f9ca0ce..461ed533db 100644 --- a/addons/kestrel4500/XEH_postInit.sqf +++ b/addons/kestrel4500/XEH_postInit.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" -//#include "initKeybinds.sqf" +#include "initKeybinds.sqf" GVAR(Menus) = ["Direction", "Wind SPD m/s", "CROSSWIND m/s", "HEADWIND m/s", "TEMP °C", "HUMIDITY %", "BARO hPA", "ALTITUDE m", "User Screen 1", "User Screen 2"]; diff --git a/addons/kestrel4500/functions/fnc_collectData.sqf b/addons/kestrel4500/functions/fnc_collectData.sqf index 8ebd4e01d2..a812ad0f7c 100644 --- a/addons/kestrel4500/functions/fnc_collectData.sqf +++ b/addons/kestrel4500/functions/fnc_collectData.sqf @@ -14,12 +14,12 @@ */ #include "script_component.hpp" -private ["_playerDir", "_windSpeed", "_windDir", "_crosswind", "_headwind", "_humidity", "_temperature", "_humidity", "_barometricPressure", "_altitude"]; +private ["_playerDir", "_windSpeed", "_crosswind", "_headwind", "_humidity", "_temperature", "_humidity", "_barometricPressure", "_altitude"]; if (isNil QGVAR(MIN) || isNil QGVAR(MAX)) then { _temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL ACE_player) select 2); _humidity = EGVAR(weather,currentHumidity); - _barometricPressure = 1013.25 * exp(-(EGVAR(weather,Altitude) + ((getPosASL ACE_player) select 2)) / 7990) - 10 * overcast; + _barometricPressure = ((getPosASL ACE_player) select 2) call EFUNC(weather,calculateBarometricPressure); _altitude = EGVAR(weather,Altitude) + ((getPosASL ACE_player) select 2); GVAR(MIN) = [0, 0, 0, 0, _temperature, _humidity, _barometricPressure, _altitude]; GVAR(MAX) = [0, 0, 0, 0, _temperature, _humidity, _barometricPressure, _altitude]; @@ -82,7 +82,7 @@ GVAR(MAX) set [5, _humidity max (GVAR(MAX) select 5)]; GVAR(TOTAL) set [5, (GVAR(TOTAL) select 5) + _humidity]; // BARO -_barometricPressure = 1013.25 * exp(-(EGVAR(weather,Altitude) + ((getPosASL ACE_player) select 2)) / 7990) - 10 * overcast; +_barometricPressure = ((getPosASL ACE_player) select 2) call EFUNC(weather,calculateBarometricPressure); GVAR(MIN) set [6, (GVAR(MIN) select 6) min _barometricPressure]; GVAR(MAX) set [6, _barometricPressure max (GVAR(MAX) select 6)]; GVAR(TOTAL) set [6, (GVAR(TOTAL) select 6) + _barometricPressure]; diff --git a/addons/kestrel4500/functions/fnc_displayKestrel.sqf b/addons/kestrel4500/functions/fnc_displayKestrel.sqf index 2c1241bb6c..8eb2cea0ad 100644 --- a/addons/kestrel4500/functions/fnc_displayKestrel.sqf +++ b/addons/kestrel4500/functions/fnc_displayKestrel.sqf @@ -42,9 +42,7 @@ if (GVAR(Kestrel4500) && dialog) then { GVAR(Overlay) = true; -[{ - private ["_outputData", "_updateTimer"]; - +[{ // abort condition if (!GVAR(Overlay) || {!(("ACE_Kestrel4500" in (uniformItems ACE_player)) || ("ACE_Kestrel4500" in (vestItems ACE_player)))}) exitWith { GVAR(Overlay) = false; @@ -55,6 +53,7 @@ GVAR(Overlay) = true; if (diag_tickTime > GVAR(updateTimer)) then { GVAR(updateTimer) = diag_tickTime + 1; + private ["_outputData"]; _outputData = [] call FUNC(generateOutputData); 3 cutRsc ["RscKestrel4500", "PLAIN", 1, false]; diff --git a/addons/kestrel4500/functions/fnc_generateOutputData.sqf b/addons/kestrel4500/functions/fnc_generateOutputData.sqf index e7679df53f..6b139fe72e 100644 --- a/addons/kestrel4500/functions/fnc_generateOutputData.sqf +++ b/addons/kestrel4500/functions/fnc_generateOutputData.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -private ["_playerDir", "_textTop", "_textCenterBig", "_textCenterLine1Left", "_textCenterLine2Left", "_textCenterLine3Left", "_textCenterLine1Right", "_textCenterLine2Right", "_textCenterLine3Right", "_textInfoLine1", "_textInfoLine2", "_temperature", "_humidity", "_windSpeed", "_windDir", "_newWindSpeed", "_windSource", "_height"]; +private ["_playerDir", "_textTop", "_textCenterBig", "_textCenterLine1Left", "_textCenterLine2Left", "_textCenterLine3Left", "_textCenterLine1Right", "_textCenterLine2Right", "_textCenterLine3Right", "_textInfoLine1", "_textInfoLine2", "_temperature", "_humidity", "_windSpeed", "_windDir"]; [] call FUNC(collectData); @@ -88,7 +88,7 @@ switch (GVAR(Menu)) do { if (!GVAR(MinAvgMax)) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { _textCenterBig = Str(round(abs(sin(GVAR(RefHeading) - _playerDir) * _windSpeed) * 10) / 10); - _textInfoLine1 = format["%1 m/s @ %2", round((cos(_playerDir - _windDir) * _windSpeed) * 10) / 10, round(_playerDir)]; + _textInfoLine1 = format["%1 m/s @ %2", round((abs(cos(_playerDir - _windDir)) * _windSpeed) * 10) / 10, round(_playerDir)]; } else { _textCenterBig = Str(round(abs(sin(GVAR(RefHeading)) * _windSpeed) * 10) / 10); _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(_windDir)]; @@ -120,7 +120,7 @@ switch (GVAR(Menu)) do { if (!GVAR(MinAvgMax)) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { _textCenterBig = Str(round(abs(cos(GVAR(RefHeading) - _playerDir) * _windSpeed) * 10) / 10); - _textInfoLine1 = format["%1 m/s @ %2", round((cos(_playerDir - _windDir) * _windSpeed) * 10) / 10, round(_playerDir)]; + _textInfoLine1 = format["%1 m/s @ %2", round((abs(cos(_playerDir - _windDir)) * _windSpeed) * 10) / 10, round(_playerDir)]; } else { _textCenterBig = Str(round(abs(cos(GVAR(RefHeading)) * _windSpeed) * 10) / 10); _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(_windDir)]; @@ -174,7 +174,7 @@ switch (GVAR(Menu)) do { }; case 6: { // BARO if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round((1013.25 * exp(-(EGVAR(weather,Altitude) + ((getPosASL ACE_player) select 2)) / 7990) - 10 * overcast) * 10) / 10); + _textCenterBig = Str(round((((getPosASL ACE_player) select 2) call EFUNC(weather,calculateBarometricPressure)) * 10) / 10); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; diff --git a/addons/kestrel4500/initKeybinds.sqf b/addons/kestrel4500/initKeybinds.sqf index 657e10d907..f6b4fec3ce 100644 --- a/addons/kestrel4500/initKeybinds.sqf +++ b/addons/kestrel4500/initKeybinds.sqf @@ -1,23 +1,23 @@ -["ACE3", QGVAR(KestrelDialogKey), localize "STR_ACE_Kestrel4500_KestrelDialogKey", +["ACE3 Equipment", QGVAR(KestrelDialogKey), localize "STR_ACE_Kestrel4500_KestrelDialogKey", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; - + // Statement [] call FUNC(createKestrelDialog); false }, {false}, -[70, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // (SCROLL) +[0, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // (empty default key) -["ACE3", QGVAR(DisplayKestrelKey), localize "STR_ACE_Kestrel4500_DisplayKestrelKey", +["ACE3 Equipment", QGVAR(DisplayKestrelKey), localize "STR_ACE_Kestrel4500_DisplayKestrelKey", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; - + // Statement [] call FUNC(displayKestrel); false }, {false}, -[70, [true, false, false]], false, 0] call CBA_fnc_addKeybind; // (SHIFT + SCROLL) +[0, [true, false, false]], false, 0] call CBA_fnc_addKeybind; // (empty default key) diff --git a/addons/kestrel4500/stringtable.xml b/addons/kestrel4500/stringtable.xml index 310884f989..88eb1fd146 100644 --- a/addons/kestrel4500/stringtable.xml +++ b/addons/kestrel4500/stringtable.xml @@ -1,5 +1,4 @@  - @@ -17,26 +16,70 @@ Kestrel 4500 Pocket Weather Tracker Anemomentr skrzydełkowy Kestrel 4500 + Карманная метеостанция Kestrel 4500NV + Station météo portable Kestrel 4500 + Estación meteorológica Kestrel 4500 + Kestrel 4500 Taschenwettermessgerät + Kestrel 4500 Indicatore Meteorologico Tascabile + Kestrel 4500 Medidor Balístico Ativo + Kestrel 4500 kézi szél-és időjárásmérő + Kapesní měřič počasí Kestrel 4500 Open Kestrel 4500 Otwórz Kestrel 4500 + Kestrel 4500 elővétele + Открыть Kestrel 4500NV + Ouvrir Kestrel 4500 + Accendi Kestrel 4500 + Abrir Kestrel 4500 + Kestrel 4500 öffnen + Abrir Kestrel 4500 + Otevřít Kestrel 4500 Show Kestrel 4500 Pokaż Kestrel 4500 + Показать Kestrel 4500NV + Afficher Kestrel 4500 + Mostra Kestrel 4500 + Mostrar Kestrel 4500 + Kestrel 4500 anzeigen + Kestrel 4500 mutatása + Zobrazit Kestrel 4500 Hide Kestrel 4500 Ukryj Kestrel 4500 + Убрать Kestrel 4500NV + Cacher Kestrel 4500 + Nascondi Kestrel 4500 + Ocultar Kestrel 4500 + Kestrel 4500 wegstecken + Kestrel 4500 elrejtése + Skrýt Kestrel 4500 Open Kestrel 4500 Otwórz Kestrel 4500 + Открыть Kestrel 4500NV + Ouvrir Kestrel 4500 + Accendi Kestrel 4500 + Abrir Kestrel 4500 + Kestrel 4500 öffnen + Kestrel 4500 elővétele + Otevřít Kestrel 4500 Show Kestrel 4500 Pokaż Kestrel 4500 + Показать Kestrel 4500NV + Afficher Kestrel 4500 + Mostra Kestrel 4500 + Mostrar Kestrel 4500 + Kestrel 4500 anzeigen + Kestrel 4500 mutatása + Zobrazit Kestrel 4500 - \ No newline at end of file + diff --git a/addons/laser/CfgVehicles.hpp b/addons/laser/CfgVehicles.hpp index f4e2ed42ab..dd3f02a0cc 100644 --- a/addons/laser/CfgVehicles.hpp +++ b/addons/laser/CfgVehicles.hpp @@ -4,30 +4,42 @@ class CfgVehicles { class LaserTarget: All { // @TODO: Changing the model and simulation hides it, but THEN IT DOESNT SPAWN WTF!? model = "\A3\Weapons_F\empty.p3d"; - simulation = "nvmarker"; - nvTarget = 1; - //simulation = "laserTarget"; - //threat[] = {0,0,0}; + destrType = "DestructNo"; + simulation = "house"; + class EventHandlers { init = QUOTE(_this call FUNC(laser_init)); }; - - diffuse[] = {0,0,0}; - ambient[] = {0,0,0}; - brightness = 0; - name = "pozicni blik"; - drawLight = 0; - drawLightSize = 0; - drawLightCenterSize = 0; - activeLight = 0; - blinking = 0; - dayLight = 0; - onlyInNvg = 0; - useFlare = 0; }; // Visual laserTarget override class ACE_LaserTarget_Visual : LaserTarget { - //model = "\A3\Weapons_f\laserTgt.p3d"; + simulation = "LaserTarget"; + model = "\A3\Weapons_f\laserTgt.p3d"; + }; + + // Vehicle lockable configurations + + class AllVehicles; + class Air: AllVehicles { + class Turrets; + }; + + class Helicopter: Air { + class Turrets { + class MainTurret; + }; + }; + + class Helicopter_Base_F: Helicopter {}; + + class Heli_Attack_01_base_F: Helicopter_Base_F {}; + + class B_Heli_Attack_01_F: Heli_Attack_01_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + GVAR(CanLockLaser) = 1; // Enable laser locking selection + }; + }; }; }; \ No newline at end of file diff --git a/addons/laser/RscInGameUI.hpp b/addons/laser/RscInGameUI.hpp index 457d320520..d87136c960 100644 --- a/addons/laser/RscInGameUI.hpp +++ b/addons/laser/RscInGameUI.hpp @@ -1 +1,144 @@ -// TODO: RscOptics_LaserDesignator for laser code designation \ No newline at end of file +class RscControlsGroup; +class VScrollbar; +class HScrollbar; +class RscText; +class RscMapControl; + +class RscInGameUI { + class RscOptics_LaserDesignator { + idd = 300; + controls[] = {"CA_IGUI_elements_group"}; + + onLoad = "uiNameSpace setVariable ['ACE_RscOptics_LaserDesignator',(_this select 0)];"; + onUnload = "uiNameSpace setVariable ['ACE_RscOptics_LaserDesignator',nil];"; + + + class CA_IGUI_elements_group: RscControlsGroup { + idc = 170; + + x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))"; + y = "0 * (0.025 * SafezoneH) + (SafezoneY)"; + w = "53.5 * (0.01875 * SafezoneH)"; + h = "40 * (0.025 * SafezoneH)"; + class VScrollbar: VScrollbar { + width = 0; + }; + class HScrollbar: HScrollbar { + height = 0; + }; + class controls { + class CA_OpticsZoom: RscText { + idc = 180; + style = 1; + colorText[] = {0.706,0.0745,0.0196,1}; + sizeEx = "0.038*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "4.5"; + x = "43.85 * (0.01875 * SafezoneH)"; + y = "19.6 * (0.025 * SafezoneH)"; + w = "4.5 * (0.01875 * SafezoneH)"; + h = "1.1 * (0.025 * SafezoneH)"; + }; + class ACE_Distance: RscText { + idc = 123002; + style = 0; + sizeEx = "0.038*SafezoneH"; + colorText[] = {0.706,0.0745,0.0196,1}; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "2456"; + x = "24.6 * (0.01875 * SafezoneH)"; + y = "3 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.5 * (0.025 * SafezoneH)"; + }; + class CA_Distance: RscText { + idc = 151; + style = 0; + sizeEx = "0.038*SafezoneH"; + colorText[] = {0.706,0.0745,0.0196,1}; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "2456"; + x = 0; + y = 0; + w = 0; + h = 0; + }; + class CA_Elev: RscText { + idc = 175; + style = 1; + sizeEx = "0.038*SafezoneH"; + colorText[] = {0.706,0.0745,0.0196,1}; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "80.5"; + x = "32.7 * (0.01875 * SafezoneH)"; + y = "3 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "1.5 * (0.025 * SafezoneH)"; + }; + class CA_VisionMode: RscText { + idc = 179; + style = 0; + sizeEx = "0.038*SafezoneH"; + colorText[] = {0.706,0.0745,0.0196,1}; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "VIS"; + x = "6.5 * (0.01875 * SafezoneH)"; + y = "19.6 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.1 * (0.025 * SafezoneH)"; + }; + class CA_Laser: RscText { + idc = 158; + style = "0x30 + 0x800"; + sizeEx = "0.038*SafezoneH"; + colorText[] = {0.706,0.0745,0.0196,1}; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics\laser_designator_iconLaserOn.paa"; + x = "29.2 * (0.01875 * SafezoneH)"; + y = "3 * (0.025 * SafezoneH)"; + w = "3.5 * (0.01875 * SafezoneH)"; + h = "1.5 * (0.025 * SafezoneH)"; + }; + class CA_Heading: RscText { + idc = 156; + style = 0; + sizeEx = "0.038*SafezoneH"; + colorText[] = {0.706,0.0745,0.0196,1}; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "023"; + x = "16.1 * (0.01875 * SafezoneH)"; + y = "3 * (0.025 * SafezoneH)"; + w = "3.5 * (0.01875 * SafezoneH)"; + h = "1.6 * (0.025 * SafezoneH)"; + }; + + class ACE_LaserCode_Helper : RscMapControl { + idc = -1; + onDraw = QUOTE(_this call FUNC(onLaserDesignatorDraw)); + w = 0; + h = 0; + }; + class ACE_LaserCode : RscText { + idc = 123001; + style = 0; + sizeEx = "0.038*SafezoneH"; + colorText[] = {0.706,0.0745,0.0196,1}; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "Code: 1001"; + x = "32.7 * (0.01875 * SafezoneH)"; + y = "35.5 * (0.025 * SafezoneH)"; + w = "12 * (0.01875 * SafezoneH)"; + h = "1.6 * (0.025 * SafezoneH)"; + }; + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/laser/XEH_post_init.sqf b/addons/laser/XEH_post_init.sqf index fb189d5041..a9f0e82be3 100644 --- a/addons/laser/XEH_post_init.sqf +++ b/addons/laser/XEH_post_init.sqf @@ -1,4 +1,7 @@ #include "script_component.hpp" +#include "initKeybinds.sqf" + ["laser_laserOn", {_this call DFUNC(handleLaserOn)}] call EFUNC(common,addEventHandler); ["laser_laserOff", {_this call DFUNC(handleLaserOff)}] call EFUNC(common,addEventHandler); + diff --git a/addons/laser/XEH_pre_init.sqf b/addons/laser/XEH_pre_init.sqf index e160a533f2..20f31d9e5b 100644 --- a/addons/laser/XEH_pre_init.sqf +++ b/addons/laser/XEH_pre_init.sqf @@ -8,8 +8,7 @@ PREP(checkLos); PREP(findStrongestRay); -PREP(translateToModelSpace); -PREP(translateToWeaponSpace); +PREP(onLaserDesignatorDraw); PREP(seekerFindLaserSpot); PREP(laserOn); @@ -25,6 +24,10 @@ PREP(laserTargetPFH); GVAR(VanillaLasers) = []; +PREP(unitTurretCanLockLaser); +PREP(keyLaserCodeUp); +PREP(keyLaserCodeDown); + // Laser default variables ACE_DEFAULT_LASER_CODE = 1001; ACE_DEFAULT_LASER_WAVELENGTH = 1550; diff --git a/addons/laser/config.cpp b/addons/laser/config.cpp index 3f430619ef..ad368cdc2d 100644 --- a/addons/laser/config.cpp +++ b/addons/laser/config.cpp @@ -12,4 +12,5 @@ class CfgPatches { #include "CfgEventhandlers.hpp" #include "CfgVehicles.hpp" -#include "CfgWeapons.hpp" \ No newline at end of file +#include "CfgWeapons.hpp" +#include "RscInGameUI.hpp" \ No newline at end of file diff --git a/addons/laser/functions/fnc_drawVisibleLaserTargets.sqf b/addons/laser/functions/fnc_drawVisibleLaserTargets.sqf index 161364c0f2..10d5f1e1b6 100644 --- a/addons/laser/functions/fnc_drawVisibleLaserTargets.sqf +++ b/addons/laser/functions/fnc_drawVisibleLaserTargets.sqf @@ -1 +1,9 @@ -// @TODO: This is to draw the actual LaserTarget positions to utilize for laser shooting. \ No newline at end of file +// This is a debug function for displaying visible lasers for ourselves +#include "script_component.hpp" + +diag_log text format["[ACE]: Laser Emitter Dump"]; + +{ + diag_log text format[" %1", _x]; + diag_log text format[" %2", HASH_GET(GVAR(laserEmitters), _x)]; +} forEach GVAR(laserEmitters) select 0; \ No newline at end of file diff --git a/addons/laser/functions/fnc_findStrongestRay.sqf b/addons/laser/functions/fnc_findStrongestRay.sqf index e4238361cb..811b75d351 100644 --- a/addons/laser/functions/fnc_findStrongestRay.sqf +++ b/addons/laser/functions/fnc_findStrongestRay.sqf @@ -1,5 +1,5 @@ #include "script_component.hpp" - +private["_checkPos", "_i", "_largest", "_largestSpot", "_list", "_outliers", "_remainingSpots", "_samplePos", "_spot", "_spots", "_testPos"]; _list = _this select 0; _checkPos = _this select 1; _spots = []; diff --git a/addons/laser/functions/fnc_keyLaserCodeDown.sqf b/addons/laser/functions/fnc_keyLaserCodeDown.sqf new file mode 100644 index 0000000000..a27b376d59 --- /dev/null +++ b/addons/laser/functions/fnc_keyLaserCodeDown.sqf @@ -0,0 +1,12 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +private["_oldLaserCode", "_laserCode"]; + +_oldLaserCode = ACE_player getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; +if(_oldLaserCode > ACE_DEFAULT_LASER_CODE) then { + _laserCode = _oldLaserCode - 1; + ACE_player setVariable [QGVAR(code), _laserCode, false]; +}; +if(_laserCode != _oldLaserCode) then { + [format ["%1: %2", localize "STR_ACE_laser_laserCode", _laserCode]] call EFUNC(common,displayTextStructured); +}; \ No newline at end of file diff --git a/addons/laser/functions/fnc_keyLaserCodeUp.sqf b/addons/laser/functions/fnc_keyLaserCodeUp.sqf new file mode 100644 index 0000000000..4e8750164c --- /dev/null +++ b/addons/laser/functions/fnc_keyLaserCodeUp.sqf @@ -0,0 +1,10 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +private["_oldLaserCode", "_laserCode"]; + +_oldLaserCode = ACE_player getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; +_laserCode = _oldLaserCode + 1; +ACE_player setVariable [QGVAR(code), _laserCode, false]; +if(_laserCode != _oldLaserCode) then { +[format ["%1: %2", localize "STR_ACE_laser_laserCode", _laserCode]] call EFUNC(common,displayTextStructured); +}; \ No newline at end of file diff --git a/addons/laser/functions/fnc_laserTargetPFH.sqf b/addons/laser/functions/fnc_laserTargetPFH.sqf index d73d9f070a..4c4f242482 100644 --- a/addons/laser/functions/fnc_laserTargetPFH.sqf +++ b/addons/laser/functions/fnc_laserTargetPFH.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" TRACE_1("enter", _this); -private["_args", "_laserTarget"]; +private["_args", "_laserTarget", "_pos", "_shooter", "_uuid"]; //TRACE_1("enter", _this); _args = _this select 0; _laserTarget = _args select 0; diff --git a/addons/laser/functions/fnc_laser_init.sqf b/addons/laser/functions/fnc_laser_init.sqf index 378ee38407..2be349c294 100644 --- a/addons/laser/functions/fnc_laser_init.sqf +++ b/addons/laser/functions/fnc_laser_init.sqf @@ -3,6 +3,7 @@ TRACE_1("enter", _this); PARAMS_1(_laserTarget); +private["_uuid"]; // Add the target to the global targets array // Everyone tracks them diff --git a/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf b/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf new file mode 100644 index 0000000000..7f8537ab9b --- /dev/null +++ b/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf @@ -0,0 +1,15 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +private["_laserCode"]; + +_laserCode = ACE_player getVariable[QGVAR(code), ACE_DEFAULT_LASER_CODE]; +if(!isNil "_laserCode") then { + __LaserDesignatorIGUI_LaserCode ctrlSetText format["Code: %1", [_laserCode, 4, 0, false] call CBA_fnc_formatNumber]; +}; + +if(! (ctrlShown __LaserDesignatorIGUI_LaserOn) ) then { + // TODO: hide distance + __LaserDesignatorIGUI_ACE_Distance ctrlSetText "----"; +} else { + __LaserDesignatorIGUI_ACE_Distance ctrlSetText (ctrlText __LaserDesignatorIGUI_CA_Distance); +}; \ No newline at end of file diff --git a/addons/laser/functions/fnc_rotateVectLine.sqf b/addons/laser/functions/fnc_rotateVectLine.sqf index ec85a83cb7..8bae491c4e 100644 --- a/addons/laser/functions/fnc_rotateVectLine.sqf +++ b/addons/laser/functions/fnc_rotateVectLine.sqf @@ -1,5 +1,5 @@ #include "script_component.hpp" - +private["_d", "_map", "_p", "_theta", "_u"]; _map = _this select 0; _theta = _this select 1; diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index 41ea877739..77713eb591 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -15,10 +15,11 @@ #include "script_component.hpp" -private ["_pos", "_seekerWavelengths", "_seekerCode", "_spots", "_buckets", "_excludes", "_bucketIndex", "_finalPos", "_owner", "_obj", "_x", "_method", - "_emitterWavelength", "_laserCode", "_divergence", "_laser", "_laserPos", "_laserDir", "_res", "_bucketPos", "_bucketList", "_c", "_forEachIndex", "_index", - "_testPos", "_finalBuckets", "_largest", "_largestIndex", "_finalBucket", "_owners", "_avgX", "_avgY", "_avgZ", "_count", "_maxOwner", "_maxOwnerIndex", "_finalOwner"]; - +private ["_pos", "_seekerWavelengths", "_seekerCode", "_spots", "_buckets", "_excludes", "_bucketIndex", "_finalPos", "_owner", "_obj", "_x", "_method"]; +private ["_emitterWavelength", "_laserCode", "_divergence", "_laser", "_laserPos", "_laserDir", "_res", "_bucketPos", "_bucketList", "_c", "_forEachIndex", "_index"]; +private ["_testPos", "_finalBuckets", "_largest", "_largestIndex", "_finalBucket", "_owners", "_avgX", "_avgY", "_avgZ", "_count", "_maxOwner", "_maxOwnerIndex", "_finalOwner"]; +private["_dir", "_seekerCos", "_seekerFov", "_testDotProduct", "_testPoint", "_testPointVector"]; + _pos = _this select 0; _dir = vectorNormalized (_this select 1); _seekerFov = _this select 2; diff --git a/addons/laser/functions/fnc_shootCone.sqf b/addons/laser/functions/fnc_shootCone.sqf index 801353d4f7..a7187aa0e4 100644 --- a/addons/laser/functions/fnc_shootCone.sqf +++ b/addons/laser/functions/fnc_shootCone.sqf @@ -1,7 +1,6 @@ #include "script_component.hpp" //#define DEBUG_MODE_FULL -private ["_divergence","_pos","_vec","_longestReturn","_shortestReturn","_resultPositions","_p1","_p2","_p","_v","_cp","_vecRotateMap","_result", - "_resultPos","_distance","_count","_pos2","_radOffset","_offset","_offsetPos","_offsetVector"]; +private ["_i", "_divergence","_pos","_vec","_longestReturn","_shortestReturn","_resultPositions","_p1","_p2","_p","_v","_cp","_vecRotateMap","_result", "_resultPos","_distance","_count","_pos2","_radOffset","_offset","_offsetPos","_offsetVector"]; _divergence = 0.3; _pos = _this select 0; _vec = _this select 1; diff --git a/addons/laser/functions/fnc_translateToModelSpace.sqf b/addons/laser/functions/fnc_translateToModelSpace.sqf deleted file mode 100644 index 1e2e930ac7..0000000000 --- a/addons/laser/functions/fnc_translateToModelSpace.sqf +++ /dev/null @@ -1,16 +0,0 @@ -_object = _this select 0; -_origin = getPosASL _object; -_matrix = _this select 1; -_xVec = _matrix select 0; -_yVec = _matrix select 1; -_zVec = _matrix select 2; - -_offset = _this select 2; - -_x = _offset select 0; -_y = _offset select 1; -_z = _offset select 2; - -_out = (((_xVec vectorMultiply _x) vectorAdd (_yVec vectorMultiply _y)) vectorAdd (_zVec vectorMultiply _z)) vectorAdd _origin; - -_out; \ No newline at end of file diff --git a/addons/laser/functions/fnc_translateToWeaponSpace.sqf b/addons/laser/functions/fnc_translateToWeaponSpace.sqf deleted file mode 100644 index 2c7dc5e6da..0000000000 --- a/addons/laser/functions/fnc_translateToWeaponSpace.sqf +++ /dev/null @@ -1,22 +0,0 @@ -_object = _this select 0; -_origin = getPosASL _object; -_matrix = _this select 1; -_xVec = _matrix select 0; -_yVec = _matrix select 1; -_zVec = _matrix select 2; - -_offset = _this select 2; - -_offset = _offset vectorDiff _origin; - -_x = _offset select 0; -_y = _offset select 1; -_z = _offset select 2; - -_out = [ - ((_xVec select 0)*_x) + ((_xVec select 1)*_y) + ((_xVec select 2)*_z), - ((_yVec select 0)*_x) + ((_yVec select 1)*_y) + ((_yVec select 2)*_z), - ((_zVec select 0)*_x) + ((_zVec select 1)*_y) + ((_zVec select 2)*_z) - ]; - -_out; \ No newline at end of file diff --git a/addons/laser/functions/fnc_unitTurretCanLockLaser.sqf b/addons/laser/functions/fnc_unitTurretCanLockLaser.sqf new file mode 100644 index 0000000000..a82e42400a --- /dev/null +++ b/addons/laser/functions/fnc_unitTurretCanLockLaser.sqf @@ -0,0 +1,21 @@ +/* + * Author: jaynus + * Checks if the turret occupied by the given unit can lock a laser designator and select laser code. + * + * Argument: + * 0: Unit + * + * Return value: + * Has designator? + */ +#include "script_component.hpp" + +EXPLODE_1_PVT(_this,_unit); + +// Get the player turret path +private ["_turret","_config","_turretConfig"]; +_turret = [_unit] call EFUNC(common,getTurretIndex); +_config = configFile >> "CfgVehicles" >> typeOf vehicle _unit; +_turretConfig = [_config, _turret] call EFUNC(common,getTurretConfigPath); + +getNumber (_turretConfig >> QGVAR(CanLockLaser)) > 0 diff --git a/addons/laser/functions/fnc_vanillaLaserSeekerHandler.sqf b/addons/laser/functions/fnc_vanillaLaserSeekerHandler.sqf index 38cd1839f9..091c4f7acf 100644 --- a/addons/laser/functions/fnc_vanillaLaserSeekerHandler.sqf +++ b/addons/laser/functions/fnc_vanillaLaserSeekerHandler.sqf @@ -12,7 +12,7 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -private["_emitter", "_owner", "_gunnerInfo", "_turretInfo", "_povPos", "_povDir"]; +private["_emmiter", "_owner", "_gunnerInfo", "_turretInfo", "_povPos", "_povDir"]; _emmiter = _this select 0; _owner = _this select 1; diff --git a/addons/laser/initKeybinds.sqf b/addons/laser/initKeybinds.sqf new file mode 100644 index 0000000000..d367b3553c --- /dev/null +++ b/addons/laser/initKeybinds.sqf @@ -0,0 +1,27 @@ +["ACE3 Equipment", QGVAR(LaserCodeUp), localize "STR_ACE_laser_laserCodeUp", +{ + if( EGVAR(laser_selfdesignate,active) + || + { (currentWeapon ACE_player) == "Laserdesignator" && (call CBA_fnc_getFoV) select 1 > 5 } // If laserdesignator & FOV, we are in scope. + || + { [ACE_player] call FUNC(unitTurretCanLockLaser) } + ) then { + [] call FUNC(keyLaserCodeUp); + }; +}, +{false}, +[16, [false, true, true]], false, 0] call CBA_fnc_addKeybind; // (ALT+CTRL+Q) + +["ACE3 Equipment", QGVAR(LaserCodeDown), localize "STR_ACE_laser_laserCodeDown", +{ + if( EGVAR(laser_selfdesignate,active) + || + { (currentWeapon ACE_player) == "Laserdesignator" && (call CBA_fnc_getFoV) select 1 > 5 } // If laserdesignator & FOV, we are in scope. + || + { [ACE_player] call FUNC(unitTurretCanLockLaser) } + ) then { + [] call FUNC(keyLaserCodeDown); + }; +}, +{false}, +[18, [true, true, true]], false, 0] call CBA_fnc_addKeybind; // (ALT+CTRL+E) diff --git a/addons/laser/script_component.hpp b/addons/laser/script_component.hpp index 2be1e9e14b..77369ead96 100644 --- a/addons/laser/script_component.hpp +++ b/addons/laser/script_component.hpp @@ -12,4 +12,11 @@ #include "\z\ace\Addons\main\script_macros.hpp" -#define FIREMODE_DIRECT_LOAL 1 \ No newline at end of file +#define FIREMODE_DIRECT_LOAL 1 + + +#define __LaserDesignatorIGUI (uiNamespace getVariable ["ACE_RscOptics_LaserDesignator", nil]) +#define __LaserDesignatorIGUI_LaserCode (__LaserDesignatorIGUI displayCtrl 123001) +#define __LaserDesignatorIGUI_ACE_Distance (__LaserDesignatorIGUI displayCtrl 123002) +#define __LaserDesignatorIGUI_CA_Distance (__LaserDesignatorIGUI displayCtrl 151) +#define __LaserDesignatorIGUI_LaserOn (__LaserDesignatorIGUI displayCtrl 158) \ No newline at end of file diff --git a/addons/laser/stringtable.xml b/addons/laser/stringtable.xml new file mode 100644 index 0000000000..710d7c2e29 --- /dev/null +++ b/addons/laser/stringtable.xml @@ -0,0 +1,26 @@ + + + + + Laser Code + Lasercode + Kod lasera + Code laser + Лазерный код + + + Laser - Cycle Code Up + Lasercode + + Laser - Następny kod + Laser - Code + + Лазер - увеличить частоту + + + Laser - Cycle Code Down + Lasercode - + Laser - Poprzedni kod + Laser - Code - + Лазер - уменьшить частоту + + + diff --git a/addons/laser_selfdesignate/CfgVehicles.hpp b/addons/laser_selfdesignate/CfgVehicles.hpp index 02d8b32b3d..3233a1e92c 100644 --- a/addons/laser_selfdesignate/CfgVehicles.hpp +++ b/addons/laser_selfdesignate/CfgVehicles.hpp @@ -21,4 +21,29 @@ class CfgVehicles { }; }; }; + + class Plane: Air {}; + class Plane_Base_F: Plane { + class Turrets { + class CopilotTurret; + }; + }; + + /* @TODO: LGB GBU + class Plane_CAS_01_base_F: Plane_Base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + GVAR(Enabled) = 1; // Enable laser self-designation + }; + }; + }; + + class Plane_CAS_02_base_F: Plane_Base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + GVAR(Enabled) = 1; // Enable laser self-designation + }; + }; + }; + */ }; diff --git a/addons/laser_selfdesignate/functions/fnc_findLaserSource.sqf b/addons/laser_selfdesignate/functions/fnc_findLaserSource.sqf index ac1ae7e438..27beed3c6a 100644 --- a/addons/laser_selfdesignate/functions/fnc_findLaserSource.sqf +++ b/addons/laser_selfdesignate/functions/fnc_findLaserSource.sqf @@ -13,7 +13,7 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -private["_emitter", "_owner", "_gunnerInfo", "_turretInfo", "_povPos", "_povDir"]; +private["_emmiter", "_owner", "_gunnerInfo", "_turretInfo", "_povPos", "_povDir"]; _emmiter = _this select 0; _owner = _this select 1; diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf index f8ff2ca0f5..aa46c383bd 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf @@ -13,7 +13,7 @@ #include "script_component.hpp" if( (count _this) > 2) then { - EXPLODE_3_PVT(_this,_shooter,_laserUuid, _localLaserTarget); + EXPLODE_3_PVT(_this,_shooter,_laserUuid,_localLaserTarget); [_laserUuid] call EFUNC(laser,laserOff); // @TODO: Nou gets to field all tickets about missing lasers. diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf index 400bf21756..e0c835814e 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf @@ -43,8 +43,8 @@ FUNC(laserHudDesignatePFH) = { _turretInfo = [_vehicle, _gunnerInfo select 1] call EFUNC(common,getTurretDirection); _povPos = _turretInfo select 0; - _laserCode = (vehicle ACE_player) getVariable[QGVAR(currentCode), ACE_DEFAULT_LASER_CODE]; - _waveLength = (vehicle ACE_player) getVariable[QGVAR(currentWaveLength), ACE_DEFAULT_LASER_WAVELENGTH]; + _laserCode = (vehicle ACE_player) getVariable["ace_laser_code", ACE_DEFAULT_LASER_CODE]; + _waveLength = (vehicle ACE_player) getVariable["ace_laser_waveLength", ACE_DEFAULT_LASER_WAVELENGTH]; _laserResult = [_povPos, [_waveLength,_waveLength], _laserCode] call EFUNC(laser,seekerFindLaserSpot); @@ -73,9 +73,9 @@ if(!GVAR(active)) then { TRACE_1("Activating laser", ""); // Get the self-designation variables, or use defaults - _laserCode = (vehicle ACE_player) getVariable[QGVAR(currentCode), ACE_DEFAULT_LASER_CODE]; - _waveLength = (vehicle ACE_player) getVariable[QGVAR(currentWaveLength), ACE_DEFAULT_LASER_WAVELENGTH]; - _beamSpread = (vehicle ACE_player) getVariable[QGVAR(currentBeamSpread), ACE_DEFAULT_LASER_BEAMSPREAD]; + _laserCode = (vehicle ACE_player) getVariable["ace_laser_code", ACE_DEFAULT_LASER_CODE]; + _waveLength = (vehicle ACE_player) getVariable["ace_laser_waveLength", ACE_DEFAULT_LASER_WAVELENGTH]; + _beamSpread = (vehicle ACE_player) getVariable["ace_laser_beamSpread", ACE_DEFAULT_LASER_BEAMSPREAD]; _laserUuid = [(vehicle ACE_player), ACE_player, QFUNC(findLaserSource), _waveLength, _laserCode, _beamSpread] call EFUNC(laser,laserOn); diff --git a/addons/laser_selfdesignate/stringtable.xml b/addons/laser_selfdesignate/stringtable.xml index 33ef24b888..02ef89f7a8 100644 --- a/addons/laser_selfdesignate/stringtable.xml +++ b/addons/laser_selfdesignate/stringtable.xml @@ -2,22 +2,28 @@ - Laser<br/>Designator On - Lasermarkierer<br/>an - Laser<br/>Designador encendido - ЛЦУ<br/>ВКЛ - Laserový<br/>značkovač zapnut - Desygnator<br/>laserowy wł. - Désignateur<br/>Laser Allumé + Laser Designator On + Lasermarkierer an + Designador láser encendido + ЛЦУ ВКЛ + Laserový značkovač zapnut + Desygnator laserowy wł. + Désignateur laser allumé + Lézeres Megjelölő Be + Designatore laser acceso + Desiginador Laser Ligado - Laser<br/>Designator Off - Lasermarkierer<br/>aus - Laser<br/>Designador apagado - ЛЦУ<br/>ВЫКЛ - Laserový<br/>značkovat vypnut - Desygnator<br/>laserowy wył. - Désignateur<br/>Laser Éteint + Laser Designator Off + Lasermarkierer aus + Designador láser apagado + ЛЦУ ВЫКЛ + Laserový značkovat vypnut + Desygnator laserowy wył. + Désignateur laser éteint + Lézeres Megjelölő Ki + Designatore laser spento + Desiginador Laser Desligado diff --git a/addons/laserpointer/CfgVehicles.hpp b/addons/laserpointer/CfgVehicles.hpp index 8c81837fe2..5a0ece1b1f 100644 --- a/addons/laserpointer/CfgVehicles.hpp +++ b/addons/laserpointer/CfgVehicles.hpp @@ -2,7 +2,7 @@ class CfgVehicles { class NATO_Box_Base; class Box_NATO_Support_F: NATO_Box_Base { class TransportItems { - MACRO_ADDITEM(ACE_acc_pointer_red,4); + MACRO_ADDITEM(ACE_acc_pointer_green,4); }; }; @@ -23,13 +23,12 @@ class CfgVehicles { class FIA_Box_Base_F; class Box_FIA_Support_F: FIA_Box_Base_F { class TransportItems { - MACRO_ADDITEM(ACE_acc_pointer_red,4); + MACRO_ADDITEM(ACE_acc_pointer_green,4); }; }; class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { - MACRO_ADDITEM(ACE_acc_pointer_red,4); MACRO_ADDITEM(ACE_acc_pointer_green,4); }; }; diff --git a/addons/laserpointer/CfgWeapons.hpp b/addons/laserpointer/CfgWeapons.hpp index 364f4b2168..6223c3a988 100644 --- a/addons/laserpointer/CfgWeapons.hpp +++ b/addons/laserpointer/CfgWeapons.hpp @@ -1,17 +1,30 @@ class SlotInfo; class PointerSlot: SlotInfo { - compatibleItems[] += {"ACE_acc_pointer_red","ACE_acc_pointer_green"}; + compatibleItems[] += {"ACE_acc_pointer_red","ACE_acc_pointer_green_IR","ACE_acc_pointer_green"}; }; class CfgWeapons { class ItemCore; class InventoryFlashLightItem_Base_F; + class acc_pointer_IR: ItemCore { + ACE_nextModeClass = "ACE_acc_pointer_red"; + ACE_modeDescription = "$STR_ACE_Laserpointer_IRLaser"; + + displayName = "$STR_ACE_Laserpointer_red"; + descriptionUse = "$STR_ACE_Laserpointer_useLaser"; + }; + class ACE_acc_pointer_red: ItemCore { + ACE_nextModeClass = "acc_pointer_IR"; + ACE_modeDescription = "$STR_ACE_Laserpointer_Laser"; + + ACE_laserpointer = 1; + author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_acc_pointer_red"; - scope = 2; + scope = 1; displayName = "$STR_ACE_Laserpointer_red"; descriptionUse = "$STR_ACE_Laserpointer_useLaser"; picture = "\A3\weapons_F\Data\UI\gear_accv_pointer_CA.paa"; @@ -54,9 +67,25 @@ class CfgWeapons { inertia = 0.1; }; - class ACE_acc_pointer_green: ACE_acc_pointer_red { + class ACE_acc_pointer_green_IR: acc_pointer_IR { + ACE_nextModeClass = "ACE_acc_pointer_green"; + ACE_modeDescription = "$STR_ACE_Laserpointer_IRLaser"; + author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_acc_pointer_green"; + scope = 1; + displayName = "$STR_ACE_Laserpointer_green"; + }; + + class ACE_acc_pointer_green: ACE_acc_pointer_red { + ACE_nextModeClass = "ACE_acc_pointer_green_IR"; + ACE_modeDescription = "$STR_ACE_Laserpointer_Laser"; + + ACE_laserpointer = 2; + + author = "$STR_ACE_Common_ACETeam"; + _generalMacro = "ACE_acc_pointer_green"; + scope = 2; displayName = "$STR_ACE_Laserpointer_green"; }; }; diff --git a/addons/laserpointer/XEH_postInit.sqf b/addons/laserpointer/XEH_postInit.sqf index 14e4c384d8..38fc35f262 100644 --- a/addons/laserpointer/XEH_postInit.sqf +++ b/addons/laserpointer/XEH_postInit.sqf @@ -11,11 +11,16 @@ GVAR(nearUnits) = []; // @todo. Maybe move to common? [{ private "_nearUnits"; - _nearUnits = nearestObjects [positionCameraToWorld [0,0,0], ["CAManBase"], 50]; + _nearUnits = []; - if (count _nearUnits > 10) then { - _nearUnits resize 10; - }; + { + _nearUnits append crew _x; + + if (count _nearUnits > 10) exitWith { + _nearUnits resize 10; + }; + + } forEach nearestObjects [positionCameraToWorld [0,0,0], ["AllVehicles"], 50]; // when moving this, search also for units inside vehicles. currently breaks the laser in FFV GVAR(nearUnits) = _nearUnits; @@ -24,3 +29,5 @@ GVAR(nearUnits) = []; addMissionEventHandler ["Draw3D", { call FUNC(onDraw); }]; + +#include "initKeybinds.sqf" diff --git a/addons/laserpointer/XEH_preInit.sqf b/addons/laserpointer/XEH_preInit.sqf index e7c74d3445..1460abda36 100644 --- a/addons/laserpointer/XEH_preInit.sqf +++ b/addons/laserpointer/XEH_preInit.sqf @@ -4,5 +4,6 @@ ADDON = false; PREP(drawLaserpoint); PREP(onDraw); +PREP(switchLaserLightMode); ADDON = true; diff --git a/addons/laserpointer/config.cpp b/addons/laserpointer/config.cpp index b97587dac6..5ca5ce3470 100644 --- a/addons/laserpointer/config.cpp +++ b/addons/laserpointer/config.cpp @@ -3,7 +3,7 @@ class CfgPatches { class ADDON { units[] = {}; - weapons[] = {"ACE_acc_pointer_red","ACE_acc_pointer_green"}; + weapons[] = {"ACE_acc_pointer_red","ACE_acc_pointer_green","ACE_acc_pointer_green_IR"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author[] = {"commy2"}; diff --git a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf index 31be95099a..93a421a094 100644 --- a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf +++ b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf @@ -1,6 +1,19 @@ // by commy2 and esteldunedain #include "script_component.hpp" +// init object +/*if (isNil QGVAR(laserdot)) then { + _light = "#lightpoint" createVehicleLocal [0,0,0]; + _light setLightBrightness 10; + _light setLightColor [1,0,0]; + _light setLightAmbient [1,0,0]; + _light setLightDayLight true; + //_light lightAttachObject [GVAR(laserdot), [0,0,0]]; + _light setLightAttenuation [0.04,4,4,0,0.04,0.08]; + + GVAR(laserdot) = _light; +};*/ + EXPLODE_3_PVT(_this,_unit,_range,_isGreen); _p0Pos = _unit modelToWorldVisual (_unit selectionPosition "righthand"); @@ -97,13 +110,15 @@ if (!surfaceIsWater _pL) then { _pL = ASLtoATL _pL; }; +/* drawLine3D [ _p0Pos, _pL, [[1,0,0,1], [0,1,0,1]] select _isGreen ]; +*/ -_size = 2 * (_range - (positionCameraToWorld [0,0,0] distance _pL)) / _range; +_size = 2 * (_range - (positionCameraToWorld [0,0,0] vectorDistance _pL)) / _range; _camPos = positionCameraToWorld [0,0,0.2]; if (count ([_unit, "FIRE"] intersect [_camPos, _pL]) > 0) exitWith {}; @@ -114,6 +129,8 @@ if (!surfaceIsWater _camPos) then { _camPos = ATLtoASL _camPos; }; if ( terrainIntersectASL [_camPos, _pL2]) exitWith {}; if ( lineIntersects [_camPos, _pL2]) exitWith {}; +//GVAR(laserdot) setPos _pL; + drawIcon3D [ format ["\a3\weapons_f\acc\data\collimdot_%1_ca.paa", ["red", "green"] select _isGreen], [[1,0.25,0.25,0.5*_brightness], [0.25,1,0.25,0.5*_brightness]] select _isGreen, diff --git a/addons/laserpointer/functions/fnc_onDraw.sqf b/addons/laserpointer/functions/fnc_onDraw.sqf index 6fa7275531..c1e955d028 100644 --- a/addons/laserpointer/functions/fnc_onDraw.sqf +++ b/addons/laserpointer/functions/fnc_onDraw.sqf @@ -25,10 +25,17 @@ _isIR = _isIR == 1; default {""}; }; - _laserID = ["ACE_acc_pointer_red", "ACE_acc_pointer_green"] find _laser; + if (_laser != "") then { + _cacheName = format [QGVAR(laser_%1), _laser]; + _laserID = missionNamespace getVariable [_cacheName, -1]; + if (missionNamespace getVariable [_cacheName, -1] == -1) then { + _laserID = getNumber (configFile >> "CfgWeapons" >> _laser >> "ACE_laserpointer"); + missionNamespace setVariable [_cacheName, _laserID]; + }; - if (_laserID > -1 && {_x isFlashlightOn _weapon}) then { - [_x, 30, _laserID == 1 || _isIR] call FUNC(drawLaserpoint); + if (_laserID > 0 && {_x isFlashlightOn _weapon}) then { + [_x, 50, _laserID == 2 || _isIR] call FUNC(drawLaserpoint); + }; }; } forEach GVAR(nearUnits); diff --git a/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf b/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf new file mode 100644 index 0000000000..f996d6b270 --- /dev/null +++ b/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf @@ -0,0 +1,58 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_weapon"]; + +_unit = _this select 0; +_weapon = _this select 1; + +// 1 = primary, 2 = secondary, 3 = handgun +private "_currentWeaponType"; +_currentWeaponType = 0; + +private "_pointer"; +_pointer = switch (_weapon) do { + case (primaryWeapon _unit): { + _currentWeaponType = 1; + primaryWeaponItems _unit select 1 + }; + case (secondaryWeapon _unit): { + _currentWeaponType = 2; + secondaryWeaponItems _unit select 1 + }; + case (handgunWeapon _unit): { + _currentWeaponType = 3; + handgunItems _unit select 1 + }; + default {""}; +}; + +if (_pointer == "") exitWith {}; + +private "_nextPointer"; +_nextPointer = getText (configFile >> "CfgWeapons" >> _pointer >> "ACE_nextModeClass"); + +if (_nextPointer == "") exitWith {}; + +private ["_description", "_picture"]; + +_description = getText (configFile >> "CfgWeapons" >> _nextPointer >> "ACE_modeDescription"); +_picture = getText (configFile >> "CfgWeapons" >> _nextPointer >> "picture"); + +switch (_currentWeaponType) do { + case 1: { + _unit removePrimaryWeaponItem _pointer; + _unit addPrimaryWeaponItem _nextPointer; + }; + case 2: { + _unit removeSecondaryWeaponItem _pointer; + _unit addSecondaryWeaponItem _nextPointer; + }; + case 3: { + _unit removeHandgunItem _pointer; + _unit addHandgunItem _nextPointer; + }; +}; + +[_description, _picture] call EFUNC(common,displayTextPicture); +playSound "ACE_Sound_Click"; diff --git a/addons/laserpointer/initKeybinds.sqf b/addons/laserpointer/initKeybinds.sqf new file mode 100644 index 0000000000..e01f3be5fa --- /dev/null +++ b/addons/laserpointer/initKeybinds.sqf @@ -0,0 +1,13 @@ +// by commy2 + +["ACE3 Weapons", QGVAR(switchLaserLightMode), localize "STR_ACE_Laserpointer_switchLaserLight", +{ + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + [ACE_player, currentWeapon ACE_player] call FUNC(switchLaserLightMode); + true +}, +{false}, [38, [false, true, false]], false] call CBA_fnc_addKeybind; diff --git a/addons/laserpointer/stringtable.xml b/addons/laserpointer/stringtable.xml index 4e2a743f85..484366085f 100644 --- a/addons/laserpointer/stringtable.xml +++ b/addons/laserpointer/stringtable.xml @@ -8,6 +8,10 @@ Лазерный прицел (красный) Laserové ukazovátko (červené) Wskaźnik laserowy (czerwony) + Lézer-pointer (piros) + Puntero láser (rojo) + Puntatore laser (rosso) + Laser (vermelho) Laser Pointer (green) @@ -16,6 +20,10 @@ Лазерный прицел (зелёный) Laserové ukazovátko (zelené) Wskaźnik laserowy (zielony) + Lézer-pointer (zöld) + Puntero láser (verde) + Puntatore laser (verde) + Laser (verde) Emits visible light. @@ -24,6 +32,10 @@ Испускает узкий пучок видимого света. Vyzařuje viditelné světlo. Wydziela widzialne światło. + Látható fényt bocsát ki. + Emite luz visible. + Emette luce visibile + Emite luz visível. <t color='#9cf953'>Use: </t>Turn Laser ON/OFF @@ -33,8 +45,42 @@ <t color='#9cf953'>Uso: </t>Laser ON/OFF <t color='#9cf953'>Użyj: </t>wł./wył. laser <t color='#9cf953'>Uso: </t>Ativar/Desativar laser - <t color='#9cf953'>Использовать: </t>вкл/выкл лазер - <t color='#9cf953'>Usar: </t>encender/apagar láser + <t color='#9cf953'>Использовать: </t>ВКЛ/ВЫКЛ лазер + <t color='#9cf953'>Usar: </t>Encender/Apagar láser + <t color='#9cf953'>Használat: </t>Lézer BE/KI kapcsolása + + + Laser + Laser + Laser + Лазер + Laser + Láser + Laser + Lézer + Laser + + + IR Laser + IR-Laser + Laser IR + ИК-лазер + Laser IR + Láser IR + Laser IR + Infravörös Lézer + IR Laser + + + Switch Laser / Infračervený Laser + Umschalten Laser / IR-Laser + Przełącz Laser / Laser IR + Изменить режим Лазер / ИК-лазер + Changer Laser / Laser IR + Alterna Laser / IR Laser + Cambiar láser / Láser IR + Lézer / Infravörös Lézer váltása + Přepnout Laser / IR Laser diff --git a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf index b5c6664657..6fda0fed10 100644 --- a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf +++ b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf @@ -18,6 +18,8 @@ PARAMS_2(_caller,_target); +private ["_onFinish", "_onFailure"]; + if (!(_this call FUNC(canRefuelUAV))) exitWith {}; _onFinish = { diff --git a/addons/logistics_uavbattery/stringtable.xml b/addons/logistics_uavbattery/stringtable.xml index efefc03cc4..fecf4754da 100644 --- a/addons/logistics_uavbattery/stringtable.xml +++ b/addons/logistics_uavbattery/stringtable.xml @@ -9,9 +9,9 @@ Dron jest naładowany A drón fel van töltve Dron je nabitý - O VANT está cheio + O UAV está cheio Il drone è pieno - БПЛА заполнен + БПЛА полностью заряжен You need a UAV Battery @@ -21,7 +21,7 @@ Potrzebujesz baterii UAV Szükséged van egy UAV akkumulátorra Potřebuješ UAV baterii - Você precisa de uma Bateria para VANT + Você precisa de uma bateria para UAVs Hai bisogno di una Batteria UAV Требуется аккумулятор для БПЛА @@ -45,7 +45,7 @@ Bateria UAV UAV akkumulátor UAV baterie - Bateria para VANT + Bateria para UAV Batteria UAV Аккумулятор БПЛА @@ -55,11 +55,11 @@ Usada para reabastecer el VANT Utilisée pour recharger l'UAV Używana do naładowania baterii przenośnego UAV - Hordozható UAV-ok működéséhez való akkumulátor + Hordozható UAV-k feltöltéséhez való akkumulátor Používané k dobíjení UAV - Usada para reabastecer VANT + Usada para reabastecer o UAV Usata per ricaricare la Batteria dell'UAV - Используется для зарядки БПЛА + Используется для зарядки переносных БПЛА Recharging ... diff --git a/addons/logistics_wirecutter/CfgEventHandlers.hpp b/addons/logistics_wirecutter/CfgEventHandlers.hpp index 79c3aaa959..3daad1425a 100644 --- a/addons/logistics_wirecutter/CfgEventHandlers.hpp +++ b/addons/logistics_wirecutter/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); diff --git a/addons/logistics_wirecutter/CfgVehicles.hpp b/addons/logistics_wirecutter/CfgVehicles.hpp new file mode 100644 index 0000000000..a31d9c0d99 --- /dev/null +++ b/addons/logistics_wirecutter/CfgVehicles.hpp @@ -0,0 +1,8 @@ +class CfgVehicles { + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_wirecutter,4); + }; + }; +}; diff --git a/addons/logistics_wirecutter/CfgWeapons.hpp b/addons/logistics_wirecutter/CfgWeapons.hpp index 76b1003f34..648bc3a3f8 100644 --- a/addons/logistics_wirecutter/CfgWeapons.hpp +++ b/addons/logistics_wirecutter/CfgWeapons.hpp @@ -1,16 +1,16 @@ class CfgWeapons { - class InventoryItem_Base_F; - class ACE_ItemCore; + class InventoryItem_Base_F; + class ACE_ItemCore; - class ACE_wirecutter: ACE_ItemCore { - author = "$STR_ACE_Common_ACETeam"; - displayName = "$STR_ACE_logistics_wirecutter_wirecutterName"; - descriptionShort = "$STR_ACE_logistics_wirecutter_wirecutterDescription"; - model = "\A3\weapons_F\ammo\mag_univ.p3d"; - picture = QUOTE(PATHTOF(ui\item_wirecutter_ca.paa)); - scope = 2; - class ItemInfo: InventoryItem_Base_F { - mass = 100; + class ACE_wirecutter: ACE_ItemCore { + author = "$STR_ACE_Common_ACETeam"; + displayName = "$STR_ACE_logistics_wirecutter_wirecutterName"; + descriptionShort = "$STR_ACE_logistics_wirecutter_wirecutterDescription"; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + picture = QUOTE(PATHTOF(ui\item_wirecutter_ca.paa)); + scope = 2; + class ItemInfo: InventoryItem_Base_F { + mass = 100; + }; }; - }; }; diff --git a/addons/logistics_wirecutter/config.cpp b/addons/logistics_wirecutter/config.cpp index 6e1db15061..d83cff4035 100644 --- a/addons/logistics_wirecutter/config.cpp +++ b/addons/logistics_wirecutter/config.cpp @@ -3,7 +3,7 @@ class CfgPatches { class ADDON { units[] = {}; - weapons[] = {}; + weapons[] = {"ACE_wirecutter"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_interaction"}; author[] = {"gpgpgpgp", "PabstMirror"}; @@ -13,5 +13,5 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" -#include "CfgSounds.hpp" #include "CfgWeapons.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf index ee4c512cd2..0cab7ab461 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf @@ -16,19 +16,26 @@ */ #include "script_component.hpp" -private ["_timeToCut"]; +#define SOUND_CLIP_TIME_SPACEING 1.5 +private ["_timeToCut", "_progressCheck"]; PARAMS_2(_unit,_fenceObject); if (_unit != ACE_player) exitWith {}; -_timeToCut = if ([ACE_player] call EFUNC(common,isEngineer)) then {5} else {10}; +_timeToCut = if ([ACE_player] call EFUNC(common,isEngineer)) then {7.5} else {11}; [ACE_player, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation); -if (_timeToCut > 5) then { - playSound "ACE_wirecutter_sound_long"; -} else { - playSound "ACE_wirecutter_sound"; +_progressCheck = { + PARAMS_2(_args,_passedTime); + EXPLODE_2_PVT(_args,_fenceObject,_lastSoundEffectTime); + if (_passedTime > (_lastSoundEffectTime + SOUND_CLIP_TIME_SPACEING)) then { + // playSound "ACE_wirecutter_sound"; + playSound3D [QUOTE(PATHTO_R(sound\wirecut.ogg)), objNull, false, (getPosASL ACE_player), 3, 1, 10]; + _args set [1, _passedTime]; + }; + + ((!isNull _fenceObject) && {(damage _fenceObject) < 1} && {("ACE_wirecutter" in (items ACE_player))}) }; -[_timeToCut, [_fenceObject], {(_this select 0) call FUNC(cutDownFenceCallback)}, {(_this select 0) call FUNC(cutDownFenceAbort)}, localize "STR_ACE_logistics_wirecutter_CuttingFence"] call EFUNC(common,progressBar); +[_timeToCut, [_fenceObject,0], {(_this select 0) call FUNC(cutDownFenceCallback)}, {(_this select 0) call FUNC(cutDownFenceAbort)}, localize "STR_ACE_logistics_wirecutter_CuttingFence", _progressCheck] call EFUNC(common,progressBar); diff --git a/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf b/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf index c9e59b41a0..15bfbdb8ef 100644 --- a/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf @@ -20,9 +20,9 @@ PARAMS_1(_unit); _nearestFence = objNull; { - if ((isNull _nearestFence) && {[_x] call FUNC(isFence)}) then { - _nearestFence = _x; - }; + if ((isNull _nearestFence) && {[_x] call FUNC(isFence)}) then { + _nearestFence = _x; + }; } forEach nearestObjects [_unit, [], 15]; _nearestFence diff --git a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf index 6dace9c42d..efb8f292c9 100644 --- a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf +++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf @@ -25,7 +25,7 @@ if (_interactionType != 0) exitWith {}; if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; [{ - private ["_fncStatement", "_attachedFence", "_fncCondition", "_helper"]; + private ["_fncStatement", "_attachedFence", "_fncCondition", "_helper", "_action"]; PARAMS_2(_args,_pfID); EXPLODE_3_PVT(_args,_setPosition,_addedHelpers,_fencesHelped); @@ -35,7 +35,7 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; } else { // Prevent Rare Error when ending mission with interact key down: if (isNull ace_player) exitWith {}; - + //If player moved >5 meters from last pos, then rescan if (((getPosASL ace_player) distance _setPosition) > 5) then { diff --git a/addons/logistics_wirecutter/functions/fnc_isFence.sqf b/addons/logistics_wirecutter/functions/fnc_isFence.sqf index aee9a22ef9..1ab97a67af 100644 --- a/addons/logistics_wirecutter/functions/fnc_isFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_isFence.sqf @@ -17,11 +17,9 @@ #include "script_component.hpp" //find is case sensitive, so keep everything lowercase -#define FENCE_A3_TYPENAMES ["land_net_fence_4m_f", "land_net_fence_8m_f", "land_net_fenced_8m_f", "land_new_wiredfence_5m_f", "land_new_wiredfence_10m_dam_f", "land_new_wiredfence_10m_f", "land_pipe_fence_4m_f", "land_pipe_fence_4mnolc_f", "land_sportground_fence_f", "land_wired_fence_4m_f", "land_wired_fence_4md_f", "land_wired_fence_8m_f", "land_wired_fence_8md_f", "land_razorwire_f"] -#define FENCE_A3_P3DS ["mil_wiredfence_f.p3d"] +#define FENCE_TYPENAMES ["land_net_fence_4m_f", "land_net_fence_8m_f", "land_net_fenced_8m_f", "land_new_wiredfence_5m_f", "land_new_wiredfence_10m_dam_f", "land_new_wiredfence_10m_f", "land_pipe_fence_4m_f", "land_pipe_fence_4mnolc_f", "land_sportground_fence_f", "land_wired_fence_4m_f", "land_wired_fence_4md_f", "land_wired_fence_8m_f", "land_wired_fence_8md_f", "land_razorwire_f"] -#define FENCE_AIA_TYPENAMES [] -#define FENCE_AIA_P3DS ["wall_indfnc_3.p3d", "wall_indfnc_9.p3d", "wall_indfnc_corner.p3d", "pletivo_wired.p3d", "wall_fen1_5.p3d"] +#define FENCE_P3DS ["mil_wiredfence_f.p3d","wall_indfnc_3.p3d", "wall_indfnc_9.p3d", "wall_indfnc_corner.p3d", "pletivo_wired.p3d", "wall_fen1_5.p3d"] private ["_typeOf", "_returnValue"]; PARAMS_1(_object); @@ -30,14 +28,15 @@ _typeOf = toLower (typeOf _object); _returnValue = false; if (_typeOf != "") then { - _returnValue = _typeOf in (FENCE_A3_TYPENAMES + FENCE_AIA_TYPENAMES); + //If the fence has configEntry we can check it directly + _returnValue = _typeOf in FENCE_TYPENAMES; } else { _typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d" { - if ((_typeOf find _x) != -1) then { + if ((_typeOf find _x) != -1) exitWith { _returnValue = true; }; - } forEach (FENCE_A3_P3DS + FENCE_AIA_P3DS); + } forEach FENCE_P3DS; }; _returnValue diff --git a/addons/logistics_wirecutter/sound/wirecut.ogg b/addons/logistics_wirecutter/sound/wirecut.ogg new file mode 100644 index 0000000000..902488c1df Binary files /dev/null and b/addons/logistics_wirecutter/sound/wirecut.ogg differ diff --git a/addons/logistics_wirecutter/stringtable.xml b/addons/logistics_wirecutter/stringtable.xml index 37fdb3f6a6..c49243d91e 100644 --- a/addons/logistics_wirecutter/stringtable.xml +++ b/addons/logistics_wirecutter/stringtable.xml @@ -9,15 +9,21 @@ Клещи-кусачки Štípací kleště Nożyce do cięcia drutu + Drótvágó + Pinze da Taglio + Cortador de Arame Wirecutter Schneidet Draht. Cortador de cables Позволяют быстро перекусывать сеточные конструкции. - Štípačky + Štípací kleště Służą do cięcia drutu i płotów Pince coupante + Drótok, huzalok, és kábelek vágására alkalmas olló. + Pinze da Taglio + Cortador de Arame Cut Fence @@ -36,7 +42,7 @@ Zaun / Draht schneiden ... Cortando alambrado / cables ... Przecinanie płotu / drutów ... - Přestřihnout plot / dráty ... + Přestřihávám plot / dráty ... Cisaille l'obstacle ... Cortando Cerca / Arame ... Sto tagliando ... @@ -56,4 +62,4 @@ Забор разрезан - + \ No newline at end of file diff --git a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf index 7a2b81371c..fbd07cf31a 100644 --- a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf +++ b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf @@ -28,7 +28,7 @@ _unitMagCounts = []; _xFullMagazineCount = getNumber (configfile >> "CfgMagazines" >> _xClassname >> "count"); //for every partial magazine, that is either in inventory or can be moved there - if ((_xCount < _xFullMagazineCount) && {_xCount > 0} && {(!_xLoaded) || {_player canAdd _magazineClassname}}) then { + if ((_xCount < _xFullMagazineCount) && {_xCount > 0} && {(!_xLoaded) || {_player canAdd _xClassname}}) then { _index = _unitMagazines find _xClassname; if (_index == -1) then { _unitMagazines pushBack _xClassname; diff --git a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf index e677cccdce..c4ddb2d93d 100644 --- a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf +++ b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf @@ -53,4 +53,4 @@ _structuredOutputText = _structuredOutputText + format ["" + (localize "STR_ACE_MagazineRepack_RepackedMagazinesCount") + ""), _fullMags, _partialMags]; -[parseText _structuredOutputText] call EFUNC(common,displayTextStructured); +[parseText _structuredOutputText, 2] call EFUNC(common,displayTextStructured); diff --git a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf index fb37a0dd4e..4ef69044da 100644 --- a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf +++ b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf @@ -19,7 +19,7 @@ */ #include "script_component.hpp" -private ["_newMagFnc", "_time", "_events", "_swapAmmoFnc", "_ammoSwaped", "_lowIndex", "_highIndex", "_ammoToTransfer", "_ammoAvailable", "_ammoNeeded"]; +private ["_newMagFnc", "_time", "_events", "_swapAmmoFnc", "_ammoSwaped", "_lowIndex", "_highIndex", "_ammoToTransfer", "_ammoAvailable", "_ammoNeeded", "_swapProgress"]; PARAMS_3(_fullMagazineCount,_arrayOfAmmoCounts,_isBelt); diff --git a/addons/magazinerepack/stringtable.xml b/addons/magazinerepack/stringtable.xml index 1f4f766b42..7030dc374e 100644 --- a/addons/magazinerepack/stringtable.xml +++ b/addons/magazinerepack/stringtable.xml @@ -2,16 +2,16 @@ - Repack<br/>Magazines - Magazine<br/>umpacken - Reorganizar<br/>cargadores - Réorganiser<br/>chargeurs - Przepakuj<br/>magazynki - Přepáskovat<br/>Zásobníky - Ricarica<br/>Caricatori - Reorganizar<br/>Carregadores - Újratárazás<br/> - Перепаковать<br/>магазины + Repack Magazines + Magazine umpacken + Reorganizar cargadores + Réorganiser les chargeurs + Przepakuj magazynki + Přepáskovat Zásobníky + Ricarica Caricatori + Reorganizar Carregadores + Újratárazás + Перепаковать магазины Select Magazine Menu @@ -66,39 +66,48 @@ %1 volle(s) Magazin(e) und %2 übrig gebliebene Patrone(n) %1 cargador(es) completo(s) y %2 bala(s) extra(s) %1 chargeur(s) plein(s) et %2 cartouche(s) en rab - Pełnych magazynków: %1.<br /> Dodatkowych naboi: %2. + Pełnych magazynków: %1.<br/>Dodatkowych naboi: %2. %1 plný zásobník(y) a %2 munice navíc %1 caricatore/i pieno e %2 munizioni extra %1 carregador(es) cheio(s) e %2 disparo(s) a mais - %1 tejles tár és %2 extra lőszer. + %1 teljes tár és %2 extra lőszer %1 полных магазина(ов) и %2 патрона(ов) Repacking Finished Réorganisation terminée Wiederverpacken Fertig - Reembalaje finalizado + Reorganización finalizada Перепаковка завершена Páskování dokončeno Przepakowywanie zakończone + Újratárazás befejezve + Riempi caricatore + Reorganização Terminada Repacking Interrupted Réorganisation interrompue Umpacken Unterbrochen - Reembalaje interrumpido + Reorganización interrumpida Перепаковка прервана Páskování přerušeno Przepakowywanie przerwane + Újratárazás megszakítva + Riempimento interrotto + Reorganização Interrompida %1 Full and %2 Partial %1 plein(s) et %2 partiel(s) %1 Vollständigen und %2 Teilweisen - %1 Total y %2 Parcial + %1 Llenos y %2 Incompletos %1 полных и %2 неполных %1 plný a %2 částečně - Pełnych: %1.<br />Częściowo pełnych: %2. + Pełnych: %1.<br/>Częściowo pełnych: %2. + %1 teljes és %2 részleges + %1 pieno e %2 parziale + %1 Total e %2 Parcial diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index fce9ec526a..d4b6739918 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -1,6 +1,11 @@ #include "\x\cba\addons\main\script_macros_common.hpp" #include "\x\cba\addons\xeh\script_xeh.hpp" +//Faster Array Unwraping (skips the IS_ARRAY check normaly found in EXPLODE_1_SYS) +#undef EXPLODE_2_SYS +#define EXPLODE_1_SYS_FAST(ARRAY,A) A =(ARRAY) select 0 +#define EXPLODE_2_SYS(ARRAY,A,B) EXPLODE_1_SYS_FAST(ARRAY,A); B = (ARRAY) select 1 + // Default versioning level #define DEFAULT_VERSIONING_LEVEL 2 diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index 25a18e8dc2..5777d7223e 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -6,7 +6,7 @@ #define MAJOR 3 #define MINOR 0 #define PATCHLVL 0 -#define BUILD 1 +#define BUILD 2 #define VERSION MAJOR.MINOR.PATCHLVL.BUILD #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD diff --git a/addons/map/functions/fnc_blueForceTrackingModule.sqf b/addons/map/functions/fnc_blueForceTrackingModule.sqf index cecfd348d2..c156c9527d 100644 --- a/addons/map/functions/fnc_blueForceTrackingModule.sqf +++ b/addons/map/functions/fnc_blueForceTrackingModule.sqf @@ -14,9 +14,7 @@ if !(hasInterface) exitWith {}; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; diff --git a/addons/map/functions/fnc_blueForceTrackingUpdate.sqf b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf index 030daeaa36..edbe484f04 100644 --- a/addons/map/functions/fnc_blueForceTrackingUpdate.sqf +++ b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf @@ -1,5 +1,7 @@ #include "script_component.hpp" +private ["_groupsToDrawMarkers", "_playerSide", "_anyPlayers", "_markerType", "_colour", "_marker"]; + // Delete last set of markers (always) { deleteMarkerLocal _x; diff --git a/addons/map/functions/fnc_determineMapLight.sqf b/addons/map/functions/fnc_determineMapLight.sqf index fbc847c313..441dc8103a 100644 --- a/addons/map/functions/fnc_determineMapLight.sqf +++ b/addons/map/functions/fnc_determineMapLight.sqf @@ -15,7 +15,7 @@ EXPLODE_1_PVT(_this,_unit); -private ["_isEnclosed","_nearObjects","_light","_ll","_flashlight"]; +private ["_isEnclosed","_nearObjects","_light","_ll","_flashlight", "_flareTint", "_lightTint", "_l"]; // Blend two colors _fnc_blendColor = { @@ -72,7 +72,7 @@ _vehicle = vehicle _unit; // Do not obscure the map if the player is on a enclosed vehicle (assume internal illumination) if (_vehicle != _unit) then { // Player is in a vehicle - if (isTurnedOut _unit && {_vehicle isKindOf "Tank" || {_vehicle isKindOf "Wheeled_APC"}}) then { + if (isTurnedOut _unit && { _vehicle isKindOf "Tank" || { ( _vehicle isKindOf "Helicopter" || _vehicle isKindOf "Plane" ) && { (driver _vehicle) == _unit || { (gunner _vehicle) == _unit } } } || {_vehicle isKindOf "Wheeled_APC"}}) then { _isEnclosed = true; }; }; diff --git a/addons/map/functions/fnc_determineZoom.sqf b/addons/map/functions/fnc_determineZoom.sqf index fdc620b417..345fc68583 100644 --- a/addons/map/functions/fnc_determineZoom.sqf +++ b/addons/map/functions/fnc_determineZoom.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -private ["_grids", "_fourSize", "_sixSize", "_continue", "_size"]; +private ["_grids", "_fourSize", "_sixSize", "_continue", "_size", "_i"]; _grids = configFile >> "CfgWorlds" >> worldName >> "Grid"; _fourSize = -1; _sixSize = -1; diff --git a/addons/map/functions/fnc_moduleMap.sqf b/addons/map/functions/fnc_moduleMap.sqf index a22bbbb385..4bcdb69269 100644 --- a/addons/map/functions/fnc_moduleMap.sqf +++ b/addons/map/functions/fnc_moduleMap.sqf @@ -10,8 +10,7 @@ */ #include "script_component.hpp" -_logic = _this select 0; -_activated = _this select 2; +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index e3e2a6fe93..4423bbcfb4 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -1,5 +1,4 @@  - diff --git a/addons/maptools/XEH_postInitClient.sqf b/addons/maptools/XEH_postInitClient.sqf index 26fb005e9f..8129a75b15 100644 --- a/addons/maptools/XEH_postInitClient.sqf +++ b/addons/maptools/XEH_postInitClient.sqf @@ -24,6 +24,7 @@ GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; // The thread dies as soon as the mission start, so it's not really compiting for scheduler space. [] spawn { _fnc_installMapEvents = { + private "_d"; _d = _this; ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}]; ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}]; diff --git a/addons/maptools/functions/fnc_addLineMarker.sqf b/addons/maptools/functions/fnc_addLineMarker.sqf index 83e983d0e3..157891a262 100644 --- a/addons/maptools/functions/fnc_addLineMarker.sqf +++ b/addons/maptools/functions/fnc_addLineMarker.sqf @@ -15,10 +15,11 @@ */ #include "script_component.hpp" -_name = _this select 0; -_startPos = _this select 1; -_difPos = (_this select 2) vectorDiff _startPos ; -_color = _this select 3; +PARAMS_4(_name,_startPos,_endPos,_color); + +private ["_marker", "_difPos", "_mag"]; + +_difPos = _endPos vectorDiff _startPos; _marker = createMarkerLocal [_name, _startPos]; _name setMarkerShapeLocal "RECTANGLE"; diff --git a/addons/maptools/functions/fnc_calculateMapScale.sqf b/addons/maptools/functions/fnc_calculateMapScale.sqf index 700e089a88..4723a4f5e1 100644 --- a/addons/maptools/functions/fnc_calculateMapScale.sqf +++ b/addons/maptools/functions/fnc_calculateMapScale.sqf @@ -12,6 +12,8 @@ */ #include "script_component.hpp" +private ["_screenOffset", "_pos"]; + _pos = ((finddisplay 12) displayctrl 51) ctrlMapScreenToWorld [0.5, 0.5]; _screenOffset = ((finddisplay 12) displayctrl 51) posWorldToScreen [(_pos select 0) + 100, (_pos select 1)]; diff --git a/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf b/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf index e3de77316a..44f6ed6203 100644 --- a/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf +++ b/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf @@ -15,6 +15,7 @@ PARAMS_1(_lineMarkers); { + private "_marker"; _marker = _x; //Add marker if we don't already have it if (({(_x select 0) == (_marker select 0)} count GVAR(drawing_lineMarkers)) == 0) then { diff --git a/addons/maptools/functions/fnc_handleKeyDown.sqf b/addons/maptools/functions/fnc_handleKeyDown.sqf index d2b3a060b8..d1f9e199c9 100644 --- a/addons/maptools/functions/fnc_handleKeyDown.sqf +++ b/addons/maptools/functions/fnc_handleKeyDown.sqf @@ -15,13 +15,10 @@ #include "script_component.hpp" -private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"]; +PARAMS_5(_display,_code,_shiftKey,_ctrlKey,_altKey); + +private ["_handled", "_relPos", "_diffVector", "_magDiffVector", "_lambdaLong", "_lambdaTrasAbs"]; -_display = _this select 0; -_code = _this select 1; -_shiftKey = _this select 2; -_ctrlKey = _this select 3; -_altKey = _this select 4; _handled = false; #define DIK_ESCAPE 0x01 diff --git a/addons/maptools/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf index 8db6b8b0f1..16cabe9719 100644 --- a/addons/maptools/functions/fnc_handleMouseButton.sqf +++ b/addons/maptools/functions/fnc_handleMouseButton.sqf @@ -13,10 +13,9 @@ #include "script_component.hpp" -private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"]; +private ["_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos", "_altKey", "_gui", "_marker"]; -_dir = _this select 0; -_params = _this select 1; +PARAMS_2(_dir,_params); _control = _params select 0; _button = _params select 1; _screenPos = [_params select 2, _params select 3]; diff --git a/addons/maptools/functions/fnc_handleMouseMove.sqf b/addons/maptools/functions/fnc_handleMouseMove.sqf index 4111c8fad4..2148c5a162 100644 --- a/addons/maptools/functions/fnc_handleMouseMove.sqf +++ b/addons/maptools/functions/fnc_handleMouseMove.sqf @@ -51,6 +51,7 @@ if (GVAR(mapTool_isDragging)) exitWith { // Rotation if (GVAR(mapTool_isRotating)) exitWith { + private "_angle"; // Get new angle _angle = (180 + ((GVAR(mousePosition) select 0) - (GVAR(mapTool_startPos) select 0)) atan2 ((GVAR(mousePosition) select 1) - (GVAR(mapTool_startPos) select 1)) mod 360); GVAR(mapTool_angle) = GVAR(mapTool_startAngle) + _angle - GVAR(mapTool_startDragAngle); diff --git a/addons/maptools/functions/fnc_isInsideMapTool.sqf b/addons/maptools/functions/fnc_isInsideMapTool.sqf index 4dd66e2b9a..eeaf8f346a 100644 --- a/addons/maptools/functions/fnc_isInsideMapTool.sqf +++ b/addons/maptools/functions/fnc_isInsideMapTool.sqf @@ -16,6 +16,7 @@ #define DIST_TOP_TO_CENTER_PERC 0.65 #define DIST_LEFT_TO_CENTER_PERC 0.30 +private ["_textureWidth", "_relPos", "_dirVector", "_lambdaLong", "_lambdaTrasAbs", "_pos"]; if (GVAR(mapTool_Shown) == 0) exitWith {false}; _textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (GVAR(mapTool_Shown) - 1); diff --git a/addons/maptools/functions/fnc_openMapGps.sqf b/addons/maptools/functions/fnc_openMapGps.sqf index c4e2436b3b..7d29d9e169 100644 --- a/addons/maptools/functions/fnc_openMapGps.sqf +++ b/addons/maptools/functions/fnc_openMapGps.sqf @@ -12,7 +12,10 @@ */ #include "script_component.hpp" -_shouldOpenGps = _this select 0; +PARAMS_1(_shouldOpenGps); + +private ["_isOpen"]; + _isOpen = !(isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull])); if (_shouldOpenGps && {"ItemGPS" in assignedItems ACE_player} && {!_isOpen}) then { diff --git a/addons/maptools/functions/fnc_openMapGpsUpdate.sqf b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf index ddc177f182..092f0720c2 100644 --- a/addons/maptools/functions/fnc_openMapGpsUpdate.sqf +++ b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf @@ -3,6 +3,8 @@ #include "script_component.hpp" +private ["_mapGpsDisplay", "_ctrl"]; + if ((!("ItemGPS" in assigneditems ACE_player)) || {isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull])}) exitWith { ("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; //close GPS RSC [(_this select 1)] call CBA_fnc_removePerFrameHandler; //remove frameHandler diff --git a/addons/maptools/functions/fnc_removeLineMarker.sqf b/addons/maptools/functions/fnc_removeLineMarker.sqf index 45c39611db..be82970524 100644 --- a/addons/maptools/functions/fnc_removeLineMarker.sqf +++ b/addons/maptools/functions/fnc_removeLineMarker.sqf @@ -11,7 +11,7 @@ #include "script_component.hpp" -_name = _this select 0; +PARAMS_1(_name); deleteMarkerLocal _name; { diff --git a/addons/maptools/functions/fnc_updateLineMarker.sqf b/addons/maptools/functions/fnc_updateLineMarker.sqf index cf80c1ac26..a745bfa123 100644 --- a/addons/maptools/functions/fnc_updateLineMarker.sqf +++ b/addons/maptools/functions/fnc_updateLineMarker.sqf @@ -13,10 +13,11 @@ */ #include "script_component.hpp" -_name = _this select 0; -_startPos = _this select 1; -_difPos = (_this select 2) vectorDiff _startPos ; -_color = _this select 3; +PARAMS_4(_name,_startPos,_endPos,_color); + +private ["_difPos", "_mag"]; + +_difPos = _endPos vectorDiff _startPos; _name setMarkerShapeLocal "RECTANGLE"; _name setMarkerAlphaLocal 1; diff --git a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf index 3a7b919b8b..fa6db8872a 100644 --- a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf +++ b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf @@ -18,6 +18,8 @@ PARAMS_1(_theMap); +private ["_rotatingTexture", "_textureWidth", "_scale", "_xPos", "_yPos"]; + if (!("ACE_MapTools" in items ACE_player)|| {GVAR(mapTool_Shown) == 0}) exitWith {}; _rotatingTexture = ""; diff --git a/addons/maptools/stringtable.xml b/addons/maptools/stringtable.xml index f2bc71e324..f2a14e8b33 100644 --- a/addons/maptools/stringtable.xml +++ b/addons/maptools/stringtable.xml @@ -1,147 +1,149 @@  - - - Map Tools - Herramientas de mapa - Outils de navigation - Narzędzia nawigacyjne - Kartenwerkzeug - Pomůcky k mapě - Strumenti Cartografici - Ferramentas de Mapa - Térképészeti eszközök - Инструменты карты - - - The Map Tools allow you to measure distances and angles on the map. - Las herramientas de mapa permiten medir distancias y ángulos en el mapa. - Les outils de navigation permettent de mesurer des distances et des angles sur la carte. - Narzędzia nawigacyjne pozwalają na mierzenie odległości i kątów na mapie. - Das Kartenwerkzeug ermöglicht es dir, Distanzen und Winkel zu messen. - Pomůcky k mapě slouží k měření vzdáleností a úhlů na mapě. - Gli Strumenti Cartografici ti consentono di misurare distanze ed angoli sulla mappa. - As Ferramentas de Mapa permitem que você meça distâncias e ângulos no mapa. - A térképészeti eszközökkel távolságokat és szögeket tud mérni a térképen. - Картографические инструменты позволяют измерять расстояния и углы на карте. - - - Map Tools - Herramientas de mapa - Outils de navigation - Narzędzia nawigacyjne - Kartenwerkzeug - Pomůcky k mapě - Strumenti Cartografici - Ferramentas de Mapa - Térképészeti eszközök - Инструменты карты - - - Hide Map Tool - Verstecke Kartenwerkzeug - Ocultar herr. de mapa - Ranger les outils - Nascondi Strumenti Cartografici - Ocultar Ferramenta de Mapa - Térképészeti eszközök elrejtése - Ukryj narzędzia nawigacyjne - Schovat pomůcku k mapě - Скрыть инструменты - - - Show Normal Map Tool - Zeige Kartenwerkzeug (normal) - Mostrar herr. de mapa normal - Montrer outils normaux - Visualizza Strumenti Cartografici standard - Mostrar Ferramenta de Mapa Padrão - Térképészeti eszköz megjelenítése (normál méret) - Pokaż normalne narzędzia nawigacyjne - Zobrazit normální pomůcku k mapě - Показать инструменты (средн. размер) - - - Show Small Map Tool - Zeige Kartenwerkzeug (klein) - Mostrar herr. de mapa pequeñas - Montrer petits outils - Visualizza Strumenti Cartografici piccoli - Mostrar Ferramenta de Mapa Pequena - Térképészeti eszköz megjelenítése (kicsinyített) - Pokaż pomniejszone narzędzia nawigacyjne - Zobrazit malou pomůcku k mapě - Показать инструменты (малый размер) - - - Align Map Tool to North - Kartenwerkzeug nach Norden ausrichten - Alinear herr. de mapa al norte - Aligner au nord - Allinea gli Strumenti Cartografici con il Nord - Alinhar Ferramenta de Mapa com o Norte - Térképészeti eszköz Északhoz állítása - Wyrównaj linijkę do północy - Srovnat pomůcku k mapě na sever - Выровнять инструменты на север - - - Align Map Tool to Compass - Kartenwerkzeug am Kompass ausrichten - Alinear herr. de mapa a la brújula - Aligner sur la boussole - Allinea gli Strumenti Cartografici con la bussola - Alinhar Ferramenta de Mapa com a Bússola - Térképészeti eszköz iránytűhöz állítása - Wyrównaj linijkę do kompasu - Srovnat pomůcku k mapě ke kompasu - Выровнять инструменты по компасу - - - Show GPS on Map - Zeige GPS auf der Karte - Mostrar el GPS sobre el mapa - Ranger le GPS - Visualizza il GPS sulla mappa - Mostrar GPS no Mapa - GPS megjelnítése a térképen - Pokaż GPS na mapie - Zobrazit GPS na mapě - Показать GPS на карте - - - Hide GPS on Map - Verstecke GPS auf der Karte - Ocultar el GPS del mapa - Montrer le GPS - Nascondi il GPS sulla mappa - Ocultar GPS no Mapa - GPS elrejtése térképről - Ukryj GPS na mapie - Schovat GPS na mapě - Скрыть GPS на карте - - - Copy Map - Karte kopieren - Copiar mapa - Скопировать карту - Kopiuj oznaczenia mapy - Copier la carte - Zkopírovat mapu - Copiare Carta - Térkép másolása - Copiar Mapa - - - Direction: %1° - Drehung: %1° - Direction: %1° - Směr: %1° - Kierunek: %1° - Dirección: %1° - Irány: %1 - Направление: %1° - - + + + Map Tools + Herramientas de mapa + Outils de navigation + Narzędzia nawigacyjne + Kartenwerkzeug + Pomůcky k mapě + Strumenti Cartografici + Ferramentas de Mapa + Térképészeti eszközök + Инструменты карты + + + The Map Tools allow you to measure distances and angles on the map. + Las herramientas de mapa permiten medir distancias y ángulos en el mapa. + Les outils de navigation permettent de mesurer des distances et des angles sur la carte. + Narzędzia nawigacyjne pozwalają na mierzenie odległości i kątów na mapie. + Das Kartenwerkzeug ermöglicht es dir, Distanzen und Winkel zu messen. + Pomůcky k mapě slouží k měření vzdáleností a úhlů na mapě. + Gli Strumenti Cartografici ti consentono di misurare distanze ed angoli sulla mappa. + As Ferramentas de Mapa permitem que você meça distâncias e ângulos no mapa. + A térképészeti eszközökkel távolságokat és szögeket tudsz mérni a térképen. + Картографические инструменты позволяют измерять расстояния и углы на карте. + + + Map Tools + Herramientas de mapa + Outils de navigation + Narzędzia nawigacyjne + Kartenwerkzeug + Pomůcky k mapě + Strumenti Cartografici + Ferramentas de Mapa + Térképészeti eszközök + Инструменты карты + + + Hide Map Tool + Verstecke Kartenwerkzeug + Ocultar herr. de mapa + Ranger les outils + Nascondi Strumenti Cartografici + Ocultar Ferramenta de Mapa + Térképészeti eszközök elrejtése + Ukryj narzędzia nawigacyjne + Schovat pomůcku k mapě + Скрыть инструменты + + + Show Normal Map Tool + Zeige Kartenwerkzeug (normal) + Mostrar herr. de mapa normal + Montrer outils normaux + Visualizza Strumenti Cartografici standard + Mostrar Ferramenta de Mapa Padrão + Térképészeti eszköz megjelenítése (normál méret) + Pokaż normalne narzędzia nawigacyjne + Zobrazit normální pomůcku k mapě + Показать инструменты (средн. размер) + + + Show Small Map Tool + Zeige Kartenwerkzeug (klein) + Mostrar herr. de mapa pequeñas + Montrer petits outils + Visualizza Strumenti Cartografici piccoli + Mostrar Ferramenta de Mapa Pequena + Térképészeti eszköz megjelenítése (kicsinyített) + Pokaż pomniejszone narzędzia nawigacyjne + Zobrazit malou pomůcku k mapě + Показать инструменты (малый размер) + + + Align Map Tool to North + Kartenwerkzeug nach Norden ausrichten + Alinear herr. de mapa al norte + Aligner au nord + Allinea gli Strumenti Cartografici con il Nord + Alinhar Ferramenta de Mapa com o Norte + Térképészeti eszköz Északhoz állítása + Wyrównaj linijkę do północy + Srovnat pomůcku k mapě na sever + Выровнять инструменты на север + + + Align Map Tool to Compass + Kartenwerkzeug am Kompass ausrichten + Alinear herr. de mapa a la brújula + Aligner sur la boussole + Allinea gli Strumenti Cartografici con la bussola + Alinhar Ferramenta de Mapa com a Bússola + Térképészeti eszköz iránytűhöz állítása + Wyrównaj linijkę do kompasu + Srovnat pomůcku k mapě ke kompasu + Выровнять инструменты по компасу + + + Show GPS on Map + Zeige GPS auf der Karte + Mostrar el GPS sobre el mapa + Ranger le GPS + Visualizza il GPS sulla mappa + Mostrar GPS no Mapa + GPS megjelenítése a térképen + Pokaż GPS na mapie + Zobrazit GPS na mapě + Показать GPS на карте + + + Hide GPS on Map + Verstecke GPS auf der Karte + Ocultar el GPS del mapa + Montrer le GPS + Nascondi il GPS sulla mappa + Ocultar GPS no Mapa + GPS elrejtése a térképről + Ukryj GPS na mapie + Schovat GPS na mapě + Скрыть GPS на карте + + + Copy Map + Karte kopieren + Copiar mapa + Скопировать карту + Kopiuj oznaczenia mapy + Copier la carte + Zkopírovat mapu + Copiare Carta + Térkép másolása + Copiar Mapa + + + Direction: %1° + Drehung: %1° + Direction: %1° + Směr: %1° + Kierunek: %1° + Dirección: %1° + Irány: %1 + Направление: %1° + Direzione : %1° + Direção: %1 + + diff --git a/addons/markers/XEH_preInit.sqf b/addons/markers/XEH_preInit.sqf index fd97aeda0c..b2b9ed5c00 100644 --- a/addons/markers/XEH_preInit.sqf +++ b/addons/markers/XEH_preInit.sqf @@ -12,6 +12,8 @@ PREP(sendMarkersJIP); PREP(setMarkerJIP); PREP(setMarkerNetwork); +private ["_config", "_marker", "_a", "_scope", "_icon", "_rgba", "_name"]; + // init marker types if (isNil QGVAR(MarkersCache)) then { _config = configfile >> "CfgMarkers"; diff --git a/addons/markers/functions/fnc_initInsertMarker.sqf b/addons/markers/functions/fnc_initInsertMarker.sqf index 6ac13f9e80..6c5160c031 100644 --- a/addons/markers/functions/fnc_initInsertMarker.sqf +++ b/addons/markers/functions/fnc_initInsertMarker.sqf @@ -19,6 +19,8 @@ #define BORDER 0.005 [{ + private ["_display", "_text", "_picture", "_channel", "_buttonOK", "_buttonCancel", "_description", "_title", "_descriptionChannel", "_sizeX", "_sizeY", "_aceShapeLB", "_aceColorLB", "_aceAngleSlider", "_aceAngleSliderText", "_mapIDD", "_pos", "_posX", "_posY", "_posW", "_posH", "_offsetButtons", "_buttonOk", "_curSelShape", "_curSelColor", "_curSelAngle"]; + disableserialization; PARAMS_1(_display); diff --git a/addons/markers/stringtable.xml b/addons/markers/stringtable.xml index 65da73a026..44d64eb1e0 100644 --- a/addons/markers/stringtable.xml +++ b/addons/markers/stringtable.xml @@ -1,15 +1,17 @@  - - - - Direction: %1° - Drehung: %1° - Direction: %1° - Směr: %1° - Kierunek: %1° - Dirección: %1° - Направление: %1° - - - \ No newline at end of file + + + Direction: %1° + Drehung: %1° + Direction: %1° + Směr: %1° + Kierunek: %1° + Dirección: %1° + Направление: %1° + Irány: %1° + Direzione: %1° + Direção %1 + + + diff --git a/addons/medical/ACE_Medical_Actions.hpp b/addons/medical/ACE_Medical_Actions.hpp index 72263c0b45..9052df81da 100644 --- a/addons/medical/ACE_Medical_Actions.hpp +++ b/addons/medical/ACE_Medical_Actions.hpp @@ -3,11 +3,13 @@ class ACE_Head { displayName = "$STR_ACE_Interaction_Head"; runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); + ACTION_CONDITION + modifierFunction = QUOTE([ARR_4(_target,_player,0,_this select 3)] call FUNC(modifyMedicalAction)); EXCEPTIONS icon = PATHTOF(UI\icons\medical_cross.paa); distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitHead"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(treatment)); @@ -19,7 +21,7 @@ class ACE_Head { }; // Advanced medical class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + displayName = "$STR_ACE_Medical_Actions_FieldDressing"; distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(treatment)); @@ -30,55 +32,63 @@ class ACE_Head { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + displayName = "$STR_ACE_Medical_Actions_PackingBandage"; condition = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; condition = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\bandage.paa); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + displayName = "$STR_ACE_Medical_Actions_QuikClot"; condition = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\bandage.paa); }; class CheckPulse: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; + displayName = "$STR_ACE_Medical_Actions_CheckPulse"; condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(treatment)); EXCEPTIONS icon = ""; }; class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; + displayName = "$STR_ACE_Medical_Actions_CheckBloodPressure"; condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(treatment)); EXCEPTIONS }; class CheckResponse: CheckPulse { - displayName = "Check Response"; + displayName = "$STR_ACE_Medical_Check_Response"; condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckResponse')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckResponse')] call DFUNC(treatment)); EXCEPTIONS }; + class Diagnose: CheckPulse { + displayName = "$STR_ACE_Medical_Actions_Diagnose"; + condition = QUOTE([ARR_4(_player, _target, 'head', 'Diagnose')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'head', 'Diagnose')] call DFUNC(treatment)); + EXCEPTIONS + }; }; class ACE_Torso { displayName = "$STR_ACE_Interaction_Torso"; runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 1)] call DFUNC(displayPatientInformation)); + ACTION_CONDITION + modifierFunction = QUOTE([ARR_4(_target,_player,1,_this select 3)] call FUNC(modifyMedicalAction)); EXCEPTIONS icon = PATHTOF(UI\icons\medical_cross.paa); distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitBody"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(treatment)); @@ -90,7 +100,7 @@ class ACE_Torso { icon = PATHTOF(UI\icons\bandage.paa); }; class PlaceInBodyBag { - displayName = "$STR_ACE_MEDICAL_PlaceInBodyBag"; + displayName = "$STR_ACE_Medical_PlaceInBodyBag"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'BodyBag')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'BodyBag')] call DFUNC(treatment)); @@ -101,7 +111,7 @@ class ACE_Torso { enableInside = 1; }; class TriageCard { - displayName = "Triage Card"; + displayName = "$STR_ACE_Medical_Actions_TriageCard"; distance = 2.0; condition = "true"; statement = QUOTE([ARR_2(_target, true)] call DFUNC(displayTriageCard)); @@ -115,7 +125,7 @@ class ACE_Torso { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + displayName = "$STR_ACE_Medical_Actions_FieldDressing"; distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(treatment)); @@ -127,42 +137,42 @@ class ACE_Torso { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + displayName = "$STR_ACE_Medical_Actions_PackingBandage"; condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; condition = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\bandage.paa); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + displayName = "$STR_ACE_Medical_Actions_QuikClot"; condition = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\bandage.paa); }; class SurgicalKit: fieldDressing { - displayName = "Use Surgical Kit"; + displayName = "$STR_ACE_Medical_Use_SurgicalKit"; condition = QUOTE([ARR_4(_player, _target, 'body', 'SurgicalKit')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'SurgicalKit')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\surgicalKit.paa); }; class PersonalAidKit: fieldDressing { - displayName = "Use Personal Aid Kit"; + displayName = "$STR_ACE_Medical_Use_Aid_Kit"; condition = QUOTE([ARR_4(_player, _target, 'body', 'PersonalAidKit')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'PersonalAidKit')] call DFUNC(treatment)); EXCEPTIONS icon = ""; }; class CPR: fieldDressing { - displayName = "CPR"; + displayName = "$STR_ACE_Medical_Actions_CPR"; condition = QUOTE([ARR_4(_player, _target, 'body', 'CPR')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'CPR')] call DFUNC(treatment)); EXCEPTIONS @@ -173,12 +183,14 @@ class ACE_ArmLeft { displayName = "$STR_ACE_Interaction_ArmLeft"; runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 2)] call DFUNC(displayPatientInformation)); + ACTION_CONDITION + modifierFunction = QUOTE([ARR_4(_target,_player,2,_this select 3)] call FUNC(modifyMedicalAction)); EXCEPTIONS icon = PATHTOF(UI\icons\medical_cross.paa); distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitLeftArm"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(treatment)); @@ -191,7 +203,7 @@ class ACE_ArmLeft { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + displayName = "$STR_ACE_Medical_Actions_FieldDressing"; distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(treatment)); @@ -202,28 +214,28 @@ class ACE_ArmLeft { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + displayName = "$STR_ACE_Medical_Actions_PackingBandage"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\bandage.paa); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + displayName = "$STR_ACE_Medical_Actions_QuikClot"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\bandage.paa); }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; + displayName = "$STR_ACE_Medical_Actions_Tourniquet"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(treatment)); EXCEPTIONS @@ -251,75 +263,75 @@ class ACE_ArmLeft { icon = PATHTOF(UI\icons\autoInjector.paa); }; class BloodIV: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_1000"; + displayName = "$STR_ACE_Medical_Actions_Blood4_1000"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\iv.paa); }; class BloodIV_500: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_500"; + displayName = "$STR_ACE_Medical_Actions_Blood4_500"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class BloodIV_250: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_250"; + displayName = "$STR_ACE_Medical_Actions_Blood4_250"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_1000"; + displayName = "$STR_ACE_Medical_Actions_Plasma4_1000"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV_500: PlasmaIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_500"; + displayName = "$STR_ACE_Medical_Actions_Plasma4_500"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV_250: PlasmaIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_250"; + displayName = "$STR_ACE_Medical_Actions_Plasma4_250"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_1000"; + displayName = "$STR_ACE_Medical_Actions_Saline4_1000"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV_500: SalineIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_500"; + displayName = "$STR_ACE_Medical_Actions_Saline4_500"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV_250: SalineIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_250"; + displayName = "$STR_ACE_Medical_Actions_Saline4_250"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class CheckPulse: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; + displayName = "$STR_ACE_Medical_Actions_CheckPulse"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(treatment)); EXCEPTIONS icon = ""; }; class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; + displayName = "$STR_ACE_Medical_Actions_CheckBloodPressure"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(treatment)); EXCEPTIONS }; class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; + displayName = "$STR_ACE_Medical_Actions_RemoveTourniquet"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(treatment)); EXCEPTIONS @@ -329,12 +341,14 @@ class ACE_ArmRight { displayName = "$STR_ACE_Interaction_ArmRight"; runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 3)] call DFUNC(displayPatientInformation)); + ACTION_CONDITION + modifierFunction = QUOTE([ARR_4(_target,_player,3,_this select 3)] call FUNC(modifyMedicalAction)); EXCEPTIONS icon = PATHTOF(UI\icons\medical_cross.paa); distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitRightArm"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment)); @@ -347,7 +361,7 @@ class ACE_ArmRight { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + displayName = "$STR_ACE_Medical_Actions_FieldDressing"; distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(treatment)); @@ -358,26 +372,26 @@ class ACE_ArmRight { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + displayName = "$STR_ACE_Medical_Actions_PackingBandage"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(treatment)); EXCEPTIONS }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + displayName = "$STR_ACE_Medical_Actions_QuikClot"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(treatment)); EXCEPTIONS }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; + displayName = "$STR_ACE_Medical_Actions_Tourniquet"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(treatment)); EXCEPTIONS @@ -403,75 +417,75 @@ class ACE_ArmRight { EXCEPTIONS }; class BloodIV: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_1000"; + displayName = "$STR_ACE_Medical_Actions_Blood4_1000"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\iv.paa); }; class BloodIV_500: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_500"; + displayName = "$STR_ACE_Medical_Actions_Blood4_500"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class BloodIV_250: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_250"; + displayName = "$STR_ACE_Medical_Actions_Blood4_250"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_1000"; - condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(treatment)); + displayName = "$STR_ACE_Medical_Actions_Plasma4_1000"; + condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV_500: PlasmaIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_500"; + displayName = "$STR_ACE_Medical_Actions_Plasma4_500"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV_250: PlasmaIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_250"; + displayName = "$STR_ACE_Medical_Actions_Plasma4_250"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_1000"; + displayName = "$STR_ACE_Medical_Actions_Saline4_1000"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV_500: SalineIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_500"; + displayName = "$STR_ACE_Medical_Actions_Saline4_500"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV_250: SalineIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_250"; + displayName = "$STR_ACE_Medical_Actions_Saline4_250"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class CheckPulse: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; + displayName = "$STR_ACE_Medical_Actions_CheckPulse"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(treatment)); EXCEPTIONS icon = ""; }; class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; + displayName = "$STR_ACE_Medical_Actions_CheckBloodPressure"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(treatment)); EXCEPTIONS }; class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; + displayName = "$STR_ACE_Medical_Actions_RemoveTourniquet"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(treatment)); EXCEPTIONS @@ -482,12 +496,14 @@ class ACE_LegLeft { displayName = "$STR_ACE_Interaction_LegLeft"; runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 4)] call DFUNC(displayPatientInformation)); + ACTION_CONDITION + modifierFunction = QUOTE([ARR_4(_target,_player,4,_this select 3)] call FUNC(modifyMedicalAction)); EXCEPTIONS icon = PATHTOF(UI\icons\medical_cross.paa); distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitLeftLeg"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(treatment)); @@ -501,7 +517,7 @@ class ACE_LegLeft { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + displayName = "$STR_ACE_Medical_Actions_FieldDressing"; distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(treatment)); @@ -512,26 +528,26 @@ class ACE_LegLeft { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + displayName = "$STR_ACE_Medical_Actions_PackingBandage"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(treatment)); EXCEPTIONS }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + displayName = "$STR_ACE_Medical_Actions_QuikClot"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(treatment)); EXCEPTIONS }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; + displayName = "$STR_ACE_Medical_Actions_Tourniquet"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(treatment)); EXCEPTIONS @@ -558,62 +574,62 @@ class ACE_LegLeft { EXCEPTIONS }; class BloodIV: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_1000"; + displayName = "$STR_ACE_Medical_Actions_Blood4_1000"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\iv.paa); }; class BloodIV_500: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_500"; + displayName = "$STR_ACE_Medical_Actions_Blood4_500"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class BloodIV_250: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_250"; + displayName = "$STR_ACE_Medical_Actions_Blood4_250"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_1000"; - condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(treatment)); + displayName = "$STR_ACE_Medical_Actions_Plasma4_1000"; + condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV_500: PlasmaIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_500"; + displayName = "$STR_ACE_Medical_Actions_Plasma4_500"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV_250: PlasmaIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_250"; + displayName = "$STR_ACE_Medical_Actions_Plasma4_250"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_1000"; + displayName = "$STR_ACE_Medical_Actions_Saline4_1000"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV_500: SalineIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_500"; + displayName = "$STR_ACE_Medical_Actions_Saline4_500"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV_250: SalineIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_250"; + displayName = "$STR_ACE_Medical_Actions_Saline4_250"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; + displayName = "$STR_ACE_Medical_Actions_RemoveTourniquet"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(treatment)); EXCEPTIONS @@ -623,12 +639,14 @@ class ACE_LegRight { displayName = "$STR_ACE_Interaction_LegRight"; runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 5)] call DFUNC(displayPatientInformation)); + ACTION_CONDITION + modifierFunction = QUOTE([ARR_4(_target,_player,5,_this select 3)] call FUNC(modifyMedicalAction)); EXCEPTIONS icon = PATHTOF(UI\icons\medical_cross.paa); distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitRightLeg"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(treatment)); @@ -642,7 +660,7 @@ class ACE_LegRight { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + displayName = "$STR_ACE_Medical_Actions_FieldDressing"; distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(treatment)); @@ -653,26 +671,26 @@ class ACE_LegRight { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + displayName = "$STR_ACE_Medical_Actions_PackingBandage"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(treatment)); EXCEPTIONS }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + displayName = "$STR_ACE_Medical_Actions_QuikClot"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(treatment)); EXCEPTIONS }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; + displayName = "$STR_ACE_Medical_Actions_Tourniquet"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(treatment)); EXCEPTIONS @@ -698,62 +716,62 @@ class ACE_LegRight { EXCEPTIONS }; class BloodIV: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_1000"; + displayName = "$STR_ACE_Medical_Actions_Blood4_1000"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\iv.paa); }; class BloodIV_500: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_500"; + displayName = "$STR_ACE_Medical_Actions_Blood4_500"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class BloodIV_250: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Blood4_250"; + displayName = "$STR_ACE_Medical_Actions_Blood4_250"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_1000"; - condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(treatment)); + displayName = "$STR_ACE_Medical_Actions_Plasma4_1000"; + condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV_500: PlasmaIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_500"; + displayName = "$STR_ACE_Medical_Actions_Plasma4_500"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV_250: PlasmaIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Plasma4_250"; + displayName = "$STR_ACE_Medical_Actions_Plasma4_250"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV: BloodIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_1000"; + displayName = "$STR_ACE_Medical_Actions_Saline4_1000"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV_500: SalineIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_500"; + displayName = "$STR_ACE_Medical_Actions_Saline4_500"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV_250: SalineIV { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Saline4_250"; + displayName = "$STR_ACE_Medical_Actions_Saline4_250"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; + displayName = "$STR_ACE_Medical_Actions_RemoveTourniquet"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(treatment)); EXCEPTIONS diff --git a/addons/medical/ACE_Medical_SelfActions.hpp b/addons/medical/ACE_Medical_SelfActions.hpp index e77e276af2..5b98448664 100644 --- a/addons/medical/ACE_Medical_SelfActions.hpp +++ b/addons/medical/ACE_Medical_SelfActions.hpp @@ -1,9 +1,10 @@ class Medical { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Medical"; + displayName = "$STR_ACE_Medical_Actions_Medical"; runOnHover = 1; hotkey = "M"; exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); + condition = "true"; icon = PATHTOF(UI\icons\medical_cross.paa); class ACE_Head { @@ -11,10 +12,12 @@ class Medical { icon = PATHTOF(UI\icons\medical_cross.paa); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); + modifierFunction = QUOTE([ARR_4(_target,_player,0,_this select 3)] call FUNC(modifyMedicalAction)); + condition = "true"; runOnHover = 1; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitHead"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -26,7 +29,7 @@ class Medical { }; // Advanced medical class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + displayName = "$STR_ACE_Medical_Actions_FieldDressing"; distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -37,35 +40,35 @@ class Medical { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + displayName = "$STR_ACE_Medical_Actions_PackingBandage"; condition = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; condition = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\bandage.paa); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + displayName = "$STR_ACE_Medical_Actions_QuikClot"; condition = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\bandage.paa); }; class CheckPulse: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; + displayName = "$STR_ACE_Medical_Actions_CheckPulse"; condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(treatment)); icon = ""; }; class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; + displayName = "$STR_ACE_Medical_Actions_CheckBloodPressure"; condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(treatment)); @@ -78,13 +81,14 @@ class Medical { runOnHover = 1; exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_3(_target, true, 1)] call DFUNC(displayPatientInformation)); + modifierFunction = QUOTE([ARR_4(_target,_player,1,_this select 3)] call FUNC(modifyMedicalAction)); showDisabled = 1; priority = 2; hotkey = ""; icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitBody"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -96,7 +100,7 @@ class Medical { }; class TriageCard { - displayName = "$STR_ACE_MEDICAL_ACTIONS_TriageCard"; + displayName = "$STR_ACE_Medical_Actions_TriageCard"; distance = 2.0; condition = "true"; exceptions[] = {"isNotInside"}; @@ -109,7 +113,7 @@ class Medical { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + displayName = "$STR_ACE_Medical_Actions_FieldDressing"; distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -120,21 +124,21 @@ class Medical { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + displayName = "$STR_ACE_Medical_Actions_PackingBandage"; condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; condition = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\bandage.paa); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + displayName = "$STR_ACE_Medical_Actions_QuikClot"; condition = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(treatment)); @@ -146,10 +150,12 @@ class Medical { runOnHover = 1; exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_3(_target, true, 2)] call DFUNC(displayPatientInformation)); + modifierFunction = QUOTE([ARR_4(_target,_player,2,_this select 3)] call FUNC(modifyMedicalAction)); + condition = "true"; icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitLeftArm"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -162,7 +168,7 @@ class Medical { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + displayName = "$STR_ACE_Medical_Actions_FieldDressing"; distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -173,28 +179,28 @@ class Medical { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + displayName = "$STR_ACE_Medical_Actions_PackingBandage"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\bandage.paa); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + displayName = "$STR_ACE_Medical_Actions_QuikClot"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\bandage.paa); }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; + displayName = "$STR_ACE_Medical_Actions_Tourniquet"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(treatment)); @@ -222,20 +228,20 @@ class Medical { icon = PATHTOF(UI\icons\autoInjector.paa); }; class CheckPulse: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; + displayName = "$STR_ACE_Medical_Actions_CheckPulse"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(treatment)); icon = ""; }; class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; + displayName = "$STR_ACE_Medical_Actions_CheckBloodPressure"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(treatment)); }; class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; + displayName = "$STR_ACE_Medical_Actions_RemoveTourniquet"; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(treatment)); @@ -246,10 +252,12 @@ class Medical { runOnHover = 1; exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_3(_target, true, 3)] call DFUNC(displayPatientInformation)); + modifierFunction = QUOTE([ARR_4(_target,_player,3,_this select 3)] call FUNC(modifyMedicalAction)); + condition = "true"; icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitRightArm"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -262,7 +270,7 @@ class Medical { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + displayName = "$STR_ACE_Medical_Actions_FieldDressing"; distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -273,26 +281,26 @@ class Medical { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + displayName = "$STR_ACE_Medical_Actions_PackingBandage"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + displayName = "$STR_ACE_Medical_Actions_QuikClot"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(treatment)); }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; + displayName = "$STR_ACE_Medical_Actions_Tourniquet"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(treatment)); @@ -318,20 +326,20 @@ class Medical { statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(treatment)); }; class CheckPulse: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckPulse"; + displayName = "$STR_ACE_Medical_Actions_CheckPulse"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(treatment)); icon = ""; }; class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_MEDICAL_ACTIONS_CheckBloodPressure"; + displayName = "$STR_ACE_Medical_Actions_CheckBloodPressure"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(treatment)); }; class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; + displayName = "$STR_ACE_Medical_Actions_RemoveTourniquet"; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(treatment)); @@ -342,10 +350,12 @@ class Medical { runOnHover = 1; exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_3(_target, true, 4)] call DFUNC(displayPatientInformation)); + modifierFunction = QUOTE([ARR_4(_target,_player,4,_this select 3)] call FUNC(modifyMedicalAction)); + condition = "true"; icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitLeftLeg"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -359,7 +369,7 @@ class Medical { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + displayName = "$STR_ACE_Medical_Actions_FieldDressing"; distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -370,26 +380,26 @@ class Medical { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + displayName = "$STR_ACE_Medical_Actions_PackingBandage"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + displayName = "$STR_ACE_Medical_Actions_QuikClot"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(treatment)); }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; + displayName = "$STR_ACE_Medical_Actions_Tourniquet"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(treatment)); @@ -416,7 +426,7 @@ class Medical { statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(treatment)); }; class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; + displayName = "$STR_ACE_Medical_Actions_RemoveTourniquet"; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(treatment)); @@ -427,10 +437,12 @@ class Medical { runOnHover = 1; exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_3(_target, true, 5)] call DFUNC(displayPatientInformation)); + modifierFunction = QUOTE([ARR_4(_target,_player,5,_this select 3)] call FUNC(modifyMedicalAction)); + condition = "true"; icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitRightLeg"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -444,7 +456,7 @@ class Medical { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_FieldDressing"; + displayName = "$STR_ACE_Medical_Actions_FieldDressing"; distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -455,26 +467,26 @@ class Medical { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_PackingBandage"; + displayName = "$STR_ACE_Medical_Actions_PackingBandage"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_ElasticBandage"; + displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_QuikClot"; + displayName = "$STR_ACE_Medical_Actions_QuikClot"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(treatment)); }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Tourniquet"; + displayName = "$STR_ACE_Medical_Actions_Tourniquet"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(treatment)); @@ -500,10 +512,10 @@ class Medical { statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(treatment)); }; class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_MEDICAL_ACTIONS_RemoveTourniquet"; + displayName = "$STR_ACE_Medical_Actions_RemoveTourniquet"; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(treatment)); }; }; -}; \ No newline at end of file +}; diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index 097292d9cc..3f5212ad71 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -55,18 +55,9 @@ class ACE_Medical_Actions { animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; litter[] = {}; }; - class Tourniquet: Bandage { - displayName = "$STR_ACE_Medical_Apply_Tourniquet"; - displayNameProgress = "$STR_ACE_Medical_Applying_Tourniquet"; - items[] = {"ACE_tourniquet"}; - treatmentTime = 6; - callbackSuccess = QUOTE(DFUNC(treatmentTourniquet)); - condition = QUOTE(!([ARR_2(_this select 1, _this select 2)] call FUNC(hasTourniquetAppliedTo))); - litter[] = {}; - }; class BodyBag: Bandage { - displayName = "$STR_ACE_MEDICAL_PlaceInBodyBag"; - displayNameProgress = "$STR_ACE_MEDICAL_PlacingInBodyBag"; + displayName = "$STR_ACE_Medical_PlaceInBodyBag"; + displayNameProgress = "$STR_ACE_Medical_PlacingInBodyBag"; treatmentLocations[] = {"All"}; requiredMedic = 0; treatmentTime = 2; @@ -80,6 +71,21 @@ class ACE_Medical_Actions { itemConsumed = 1; litter[] = {}; }; + class Diagnose: Bandage { + displayName = "$STR_ACE_Medical_Actions_Diagnose"; + displayNameProgress = "$STR_ACE_Medical_Actions_Diagnosing"; + treatmentLocations[] = {"All"}; + requiredMedic = 0; + treatmentTime = 1; + items[] = {}; + callbackSuccess = QUOTE(DFUNC(actionDiagnose)); + callbackFailure = ""; + callbackProgress = ""; + animationPatient = ""; + animationCaller = ""; // TODO + itemConsumed = 0; + litter[] = {}; + }; }; class Advanced { @@ -190,7 +196,7 @@ class ACE_Medical_Actions { }; class SurgicalKit: fieldDressing { displayName = ""; - displayNameProgress = ""; + displayNameProgress = "$STR_ACE_Medical_TreatmentAction"; items[] = {"ACE_surgicalKit"}; treatmentLocations[] = {QGVAR(useLocation_SurgicalKit)}; requiredMedic = QGVAR(medicSetting_SurgicalKit); @@ -202,7 +208,7 @@ class ACE_Medical_Actions { }; class PersonalAidKit: fieldDressing { displayName = ""; - displayNameProgress = ""; + displayNameProgress = "$STR_ACE_Medical_TreatmentAction"; items[] = {"ACE_personalAidKit"}; treatmentLocations[] = {QGVAR(useLocation_PAK)}; requiredMedic = QGVAR(medicSetting_PAK); @@ -219,7 +225,7 @@ class ACE_Medical_Actions { }; class CheckPulse: fieldDressing { displayName = ""; - displayNameProgress = ""; + displayNameProgress = "$STR_ACE_Medical_Check_Pulse_Content"; treatmentLocations[] = {"All"}; requiredMedic = 0; treatmentTime = 2; @@ -234,18 +240,21 @@ class ACE_Medical_Actions { }; class CheckBloodPressure: CheckPulse { callbackSuccess = QUOTE(DFUNC(actionCheckBloodPressure)); + displayNameProgress = "$STR_ACE_Medical_Check_Bloodpressure_Content"; }; class CheckResponse: CheckPulse { callbackSuccess = QUOTE(DFUNC(actionCheckResponse)); + displayNameProgress = "$STR_ACE_Medical_Check_Response_Content"; }; class RemoveTourniquet: CheckPulse { treatmentTime = 2.5; callbackSuccess = QUOTE(DFUNC(actionRemoveTourniquet)); condition = QUOTE([ARR_2(_this select 1, _this select 2)] call FUNC(hasTourniquetAppliedTo)); + displayNameProgress = "$STR_ACE_Medical_RemovingTourniquet"; }; class CPR: fieldDressing { - displayName = "CPR"; - displayNameProgress = "Performing CPR"; + displayName = "$STR_ACE_Medical_Actions_CPR"; + displayNameProgress = "$STR_ACE_Medical_Actions_PerformingCPR"; treatmentLocations[] = {"All"}; requiredMedic = 0; treatmentTime = 15; @@ -264,8 +273,8 @@ class ACE_Medical_Actions { litter[] = {}; }; class BodyBag: fieldDressing { - displayName = "$STR_ACE_MEDICAL_PlaceInBodyBag"; - displayNameProgress = "$STR_ACE_MEDICAL_PlacingInBodyBag"; + displayName = "$STR_ACE_Medical_PlaceInBodyBag"; + displayNameProgress = "$STR_ACE_Medical_PlacingInBodyBag"; treatmentLocations[] = {"All"}; requiredMedic = 0; treatmentTime = 2; @@ -291,23 +300,26 @@ class ACE_Medical_Advanced { // Source: Scarle // Also called scrapes, they occur when the skin is rubbed away by friction against another rough surface (e.g. rope burns and skinned knees). class Abrasion { - name = "Scrape"; + name = "$STR_ACE_Medical_Wounds_Abrasion"; selections[] = {"All"}; bleedingRate = 0.0001; pain = 0.01; causes[] = {"falling", "ropeburn", "vehiclecrash", "unknown"}; minDamage = 0.01; class Minor { + name = "$STR_ACE_Medical_Wounds_Abrasion_Minor"; minDamage = 0.01; maxDamage = 0.2; bleedingRate = 0.0001; }; class Medium { + name = "$STR_ACE_Medical_Wounds_Abrasion_Medium"; minDamage = 0.2; maxDamage = 0.3; bleedingRate = 0.00015; }; class Large { + name = "$STR_ACE_Medical_Wounds_Abrasion_Large"; minDamage = 0.3; bleedingRate = 0.0002; }; @@ -315,23 +327,26 @@ class ACE_Medical_Advanced { // Occur when an entire structure or part of it is forcibly pulled away, such as the loss of a permanent tooth or an ear lobe. Explosions, gunshots, and animal bites may cause avulsions. class Avulsions { - name = "Avulsion"; + name = "$STR_ACE_Medical_Wounds_Avulsion"; selections[] = {"All"}; bleedingRate = 0.01; pain = 0.3; causes[] = {"explosive", "vehiclecrash", "grenade", "shell", "bullet", "backblast", "bite"}; minDamage = 0.2; class Minor { + name = "$STR_ACE_Medical_Wounds_Avulsion_Minor"; minDamage = 0.2; maxDamage = 0.3; bleedingRate = 0.01; }; class Medium { + name = "$STR_ACE_Medical_Wounds_Avulsion_Medium"; minDamage = 0.3; maxDamage = 0.6; bleedingRate = 0.02; }; class Large { + name = "$STR_ACE_Medical_Wounds_Avulsion_Large"; minDamage = 0.5; bleedingRate = 0.05; }; @@ -339,22 +354,25 @@ class ACE_Medical_Advanced { // Also called bruises, these are the result of a forceful trauma that injures an internal structure without breaking the skin. Blows to the chest, abdomen, or head with a blunt instrument (e.g. a football or a fist) can cause contusions. class Contusion { - name = "Bruise"; + name = "$STR_ACE_Medical_Wounds_Contusion"; selections[] = {"All"}; bleedingRate = 0.0; pain = 0.05; - causes[] = {"bullet", "backblast", "punch","vehiclecrash","falling"}; + causes[] = {"bullet", "backblast", "punch", "vehiclecrash", "falling"}; minDamage = 0.01; maxDamage = 0.1; class Minor { + name = "$STR_ACE_Medical_Wounds_Contusion_Minor"; minDamage = 0.01; maxDamage = 0.1; }; class Medium { + name = "$STR_ACE_Medical_Wounds_Contusion_Medium"; minDamage = 0.1; maxDamage = 0.15; }; class Large { + name = "$STR_ACE_Medical_Wounds_Contusion_Large"; minDamage = 0.15; maxDamage = 0.2; }; @@ -362,23 +380,26 @@ class ACE_Medical_Advanced { // Occur when a heavy object falls onto a person, splitting the skin and shattering or tearing underlying structures. class CrushWound { - name = "Crushed tissue"; + name = "$STR_ACE_Medical_Wounds_Crush"; selections[] = {"All"}; bleedingRate = 0.01; pain = 0.1; causes[] = {"falling", "vehiclecrash", "punch", "unknown"}; minDamage = 0.1; class Minor { + name = "$STR_ACE_Medical_Wounds_Crush_Minor"; minDamage = 0.1; maxDamage = 0.45; bleedingRate = 0.005; }; class Medium { + name = "$STR_ACE_Medical_Wounds_Crush_Medium"; minDamage = 0.4; maxDamage = 0.7; bleedingRate = 0.007; }; class Large { + name = "$STR_ACE_Medical_Wounds_Crush_Large"; minDamage = 0.6; bleedingRate = 0.0095; }; @@ -386,23 +407,26 @@ class ACE_Medical_Advanced { // Slicing wounds made with a sharp instrument, leaving even edges. They may be as minimal as a paper cut or as significant as a surgical incision. class Cut { - name = "Cut"; + name = "$STR_ACE_Medical_Wounds_Cut"; selections[] = {"All"}; bleedingRate = 0.01; pain = 0.075; causes[] = {"vehiclecrash", "grenade", "explosive", "shell", "backblast", "stab", "unknown"}; minDamage = 0.1; class Minor { + name = "$STR_ACE_Medical_Wounds_Cut_Minor"; minDamage = 0.1; maxDamage = 0.3; bleedingRate = 0.005; }; class Medium { + name = "$STR_ACE_Medical_Wounds_Cut_Medium"; minDamage = 0.3; maxDamage = 0.65; bleedingRate = 0.02; }; class Large { + name = "$STR_ACE_Medical_Wounds_Cut_Large"; minDamage = 0.65; bleedingRate = 0.05; }; @@ -410,23 +434,26 @@ class ACE_Medical_Advanced { // Also called tears, these are separating wounds that produce ragged edges. They are produced by a tremendous force against the body, either from an internal source as in childbirth, or from an external source like a punch. class Laceration { - name = "Tear"; + name = "$STR_ACE_Medical_Wounds_Laceration"; selections[] = {"All"}; bleedingRate = 0.01; pain = 0.075; causes[] = {"vehiclecrash", "punch"}; minDamage = 0.01; class Minor { + name = "$STR_ACE_Medical_Wounds_Laceration_Minor"; minDamage = 0.1; maxDamage = 0.5; bleedingRate = 0.005; }; class Medium { + name = "$STR_ACE_Medical_Wounds_Laceration_Medium"; minDamage = 0.5; maxDamage = 0.7; bleedingRate = 0.01; }; class Large { + name = "$STR_ACE_Medical_Wounds_Laceration_Large"; minDamage = 0.7; bleedingRate = 0.03; }; @@ -434,22 +461,25 @@ class ACE_Medical_Advanced { // Also called velocity wounds, they are caused by an object entering the body at a high speed, typically a bullet or small peices of shrapnel. class velocityWound { - name = "Velocity Wound"; + name = "$STR_ACE_Medical_Wounds_VelocityWound"; selections[] = {"All"}; bleedingRate = 0.01; pain = 0.2; causes[] = {"bullet", "grenade","explosive", "shell", "unknown"}; minDamage = 0.15; class Minor { + name = "$STR_ACE_Medical_Wounds_VelocityWound_Minor"; minDamage = 0.15; maxDamage = 0.3; bleedingRate = 0.025; }; class Medium { + name = "$STR_ACE_Medical_Wounds_VelocityWound_Medium"; minDamage = 0.3; bleedingRate = 0.05; }; class Large { + name = "$STR_ACE_Medical_Wounds_VelocityWound_Large"; minDamage = 0.75; bleedingRate = 0.1; }; @@ -457,23 +487,26 @@ class ACE_Medical_Advanced { // Deep, narrow wounds produced by sharp objects such as nails, knives, and broken glass. class punctureWound { - name = "Puncture Wound"; + name = "$STR_ACE_Medical_Wounds_PunctureWound"; selections[] = {"All"}; bleedingRate = 0.01; pain = 0.075; causes[] = {"stab", "grenade"}; minDamage = 0.01; class Minor { + name = "$STR_ACE_Medical_Wounds_PunctureWound_Minor"; minDamage = 0.01; maxDamage = 0.5; bleedingRate = 0.01; }; class Medium { + name = "$STR_ACE_Medical_Wounds_PunctureWound_Medium"; minDamage = 0.5; maxDamage = 0.75; bleedingRate = 0.03; }; class Large { + name = "$STR_ACE_Medical_Wounds_PunctureWound_Large"; minDamage = 0.65; bleedingRate = 0.08; }; @@ -481,7 +514,7 @@ class ACE_Medical_Advanced { }; class fractures { class Femur { - name = "Broken Femur"; + name = "$STR_ACE_Medical_Wounds_Femur"; selections[] = {"Head", "Torso"}; pain = 0.2; causes[] = {"Bullet", "VehicleCrash", "Backblast", "Explosive", "Shell", "Grenade"}; diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index 4d2f2db9be..b3c2152df1 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -22,6 +22,10 @@ class ACE_Settings { typeName = "SCALAR"; value = 1; }; + class GVAR(painCoefficient) { + typeName = "SCALAR"; + value = 1; + }; class GVAR(enableAirway) { typeName = "BOOL"; value = false; @@ -50,15 +54,20 @@ class ACE_Settings { typeName = "SCALAR"; value = 1; }; - class GVAR(enableUnsconsiousnessAI) { + class GVAR(enableUnconsciousnessAI) { value = 1; typeName = "SCALAR"; - values[] = {"Disabled", "Enabled", "50/50"}; + values[] = {"Disabled", "50/50", "Enabled"}; }; class GVAR(preventInstaDeath) { typeName = "BOOL"; value = 0; }; + class GVAR(enableRevive) { + typeName = "SCALAR"; + value = 0; + values[] = {"Disabled", "Players only", "Players and AI"}; + }; class GVAR(maxReviveTime) { typeName = "SCALAR"; value = 120; @@ -73,11 +82,22 @@ class ACE_Settings { }; class GVAR(allowLitterCreation) { typeName = "BOOL"; - value = true; + value = 1; + }; + class GVAR(litterSimulationDetail) { + displayName = "$STR_ACE_Medical_litterSimulationDetail"; + description = "$STR_ACE_Medical_litterSimulationDetail_Desc"; + typeName = "SCALAR"; + + value = 3; + values[] = {"Off", "Low", "Medium", "High", "Ultra"}; + _values[] = { 0, 50, 100, 1000, 5000 }; + + isClientSettable = 1; }; class GVAR(litterCleanUpDelay) { typeName = "SCALAR"; - value = 1800; + value = 0; }; class GVAR(medicSetting_PAK) { typeName = "SCALAR"; @@ -117,4 +137,28 @@ class ACE_Settings { typeName = "BOOL"; value = 1; }; + class GVAR(painEffectType) { + displayName = "$STR_ACE_Medical_painEffectType"; + typeName = "SCALAR"; + value = 0; + values[] = {"$STR_ACE_Medical_painEffect_Flash", "$STR_ACE_Medical_painEffect_Chroma"}; + isClientSettable = 1; + }; + class GVAR(allowUnconsciousAnimationOnTreatment) { + typeName = "BOOL"; + value = 0; + }; + class GVAR(moveUnitsFromGroupOnUnconscious) { + typeName = "BOOL"; + value = 0; + }; + + class GVAR(menuTypeStyle) { + displayName = "$STR_ACE_Medical_menuTypeDisplay"; + description = "$STR_ACE_Medical_menuTypeDescription"; + typeName = "SCALAR"; + value = 0; + values[] = {"$STR_ACE_Medical_useSelection"/*, "$STR_ACE_Medical_useRadial"*/}; + // isClientSettable = 1; + }; }; diff --git a/addons/medical/CfgEventHandlers.hpp b/addons/medical/CfgEventHandlers.hpp index bf96b6a239..2fe5d0a9e5 100644 --- a/addons/medical/CfgEventHandlers.hpp +++ b/addons/medical/CfgEventHandlers.hpp @@ -47,11 +47,3 @@ class Extended_Local_EventHandlers { }; }; }; - -class Extended_Take_EventHandlers { - class CAManBase { - class ADDON { - take = QUOTE(call FUNC(itemCheck)); - }; - }; -}; diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 4d7b23463a..4054a2ee1e 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -37,122 +37,6 @@ class CfgVehicles { }; }; }; - class enableFor { - displayName = "Enabled for"; - description = "Select what units the medical system will be enabled for (Adv only)"; - typeName = "NUMBER"; - class values { - class playableUnits { - name = "Players only."; - value = 0; - default = 1; - }; - class playableUnitsAndAI { - name = "Players and AI"; - value = 1; - }; - }; - }; - // TODO Disabled until the features are implemented - /*class enableAirway { - displayName = "Enable Airway"; - description = "Enable Advanced medical Airway (Adv only)"; - typeName = "BOOL"; - defaultValue = 0; - }; - class enableFractures { - displayName = "Enable Fractures"; - description = "Enable Advanced medical Fractures (Adv only)"; - typeName = "BOOL"; - defaultValue = 0; - };*/ - class enableAdvancedWounds { - displayName = "Enable Advanced wounds"; - description = "Allow reopening of bandaged wounds? (Adv only)"; - typeName = "BOOL"; - defaultValue = 0; - }; - class enableVehicleCrashes { - displayName = "Vehicle Crashes"; - description = "Do units take damage from a vehicle crash?"; - typeName = "BOOL"; - defaultValue = 1; - }; - class enableScreams { - displayName = "Enable Screams"; - description = "Enable screaming by injuried units"; - typeName = "BOOL"; - defaultValue = 1; - }; - class playerDamageThreshold { - displayName = "Player Damage"; - description = "What is the damage a player can take before being killed?"; - typeName = "NUMBER"; - defaultValue = 1; - }; - class AIDamageThreshold { - displayName = "AI Damage"; - description = "What is the damage an AI can take before being killed?"; - typeName = "NUMBER"; - defaultValue = 1; - }; - class enableUnsconsiousnessAI { - displayName = "AI Unconsciousness"; - description = "Allow AI to go unconscious"; - typeName = "NUMBER"; - class values { - class disable { - name = "Disabled"; - value = 0; - }; - class normal { - name = "Enabled"; - value = 1; - default = 1; - }; - class full { - name = "50/50"; - value = 2; - }; - }; - }; - class preventInstaDeath { - displayName = "Prevent instant death"; - description = "Have a unit move to unconscious instead of death"; - typeName = "BOOL"; - defaultValue = 0; - }; - class bleedingCoefficient { - displayName = "Bleeding coefficient"; - description = "Coefficient to modify the bleeding speed"; - typeName = "NUMBER"; - defaultValue = 1; - }; - class keepLocalSettingsSynced { - displayName = "Sync status"; - description = "Keep unit status synced. Recommended on."; - typeName = "BOOL"; - defaultValue = 1; - }; - }; - class ModuleDescription { - description = "Provides a medical system for both players and AI."; - sync[] = {}; - }; - }; - - class ACE_moduleTreatmentSettings: ACE_Module { - scope = 2; - displayName = "Treatment Settings [ACE]"; - icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); - category = "ACE_medical"; - function = QUOTE(FUNC(moduleTreatmentConfiguration)); - functionPriority = 10; - isGlobal = 2; - isTriggerActivated = 0; - isDisposable = 0; - author = "$STR_ACE_Common_ACETeam"; - class Arguments { class medicSetting { displayName = "Medics setting"; description = "What is the level of detail prefered for medics?"; @@ -173,24 +57,6 @@ class CfgVehicles { }; }; }; - class maxReviveTime { - displayName = "Max Revive time"; - description = "Max amount of seconds a unit can spend in revive state"; - typeName = "NUMBER"; - defaultValue = 120; - }; - class amountOfReviveLives { - displayName = "Max Revive lives"; - description = "Max amount of lives a unit. 0 or -1 is disabled."; - typeName = "NUMBER"; - defaultValue = -1; - }; - class enableOverdosing { - displayName = "Enable Overdosing"; - description = "Enable overdosing of medications"; - typeName = "BOOL"; - defaultValue = 1; - }; class allowLitterCreation { displayName = "Enable Litter"; description = "Enable litter being created upon treatment"; @@ -203,18 +69,127 @@ class CfgVehicles { typeName = "NUMBER"; defaultValue = 1800; }; + class enableScreams { + displayName = "Enable Screams"; + description = "Enable screaming by injuried units"; + typeName = "BOOL"; + defaultValue = 1; + }; + class playerDamageThreshold { + displayName = "Player Damage"; + description = "What is the damage a player can take before being killed?"; + typeName = "NUMBER"; + defaultValue = 1; + }; + class AIDamageThreshold { + displayName = "AI Damage"; + description = "What is the damage an AI can take before being killed?"; + typeName = "NUMBER"; + defaultValue = 1; + }; + class enableUnconsciousnessAI { + displayName = "AI Unconsciousness"; + description = "Allow AI to go unconscious"; + typeName = "NUMBER"; + class values { + class disable { + name = "Disabled"; + value = 0; + }; + class normal { + name = "50/50"; + value = 1; + default = 1; + }; + class full { + name = "Enabled"; + value = 2; + }; + }; + }; + class preventInstaDeath { + displayName = "Prevent instant death"; + description = "Have a unit move to unconscious instead of death"; + typeName = "BOOL"; + defaultValue = 0; + }; + class bleedingCoefficient { + displayName = "Bleeding coefficient"; + description = "Coefficient to modify the bleeding speed"; + typeName = "NUMBER"; + defaultValue = 1; + }; + class painCoefficient { + displayName = "Pain coefficient"; + description = "Coefficient to modify the pain intensity"; + typeName = "NUMBER"; + defaultValue = 1; + }; + class keepLocalSettingsSynced { + displayName = "Sync status"; + description = "Keep unit status synced. Recommended on."; + typeName = "BOOL"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = "Provides a medical system for both players and AI."; + sync[] = {}; + }; + }; + + class ACE_moduleAdvancedMedicalSettings: ACE_Module { + scope = 2; + displayName = "Advanced Medical Settings [ACE]"; + icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); + category = "ACE_medical"; + function = QUOTE(FUNC(moduleAdvancedMedicalSettings)); + functionPriority = 10; + isGlobal = 2; + isTriggerActivated = 0; + isDisposable = 0; + author = "$STR_ACE_Common_ACETeam"; + class Arguments { + class enableFor { + displayName = "Enabled for"; + description = "Select what units the advanced medical system will be enabled for"; + typeName = "NUMBER"; + class values { + class playableUnits { + name = "Players only."; + value = 0; + default = 1; + }; + class playableUnitsAndAI { + name = "Players and AI"; + value = 1; + }; + }; + }; + class enableAdvancedWounds { + displayName = "Enable Advanced wounds"; + description = "Allow reopening of bandaged wounds?"; + typeName = "BOOL"; + defaultValue = 0; + }; + class enableVehicleCrashes { + displayName = "Vehicle Crashes"; + description = "Do units take damage from a vehicle crash?"; + typeName = "BOOL"; + defaultValue = 1; + }; class medicSetting_PAK { - displayName = "Allow PAK (Adv)"; + displayName = "Allow PAK"; description = "Who can use the PAK for full heal?"; typeName = "NUMBER"; class values { class anyone { name = "Anyone"; value = 0; }; class Medic { name = "Medics only"; value = 1; default = 1; }; - class Special { name = "Doctors only (Adv)"; value = 2; }; + class Special { name = "Doctors only"; value = 2; }; }; }; class consumeItem_PAK { - displayName = "Remove PAK on use (Adv)"; + displayName = "Remove PAK on use"; description = "Should PAK be removed on usage?"; typeName = "NUMBER"; class values { @@ -223,7 +198,7 @@ class CfgVehicles { }; }; class useLocation_PAK { - displayName = "Locations PAK (Adv)"; + displayName = "Locations PAK"; description = "Where can the personal aid kit be used?"; typeName = "NUMBER"; class values { @@ -254,6 +229,47 @@ class CfgVehicles { }; }; + + class ACE_moduleReviveSettings: ACE_Module { + scope = 2; + displayName = "Revive Settings [ACE]"; + icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); + category = "ACE_medical"; + function = QUOTE(DFUNC(moduleReviveSettings)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "$STR_ACE_Common_ACETeam"; + class Arguments { + class enableRevive { + displayName = "Enable Revive"; + description = "Enable a basic revive system"; + typeName = "NUMBER"; + defaultValue = 0; + class values { + class disable { name = "Disabled"; value = 0; default = 1;}; + class playerOnly { name = "Player only"; value = 1; }; + class playerAndAI { name = "Player & AI"; value = 2; }; + }; + }; + class maxReviveTime { + displayName = "Max Revive time"; + description = "Max amount of seconds a unit can spend in revive state"; + typeName = "NUMBER"; + defaultValue = 120; + }; + class amountOfReviveLives { + displayName = "Max Revive lives"; + description = "Max amount of lives a unit. 0 or -1 is disabled."; + typeName = "NUMBER"; + defaultValue = -1; + }; + }; + class ModuleDescription { + description = "Provides a medical system for both players and AI."; + sync[] = {}; + }; + }; class ACE_moduleAssignMedicRoles: Module_F { scope = 2; displayName = "Set Medic Class [ACE]"; @@ -288,7 +304,7 @@ class CfgVehicles { }; class doctor { name = "Doctor (Only Advanced Medics)"; - value = 1; + value = 2; }; }; }; @@ -428,20 +444,23 @@ class CfgVehicles { class ACE_Actions { // Include actions in body parts for treatment while in the open #define EXCEPTIONS exceptions[] = {}; + #define ACTION_CONDITION condition = QUOTE(GVAR(menuTypeStyle) == 0); #include "ACE_Medical_Actions.hpp" // Create a consolidates medical menu for treatment while boarded class ACE_MainActions { class Medical { - displayName = "$STR_ACE_MEDICAL_ACTIONS_Medical"; + displayName = "$STR_ACE_Medical_Actions_Medical"; runOnHover = 1; exceptions[] = {"isNotInside"}; - condition = QUOTE(vehicle _target != _target); + condition = QUOTE((vehicle _target != _target && vehicle _target == vehicle _player) || GVAR(menuTypeStyle) == 1); statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); icon = PATHTOF(UI\icons\medical_cross.paa); #undef EXCEPTIONS + #undef ACTION_CONDITION #define EXCEPTIONS exceptions[] = {"isNotInside"}; + #define ACTION_CONDITION condition = "true"; #include "ACE_Medical_Actions.hpp" }; class GVAR(loadPatient) { @@ -462,7 +481,7 @@ class CfgVehicles { showDisabled = 0; priority = 2; icon = PATHTOF(UI\icons\medical_cross.paa); - exceptions[] = {"isNotDragging", "isNotCarrying"}; + exceptions[] = {"isNotDragging", "isNotCarrying", "isNotInside"}; }; }; }; @@ -638,14 +657,14 @@ class CfgVehicles { XEH_ENABLED; scope = 1; side = -1; - model = QUOTE(PATHTOF(data\bodybag.p3d)); + model = QUOTE(PATHTOEF(apl,bodybag.p3d)); icon = ""; - displayName = $STR_ACE_MEDICAL_BODYBAG_DISPLAY; + displayName = $STR_ACE_Medical_Bodybag_Display; EGVAR(dragging,canDrag) = 1; EGVAR(dragging,dragPosition[]) = {0,1.2,0}; EGVAR(dragging,dragDirection) = 0; class ACE_Actions { - class ACE_MainActions { + class ACE_MainActions { displayName = "$STR_ACE_Interaction_MainAction"; distance = 5; condition = QUOTE(true); @@ -693,13 +712,11 @@ class CfgVehicles { class ACE_fieldDressingItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_MEDICAL_BANDAGE_BASIC_DISPLAY; + displayName = $STR_ACE_Medical_Bandage_Basic_Display; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_fieldDressing - { + class TransportItems { + class ACE_fieldDressing { name = "ACE_fieldDressing"; count = 1; }; @@ -708,13 +725,11 @@ class CfgVehicles { class ACE_packingBandageItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_MEDICAL_PACKING_BANDAGE_DISPLAY; + displayName = $STR_ACE_Medical_Packing_Bandage_Display; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_packingBandage - { + class TransportItems { + class ACE_packingBandage { name = "ACE_packingBandage"; count = 1; }; @@ -723,13 +738,11 @@ class CfgVehicles { class ACE_elasticBandageItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DISPLAY; + displayName = $STR_ACE_Medical_Bandage_Elastic_Display; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_elasticBandage - { + class TransportItems { + class ACE_elasticBandage { name = "ACE_elasticBandage"; count = 1; }; @@ -738,13 +751,11 @@ class CfgVehicles { class ACE_tourniquetItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_MEDICAL_TOURNIQUET_DISPLAY; + displayName = $STR_ACE_Medical_Tourniquet_Display; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_tourniquet - { + class TransportItems { + class ACE_tourniquet { name = "ACE_tourniquet"; count = 1; }; @@ -753,13 +764,11 @@ class CfgVehicles { class ACE_morphineItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_MEDICAL_MORPHINE_DISPLAY; + displayName = $STR_ACE_Medical_Morphine_Display; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_morphine - { + class TransportItems { + class ACE_morphine { name = "ACE_morphine"; count = 1; }; @@ -768,13 +777,11 @@ class CfgVehicles { class ACE_atropineItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_MEDICAL_ATROPINE_DISPLAY; + displayName = $STR_ACE_Medical_Atropine_Display; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_atropine - { + class TransportItems { + class ACE_atropine { name = "ACE_atropine"; count = 1; }; @@ -783,13 +790,11 @@ class CfgVehicles { class ACE_epinephrineItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_MEDICAL_EPINEPHRINE_DISPLAY; + displayName = $STR_ACE_Medical_Epinephrine_Display; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_epinephrine - { + class TransportItems { + class ACE_epinephrine { name = "ACE_epinephrine"; count = 1; }; @@ -798,13 +803,11 @@ class CfgVehicles { class ACE_plasmaIVItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_MEDICAL_PLASMA_IV; + displayName = $STR_ACE_Medical_Plasma_IV; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_plasmaIV - { + class TransportItems { + class ACE_plasmaIV { name = "ACE_plasmaIV"; count = 1; }; @@ -814,13 +817,11 @@ class CfgVehicles { class ACE_bloodIVItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_MEDICAL_BLOOD_IV; + displayName = $STR_ACE_Medical_Blood_IV; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_bloodIV - { + class TransportItems { + class ACE_bloodIV { name = "ACE_bloodIV"; count = 1; }; @@ -829,13 +830,11 @@ class CfgVehicles { class ACE_salineIVItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_MEDICAL_SALINE_IV; + displayName = $STR_ACE_Medical_Saline_IV; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_salineIV - { + class TransportItems { + class ACE_salineIV { name = "ACE_salineIV"; count = 1; }; @@ -844,13 +843,11 @@ class CfgVehicles { class ACE_quikClotItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_MEDICAL_QUIKCLOT_DISPLAY; + displayName = $STR_ACE_Medical_QuikClot_Display; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_quikClot - { + class TransportItems { + class ACE_quikClot { name = "ACE_quikclot"; count = 1; }; @@ -859,13 +856,11 @@ class CfgVehicles { class ACE_personalAidKitItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_MEDICAL_AID_KIT_DISPLAY; + displayName = $STR_ACE_Medical_Aid_Kit_Display; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_personalAidKit - { + class TransportItems { + class ACE_personalAidKit { name = "ACE_personalAidKit"; count = 1; }; @@ -874,13 +869,11 @@ class CfgVehicles { class ACE_surgicalKitItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_MEDICAL_SURGICALKIT_DISPLAY; + displayName = $STR_ACE_Medical_SurgicalKit_Display; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_surgicalKit - { + class TransportItems { + class ACE_surgicalKit { name = "ACE_surgicalKit"; count = 1; }; @@ -889,13 +882,11 @@ class CfgVehicles { class ACE_bodyBagItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_MEDICAL_BODYBAG_DISPLAY; + displayName = $STR_ACE_Medical_Bodybag_Display; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_bodyBag - { + class TransportItems { + class ACE_bodyBag { name = "ACE_bodyBag"; count = 1; }; @@ -906,9 +897,42 @@ class CfgVehicles { class ACE_medicalSupplyCrate: NATO_Box_Base { scope = 2; accuracy = 1000; - displayName = "[ACE] Medical Supply Crate"; + displayName = "[ACE] Medical Supply Crate (Basic)"; model = PATHTOF(data\ace_medcrate.p3d); author = "$STR_ACE_Common_ACETeam"; + class TransportItems { + class ACE_fieldDressing { + name = "ACE_fieldDressing"; + count = 50; + }; + class ACE_morphine { + name = "ACE_morphine"; + count = 25; + }; + class ACE_epinephrine { + name = "ACE_epinephrine"; + count = 25; + }; + class ACE_bloodIV { + name = "ACE_bloodIV"; + count = 15; + }; + class ACE_bloodIV_500 { + name = "ACE_bloodIV_500"; + count = 15; + }; + class ACE_bloodIV_250 { + name = "ACE_bloodIV_250"; + count = 15; + }; + class ACE_bodyBag { + name = "ACE_bodyBag"; + count = 10; + }; + }; + }; + class ACE_medicalSupplyCrate_advanced: ACE_medicalSupplyCrate { + displayName = "[ACE] Medical Supply Crate (Advanced)"; class TransportItems { class ACE_fieldDressing { name = "ACE_fieldDressing"; diff --git a/addons/medical/CfgWeapons.hpp b/addons/medical/CfgWeapons.hpp index 51795d266c..d70b64a1d2 100644 --- a/addons/medical/CfgWeapons.hpp +++ b/addons/medical/CfgWeapons.hpp @@ -19,85 +19,69 @@ class CfgWeapons { }; }; - // @todo localize class ACE_ItemCore; class ACE_fieldDressing: ACE_ItemCore { scope = 2; model = QUOTE(PATHTOF(data\bandage.p3d)); picture = QUOTE(PATHTOF(ui\items\fieldDressing_x_ca.paa)); - displayName = $STR_ACE_MEDICAL_BANDAGE_BASIC_DISPLAY; - descriptionShort = $STR_ACE_MEDICAL_BANDAGE_BASIC_DESC_SHORT; - descriptionUse = $STR_ACE_MEDICAL_BANDAGE_BASIC_DESC_USE; + displayName = $STR_ACE_Medical_Bandage_Basic_Display; + descriptionShort = $STR_ACE_Medical_Bandage_Basic_Desc_Short; + descriptionUse = $STR_ACE_Medical_Bandage_Basic_Desc_Use; class ItemInfo: InventoryItem_Base_F { mass = 1; }; }; class ACE_packingBandage: ACE_ItemCore { scope = 2; - value = 1; - count = 1; - type = 16; - displayName = $STR_ACE_MEDICAL_PACKING_BANDAGE_DISPLAY; + displayName = $STR_ACE_Medical_Packing_Bandage_Display; picture = QUOTE(PATHTOF(ui\items\packingBandage_x_ca.paa)); model = QUOTE(PATHTOF(data\packingbandage.p3d)); - descriptionShort = $STR_ACE_MEDICAL_PACKING_BANDAGE_DESC_SHORT; - descriptionUse = $STR_ACE_MEDICAL_PACKING_BANDAGE_DESC_USE; + descriptionShort = $STR_ACE_Medical_Packing_Bandage_Desc_Short; + descriptionUse = $STR_ACE_Medical_Packing_Bandage_Desc_Use; class ItemInfo: InventoryItem_Base_F { mass = 1; }; }; class ACE_elasticBandage: ACE_ItemCore { scope = 2; - value = 1; - count = 1; - type = 16; - displayName = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DISPLAY; + displayName = $STR_ACE_Medical_Bandage_Elastic_Display; picture = QUOTE(PATHTOF(ui\items\elasticBandage_x_ca.paa)); model = "\A3\Structures_F_EPA\Items\Medical\Bandage_F.p3d"; - descriptionShort = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DESC_SHORT; - descriptionUse = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DESC_USE; + descriptionShort = $STR_ACE_Medical_Bandage_Elastic_Desc_Short; + descriptionUse = $STR_ACE_Medical_Bandage_Elastic_Desc_Use; class ItemInfo: InventoryItem_Base_F { mass = 1; }; }; class ACE_tourniquet: ACE_ItemCore { scope = 2; - value = 1; - count = 1; - type = 16; - displayName = $STR_ACE_MEDICAL_TOURNIQUET_DISPLAY; + displayName = $STR_ACE_Medical_Tourniquet_Display; picture = QUOTE(PATHTOF(ui\items\tourniquet_x_ca.paa)); model = QUOTE(PATHTOF(data\tourniquet.p3d)); - descriptionShort = $STR_ACE_MEDICAL_TOURNIQUET_DESC_SHORT; - descriptionUse = $STR_ACE_MEDICAL_TOURNIQUET_DESC_USE; + descriptionShort = $STR_ACE_Medical_Tourniquet_Desc_Short; + descriptionUse = $STR_ACE_Medical_Tourniquet_Desc_Use; class ItemInfo: InventoryItem_Base_F { mass = 1; }; }; class ACE_morphine: ACE_ItemCore { scope = 2; - value = 1; - count = 1; - type = 16; - displayName = $STR_ACE_MEDICAL_MORPHINE_DISPLAY; + displayName = $STR_ACE_Medical_Morphine_Display; picture = QUOTE(PATHTOF(ui\items\morphine_x_ca.paa)); model = QUOTE(PATHTOF(data\morphine.p3d)); - descriptionShort = $STR_ACE_MEDICAL_MORPHINE_DESC_SHORT; - descriptionUse = $STR_ACE_MEDICAL_MORPHINE_DESC_USE; + descriptionShort = $STR_ACE_Medical_Morphine_Desc_Short; + descriptionUse = $STR_ACE_Medical_Morphine_Desc_Use; class ItemInfo: InventoryItem_Base_F { mass = 1; }; }; class ACE_atropine: ACE_ItemCore { scope = 2; - value = 1; - count = 1; - type = 16; - displayName = $STR_ACE_MEDICAL_ATROPINE_DISPLAY; + displayName = $STR_ACE_Medical_Atropine_Display; picture = QUOTE(PATHTOF(ui\items\atropine_x_ca.paa)); model = QUOTE(PATHTOF(data\atropine.p3d)); - descriptionShort = $STR_ACE_MEDICAL_ATROPINE_DESC_SHORT; - descriptionUse = $STR_ACE_MEDICAL_ATROPINE_DESC_USE; + descriptionShort = $STR_ACE_Medical_Atropine_Desc_Short; + descriptionUse = $STR_ACE_Medical_Atropine_Desc_Use; class ItemInfo: InventoryItem_Base_F { mass = 1; @@ -105,135 +89,120 @@ class CfgWeapons { }; class ACE_epinephrine: ACE_ItemCore { scope = 2; - value = 1; - count = 1; - type = 16; - displayName = $STR_ACE_MEDICAL_EPINEPHRINE_DISPLAY; + displayName = $STR_ACE_Medical_Epinephrine_Display; picture = QUOTE(PATHTOF(ui\items\epinephrine_x_ca.paa)); model = QUOTE(PATHTOF(data\epinephrine.p3d)); - descriptionShort = $STR_ACE_MEDICAL_EPINEPHRINE_DESC_SHORT; - descriptionUse = $STR_ACE_MEDICAL_EPINEPHRINE_DESC_USE; + descriptionShort = $STR_ACE_Medical_Epinephrine_Desc_Short; + descriptionUse = $STR_ACE_Medical_Epinephrine_Desc_Use; class ItemInfo: InventoryItem_Base_F { mass = 1; }; }; class ACE_plasmaIV: ACE_ItemCore { scope = 2; - value = 1; - count = 1; - displayName = $STR_ACE_MEDICAL_PLASMA_IV; + displayName = $STR_ACE_Medical_Plasma_IV; picture = QUOTE(PATHTOF(ui\items\plasmaIV_x_ca.paa)); - descriptionShort = $STR_ACE_MEDICAL_PLASMA_IV_DESC_SHORT; - descriptionUse = $STR_ACE_MEDICAL_PLASMA_IV_DESC_USE; + descriptionShort = $STR_ACE_Medical_Plasma_IV_Desc_Short; + descriptionUse = $STR_ACE_Medical_Plasma_IV_Desc_Use; class ItemInfo: InventoryItem_Base_F { mass = 10; }; }; class ACE_plasmaIV_500: ACE_plasmaIV { - displayName = $STR_ACE_MEDICAL_PLASMA_IV_500; + displayName = $STR_ACE_Medical_Plasma_IV_500; class ItemInfo: InventoryItem_Base_F { mass = 5; }; }; class ACE_plasmaIV_250: ACE_plasmaIV { - displayName = $STR_ACE_MEDICAL_PLASMA_IV_250; + displayName = $STR_ACE_Medical_Plasma_IV_250; class ItemInfo: InventoryItem_Base_F { mass = 2.5; }; }; class ACE_bloodIV: ACE_ItemCore { scope = 2; - value = 1; - count = 1; model = "\A3\Structures_F_EPA\Items\Medical\BloodBag_F.p3d"; - displayName = $STR_ACE_MEDICAL_BLOOD_IV; + displayName = $STR_ACE_Medical_Blood_IV; picture = QUOTE(PATHTOF(ui\items\bloodIV_x_ca.paa)); - descriptionShort = $STR_ACE_MEDICAL_BLOOD_IV_DESC_SHORT; - descriptionUse = $STR_ACE_MEDICAL_BLOOD_IV_DESC_USE; + descriptionShort = $STR_ACE_Medical_Blood_IV_Desc_Short; + descriptionUse = $STR_ACE_Medical_Blood_IV_Desc_Use; class ItemInfo: InventoryItem_Base_F { mass = 10; }; }; class ACE_bloodIV_500: ACE_bloodIV { - displayName = $STR_ACE_MEDICAL_BLOOD_IV_500; + displayName = $STR_ACE_Medical_Blood_IV_500; class ItemInfo: InventoryItem_Base_F { mass = 5; }; }; class ACE_bloodIV_250: ACE_bloodIV { - displayName = $STR_ACE_MEDICAL_BLOOD_IV_250; + displayName = $STR_ACE_Medical_Blood_IV_250; class ItemInfo: InventoryItem_Base_F { mass = 2.5; }; }; class ACE_salineIV: ACE_ItemCore { scope = 2; - value = 1; - count = 1; - displayName = $STR_ACE_MEDICAL_SALINE_IV; + displayName = $STR_ACE_Medical_Saline_IV; picture = QUOTE(PATHTOF(ui\items\salineIV_x_ca.paa)); - descriptionShort = $STR_ACE_MEDICAL_SALINE_IV_DESC_SHORT; - descriptionUse = $STR_ACE_MEDICAL_SALINE_IV_DESC_USE; + descriptionShort = $STR_ACE_Medical_Saline_IV_Desc_Short; + descriptionUse = $STR_ACE_Medical_Saline_IV_Desc_Use; class ItemInfo: InventoryItem_Base_F { mass = 10; }; }; class ACE_salineIV_500: ACE_salineIV { - displayName = $STR_ACE_MEDICAL_SALINE_IV_500; + displayName = $STR_ACE_Medical_Saline_IV_500; class ItemInfo: InventoryItem_Base_F { mass = 2.5; }; }; class ACE_salineIV_250: ACE_salineIV { - displayName = $STR_ACE_MEDICAL_SALINE_IV_250; + displayName = $STR_ACE_Medical_Saline_IV_250; class ItemInfo: InventoryItem_Base_F { mass = 2.5; }; }; class ACE_quikclot: ACE_ItemCore { scope = 2; - value = 1; - count = 1; - type = 16; - displayName = $STR_ACE_MEDICAL_QUIKCLOT_DISPLAY; + displayName = $STR_ACE_Medical_QuikClot_Display; picture = QUOTE(PATHTOF(ui\items\quickclot_x_ca.paa)); - descriptionShort = $STR_ACE_MEDICAL_QUIKCLOT_DESC_SHORT; - descriptionUse = $STR_ACE_MEDICAL_QUIKCLOT_DESC_USE; + descriptionShort = $STR_ACE_Medical_QuikClot_Desc_Short; + descriptionUse = $STR_ACE_Medical_QuikClot_Desc_Use; class ItemInfo: InventoryItem_Base_F { mass = 1; }; }; class ACE_personalAidKit: ACE_ItemCore { scope = 2; - value = 1; - count = 1; - type = 16; - displayName = $STR_ACE_MEDICAL_AID_KIT_DISPLAY; + displayName = $STR_ACE_Medical_Aid_Kit_Display; picture = QUOTE(PATHTOF(ui\items\personal_aid_kit_x_ca.paa)); - descriptionShort = $STR_ACE_MEDICAL_AID_KIT_DESC_SHORT; - descriptionUse = $STR_ACE_MEDICAL_AID_KIT_DESC_USE; + descriptionShort = $STR_ACE_Medical_Aid_Kit_Desc_Short; + descriptionUse = $STR_ACE_Medical_Aid_Kit_Desc_Use; class ItemInfo: InventoryItem_Base_F { mass = 2; }; }; class ACE_surgicalKit: ACE_ItemCore { scope=2; - displayName= $STR_ACE_MEDICAL_SURGICALKIT_DISPLAY; + displayName= $STR_ACE_Medical_SurgicalKit_Display; model = QUOTE(PATHTOF(data\surgical_kit.p3d)); picture = QUOTE(PATHTOF(ui\items\surgicalKit_x_ca.paa)); - descriptionShort = $STR_ACE_MEDICAL_SURGICALKIT_DESC_SHORT; - descriptionUse = $STR_ACE_MEDICAL_SURGICALKIT_DESC_USE; + descriptionShort = $STR_ACE_Medical_SurgicalKit_Desc_Short; + descriptionUse = $STR_ACE_Medical_SurgicalKit_Desc_Use; class ItemInfo: InventoryItem_Base_F { mass = 5; }; }; class ACE_bodyBag: ACE_ItemCore { scope=2; - displayName= $STR_ACE_MEDICAL_BODYBAG_DISPLAY; + displayName= $STR_ACE_Medical_Bodybag_Display; model = QUOTE(PATHTOF(data\bodybagItem.p3d)); picture = QUOTE(PATHTOF(ui\items\bodybag_x_ca.paa)); - descriptionShort = $STR_ACE_MEDICAL_BODYBAG_DESC_SHORT; - descriptionUse = $STR_ACE_MEDICAL_BODYBAG_DESC_USE; + descriptionShort = $STR_ACE_Medical_Bodybag_Desc_Short; + descriptionUse = $STR_ACE_Medical_Bodybag_Desc_Use; class ItemInfo: InventoryItem_Base_F { mass = 15; }; diff --git a/addons/medical/XEH_init.sqf b/addons/medical/XEH_init.sqf index 2f840fe950..0ded7d471f 100644 --- a/addons/medical/XEH_init.sqf +++ b/addons/medical/XEH_init.sqf @@ -6,5 +6,5 @@ _unit = _this select 0; _unit addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}]; if (local _unit) then { - [_unit] call FUNC(init); + [_unit] call FUNC(init); }; diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 1b0a38f1af..1bb0e744bc 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -14,6 +14,7 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"]; ["medical_onUnconscious", { if (local (_this select 0)) then { + private ["_unit"]; _unit = _this select 0; if (_this select 1) then { _unit setVariable ["tf_globalVolume", 0.4]; @@ -21,14 +22,14 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"]; _unit setVariable ["tf_unable_to_use_radio", true, true]; _unit setVariable ["acre_sys_core_isDisabled", true, true]; - _unit setVariable ["acre_sys_core_globalVolume", 0.4]; + if (!isNil "acre_api_fnc_setGlobalVolume") then { [0.4^0.33] call acre_api_fnc_setGlobalVolume; }; } else { _unit setVariable ["tf_globalVolume", 1]; _unit setVariable ["tf_voiceVolume", 1, true]; _unit setVariable ["tf_unable_to_use_radio", false, true]; _unit setVariable ["acre_sys_core_isDisabled", false, true]; - _unit setVariable ["acre_sys_core_globalVolume", 1]; + if (!isNil "acre_api_fnc_setGlobalVolume") then { [1] call acre_api_fnc_setGlobalVolume; }; }; }; }] call ace_common_fnc_addEventHandler; @@ -36,7 +37,7 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"]; // Initialize all effects _fnc_createEffect = { - private ["_type", "_layer", "_default"]; + private ["_type", "_layer", "_default", "_effect"]; _type = _this select 0; _layer = _this select 1; _default = _this select 2; @@ -91,6 +92,7 @@ GVAR(effectTimeBlood) = time; // MAIN EFFECTS LOOP [{ + private["_bleeding", "_blood"]; // Zeus interface is open or player is dead; disable everything if (!(isNull (findDisplay 312)) or !(alive ACE_player)) exitWith { GVAR(effectUnconsciousCC) ppEffectEnable false; @@ -131,7 +133,7 @@ GVAR(effectTimeBlood) = time; }; }; - _bleeding = ACE_player call FUNC(getBloodLoss); + _bleeding = [ACE_player] call FUNC(getBloodLoss); // Bleeding Indicator if (_bleeding > 0 and GVAR(effectTimeBlood) + 3.5 < time) then { GVAR(effectTimeBlood) = time; @@ -153,13 +155,9 @@ GVAR(effectTimeBlood) = time; GVAR(lastHeartBeat) = time; GVAR(lastHeartBeatSound) = time; -// @todo, remove once parameters are set up -if (isNil QGVAR(level)) then { - GVAR(level) = 0; -}; - // HEARTRATE BASED EFFECTS [{ + private["_heartRate", "_interval", "_minTime", "_sound", "_strength"]; _heartRate = ACE_player getVariable [QGVAR(heartRate), 70]; if (GVAR(level) == 1) then { _heartRate = 60 + 40 * (ACE_player getVariable [QGVAR(pain), 0]); @@ -171,9 +169,8 @@ if (isNil QGVAR(level)) then { // Pain effect _strength = ACE_player getVariable [QGVAR(pain), 0]; - // _strength = _strength * (ACE_player getVariable [QGVAR(coefPain), GVAR(coefPain)]); @todo - GVAR(alternativePainEffect) = false; // @todo - if (GVAR(alternativePainEffect)) then { + _strength = _strength * (ACE_player getVariable [QGVAR(painCoefficient), GVAR(painCoefficient)]); + if (GVAR(painEffectType) == 1) then { GVAR(effectPainCC) ppEffectEnable false; if ((ACE_player getVariable [QGVAR(pain), 0]) > 0 && {alive ACE_player}) then { _strength = _strength * 0.15; @@ -198,7 +195,7 @@ if (isNil QGVAR(level)) then { } else { GVAR(effectPainCA) ppEffectEnable false; if ((ACE_player getVariable [QGVAR(pain), 0]) > 0 && {alive ACE_player}) then { - _strength = _strength * 0.6; + _strength = _strength * 0.9; GVAR(effectPainCC) ppEffectEnable true; GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - _strength,1 - _strength,0,0,0,0.2,2]]; GVAR(effectPainCC) ppEffectCommit 0.01; @@ -247,16 +244,16 @@ if (USE_WOUND_EVENT_SYNC) then { // We are only pulling the wounds for the units in the player group. Anything else will come when the unit interacts with them. { [_x, _newPlayer] call FUNC(requestWoundSync); - }foreach units group player; + }foreach units group _newPlayer; }; }] call EFUNC(common,addEventhandler); }; }; [ - {(((_this select 0) getvariable [QGVAR(bloodVolume), 0]) < 65)}, + {(((_this select 0) getvariable [QGVAR(bloodVolume), 100]) < 65)}, {(((_this select 0) getvariable [QGVAR(pain), 0]) > 0.9)}, - {(((_this select 0) call FUNC(getBloodLoss)) > 0.25)}, + {(([_this select 0] call FUNC(getBloodLoss)) > 0.25)}, {((_this select 0) getvariable [QGVAR(inReviveState), false])}, {((_this select 0) getvariable [QGVAR(inCardiacArrest), false])}, {((_this select 0) getvariable ["ACE_isDead", false])}, @@ -266,3 +263,18 @@ if (USE_WOUND_EVENT_SYNC) then { // Prevent all types of interaction while unconscious // @todo: probably remove this when CBA keybind hold key works properly ["isNotUnconscious", {!((_this select 0) getVariable ["ACE_isUnconscious", false])}] call EFUNC(common,addCanInteractWithCondition); + +// Item Event Handler +["playerInventoryChanged", { + [ACE_player] call FUNC(itemCheck); +}] call EFUNC(common,addEventHandler); + +// Networked litter +[QGVAR(createLitter), FUNC(handleCreateLitter), GVAR(litterCleanUpDelay)] call EFUNC(common,addSyncedEventHandler); + +if (hasInterface) then { + ["PlayerJip", { + diag_log format["[ACE] JIP Medical init for player"]; + [player] call FUNC(init); + }] call FUNC(addEventHandler); +}; diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index 8e1fd5856f..4f4ff5bc30 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -7,6 +7,7 @@ PREP(actionCheckBloodPressureLocal); PREP(actionCheckPulse); PREP(actionCheckPulseLocal); PREP(actionCheckResponse); +PREP(actionDiagnose); PREP(actionPlaceInBodyBag); PREP(actionRemoveTourniquet); PREP(actionLoadUnit); @@ -17,10 +18,10 @@ PREP(addToLog); PREP(addToTriageCard); PREP(addUnconsciousCondition); PREP(addUnloadPatientActions); +PREP(adjustPainLevel); PREP(canAccessMedicalEquipment); PREP(canTreat); PREP(canTreatCached); -PREP(createLitter); PREP(determineIfFatal); PREP(getBloodLoss); PREP(getBloodPressure); @@ -55,6 +56,7 @@ PREP(isInMedicalVehicle); PREP(isMedic); PREP(isMedicalVehicle); PREP(itemCheck); +PREP(modifyMedicalAction); PREP(onMedicationUsage); PREP(onWoundUpdateRequest); PREP(onPropagateWound); @@ -78,8 +80,10 @@ PREP(treatmentAdvanced_medication); PREP(treatmentAdvanced_medicationLocal); PREP(treatmentBasic_bandage); PREP(treatmentBasic_bloodbag); +PREP(treatmentBasic_bloodbagLocal); PREP(treatmentBasic_epipen); PREP(treatmentBasic_morphine); +PREP(treatmentBasic_morphineLocal); PREP(treatmentIV); PREP(treatmentIVLocal); PREP(treatmentTourniquet); @@ -90,12 +94,18 @@ PREP(displayPatientInformation); PREP(displayTriageCard); PREP(dropDownTriageCard); PREP(moduleMedicalSettings); +PREP(moduleAdvancedMedicalSettings); +PREP(moduleReviveSettings); PREP(moduleAssignMedicRoles); PREP(moduleAssignMedicalVehicle); PREP(moduleAssignMedicalFacility); -PREP(moduleTreatmentConfiguration); PREP(copyDeadBody); PREP(requestWoundSync); +PREP(unconsciousPFH); + +// Networked litter +PREP(createLitter); +PREP(handleCreateLitter); GVAR(injuredUnitCollection) = []; GVAR(IVBags) = []; diff --git a/addons/medical/XEH_respawn.sqf b/addons/medical/XEH_respawn.sqf index b2101b1d4e..0a95e064fd 100644 --- a/addons/medical/XEH_respawn.sqf +++ b/addons/medical/XEH_respawn.sqf @@ -6,10 +6,15 @@ _unit = _this select 0; if !(local _unit) exitWith {}; -diag_log "running respawn"; [_unit] call FUNC(init); -//Reset captive status for respawning unit +// Reset captive status for respawning unit if (!(_unit getVariable ["ACE_isUnconscious", false])) then { [_unit, QGVAR(unconscious), false] call EFUNC(common,setCaptivityStatus); }; + +// Remove maximum unconsciousness time handler +_maxUnconHandle = _unit getVariable [QGVAR(maxUnconTimeHandle), -1]; +if (_maxUnconHandle > 0) then { + [_maxUnconHandle] call CBA_fnc_removePerFrameHandler; +}; diff --git a/addons/medical/config.cpp b/addons/medical/config.cpp index 4dca8bdeca..566de29f91 100644 --- a/addons/medical/config.cpp +++ b/addons/medical/config.cpp @@ -2,10 +2,10 @@ class CfgPatches { class ADDON { - units[] = {"ACE_medicalSupplyCrate", "ACE_fieldDressingItem", "ACE_packingBandageItem", "ACE_elasticBandageItem", "ACE_tourniquetItem", "ACE_morphineItem", "ACE_atropineItem", "ACE_epinephrineItem", "ACE_plasmaIVItem", "ACE_bloodIVItem", "ACE_salineIVItem", "ACE_quikclotItem", "ACE_personalAidKitItem", "ACE_surgicalKitItem", "ACE_bodyBagItem", "ACE_bodyBagObject"}; + units[] = {"ACE_medicalSupplyCrate", "ACE_medicalSupplyCrate_advanced", "ACE_fieldDressingItem", "ACE_packingBandageItem", "ACE_elasticBandageItem", "ACE_tourniquetItem", "ACE_morphineItem", "ACE_atropineItem", "ACE_epinephrineItem", "ACE_plasmaIVItem", "ACE_bloodIVItem", "ACE_salineIVItem", "ACE_quikclotItem", "ACE_personalAidKitItem", "ACE_surgicalKitItem", "ACE_bodyBagItem", "ACE_bodyBagObject"}; weapons[] = {"ACE_fieldDressing", "ACE_packingBandage", "ACE_elasticBandage", "ACE_tourniquet", "ACE_morphine", "ACE_atropine", "ACE_epinephrine", "ACE_plasmaIV", "ACE_plasmaIV_500", "ACE_plasmaIV_250", "ACE_bloodIV", "ACE_bloodIV_500", "ACE_bloodIV_250", "ACE_salineIV", "ACE_salineIV_500", "ACE_salineIV_250", "ACE_quikclot", "ACE_personalAidKit", "ACE_surgicalKit", "ACE_bodyBag"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_interaction","ace_modules"}; + requiredAddons[] = {"ace_interaction","ace_modules", "ace_apl"}; author[] = {"Glowbal", "KoffienFlummi"}; authorUrl = ""; VERSION_CONFIG; diff --git a/addons/medical/data/bodybag.p3d b/addons/medical/data/bodybag.p3d deleted file mode 100644 index 1fec3a05f0..0000000000 Binary files a/addons/medical/data/bodybag.p3d and /dev/null differ diff --git a/addons/medical/data/surgical_kit.rvmat b/addons/medical/data/surgical_kit.rvmat index e7db14f08b..71d266f668 100644 --- a/addons/medical/data/surgical_kit.rvmat +++ b/addons/medical/data/surgical_kit.rvmat @@ -80,7 +80,7 @@ class Stage6 }; class Stage7 { - texture="z\ace\addons\medical\data\env_co.tga"; + texture="z\ace\addons\apl\data\env_co.tga"; uvSource="tex"; class uvTransform { diff --git a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf index 28ed10c83c..560b171400 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf @@ -14,7 +14,7 @@ #include "script_component.hpp" -private ["_caller","_target","_bloodPressure","_bloodPressureHigh","_bloodPressureLow","_title","_content"]; +private ["_caller","_target","_bloodPressure","_bloodPressureHigh","_bloodPressureLow", "_logOutPut", "_output"]; _caller = _this select 0; _target = _this select 1; @@ -28,27 +28,27 @@ _bloodPressureLow = _bloodPressure select 0; _output = ""; _logOutPut = ""; if ([_caller] call FUNC(isMedic)) then { - _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_1"; + _output = "STR_ACE_Medical_Check_Bloodpressure_Output_1"; _logOutPut = format["%1/%2",round(_bloodPressureHigh),round(_bloodPressureLow)]; } else { if (_bloodPressureHigh > 20) then { - _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_2"; - _logOutPut = "Low"; + _output = "STR_ACE_Medical_Check_Bloodpressure_Output_2"; + _logOutPut = localize "STR_ACE_Medical_Check_Bloodpressure_Low"; if (_bloodPressureHigh > 100) then { - _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_3"; - _logOutPut = "Normal"; + _output = "STR_ACE_Medical_Check_Bloodpressure_Output_3"; + _logOutPut = localize "STR_ACE_Medical_Check_Bloodpressure_Normal"; if (_bloodPressureHigh > 160) then { - _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_4"; - _logOutPut = "High"; + _output = "STR_ACE_Medical_Check_Bloodpressure_Output_4"; + _logOutPut = localize "STR_ACE_Medical_Check_Bloodpressure_High"; }; }; } else { if (random(10) > 3) then { - _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_5"; - _logOutPut = "No Blood Pressure"; + _output = "STR_ACE_Medical_Check_Bloodpressure_Output_5"; + _logOutPut = localize "STR_ACE_Medical_Check_Bloodpressure_NoBloodpressure"; } else { - _output = "STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_OUTPUT_6"; + _output = "STR_ACE_Medical_Check_Bloodpressure_Output_6"; }; }; }; @@ -56,5 +56,5 @@ if ([_caller] call FUNC(isMedic)) then { ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.75, _caller]] call EFUNC(common,targetEvent); if (_logOutPut != "") then { - [_target,"activity", "%1 checked Blood Pressure: %2", [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); + [_target,"activity", localize "STR_ACE_Medical_Check_Bloodpressure_Log", [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); }; diff --git a/addons/medical/functions/fnc_actionCheckPulse.sqf b/addons/medical/functions/fnc_actionCheckPulse.sqf index f545c11144..fd96321e8f 100644 --- a/addons/medical/functions/fnc_actionCheckPulse.sqf +++ b/addons/medical/functions/fnc_actionCheckPulse.sqf @@ -14,7 +14,7 @@ #include "script_component.hpp" -private ["_caller","_target","_title","_content"]; +private ["_caller","_target"]; _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/medical/functions/fnc_actionCheckPulseLocal.sqf b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf index 73d1d07190..85e9bee828 100644 --- a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf @@ -14,7 +14,7 @@ #include "script_component.hpp" -private ["_caller","_unit", "_heartRateOutput", "_heartRate","_logOutPut","_content"]; +private ["_caller", "_unit", "_heartRateOutput", "_heartRate", "_logOutPut"]; _caller = _this select 0; _unit = _this select 1; @@ -23,24 +23,24 @@ _heartRate = _unit getvariable [QGVAR(heartRate), 80]; if (!alive _unit) then { _heartRate = 0; }; -_heartRateOutput = "STR_ACE_MEDICAL_CHECK_PULSE_OUTPUT_5"; +_heartRateOutput = "STR_ACE_Medical_Check_Pulse_Output_5"; _logOutPut = "No heart rate"; if (_heartRate > 1.0) then { if ([_caller] call FUNC(isMedic)) then { - _heartRateOutput = "STR_ACE_MEDICAL_CHECK_PULSE_OUTPUT_1"; + _heartRateOutput = "STR_ACE_Medical_Check_Pulse_Output_1"; _logOutPut = format["%1",round(_heartRate)]; } else { // non medical personel will only find a pulse/HR - _heartRateOutput = "STR_ACE_MEDICAL_CHECK_PULSE_OUTPUT_2"; - _logOutPut = "Weak"; + _heartRateOutput = "STR_ACE_Medical_Check_Pulse_Output_2"; + _logOutPut = localize "STR_ACE_Medical_Check_Pulse_Weak"; if (_heartRate > 60) then { if (_heartRate > 100) then { - _heartRateOutput = "STR_ACE_MEDICAL_CHECK_PULSE_OUTPUT_3"; - _logOutPut = "Strong"; + _heartRateOutput = "STR_ACE_Medical_Check_Pulse_Output_3"; + _logOutPut = localize "STR_ACE_Medical_Check_Pulse_Strong"; } else { - _heartRateOutput = "STR_ACE_MEDICAL_CHECK_PULSE_OUTPUT_4"; - _logOutPut = "Normal"; + _heartRateOutput = "STR_ACE_Medical_Check_Pulse_Output_4"; + _logOutPut = localize "STR_ACE_Medical_Check_Pulse_Normal"; }; }; }; @@ -49,5 +49,5 @@ if (_heartRate > 1.0) then { ["displayTextStructured", [_caller], [[_heartRateOutput, [_unit] call EFUNC(common,getName), round(_heartRate)], 1.5, _caller]] call EFUNC(common,targetEvent); if (_logOutPut != "") then { - [_unit,"activity","%1 checked Heart Rate: %2",[[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog); + [_unit,"activity", localize "STR_ACE_Medical_Check_Pulse_Log",[[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog); }; diff --git a/addons/medical/functions/fnc_actionCheckResponse.sqf b/addons/medical/functions/fnc_actionCheckResponse.sqf index c483706274..92e724a3e0 100644 --- a/addons/medical/functions/fnc_actionCheckResponse.sqf +++ b/addons/medical/functions/fnc_actionCheckResponse.sqf @@ -14,15 +14,15 @@ #include "script_component.hpp" -private ["_caller","_target"]; +private ["_caller","_target", "_output"]; _caller = _this select 0; _target = _this select 1; _output = ""; if ([_target] call EFUNC(common,isAwake)) then { - _output = "STR_ACE_MEDICAL_CHECK_REPONSE_RESPONSIVE"; + _output = "STR_ACE_Medical_Check_Response_Responsive"; } else { - _output = "STR_ACE_MEDICAL_CHECK_REPONSE_UNRESPONSIVE"; + _output = "STR_ACE_Medical_Check_Response_Unresponsive"; }; ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName)], 2, _caller]] call EFUNC(common,targetEvent); diff --git a/addons/medical/functions/fnc_actionDiagnose.sqf b/addons/medical/functions/fnc_actionDiagnose.sqf new file mode 100644 index 0000000000..d0a5aebc9f --- /dev/null +++ b/addons/medical/functions/fnc_actionDiagnose.sqf @@ -0,0 +1,45 @@ +/* +* Author: Glowbal +* Action for diagnosing in basic medical +* +* Arguments: +* 0: The medic +* 1: The patient +* +* Return Value: +* NONE +* +* Public: No +*/ + +#include "script_component.hpp" + +private ["_caller", "_target", "_genericMessages"]; +_caller = _this select 0; +_target = _this select 1; + +_genericMessages = ["STR_ACE_Medical_diagnoseMessage"]; + +_genericMessages pushBack ([_target] call EFUNC(common,getName)); +if (alive _target) then { + _genericMessages pushback "STR_ACE_Medical_diagnoseAlive"; +} else { + _genericMessages pushback "STR_ACE_Medical_diagnoseDead"; +}; +if (_target getvariable[QGVAR(hasLostBlood), 0] > 0) then { + if (_target getvariable[QGVAR(hasLostBlood), 0] > 1) then { + _genericMessages pushback "STR_ACE_Medical_lostBloodALot"; + } else { + _genericMessages pushback "STR_ACE_Medical_lostBlood"; + }; +} else { + _genericMessages pushback "STR_ACE_Medical_noBloodloss"; +}; + +if (_target getvariable[QGVAR(hasPain), false]) then { + _genericMessages pushback "STR_ACE_Medical_inPain"; +} else { + _genericMessages pushback "STR_ACE_Medical_noPain"; +}; + +["displayTextStructured", [_caller], [_genericMessages, 3.0, _caller]] call EFUNC(common,targetEvent); diff --git a/addons/medical/functions/fnc_actionLoadUnit.sqf b/addons/medical/functions/fnc_actionLoadUnit.sqf index 5606f15d19..03d9a3ef54 100644 --- a/addons/medical/functions/fnc_actionLoadUnit.sqf +++ b/addons/medical/functions/fnc_actionLoadUnit.sqf @@ -14,7 +14,7 @@ #include "script_component.hpp" -private ["_caller", "_target","_vehicle", "_loaded"]; +private ["_caller", "_target","_vehicle"]; _caller = _this select 0; _target = _this select 1; @@ -23,16 +23,10 @@ if ([_target] call EFUNC(common,isAwake)) exitwith { ["displayTextStructured", [_caller], [["This person (%1) is awake and cannot be loaded", [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent); }; if ([_target] call FUNC(isBeingCarried)) then { - [_caller, _target] call FUNC(dropObject_carry); + [_caller, _target] call EFUNC(dragging,dropObject_carry); }; if ([_target] call FUNC(isBeingDragged)) then { - [_caller, _target] call FUNC(dropObject); + [_caller, _target] call EFUNC(dragging,dropObject); }; _vehicle = [_caller, _target] call EFUNC(common,loadPerson); -if (!isNull _vehicle) then { - if (!isnil QGVAR(DROP_ADDACTION)) then { - _caller removeAction GVAR(DROP_ADDACTION); - GVAR(DROP_ADDACTION) = nil; - }; -}; diff --git a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf index 2eafe36732..a14dbc3bcd 100644 --- a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf +++ b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf @@ -15,7 +15,7 @@ #include "script_component.hpp" -private ["_caller","_target","_part","_selectionName","_removeItem","_tourniquets", "_output"]; +private ["_caller", "_target", "_part", "_selectionName", "_tourniquets", "_output"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; diff --git a/addons/medical/functions/fnc_actionUnloadUnit.sqf b/addons/medical/functions/fnc_actionUnloadUnit.sqf index 8c05a43fc9..bb66147f2a 100644 --- a/addons/medical/functions/fnc_actionUnloadUnit.sqf +++ b/addons/medical/functions/fnc_actionUnloadUnit.sqf @@ -15,7 +15,7 @@ #include "script_component.hpp" -private ["_caller", "_target","_vehicle", "_drag", "_handle"]; +private ["_caller", "_target", "_drag"]; _caller = _this select 0; _target = _this select 1; _drag = if (count _this > 2) then {_this select 2} else {false}; @@ -24,7 +24,7 @@ _drag = if (count _this > 2) then {_this select 2} else {false}; if (vehicle _target == _target) exitwith {}; if (([_target] call cse_fnc_isAwake)) exitwith {}; -if ([_caller, _target] call EFUNC(common,unloadPerson)) then { +if ([_target] call EFUNC(common,unloadPerson)) then { if (_drag) then { if ((vehicle _caller) == _caller) then { [[_caller, _target, true], QUOTE(DFUNC(actionDragUnit)), _caller, false] call EFUNC(common,execRemoteFnc); // TODO replace by event diff --git a/addons/medical/functions/fnc_addToInjuredCollection.sqf b/addons/medical/functions/fnc_addToInjuredCollection.sqf index 82c385f0e1..c95db059df 100644 --- a/addons/medical/functions/fnc_addToInjuredCollection.sqf +++ b/addons/medical/functions/fnc_addToInjuredCollection.sqf @@ -13,7 +13,7 @@ #include "script_component.hpp" -private "_unit"; +private ["_unit", "_force"]; _unit = _this select 0; _force = if (count _this > 1) then {_this select 1} else {false}; @@ -33,10 +33,10 @@ if ([_unit] call FUNC(hasMedicalEnabled) || _force) then { [_this select 1] call CBA_fnc_removePerFrameHandler; if (!local _unit) then { if (GVAR(level) >= 2) then { - _unit setvariable [QGVAR(heartRate), _unit getvariable [QGVAR(heartRate), 0], true]; - _unit setvariable [QGVAR(bloodPressure), _unit getvariable [QGVAR(bloodPressure), [0, 0]], true]; + _unit setvariable [QGVAR(heartRate), _unit getvariable [QGVAR(heartRate), 80], true]; + _unit setvariable [QGVAR(bloodPressure), _unit getvariable [QGVAR(bloodPressure), [80, 120]], true]; }; - _unit setvariable [QGVAR(bloodVolume), _unit getvariable [QGVAR(bloodVolume), 0], true]; + _unit setvariable [QGVAR(bloodVolume), _unit getvariable [QGVAR(bloodVolume), 100], true]; }; } else { [_unit] call FUNC(handleUnitVitals); diff --git a/addons/medical/functions/fnc_addToLog.sqf b/addons/medical/functions/fnc_addToLog.sqf index c36d57b482..46bacf2349 100644 --- a/addons/medical/functions/fnc_addToLog.sqf +++ b/addons/medical/functions/fnc_addToLog.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_unit", "_type", "_message", "_arguments", "_lastNumber", "_moment", "_logVarName", "_log","_newLog"]; +private ["_unit", "_type", "_message", "_arguments", "_lastNumber", "_moment", "_logVarName", "_log","_newLog", "_logs"]; _unit = _this select 0; _type = _this select 1; _message = _this select 2; diff --git a/addons/medical/functions/fnc_addToTriageCard.sqf b/addons/medical/functions/fnc_addToTriageCard.sqf index 49e642cfc4..61add24cfc 100644 --- a/addons/medical/functions/fnc_addToTriageCard.sqf +++ b/addons/medical/functions/fnc_addToTriageCard.sqf @@ -14,7 +14,7 @@ #include "script_component.hpp" -private ["_unit","_caller","_newItem","_log", "_inList","_amount"]; +private ["_unit", "_newItem", "_log", "_inList", "_amount"]; _unit = _this select 0; _newItem = _this select 1; diff --git a/addons/medical/functions/fnc_addUnloadPatientActions.sqf b/addons/medical/functions/fnc_addUnloadPatientActions.sqf index c792746d47..13a4177859 100644 --- a/addons/medical/functions/fnc_addUnloadPatientActions.sqf +++ b/addons/medical/functions/fnc_addUnloadPatientActions.sqf @@ -16,7 +16,7 @@ EXPLODE_3_PVT(_this,_vehicle,_player,_parameters); -private ["_actions"]; +private ["_actions", "_unit"]; _actions = []; { diff --git a/addons/medical/functions/fnc_adjustPainLevel.sqf b/addons/medical/functions/fnc_adjustPainLevel.sqf new file mode 100644 index 0000000000..7e6ce2d5f1 --- /dev/null +++ b/addons/medical/functions/fnc_adjustPainLevel.sqf @@ -0,0 +1,40 @@ +/* + * Author: PabstMirror + * Interface to allow external modules to safely adjust pain levels. + * + * Arguments: + * 0: The patient + * 1: Added ammount of pain (can be negative) + * + * Return Value: + * The new pain level + * + * Example: + * [guy, 0.5] call ace_medical_fnc_adjustPainLevel + * + * Public: Yes + */ +#include "script_component.hpp" + +private ["_pain"]; + +PARAMS_2(_unit,_addedPain); + +//Only run on local units: +if (!local _unit) exitWith {ERROR("unit is not local");}; + +//Ignore if medical system disabled: +if (GVAR(level) == 0) exitWith {}; + +_pain = _unit getVariable [QGVAR(pain), 0]; + +_pain = _pain + _addedPain; +if (GVAR(level) == 1) then {_pain = _pain min 1;}; //for basic, cap at 1 +_pain = _pain max 0; + +_unit setVariable [QGVAR(pain), _pain]; + +//Start up the vital watching (if not already running) +[_unit] call FUNC(addToInjuredCollection); + +_pain diff --git a/addons/medical/functions/fnc_canTreat.sqf b/addons/medical/functions/fnc_canTreat.sqf index 5f52759f54..062a696fcd 100644 --- a/addons/medical/functions/fnc_canTreat.sqf +++ b/addons/medical/functions/fnc_canTreat.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_caller", "_target", "_selectionName", "_className", "_config", "_availableLevels", "_medicRequired", "_items", "_locations", "_return", "_condition"]; +private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_condition"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; diff --git a/addons/medical/functions/fnc_canTreatCached.sqf b/addons/medical/functions/fnc_canTreatCached.sqf index 34d753b119..b1dfaf7d12 100644 --- a/addons/medical/functions/fnc_canTreatCached.sqf +++ b/addons/medical/functions/fnc_canTreatCached.sqf @@ -19,4 +19,4 @@ #define MAX_DURATION_CACHE 2 // parameters, function, namespace, uid -[_this, DFUNC(canTreat), _this select 0, format[QGVAR(canTreat_%1_%2), _this select 2, _this select 3], MAX_DURATION_CACHE, "clearConditionCaches"] call EFUNC(common,cachedCall); +[_this, DFUNC(canTreat), _this select 1, format[QGVAR(canTreat_%1_%2), _this select 2, _this select 3], MAX_DURATION_CACHE, "clearConditionCaches"] call EFUNC(common,cachedCall); diff --git a/addons/medical/functions/fnc_copyDeadBody.sqf b/addons/medical/functions/fnc_copyDeadBody.sqf index 8e476b8662..36bcd91487 100644 --- a/addons/medical/functions/fnc_copyDeadBody.sqf +++ b/addons/medical/functions/fnc_copyDeadBody.sqf @@ -14,7 +14,7 @@ #include "script_component.hpp" -private ["_oldBody","_newUnit","_class","_group","_position","_side","_allVariables"]; +private ["_oldBody","_newUnit","_class","_group","_position","_side", "_caller", "_name"]; _oldBody = _this select 0; _caller = _this select 1; diff --git a/addons/medical/functions/fnc_createLitter.sqf b/addons/medical/functions/fnc_createLitter.sqf index 570c6d63d3..253a3ed315 100644 --- a/addons/medical/functions/fnc_createLitter.sqf +++ b/addons/medical/functions/fnc_createLitter.sqf @@ -16,7 +16,7 @@ #define MIN_ENTRIES_LITTER_CONFIG 3 -private ["_target", "_className", "_config", "_litter", "_createLitter", "_litterObject", "_position", "_createdLitter"]; +private ["_target", "_className", "_config", "_litter", "_createLitter", "_position", "_createdLitter", "_caller", "_selectionName", "_usersOfItems"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; @@ -37,21 +37,21 @@ if !(isArray (_config >> "litter")) exitwith {}; _litter = getArray (_config >> "litter"); _createLitter = { + private["_position", "_litterClass", "_direction"]; _position = getPos (_this select 0); _litterClass = _this select 1; - _litterObject = createVehicle [_litterClass, _position, [], 0, "NONE"]; if (random(1) >= 0.5) then { - _litterObject setPos [(_position select 0) + random 2, (_position select 1) + random 2, _position select 2]; + _position = [(_position select 0) + random 2, (_position select 1) + random 2, _position select 2]; } else { - _litterObject setPos [(_position select 0) - random 2, (_position select 1) - random 2, _position select 2]; + _position = [(_position select 0) - random 2, (_position select 1) - random 2, _position select 2]; }; - _litterObject setDir (random 360); - _litterObject; -}; - -if (isnil QGVAR(allCreatedLitter)) then { - GVAR(allCreatedLitter) = []; - GVAR(litterPFHRunning) = false; + _direction = (random 360); + + // Create the litter, and timeout the event based on the cleanup delay + // The cleanup delay for events in MP is handled by the server side + [QGVAR(createLitter), [_litterClass,_position,_direction], 0] call EFUNC(common,syncedEvent); + + true }; _createdLitter = []; @@ -75,37 +75,13 @@ _createdLitter = []; // Loop through through the litter options and place the litter { if (typeName _x == "ARRAY" && {(count _x > 0)}) then { - _createdLitter pushback ([_target, _x select (floor(random(count _x)))] call _createLitter); + [_target, _x select (floor(random(count _x)))] call _createLitter; }; if (typeName _x == "STRING") then { - _createdLitter pushback ([_target, _x] call _createLitter); + [_target, _x] call _createLitter; }; }foreach _litterOptions; }; }; }; -}foreach _litter; - -if (GVAR(litterCleanUpDelay) >= 0) then { - GVAR(allCreatedLitter) pushback [time, GVAR(litterCleanUpDelay), _createdLitter]; -}; - -if !(GVAR(litterPFHRunning)) then { - GVAR(litterPFHRunning) = true; - [{ - { - if (time - (_x select 0) >= (_x select 1)) then { - { - deleteVehicle _x; - }foreach (_this select 2); - GVAR(allCreatedLitter) set[_foreachIndex, objNull]; - }; - }foreach GVAR(allCreatedLitter); - GVAR(allCreatedLitter) = GVAR(allCreatedLitter) - [objNull]; - - if (count GVAR(allCreatedLitter) == 0) exitwith { - GVAR(litterPFHRunning) = false; - [_this select 1] call CBA_fnc_removePerFrameHandler; - }; - }, 30, []] call CBA_fnc_addPerFrameHandler; -}; +}foreach _litter; \ No newline at end of file diff --git a/addons/medical/functions/fnc_determineIfFatal.sqf b/addons/medical/functions/fnc_determineIfFatal.sqf index 6c90e54da3..bad15dbcad 100644 --- a/addons/medical/functions/fnc_determineIfFatal.sqf +++ b/addons/medical/functions/fnc_determineIfFatal.sqf @@ -10,7 +10,7 @@ #include "script_component.hpp" -private ["_unit","_part","_damageThreshold", "_withDamage"]; +private ["_unit","_part","_damageThreshold", "_withDamage", "_damageBodyPart"]; _unit = _this select 0; _part = _this select 1; _withDamage = if (count _this > 2) then { _this select 2} else {0}; @@ -21,10 +21,10 @@ if ((vehicle _unit != _unit) && {!alive (vehicle _unit)}) exitwith { true }; // Find the correct Damage threshold for unit. _damageThreshold = [1,1,1]; -if (isPlayer _unit) then { - //_damageThreshold =_unit getvariable[QGVAR(unitDamageThreshold), [GVAR(damageThreshold_Players), GVAR(damageThreshold_Players), GVAR(damageThreshold_Players) * 1.7]]; +if ([_unit] call EFUNC(common,IsPlayer)) then { + _damageThreshold =_unit getvariable[QGVAR(unitDamageThreshold), [GVAR(playerDamageThreshold), GVAR(playerDamageThreshold), GVAR(playerDamageThreshold) * 1.7]]; } else { - //_damageThreshold =_unit getvariable[QGVAR(unitDamageThreshold), [GVAR(damageThreshold_AI), GVAR(damageThreshold_AI), GVAR(damageThreshold_AI) * 1.7]]; + _damageThreshold =_unit getvariable[QGVAR(unitDamageThreshold), [GVAR(AIDamageThreshold), GVAR(AIDamageThreshold), GVAR(AIDamageThreshold) * 1.7]]; }; _damageBodyPart = ((_unit getvariable [QGVAR(bodyPartStatus),[0, 0, 0, 0, 0, 0]]) select _part) + _withDamage; diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index 2e0525f1a3..c5c5d23a01 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -14,7 +14,9 @@ #include "script_component.hpp" -private ["_target", "_show", "_selectionN"]; +// Exit for basic medical +if (GVAR(level) < 2) exitWith {}; +private ["_target", "_show", "_selectionN", "_amountOfGeneric", "_bandagedwounds", "_logCtrl", "_part", "_partText", "_pointDamage", "_severity", "_total", "_totalIvVolume", "_triageStatus", "_type"]; _target = _this select 0; _show = if (count _this > 1) then {_this select 1} else {true}; _selectionN = if (count _this > 2) then {_this select 2} else {0}; @@ -47,21 +49,23 @@ if (_show) then { _allInjuryTexts = []; _genericMessages = []; - _partText = ["STR_ACE_Interaction_Head", "STR_ACE_Interaction_Torso", "STR_ACE_Interaction_ArmLeft" ,"STR_ACE_Interaction_ArmRight" ,"STR_ACE_Interaction_LegLeft", "STR_ACE_Interaction_LegRight"] select _selectionN; - _genericMessages pushback [localize _partText, [1, 1, 1, 1]]; + if (GVAR(level) >= 2) then { + _partText = ["STR_ACE_Interaction_Head", "STR_ACE_Interaction_Torso", "STR_ACE_Interaction_ArmLeft" ,"STR_ACE_Interaction_ArmRight" ,"STR_ACE_Interaction_LegLeft", "STR_ACE_Interaction_LegRight"] select _selectionN; + _genericMessages pushback [localize _partText, [1, 1, 1, 1]]; + }; if (_target getvariable[QGVAR(isBleeding), false]) then { - _genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_BLEEDING", [1, 0.1, 0.1, 1]]; + _genericMessages pushback [localize "STR_ACE_Medical_Status_Bleeding", [1, 0.1, 0.1, 1]]; }; - if (_target getvariable[QGVAR(hasLostBlood), false]) then { - _genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_LOST_BLOOD", [1, 0.1, 0.1, 1]]; + if (_target getvariable[QGVAR(hasLostBlood), 0] > 1) then { + _genericMessages pushback [localize "STR_ACE_Medical_Status_Lost_Blood", [1, 0.1, 0.1, 1]]; }; if (((_target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]) select _selectionN) > 0) then { - _genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_TOURNIQUET_APPLIED", [0.77, 0.51, 0.08, 1]]; + _genericMessages pushback [localize "STR_ACE_Medical_Status_Tourniquet_Applied", [0.77, 0.51, 0.08, 1]]; }; if (_target getvariable[QGVAR(hasPain), false]) then { - _genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_PAIN", [1, 1, 1, 1]]; + _genericMessages pushback [localize "STR_ACE_Medical_Status_Pain", [1, 1, 1, 1]]; }; _totalIvVolume = 0; @@ -73,7 +77,7 @@ if (_show) then { }; }foreach GVAR(IVBags); if (_totalIvVolume >= 1) then { - _genericMessages pushback [format[localize "STR_ACE_MEDICAL_receivingIvVolume", floor _totalIvVolume], [1, 1, 1, 1]]; + _genericMessages pushback [format[localize "STR_ACE_Medical_receivingIvVolume", floor _totalIvVolume], [1, 1, 1, 1]]; }; _damaged = [false, false, false, false, false, false]; @@ -126,12 +130,22 @@ if (_show) then { { _selectionBloodLoss set [_forEachIndex, _target getHitPointDamage _x]; - if (_target getHitPointDamage _x > 0.1 && {_forEachIndex == _selectionN}) then { - // @todo localize - _allInjuryTexts pushBack [format ["%1 %2", - ["Lightly wounded", "Heavily wounded"] select (_target getHitPointDamage _x > 0.5), - ["head", "torso", "left arm", "right arm", "left leg", "right leg"] select _forEachIndex - ], [1,1,1,1]]; + if (_target getHitPointDamage _x > 0 && {_forEachIndex == _selectionN}) then { + _pointDamage = _target getHitPointDamage _x; + _severity = switch (true) do { + case (_pointDamage > 0.5): {localize "STR_ACE_Medical_HeavilyWounded"}; + case (_pointDamage > 0.1): {localize "STR_ACE_Medical_LightlyWounded"}; + default {localize "STR_ACE_Medical_VeryLightlyWounded"}; + }; + _part = localize ([ + "STR_ACE_Medical_Head", + "STR_ACE_Medical_Torso", + "STR_ACE_Medical_LeftArm", + "STR_ACE_Medical_RightArm", + "STR_ACE_Medical_LeftLeg", + "STR_ACE_Medical_RightLeg" + ] select _forEachIndex); + _allInjuryTexts pushBack [format ["%1 %2", _severity, toLower _part], [1,1,1,1]]; }; } forEach ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; }; @@ -172,13 +186,13 @@ if (_show) then { _lbCtrl lbSetColor [_foreachIndex + _amountOfGeneric, _x select 1]; }foreach _allInjuryTexts; if (count _allInjuryTexts == 0) then { - _lbCtrl lbAdd "No injuries on this bodypart.."; + _lbCtrl lbAdd (localize "STR_ACE_Medical_NoInjuriesBodypart"); }; _logCtrl = (_display displayCtrl 302); lbClear _logCtrl; - private ["_logs", "_log", "_message", "_moment", "_arguments", "_lbCtrl"]; + private ["_logs", "_message", "_moment", "_arguments", "_lbCtrl"]; _logs = _target getvariable [QGVAR(logFile_Activity), []]; { // [_message,_moment,_type, _arguments] diff --git a/addons/medical/functions/fnc_displayTriageCard.sqf b/addons/medical/functions/fnc_displayTriageCard.sqf index 5feb209b44..a9054dac46 100644 --- a/addons/medical/functions/fnc_displayTriageCard.sqf +++ b/addons/medical/functions/fnc_displayTriageCard.sqf @@ -13,7 +13,7 @@ #include "script_component.hpp" -private ["_target", "_show"]; +private ["_target", "_show", "_amount", "_item", "_log", "_message", "_triageCardTexts", "_triageStatus"]; _target = _this select 0; _show = if (count _this > 1) then {_this select 1} else {true}; @@ -24,7 +24,7 @@ if (_show) then { createDialog QGVAR(triageCard); [{ - private ["_target", "_display", "_alphaLevel", "_damaged", "_availableSelections", "_openWounds", "_selectionBloodLoss", "_red", "_green", "_blue", "_alphaLevel", "_allInjuryTexts", "_lbCtrl", "_genericMessages"]; + private ["_target", "_display", "_alphaLevel", "_alphaLevel", "_lbCtrl"]; _target = (_this select 0) select 0; if (GVAR(TriageCardTarget) != _target) exitwith { [_this select 1] call CBA_fnc_removePerFrameHandler; @@ -58,7 +58,7 @@ if (_show) then { }foreach _log; if (count _triageCardTexts == 0) then { - _lbCtrl lbAdd "No entries on this triage card.."; + _lbCtrl lbAdd (localize "STR_ACE_Medical_TriageCard_NoEntry"); }; { _lbCtrl lbAdd _x; diff --git a/addons/medical/functions/fnc_dropDownTriageCard.sqf b/addons/medical/functions/fnc_dropDownTriageCard.sqf index 6ea910b7af..6f30152c5f 100644 --- a/addons/medical/functions/fnc_dropDownTriageCard.sqf +++ b/addons/medical/functions/fnc_dropDownTriageCard.sqf @@ -13,7 +13,7 @@ #include "script_component.hpp" -private ["_show"]; +private ["_show", "_ctrl", "_display", "_idc", "_pos"]; _show = _this select 0; disableSerialization; diff --git a/addons/medical/functions/fnc_getBloodLoss.sqf b/addons/medical/functions/fnc_getBloodLoss.sqf index 6418d425e8..1881643d97 100644 --- a/addons/medical/functions/fnc_getBloodLoss.sqf +++ b/addons/medical/functions/fnc_getBloodLoss.sqf @@ -13,17 +13,19 @@ #include "script_component.hpp" -#define BLOODLOSSRATE_BASIC 0.4 +#define BLOODLOSSRATE_BASIC 0.2 -private ["_totalBloodLoss","_tourniquets","_openWounds", "_value", "_cardiacOutput", "_internalWounds"]; +private ["_unit", "_totalBloodLoss","_tourniquets","_openWounds", "_cardiacOutput", "_internalWounds"]; // TODO Only use this calculation if medium or higher, otherwise use vanilla calculations (for basic medical). + +_unit = _this select 0; _totalBloodLoss = 0; // Advanced medical bloodloss handling if (GVAR(level) >= 2) then { - _tourniquets = _this getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; - _openWounds = _this getvariable [QGVAR(openWounds), []]; - //_cardiacOutput = [_this] call FUNC(getCardiacOutput); + _tourniquets = _unit getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; + _openWounds = _unit getvariable [QGVAR(openWounds), []]; + //_cardiacOutput = [_unit] call FUNC(getCardiacOutput); { if ((_tourniquets select (_x select 2)) == 0) then { @@ -34,7 +36,7 @@ if (GVAR(level) >= 2) then { }; }foreach _openWounds; - _internalWounds = _this getvariable [QGVAR(internalWounds), []]; + _internalWounds = _unit getvariable [QGVAR(internalWounds), []]; { _totalBloodLoss = _totalBloodLoss + ((_x select 4) * (_x select 3)); }foreach _internalWounds; @@ -42,6 +44,6 @@ if (GVAR(level) >= 2) then { // cap the blood loss to be no greater as the current cardiac output //(_totalBloodLoss min _cardiacOutput); } else { - _totalBloodLoss = BLOODLOSSRATE_BASIC * (damage _this); + _totalBloodLoss = BLOODLOSSRATE_BASIC * (damage _unit); }; -_totalBloodLoss * (GVAR(bleedingCoefficient) max 0); +_totalBloodLoss * ((_unit getVariable [QGVAR(bleedingCoefficient), GVAR(bleedingCoefficient)]) max 0); diff --git a/addons/medical/functions/fnc_getBloodVolumeChange.sqf b/addons/medical/functions/fnc_getBloodVolumeChange.sqf index f94c5d5b7b..23eba4a0c7 100644 --- a/addons/medical/functions/fnc_getBloodVolumeChange.sqf +++ b/addons/medical/functions/fnc_getBloodVolumeChange.sqf @@ -34,7 +34,7 @@ private ["_unit","_bloodVolume","_bloodVolumeChange", "_ivVolume"]; _unit = _this select 0; _bloodVolume = _unit getvariable [QGVAR(bloodVolume), 100]; -_bloodVolumeChange = -(_unit call FUNC(getBloodLoss)); +_bloodVolumeChange = -([_unit] call FUNC(getBloodLoss)); if (_bloodVolume < 100.0) then { { diff --git a/addons/medical/functions/fnc_getHeartRateChange.sqf b/addons/medical/functions/fnc_getHeartRateChange.sqf index e7bc9407d2..92a2053737 100644 --- a/addons/medical/functions/fnc_getHeartRateChange.sqf +++ b/addons/medical/functions/fnc_getHeartRateChange.sqf @@ -15,12 +15,12 @@ #define HEART_RATE_MODIFIER 0.02 -private ["_unit", "_heartRate", "_hrIncrease", "_bloodLoss", "_time", "_values", "_adjustment", "_adjustments", "_additionalIncrease", "_change", "_callBack", "_bloodVolume"]; +private ["_unit", "_heartRate", "_hrIncrease", "_bloodLoss", "_time", "_values", "_adjustment", "_change", "_callBack", "_bloodVolume"]; _unit = _this select 0; _hrIncrease = 0; if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then { _heartRate = _unit getvariable [QGVAR(heartRate), 80]; - _bloodLoss = _unit call FUNC(getBloodLoss); + _bloodLoss = [_unit] call FUNC(getBloodLoss); _adjustment = _unit getvariable [QGVAR(heartRateAdjustments), []]; { @@ -83,4 +83,4 @@ if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then { _hrIncrease = _hrIncrease - HEART_RATE_MODIFIER; }; }; -_hrIncrease \ No newline at end of file +_hrIncrease diff --git a/addons/medical/functions/fnc_getTriageStatus.sqf b/addons/medical/functions/fnc_getTriageStatus.sqf index d80cbe5d64..aaeec2d516 100644 --- a/addons/medical/functions/fnc_getTriageStatus.sqf +++ b/addons/medical/functions/fnc_getTriageStatus.sqf @@ -17,10 +17,10 @@ private ["_unit","_return","_status"]; _unit = _this select 0; _status = _unit getvariable [QGVAR(triageLevel), -1]; _return = switch (_status) do { - case 1: {[localize "STR_ACE_MEDICAL_TRIAGE_STATUS_MINOR", 1, [0, 0.5, 0, 0.9]]}; - case 2: {[localize "STR_ACE_MEDICAL_TRIAGE_STATUS_DELAYED", 2, [0.7, 0.5, 0, 0.9]]}; - case 3: {[localize "STR_ACE_MEDICAL_TRIAGE_STATUS_IMMEDIATE", 3, [0.4, 0.07, 0.07, 0.9]]}; - case 4: {[localize "STR_ACE_MEDICAL_TRIAGE_STATUS_DECEASED", 4, [0, 0, 0, 0.9]]}; - default {[localize "STR_ACE_MEDICAL_TRIAGE_STATUS_NONE", 0, [0, 0, 0, 0.9]]}; + case 1: {[localize "STR_ACE_Medical_Triage_Status_Minor", 1, [0, 0.5, 0, 0.9]]}; + case 2: {[localize "STR_ACE_Medical_Triage_Status_Delayed", 2, [0.7, 0.5, 0, 0.9]]}; + case 3: {[localize "STR_ACE_Medical_Triage_Status_Immediate", 3, [0.4, 0.07, 0.07, 0.9]]}; + case 4: {[localize "STR_ACE_Medical_Triage_Status_Deceased", 4, [0, 0, 0, 0.9]]}; + default {[localize "STR_ACE_Medical_Triage_Status_None", 0, [0, 0, 0, 0.9]]}; }; _return; diff --git a/addons/medical/functions/fnc_handleBandageOpening.sqf b/addons/medical/functions/fnc_handleBandageOpening.sqf index b4e40984ae..a92bf9029c 100644 --- a/addons/medical/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical/functions/fnc_handleBandageOpening.sqf @@ -18,7 +18,7 @@ #include "script_component.hpp" -private ["_target", "_impact", "_part", "_injuryIndex", "_injury", "_bandage", "_classID", "_className", "_reopeningChance", "_reopeningMinDelay", "_reopeningMaxDelay", "_config", "_woundTreatmentConfig", "_bandagedWounds", "_exist", "_injuryId", "_existingInjury", "_delay", "_openWounds", "_selectedInjury"]; +private ["_target", "_impact", "_part", "_injuryIndex", "_injury", "_bandage", "_classID", "_className", "_reopeningChance", "_reopeningMinDelay", "_reopeningMaxDelay", "_config", "_woundTreatmentConfig", "_bandagedWounds", "_exist", "_injuryId", "_existingInjury", "_delay", "_openWounds", "_selectedInjury", "_bandagedInjury"]; _target = _this select 0; _impact = _this select 1; _part = _this select 2; @@ -59,20 +59,30 @@ if (isClass (_config >> _className)) then { _bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []]; _exist = false; _injuryId = _injury select 0; +_bandagedInjury = []; { if ((_x select 0) == _injuryId) exitwith { _exist = true; _existingInjury = _x; _existingInjury set [3, (_existingInjury select 3) + _impact]; _bandagedWounds set [_foreachIndex, _existingInjury]; + + _bandagedInjury = _existingInjury; }; }foreach _bandagedWounds; if !(_exist) then { // [ID, classID, bodypart, percentage treated, bloodloss rate] - _bandagedWounds pushback [_injuryId, _injury select 1, _injury select 2, _impact, _injury select 4]; + _bandagedInjury = [_injuryId, _injury select 1, _injury select 2, _impact, _injury select 4]; + _bandagedWounds pushback _bandagedInjury; +}; + +_target setvariable [QGVAR(bandagedWounds), _bandagedWounds, !USE_WOUND_EVENT_SYNC]; + +if (USE_WOUND_EVENT_SYNC) then { + // sync _bandagedInjury + }; -_target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; // Check if we are ever going to reopen this if (random(1) <= _reopeningChance) then { @@ -109,7 +119,7 @@ if (random(1) <= _reopeningChance) then { }foreach _bandagedWounds; if (_exist) then { - _target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; + _target setvariable [QGVAR(bandagedWounds), _bandagedWounds, !USE_WOUND_EVENT_SYNC]; }; }; // Otherwise something went wrong, we we don't reopen them.. diff --git a/addons/medical/functions/fnc_handleCreateLitter.sqf b/addons/medical/functions/fnc_handleCreateLitter.sqf new file mode 100644 index 0000000000..617d05e519 --- /dev/null +++ b/addons/medical/functions/fnc_handleCreateLitter.sqf @@ -0,0 +1,49 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +if(!hasInterface) exitWith { false }; + +PARAMS_3(_litterClass,_position,_direction); +private["_litterObject", "_maxLitterCount"]; +//IGNORE_PRIVATE_WARNING(_values); + +if (isNil QGVAR(allCreatedLitter)) then { + GVAR(allCreatedLitter) = []; + GVAR(litterPFHRunning) = false; +}; + +_litterObject = _litterClass createVehicleLocal _position; +_litterObject setDir _direction; + +_maxLitterCount = getArray (configFile >> "ACE_Settings" >> QGVAR(litterSimulationDetail) >> "_values") select GVAR(litterSimulationDetail); +if((count GVAR(allCreatedLitter)) > _maxLitterCount ) then { + // gank the first litter object, and spawn ours. + private["_oldLitter"]; + _oldLitter = GVAR(allCreatedLitter) deleteAt 0; + { + deleteVehicle _x; + } forEach (_oldLitter select 1); +}; + +GVAR(allCreatedLitter) pushBack [time, [_litterObject]]; + +if(!GVAR(litterPFHRunning) && {GVAR(litterCleanUpDelay) > 0}) then { + [{ + { + if (time - (_x select 0) >= GVAR(litterCleanUpDelay)) then { + { + deleteVehicle _x; + } forEach (_x select 1); + GVAR(allCreatedLitter) set[_foreachIndex, objNull]; + }; + } forEach GVAR(allCreatedLitter); + GVAR(allCreatedLitter) = GVAR(allCreatedLitter) - [objNull]; + + if ( (count GVAR(allCreatedLitter)) == 0) exitwith { + [(_this select 1)] call CBA_fnc_removePerFrameHandler; + GVAR(litterPFHRunning) = false; + }; + }, 30, []] call cba_fnc_addPerFrameHandler; +}; + +true \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index 1632a8f55b..1d8c821d1f 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -17,12 +17,12 @@ #include "script_component.hpp" -private ["_unit", "_selection", "_damage", "_shooter", "_projectile", "_damageReturn", "_typeOfDamage"]; -_unit = _this select 0; -_selection = _this select 1; -_damage = _this select 2; -_shooter = _this select 3; -_projectile = _this select 4; +private ["_unit", "_selection", "_damage", "_shooter", "_projectile", "_damageReturn", "_typeOfDamage", "_minLethalDamage", "_newDamage", "_typeIndex", "_preventDeath"]; +_unit = _this select 0; +_selection = _this select 1; +_damage = _this select 2; +_shooter = _this select 3; +_projectile = _this select 4; if !(local _unit) exitWith {nil}; @@ -34,50 +34,93 @@ if (typeName _projectile == "OBJECT") then { // If the damage is being weird, we just tell it to fuck off. if !(_selection in (GVAR(SELECTIONS) + [""])) exitWith {0}; +// Exit if we disable damage temporarily +_damageOld = damage _unit; +if (_selection in GVAR(SELECTIONS)) then { + _damageOld = _unit getHit _selection; +}; +if !(_unit getVariable [QGVAR(allowDamage), true]) exitWith {_damageOld}; + +// Figure out whether to prevent death before handling damage +if (diag_frameno > (_unit getVariable [QGVAR(frameNo), -3]) + 2) then { + _unit setVariable [QGVAR(frameNo), diag_frameno]; + _unit setVariable [QGVAR(wasUnconscious), _unit getVariable ["ACE_isUnconscious", false]]; + + _preventDeath = _unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]; + if (_unit getVariable ["ACE_isUnconscious", false]) then { + _preventDeath = _unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]; + if !([_unit] call EFUNC(common,isPlayer)) then { + _preventDeath = _preventDeath - 1; + }; + _preventDeath = _preventDeath > 0; + }; + _unit setVariable [QGVAR(preventDeath), _preventDeath]; +}; + +// Get return damage _damageReturn = _damage; if (GVAR(level) < 2) then { _damageReturn = _this call FUNC(handleDamage_basic); -}; - -if (GVAR(level) >= 2) then { +} else { if !([_unit] call FUNC(hasMedicalEnabled)) exitwith { // Because of the config changes, we cannot properly disable the medical system for a unit. // lets use basic for the time being.. _damageReturn = _this call FUNC(handleDamage_basic); }; _newDamage = _this call FUNC(handleDamage_caching); + _typeOfDamage = [_projectile] call FUNC(getTypeOfDamage); - if (_damageReturn > 0.9) then { + _typeIndex = (GVAR(allAvailableDamageTypes) find _typeOfDamage); + _minLethalDamage = 0.01; + if (_typeIndex >= 0) then { + _minLethalDamage = GVAR(minLethalDamages) select _typeIndex; + }; - _typeOfDamage = [_projectile] call FUNC(getTypeOfDamage); - - _typeIndex = (GVAR(allAvailableDamageTypes) find _typeOfDamage); - _minLethalDamage = 0.01; - if (_typeIndex >= 0) then { - _minLethalDamage = GVAR(minLethalDamages) select _typeIndex; + if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _shooter} && {_projectile == ""} && {_selection == ""}) then { + if (GVAR(enableVehicleCrashes)) then { + _selection = GVAR(SELECTIONS) select (floor(random(count GVAR(SELECTIONS)))); }; + }; - if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)} && {_selection in ["", "head", "body"]}) then { - if ([_unit] call FUNC(setDead)) then { - _damageReturn = 1; - } else { - _damageReturn = 0.89; - }; + if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)} || !alive vehicle _unit) then { + if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)])) exitwith { + _damageReturn = 0.9; + }; + if ([_unit] call FUNC(setDead)) then { + _damageReturn = 1; } else { - _damageReturn = 0.89; + _damageReturn = _damageReturn min 0.89; }; + } else { + _damageReturn = _damageReturn min 0.89; }; }; [_unit] call FUNC(addToInjuredCollection); -if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) && {_damageReturn >= 0.9} && {_selection in ["", "head", "body"]}) exitWith { - if (vehicle _unit != _unit and {damage _vehicle >= 1}) then { - // @todo - // [_unit] call FUNC(unload); +// Prevent death if necessary +if (_unit getVariable QGVAR(preventDeath)) then { + if (_selection in ["", "head", "body"]) then { + _damageReturn = _damageReturn min 0.89; }; - [_unit] call FUNC(setDead); - 0.89 + // Move the unit out of the vehicle if necessary + if (vehicle _unit != _unit and damage (vehicle _unit) == 1) then { + [_unit] call EFUNC(common,unloadPerson); + if (_unit getVariable QGVAR(wasUnconscious)) then { + [_unit] call FUNC(setDead); + } else { + [_unit, true] call FUNC(setUnconscious); + }; + }; + + // Temporarily disable all damage to prevent stuff like + // being killed during the animation etc. + if (!_wasUnconscious and (_unit getVariable ["ACE_isUnconscious", false])) then { + _unit setVariable [QGVAR(allowDamage), false]; + [{ + _this setVariable [QGVAR(allowDamage), true]; + }, _unit, 0.7, 0] call EFUNC(common,waitAndExecute); + }; }; _damageReturn diff --git a/addons/medical/functions/fnc_handleDamage_advanced.sqf b/addons/medical/functions/fnc_handleDamage_advanced.sqf index ba0eb8af24..8bd0267d3f 100644 --- a/addons/medical/functions/fnc_handleDamage_advanced.sqf +++ b/addons/medical/functions/fnc_handleDamage_advanced.sqf @@ -33,10 +33,12 @@ if (isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _un }; _typeOfDamage = [_typeOfProjectile] call FUNC(getTypeOfDamage); _part = [_selectionName] call FUNC(selectionNameToNumber); +if (_part < 0) exitwith {}; _hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; // Sorting out the damage _damageBodyParts = _unit getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; + _damageBodyParts set [_part, (_damageBodyParts select _part) + _newDamage]; _unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index aa9c2f61df..7b308ad188 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -24,24 +24,30 @@ #define ARMDAMAGETRESHOLD2 1.7 #define UNCONSCIOUSNESSTRESHOLD 0.7 -private ["_unit", "_selectionName", "_damage", "_shooter", "_projectile", "_damage"]; +private ["_unit", "_selectionName", "_damage", "_shooter", "_projectile", "_damage", "_armdamage", "_hitPoint", "_index", "_legdamage", "_newDamage", "_otherDamage", "_pain", "_restore"]; -_unit = _this select 0; -_selectionName = _this select 1; -_damage = _this select 2; -_shooter = _this select 3; -_projectile = _this select 4; +_unit = _this select 0; +_selectionName = _this select 1; +_damage = _this select 2; +_shooter = _this select 3; +_projectile = _this select 4; + +// Apply damage treshold / coefficient +_threshold = [ + _unit getVariable [QGVAR(damageThreshold), GVAR(AIDamageThreshold)], + _unit getVariable [QGVAR(damageThreshold), GVAR(playerDamageThreshold)] +] select ([_unit] call EFUNC(common,isPlayer)); +_damage = _damage * (1 / _threshold); // This is a new hit, reset variables. // Note: sometimes handleDamage spans over 2 or even 3 frames. -if (diag_frameno > (_unit getVariable [QGVAR(frameNo), -3]) + 2) then { - _unit setVariable [QGVAR(frameNo), diag_frameno]; +if (diag_frameno > (_unit getVariable [QGVAR(basic_frameNo), -3]) + 2) then { + _unit setVariable [QGVAR(basic_frameNo), diag_frameno]; _unit setVariable [QGVAR(isFalling), false]; _unit setVariable [QGVAR(projectiles), []]; _unit setVariable [QGVAR(hitPoints), []]; _unit setVariable [QGVAR(damages), []]; _unit setVariable [QGVAR(structDamage), 0]; - _unit setVariable [QGVAR(preventDeath), false]; // Assign orphan structural damage to torso [{ private ["_unit", "_damagesum"]; @@ -172,11 +178,7 @@ if (_selectionName == "" and _damage < 1 and !(_unit getVariable ["ACE_isUnconscious", False] )) then { - if (_unit getVariable [QGVAR(allowUnconscious), ([_unit] call EFUNC(common,isPlayer)) or random 1 > 0.3]) then { - [_unit, true] call FUNC(setUnconscious); - } else { - _damage = 1; - }; + [_unit, true] call FUNC(setUnconscious); }; _damage diff --git a/addons/medical/functions/fnc_handleDamage_caching.sqf b/addons/medical/functions/fnc_handleDamage_caching.sqf index 98b2373c74..95d750843d 100644 --- a/addons/medical/functions/fnc_handleDamage_caching.sqf +++ b/addons/medical/functions/fnc_handleDamage_caching.sqf @@ -38,7 +38,7 @@ if (_selectionName in _hitSelections) then { // Check for vehicle crash if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _source} && {_projectile == ""} && {_selectionName == ""}) then { - if (missionNamespace getvariable [QGVAR(allowVehicleCrashDamage), true]) then { + if (GVAR(enableVehicleCrashes)) then { _selectionName = _hitSelections select (floor(random(count _hitSelections))); _projectile = "vehiclecrash"; }; diff --git a/addons/medical/functions/fnc_handleDamage_wounds.sqf b/addons/medical/functions/fnc_handleDamage_wounds.sqf index 5933651e57..9172304dd2 100644 --- a/addons/medical/functions/fnc_handleDamage_wounds.sqf +++ b/addons/medical/functions/fnc_handleDamage_wounds.sqf @@ -17,7 +17,7 @@ #include "script_component.hpp" -private ["_unit", "_selectionName", "_damage", "_typeOfProjectile", "_typeOfDamage", "_bodyPartn", "_woundType", "_injuryTypeInfo", "_allInjuriesForDamageType", "_allPossibleInjuries", "_highestPossibleDamage", "_highestPossibleSpot", "_minDamage", "_openWounds", "_woundID", "_toAddInjury", "_painToAdd"]; +private ["_unit", "_selectionName", "_damage", "_typeOfProjectile", "_typeOfDamage", "_bodyPartn", "_injuryTypeInfo", "_allInjuriesForDamageType", "_allPossibleInjuries", "_highestPossibleDamage", "_highestPossibleSpot", "_minDamage", "_openWounds", "_woundID", "_toAddInjury", "_painToAdd", "_bloodLoss", "_bodyPartNToAdd", "_classType", "_damageLevels", "_foundIndex", "_i", "_injury", "_maxDamage", "_pain", "_painLevel", "_selections", "_toAddClassID", "_woundsCreated"]; _unit = _this select 0; _selectionName = _this select 1; _damage = _this select 2; @@ -133,7 +133,6 @@ if (count _woundsCreated > 0) then { }; if (USE_WOUND_EVENT_SYNC) then { - // TODO Should this be done in a single broadcast? // Broadcast the new injuries across the net in parts. One broadcast per injury. Prevents having to broadcast one massive array of injuries. { ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); diff --git a/addons/medical/functions/fnc_handleKilled.sqf b/addons/medical/functions/fnc_handleKilled.sqf index ce0f087836..5003ec189c 100644 --- a/addons/medical/functions/fnc_handleKilled.sqf +++ b/addons/medical/functions/fnc_handleKilled.sqf @@ -13,7 +13,7 @@ #include "script_component.hpp" -private["_unit"]; +private["_unit", "_openWounds"]; _unit = _this select 0; if (!local _unit) exitwith {}; diff --git a/addons/medical/functions/fnc_handleLocal.sqf b/addons/medical/functions/fnc_handleLocal.sqf index 5d9c5865a4..216fb8ed49 100644 --- a/addons/medical/functions/fnc_handleLocal.sqf +++ b/addons/medical/functions/fnc_handleLocal.sqf @@ -22,4 +22,14 @@ if (_local) then { if (_unit getvariable[QGVAR(addedToUnitLoop),false]) then { [_unit, true] call FUNC(addToInjuredCollection); }; + + if ((_unit getvariable ["ACE_isUnconscious",false]) && {count (_unit getvariable [QGVAR(unconsciousArguments), []]) >= 6}) then { + private "_arguments"; + _arguments = (_unit getvariable [QGVAR(unconsciousArguments), []]); + _arguments set [2, time]; + + [DFUNC(unconsciousPFH), 0.1, _arguments ] call CBA_fnc_addPerFrameHandler; + + _unit setvariable [QGVAR(unconsciousArguments), nil, true]; + }; }; diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index fc13e19d29..ebfb8be746 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -13,7 +13,7 @@ #include "script_component.hpp" -private ["_unit", "_heartRate","_bloodPressure","_bloodVolume","_painStatus", "_lastTimeValuesSynced", "_syncValues"]; +private ["_unit", "_heartRate","_bloodPressure","_bloodVolume","_painStatus", "_lastTimeValuesSynced", "_syncValues", "_airwayStatus", "_blood", "_bloodPressureH", "_bloodPressureL", "_interval"]; _unit = _this select 0; _interval = time - (_unit getVariable [QGVAR(lastMomentVitalsHandled), 0]); @@ -27,24 +27,29 @@ if (_syncValues) then { _unit setvariable [QGVAR(lastMomentValuesSynced), time]; }; -_bloodVolume = (_unit getvariable [QGVAR(bloodVolume), 0]) + ([_unit] call FUNC(getBloodVolumeChange)); -if (_bloodVolume <= 0) then { - _bloodVolume = 0; -}; +_bloodVolume = (_unit getvariable [QGVAR(bloodVolume), 100]) + ([_unit] call FUNC(getBloodVolumeChange)); +_bloodVolume = _bloodVolume max 0; + _unit setvariable [QGVAR(bloodVolume), _bloodVolume, _syncValues]; // Set variables for synchronizing information across the net -if (_bloodVolume < 90) then { - if !(_unit getvariable [QGVAR(hasLostBlood), false]) then { - _unit setvariable [QGVAR(hasLostBlood), true, true]; - }; +if (_bloodVolume < 100) then { + if ((_bloodVolume < 90 && (GVAR(level) == 2)) || _bloodVolume <= 45) then { + if (_unit getvariable [QGVAR(hasLostBlood), 0] != 2) then { + _unit setvariable [QGVAR(hasLostBlood), 2, true]; + }; + } else { + if (_unit getvariable [QGVAR(hasLostBlood), 0] != 1) then { + _unit setvariable [QGVAR(hasLostBlood), 1, true]; + }; + } } else { - if (_unit getvariable [QGVAR(hasLostBlood),false]) then { - _unit setvariable [QGVAR(hasLostBlood), false, true]; + if (_unit getvariable [QGVAR(hasLostBlood), 0] != 0) then { + _unit setvariable [QGVAR(hasLostBlood), 0, true]; }; }; -if ((_unit call FUNC(getBloodLoss)) > 0) then { +if (([_unit] call FUNC(getBloodLoss)) > 0) then { if !(_unit getvariable [QGVAR(isBleeding), false]) then { _unit setvariable [QGVAR(isBleeding), true, true]; }; @@ -67,26 +72,22 @@ if (_painStatus > 0) then { if (GVAR(level) == 1) then { // reduce pain - if (_unit getVariable [QGVAR(pain), 0] > 0) then { - _unit setVariable [QGVAR(pain), ((_unit getVariable QGVAR(pain)) - 0.001 * _interval) max 0, _syncValues]; + if (_painStatus > 0) then { + _unit setVariable [QGVAR(pain), (_painStatus - 0.001 * _interval) max 0, _syncValues]; }; // reduce painkillers if (_unit getVariable [QGVAR(morphine), 0] > 0) then { - _unit setVariable [QGVAR(morphine), ((_unit getVariable QGVAR(morphine)) - 0.0015 * _interval) max 0, _syncValues]; + _unit setVariable [QGVAR(morphine), ((_unit getVariable [QGVAR(morphine), 0]) - 0.0015 * _interval) max 0, _syncValues]; }; // bleeding _blood = _unit getVariable [QGVAR(bloodVolume), 100]; - _blood = (_blood - 0.4 * (damage _unit) * _interval) max 0; - if (_blood != (_unit getVariable [QGVAR(bloodVolume), 100])) then { - _unit setVariable [QGVAR(bloodVolume), _blood, _syncValues]; - if (_blood <= 35 and !(_unit getVariable ["ACE_isUnconscious", false])) then { - [_unit, true] call FUNC(setUnconscious); - }; - if (_blood == 0) then { - [_unit] call FUNC(setDead); - }; + if (_blood <= 35 and !(_unit getVariable ["ACE_isUnconscious", false])) then { + [_unit, true] call FUNC(setUnconscious); + }; + if (_blood == 0) then { + [_unit] call FUNC(setDead); }; }; @@ -99,13 +100,13 @@ if (GVAR(level) >= 2) then { if ([_unit] call EFUNC(common,isAwake)) then { if (_bloodVolume < 60) then { if (random(1) > 0.9) then { - [_unit] call FUNC(setUnconscious); + [_unit, true, 15 + random(20)] call FUNC(setUnconscious); }; }; }; // Set the vitals - _heartRate = (_unit getvariable [QGVAR(heartRate), 0]) + (([_unit] call FUNC(getHeartRateChange)) * _interval); + _heartRate = (_unit getvariable [QGVAR(heartRate), 80]) + (([_unit] call FUNC(getHeartRateChange)) * _interval); _unit setvariable [QGVAR(heartRate), _heartRate, _syncValues]; _bloodPressure = [_unit] call FUNC(getBloodPressure); @@ -141,7 +142,7 @@ if (GVAR(level) >= 2) then { if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then { if (_heartRate < 10 || _bloodPressureH < 30 || _bloodVolume < 20) then { - [_unit] call FUNC(setUnconscious); // safety check to ensure unconsciousness for units if they are not dead already. + [_unit, true, 10+ random(20)] call FUNC(setUnconscious); // safety check to ensure unconsciousness for units if they are not dead already. }; if (_bloodPressureH > 260) then { diff --git a/addons/medical/functions/fnc_hasItem.sqf b/addons/medical/functions/fnc_hasItem.sqf index 551d532ae4..cfec633b55 100644 --- a/addons/medical/functions/fnc_hasItem.sqf +++ b/addons/medical/functions/fnc_hasItem.sqf @@ -15,7 +15,7 @@ #include "script_component.hpp" -private ["_medic", "_patient", "_item", "_return"]; +private ["_medic", "_patient", "_item", "_return", "_crew"]; _medic = _this select 0; _patient = _this select 1; _item = _this select 2; diff --git a/addons/medical/functions/fnc_init.sqf b/addons/medical/functions/fnc_init.sqf index ed8301b6b2..0ec6ce3ce2 100644 --- a/addons/medical/functions/fnc_init.sqf +++ b/addons/medical/functions/fnc_init.sqf @@ -28,6 +28,7 @@ _unit setvariable [QGVAR(tourniquets), [0,0,0,0,0,0], true]; _unit setvariable [QGVAR(openWounds), [], true]; _unit setvariable [QGVAR(bandagedWounds), [], true]; _unit setVariable [QGVAR(internalWounds), [], true]; +_unit setvariable [QGVAR(lastUniqueWoundID), 1, true]; // vitals _unit setVariable [QGVAR(heartRate), 80]; @@ -36,30 +37,30 @@ _unit setvariable [QGVAR(bloodPressure), [80, 120]]; _unit setVariable [QGVAR(peripheralResistance), 100]; // fractures -_unit setVariable [QGVAR(fractures), []]; +_unit setVariable [QGVAR(fractures), [], true]; // triage card and logs _unit setvariable [QGVAR(triageLevel), 0, true]; _unit setvariable [QGVAR(triageCard), [], true]; // IVs -_unit setVariable [QGVAR(salineIVVolume), 0]; -_unit setVariable [QGVAR(plasmaIVVolume), 0]; -_unit setVariable [QGVAR(bloodIVVolume), 0]; +_unit setVariable [QGVAR(salineIVVolume), 0, true]; +_unit setVariable [QGVAR(plasmaIVVolume), 0, true]; +_unit setVariable [QGVAR(bloodIVVolume), 0, true]; // damage storage _unit setvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true]; // airway -_unit setvariable [QGVAR(airwayStatus), 100, true]; -_unit setVariable [QGVAR(airwayOccluded), false, true]; -_unit setvariable [QGVAR(airwayCollapsed), false, true]; +_unit setvariable [QGVAR(airwayStatus), 100]; +_unit setVariable [QGVAR(airwayOccluded), false]; +_unit setvariable [QGVAR(airwayCollapsed), false]; // generic medical admin _unit setvariable [QGVAR(addedToUnitLoop), false, true]; _unit setvariable [QGVAR(inCardiacArrest), false, true]; _unit setVariable ["ACE_isUnconscious", false, true]; -_unit setvariable [QGVAR(hasLostBlood), false, true]; +_unit setvariable [QGVAR(hasLostBlood), 0, true]; _unit setvariable [QGVAR(isBleeding), false, true]; _unit setvariable [QGVAR(hasPain), false, true]; _unit setvariable [QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives), true]; @@ -69,11 +70,11 @@ _allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []]; { _unit setvariable [_x select 0, nil]; } foreach _allUsedMedication; -_unit setVariable [QGVAR(allUsedMedication), []]; +_unit setVariable [QGVAR(allUsedMedication), [], true]; _logs = _unit getvariable [QGVAR(allLogs), []]; { - _unit setvariable [_x, nil, true]; + _unit setvariable [_x, nil]; } foreach _logs; _unit setvariable [QGVAR(allLogs), [], true]; diff --git a/addons/medical/functions/fnc_isMedic.sqf b/addons/medical/functions/fnc_isMedic.sqf index cc07948f4b..122d261238 100644 --- a/addons/medical/functions/fnc_isMedic.sqf +++ b/addons/medical/functions/fnc_isMedic.sqf @@ -14,7 +14,7 @@ #include "script_component.hpp" -private ["_unit","_class","_return"]; +private ["_unit", "_class", "_medicN"]; _unit = _this select 0; _medicN = if (count _this > 1) then {_this select 1} else {1}; diff --git a/addons/medical/functions/fnc_modifyMedicalAction.sqf b/addons/medical/functions/fnc_modifyMedicalAction.sqf new file mode 100644 index 0000000000..179ae9eb83 --- /dev/null +++ b/addons/medical/functions/fnc_modifyMedicalAction.sqf @@ -0,0 +1,40 @@ +/* + * Author: esteldunedain + * Modify the visuals of a medical action point. + * On Basic medical: modify the icon color based on damage on that body part. + * + * Arguments: + * 0: The Patient Unit + * 1: The Diagnosing Unit + * 2: Selection Number + * 3: The action to modify + * + * ReturnValue: + * nil + * + * Public: No + */ + +#include "script_component.hpp" + +EXPLODE_4_PVT(_this,_target,_player,_selectionN,_actionData); +if (GVAR(level) < 2) exitwith { + private ["_pointDamage"]; + _pointDamage = _target getHitPointDamage (["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"] select _selectionN); + + if (_pointDamage >= 0.8) exitWith { + _actionData set [2, QUOTE(PATHTOF(UI\icons\medical_crossRed.paa))]; + }; + if (_pointDamage > 0) exitWith { + _actionData set [2, QUOTE(PATHTOF(UI\icons\medical_crossYellow.paa))]; + }; +}; + +private ["_openWounds", "_amountOf"]; +_openWounds = _target getvariable [QGVAR(openWounds), []]; +{ + _amountOf = _x select 3; + if (_amountOf > 0 && {(_selectionN == (_x select 2))}) exitwith { + _actionData set [2, QUOTE(PATHTOF(UI\icons\medical_crossRed.paa))]; + }; +} foreach _openWounds; diff --git a/addons/medical/functions/fnc_moduleTreatmentConfiguration.sqf b/addons/medical/functions/fnc_moduleAdvancedMedicalSettings.sqf similarity index 64% rename from addons/medical/functions/fnc_moduleTreatmentConfiguration.sqf rename to addons/medical/functions/fnc_moduleAdvancedMedicalSettings.sqf index 5d88fa0f0a..cf884e0ab0 100644 --- a/addons/medical/functions/fnc_moduleTreatmentConfiguration.sqf +++ b/addons/medical/functions/fnc_moduleAdvancedMedicalSettings.sqf @@ -22,12 +22,11 @@ _activated = _this select 2; if !(_activated) exitWith {}; -[_logic, QGVAR(medicSetting), "medicSetting"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(maxReviveTime), "maxReviveTime"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(amountOfReviveLives), "amountOfReviveLives"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(enableOverdosing), "enableOverdosing"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(allowLitterCreation), "allowLitterCreation"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(litterCleanUpDelay), "litterCleanUpDelay"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(enableFor), "enableFor"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(enableAdvancedWounds), "enableAdvancedWounds"] call EFUNC(common,readSettingFromModule); +// TODO disabled until implemented +// [_logic, QGVAR(enableAirway), "enableAirway"] call EFUNC(common,readSettingFromModule); +// [_logic, QGVAR(enableFractures), "enableFractures"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(medicSetting_PAK), "medicSetting_PAK"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(medicSetting_SurgicalKit), "medicSetting_SurgicalKit"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(consumeItem_PAK), "consumeItem_PAK"] call EFUNC(common,readSettingFromModule); diff --git a/addons/medical/functions/fnc_moduleMedicalSettings.sqf b/addons/medical/functions/fnc_moduleMedicalSettings.sqf index 34dd063a4d..296b4f1d56 100644 --- a/addons/medical/functions/fnc_moduleMedicalSettings.sqf +++ b/addons/medical/functions/fnc_moduleMedicalSettings.sqf @@ -23,15 +23,14 @@ _activated = _this select 2; if !(_activated) exitWith {}; [_logic, QGVAR(level), "level"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(enableFor), "enableFor"] call EFUNC(common,readSettingFromModule); -// TODO disabled until implemented -// [_logic, QGVAR(enableAirway), "enableAirway"] call EFUNC(common,readSettingFromModule); -// [_logic, QGVAR(enableFractures), "enableFractures"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(enableAdvancedWounds), "enableAdvancedWounds"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(medicSetting), "medicSetting"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(allowLitterCreation), "allowLitterCreation"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(litterCleanUpDelay), "litterCleanUpDelay"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(enableScreams), "enableScreams"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(playerDamageThreshold), "playerDamageThreshold"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(AIDamageThreshold), "AIDamageThreshold"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(enableUnsconsiousnessAI), "enableUnsconsiousnessAI"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(enableUnconsciousnessAI), "enableUnconsciousnessAI"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(preventInstaDeath), "preventInstaDeath"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(bleedingCoefficient), "bleedingCoefficient"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(painCoefficient), "painCoefficient"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(keepLocalSettingsSynced), "keepLocalSettingsSynced"] call EFUNC(common,readSettingFromModule); diff --git a/addons/medical/functions/fnc_moduleReviveSettings.sqf b/addons/medical/functions/fnc_moduleReviveSettings.sqf new file mode 100644 index 0000000000..c96b1eb67c --- /dev/null +++ b/addons/medical/functions/fnc_moduleReviveSettings.sqf @@ -0,0 +1,27 @@ +/* + * Author: Glowbal + * Module for adjusting the medical revive settings + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_logic", "_units", "_activated"]; +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; + +if !(_activated) exitWith {}; + +[_logic, QGVAR(maxReviveTime), "maxReviveTime"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(amountOfReviveLives), "amountOfReviveLives"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(enableRevive), "enableRevive"] call EFUNC(common,readSettingFromModule); diff --git a/addons/medical/functions/fnc_onWoundUpdateRequest.sqf b/addons/medical/functions/fnc_onWoundUpdateRequest.sqf index c160e47ea0..3c99496d7b 100644 --- a/addons/medical/functions/fnc_onWoundUpdateRequest.sqf +++ b/addons/medical/functions/fnc_onWoundUpdateRequest.sqf @@ -1,11 +1,10 @@ /* * Author: Glowbal - * Enabled the vitals loop for a unit. + * Handles an wound update request. * * Arguments: * 0: The Unit - * 1: the last known ID - * 2: Origin object + * 1: Origin object * * ReturnValue: * @@ -14,12 +13,11 @@ */ #include "script_component.hpp" -private ["_unit", "_lastId", "_openWounds"]; +private ["_unit", "_openWounds", "_originOfrequest"]; _unit = _this select 0; -_lastId = _this select 1; -_originOfrequest = _this select 2; +_originOfrequest = _this select 1; -if (local _unit) then { +if (local _unit && !(local _originOfrequest)) then { _openWounds = _unit getvariable [QGVAR(openWounds), []]; { ["medical_propagateWound", [_originOfrequest], [_unit, _x]] call EFUNC(common,targetEvent); diff --git a/addons/medical/functions/fnc_parseConfigForInjuries.sqf b/addons/medical/functions/fnc_parseConfigForInjuries.sqf index c624b1af1b..503ff9833e 100644 --- a/addons/medical/functions/fnc_parseConfigForInjuries.sqf +++ b/addons/medical/functions/fnc_parseConfigForInjuries.sqf @@ -12,7 +12,7 @@ #include "script_component.hpp" -private ["_injuriesRootConfig", "_woundsConfig", "_allWoundClasses", "_amountOf", "_entry","_classType", "_selections", "_bloodLoss", "_pain","_minDamage","_causes", "_damageTypesConfig", "_thresholds", "_typeThresholds", "_selectionSpecific", "_selectionSpecificType", "_classDisplayName", "_subClassDisplayName", "_maxDamage", "_subClassmaxDamage", "_defaultMinLethalDamage", "_minLethalDamage"]; +private ["_injuriesRootConfig", "_woundsConfig", "_allWoundClasses", "_amountOf", "_entry","_classType", "_selections", "_bloodLoss", "_pain","_minDamage","_causes", "_damageTypesConfig", "_thresholds", "_typeThresholds", "_selectionSpecific", "_selectionSpecificType", "_classDisplayName", "_subClassDisplayName", "_maxDamage", "_subClassmaxDamage", "_defaultMinLethalDamage", "_minLethalDamage", "_allFoundDamageTypes", "_classID", "_configDamageTypes", "_i", "_parseForSubClassWounds", "_subClass", "_subClassConfig", "_subClassbloodLoss", "_subClasscauses", "_subClassminDamage", "_subClasspain", "_subClassselections", "_subClasstype", "_type", "_varName", "_woundTypes"]; _injuriesRootConfig = (configFile >> "ACE_Medical_Advanced" >> "Injuries"); _allFoundDamageTypes = []; diff --git a/addons/medical/functions/fnc_playInjuredSound.sqf b/addons/medical/functions/fnc_playInjuredSound.sqf index 16a7d69116..c48e3d0a4c 100644 --- a/addons/medical/functions/fnc_playInjuredSound.sqf +++ b/addons/medical/functions/fnc_playInjuredSound.sqf @@ -15,7 +15,7 @@ #include "script_component.hpp" -private ["_unit","_amountOfDamage","_bodyPartStatus","_availableSounds_A","_availableSounds_B","_availableSounds_C","_sound"]; +private ["_unit","_availableSounds_A","_availableSounds_B","_availableSounds_C","_sound", "_pain"]; _unit = _this select 0; _pain = _this select 1; if (!local _unit || !GVAR(enableScreams)) exitwith{}; diff --git a/addons/medical/functions/fnc_requestWoundSync.sqf b/addons/medical/functions/fnc_requestWoundSync.sqf index bf6f881930..74fd3e230d 100644 --- a/addons/medical/functions/fnc_requestWoundSync.sqf +++ b/addons/medical/functions/fnc_requestWoundSync.sqf @@ -14,11 +14,11 @@ #include "script_component.hpp" -private [ "_target", "_caller", "_openWounds","_lastId"]; +private [ "_target", "_caller"]; _target = _this select 0; _caller = _this select 1; if (local _target || GVAR(level) < 2) exitwith {}; // if the target is local, we already got the most update to date information if (_target getvariable [QGVAR(isWoundSynced), false]) exitwith {}; _target setvariable [QGVAR(isWoundSynced), true]; -["medical_woundUpdateRequest", [_target], [_target, _lastId, _caller]] call EFUNC(common,targetEvent); +["medical_woundUpdateRequest", [_target], [_target, _caller]] call EFUNC(common,targetEvent); diff --git a/addons/medical/functions/fnc_setCardiacArrest.sqf b/addons/medical/functions/fnc_setCardiacArrest.sqf index cebf968898..b4483defc2 100644 --- a/addons/medical/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical/functions/fnc_setCardiacArrest.sqf @@ -33,7 +33,7 @@ _timeInCardiacArrest = 120 + round(random(600)); _startTime = _args select 1; _timeInCardiacArrest = _args select 2; - _heartRate = _unit getvariable [QGVAR(heartRate), 0]; + _heartRate = _unit getvariable [QGVAR(heartRate), 80]; if (_heartRate > 0 || !alive _unit) exitwith { [(_this select 1)] call cba_fnc_removePerFrameHandler; _unit setvariable [QGVAR(inCardiacArrest), nil,true]; diff --git a/addons/medical/functions/fnc_setDead.sqf b/addons/medical/functions/fnc_setDead.sqf index 334a2d8b97..411fd6dc06 100644 --- a/addons/medical/functions/fnc_setDead.sqf +++ b/addons/medical/functions/fnc_setDead.sqf @@ -13,7 +13,7 @@ #include "script_component.hpp" -private ["_unit", "_force"]; +private ["_unit", "_force", "_reviveVal", "_lifesLeft"]; _unit = _this select 0; _force = false; if (count _this >= 2) then { @@ -26,7 +26,8 @@ if (!local _unit) exitwith { false; }; -if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) && !_force) exitwith { +_reviveVal = _unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]; +if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal == 2)) && !_force) exitwith { if (_unit getvariable [QGVAR(inReviveState), false]) exitwith { if (GVAR(amountOfReviveLives) > 0) then { _lifesLeft = _unit getvariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)]; diff --git a/addons/medical/functions/fnc_setHitPointDamage.sqf b/addons/medical/functions/fnc_setHitPointDamage.sqf index d71edc94df..18d4fc616e 100644 --- a/addons/medical/functions/fnc_setHitPointDamage.sqf +++ b/addons/medical/functions/fnc_setHitPointDamage.sqf @@ -21,7 +21,7 @@ #define ARMDAMAGETRESHOLD1 1 #define ARMDAMAGETRESHOLD2 1.7 -private ["_unit", "_selection", "_damage", "_selections", "_damages", "_damageOld", "_damageSumOld", "_damageNew", "_damageSumNew", "_damageFinal"]; +private ["_unit", "_selection", "_damage", "_selections", "_damages", "_damageOld", "_damageSumOld", "_damageNew", "_damageSumNew", "_damageFinal", "_armdamage", "_legdamage"]; _unit = _this select 0; _selection = _this select 1; diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index 89ab5ee3b3..72d297b2c8 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -17,16 +17,19 @@ #define DEFAULT_DELAY (round(random(10)+5)) -private ["_unit", "_set", "_animState", "_originalPos", "_captiveSwitch", "_startingTime","_minWaitingTime"]; +private ["_unit", "_set", "_animState", "_originalPos", "_startingTime","_minWaitingTime"]; _unit = _this select 0; _set = if (count _this > 1) then {_this select 1} else {true}; _minWaitingTime = if (count _this > 2) then {_this select 2} else {DEFAULT_DELAY}; +// No change, fuck off. (why is there no xor?) +if (_set isEqualTo (_unit getVariable ["ACE_isUnconscious", false])) exitWith {}; + if !(_set) exitwith { - _unit setvariable ["ACE_isUnconscious", false,true]; + _unit setvariable ["ACE_isUnconscious", false, true]; }; -if !(!(isNull _unit) && {(_unit isKindOf "CaManBase") && ([_unit] call EFUNC(common,isAwake))}) exitwith{}; +if !(!(isNull _unit) && {(_unit isKindOf "CAManBase") && ([_unit] call EFUNC(common,isAwake))}) exitwith{}; if (!local _unit) exitwith { [[_unit], QUOTE(DFUNC(setUnconscious)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ @@ -37,15 +40,23 @@ _unit setUnconscious true; if (_unit == ACE_player) then { if (visibleMap) then {openMap false}; - closeDialog 0; + while {dialog} do { + closeDialog 0; + }; +}; + +// if we have unconsciousness for AI disabled, we will kill the unit instead +if !([_unit] call EFUNC(common,isPlayer)) then { + _enableUncon = _unit getVariable [QGVAR(enableUnconsciousnessAI), GVAR(enableUnconsciousnessAI)]; + if (_enableUncon == 0 or {_enableUncon == 1 and (random 1) < 0.5}) exitWith { + [_unit, true] call FUNC(setDead); + }; }; // If a unit has the launcher out, it will sometimes start selecting the primairy weapon while unconscious, // therefor we force it to select the primairy weapon before going unconscious if ((vehicle _unit) isKindOf "StaticWeapon") then { - moveOut _unit; - unassignVehicle _unit; - //_unit action ["eject", vehicle _unit]; + [_unit] call EFUNC(common,unloadPerson); }; if (animationState _unit in ["ladderriflestatic","laddercivilstatic"]) then { _unit action ["ladderOff", (nearestBuilding _unit)]; @@ -55,12 +66,14 @@ if (vehicle _unit == _unit) then { _unit addWeapon "ACE_FakePrimaryWeapon"; }; _unit selectWeapon (primaryWeapon _unit); - _unit switchMove ""; - _unit playmoveNow ""; }; // We are storing the current animation, so we can use it later on when waking the unit up inside a vehicle -_animState = animationState _unit; +if (vehicle _unit != _unit) then { + _unit setVariable [QGVAR(vehicleAwakeAnim), [(vehicle _unit), (animationState _unit)]]; +}; + +//Save current stance: _originalPos = unitPos _unit; _unit setUnitPos "DOWN"; @@ -68,73 +81,26 @@ _unit setUnitPos "DOWN"; // So the AI does not get stuck, we are moving the unit to a temp group on its own. //Unconscious units shouldn't be put in another group #527: -// [_unit, true, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide); +if (GVAR(moveUnitsFromGroupOnUnconscious)) then { + [_unit, true, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide); +}; [_unit, QGVAR(unconscious), true] call EFUNC(common,setCaptivityStatus); -[_unit, [_unit] call EFUNC(common,getDeathAnim), 1, true] call EFUNC(common,doAnimation); +_anim = [_unit] call EFUNC(common,getDeathAnim); +[_unit, _anim, 1, true] call EFUNC(common,doAnimation); +[{ + _unit = _this select 0; + _anim = _this select 1; + if ((_unit getVariable "ACE_isUnconscious") and (animationState _unit != _anim)) then { + [_unit, _anim, 2, true] call EFUNC(common,doAnimation); + }; +}, [_unit, _anim], 0.5, 0] call EFUNC(common,waitAndExecute); _startingTime = time; -[{ - private ["_unit", "_vehicleOfUnit","_minWaitingTime", "_oldAnimation", "_captiveSwitch", "_hasMovedOut"]; - _args = _this select 0; - _unit = _args select 0; - _oldAnimation = _args select 1; - _originalPos = _args select 2; - _startingTime = _args select 3; - _minWaitingTime = _args select 4; - _hasMovedOut = _args select 5; +[DFUNC(unconsciousPFH), 0.1, [_unit, _originalPos, _startingTime, _minWaitingTime, false, vehicle _unit isKindOf "ParachuteBase"] ] call CBA_fnc_addPerFrameHandler; - if (!alive _unit) exitwith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; - - // In case the unit is no longer in an unconscious state, we are going to check if we can already reset the animation - if !(_unit getvariable ["ACE_isUnconscious",false]) exitwith { - - // TODO, handle this with carry instead, so we can remove the PFH here. - // Wait until the unit isn't being carried anymore, so we won't end up with wierd animations - if !(([_unit] call FUNC(isBeingCarried)) || ([_unit] call FUNC(isBeingDragged))) then { - if (vehicle _unit == _unit) then { - if (animationState _unit == "AinjPpneMstpSnonWrflDnon") then { - [_unit,"AinjPpneMstpSnonWrflDnon_rolltofront", 2] call EFUNC(common,doAnimation); - [_unit,"amovppnemstpsnonwnondnon", 1] call EFUNC(common,doAnimation); - } else { - [_unit,"amovppnemstpsnonwnondnon", 2] call EFUNC(common,doAnimation); - }; - } else { - // Switch to the units original animation, assuming - // TODO: what if the unit switched vehicle? - [_unit, _oldAnimation, 2] call EFUNC(common,doAnimation); - }; - // EXIT PFH - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; - if (!_hasMovedOut) then { - // Reset the unit back to the previous captive state. - [_unit, QGVAR(unconscious), false] call EFUNC(common,setCaptivityStatus); - - // Swhich the unit back to its original group - //Unconscious units shouldn't be put in another group #527: - // [_unit, false, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide); - - [_unit, false] call EFUNC(common,disableAI); - _unit setUnitPos _originalPos; // This is not position but stance (DOWN, MIDDLE, UP) - - _unit setUnconscious false; - ["medical_onUnconscious", [_unit, false]] call EFUNC(common,globalEvent); - // ensure this statement runs only once - _args set [5, true]; - }; - }; - - // Ensure we are waiting at least a minimum period before checking if we can wake up the unit again, allows for temp knock outs - if ((time - _startingTime) >= _minWaitingTime) exitwith { - - if (!([_unit] call FUNC(getUnconsciousCondition))) then { - _unit setvariable ["ACE_isUnconscious", false, true]; - }; - }; -}, 0.1, [_unit,_animState, _originalPos, _startingTime, _minWaitingTime, false] ] call CBA_fnc_addPerFrameHandler; +// unconscious can't talk +[_unit, "isUnconscious"] call EFUNC(common,muteUnit); ["medical_onUnconscious", [_unit, true]] call EFUNC(common,globalEvent); diff --git a/addons/medical/functions/fnc_treatment.sqf b/addons/medical/functions/fnc_treatment.sqf index e010279be1..f50ff505e0 100644 --- a/addons/medical/functions/fnc_treatment.sqf +++ b/addons/medical/functions/fnc_treatment.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_caller", "_target", "_selectionName", "_className", "_config", "_availableLevels", "_medicRequired", "_items", "_locations", "_return", "_callbackSuccess", "_callbackFailure", "_callbackProgress", "_treatmentTime", "_callerAnim", "_patientAnim", "_iconDisplayed", "_return", "_usersOfItems", "_consumeItems"]; +private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_callbackProgress", "_treatmentTime", "_callerAnim", "_patientAnim", "_iconDisplayed", "_return", "_usersOfItems", "_consumeItems", "_condition", "_displayText", "_wpn"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; @@ -129,7 +129,7 @@ if (isNil _callbackProgress) then { // Patient Animation _patientAnim = getText (_config >> "animationPatient"); -if (_target getvariable ["ACE_isUnconscious", false]) then { +if (_target getvariable ["ACE_isUnconscious", false] && GVAR(allowUnconsciousAnimationOnTreatment)) then { if !(animationState _target in (getArray (_config >> "animationPatientUnconsciousExcludeOn"))) then { _patientAnim = getText (_config >> "animationPatientUnconscious"); }; @@ -149,6 +149,8 @@ if (_caller == _target) then { _callerAnim = [getText (_config >> "animationCallerSelf"), getText (_config >> "animationCallerSelfProne")] select (stance _caller == "PRONE"); }; +_caller setvariable [QGVAR(selectedWeaponOnTreatment), currentWeapon _caller]; + // Cannot use secondairy weapon for animation if (currentWeapon _caller == secondaryWeapon _caller) then { _caller selectWeapon (primaryWeapon _caller); diff --git a/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf b/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf index ee3f51f549..0a49420783 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_caller", "_target", "_selectionName", "_className", "_items", "_removeItem"]; +private ["_caller", "_target", "_selectionName", "_className", "_items"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf index 146e996d25..394595ade3 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf @@ -17,7 +17,7 @@ #include "script_component.hpp" -private ["_caller", "_target", "_selectionName", "_className", "_items", "_removeItem"]; +private ["_caller", "_target", "_selectionName", "_className", "_items", "_specificSpot"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; @@ -37,6 +37,6 @@ if !([_target] call FUNC(hasMedicalEnabled)) exitwith { }; }foreach _items;*/ -[_target, "activity", "STR_ACE_MEDICAL_ACTIVITY_bandagedPatient", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity", "STR_ACE_Medical_Activity_bandagedPatient", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index 217a69cd4d..d6c490d3c6 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -15,7 +15,7 @@ #include "script_component.hpp" -private ["_target", "_bandage", "_part", "_selectionName", "_openWounds", "_config", "_effectiveness","_mostEffectiveInjury", "_mostEffectiveSpot", "_woundEffectivenss", "_mostEffectiveInjury", "_impact", "_exit"]; +private ["_target", "_bandage", "_part", "_selectionName", "_openWounds", "_config", "_effectiveness","_mostEffectiveInjury", "_mostEffectiveSpot", "_woundEffectivenss", "_mostEffectiveInjury", "_impact", "_exit", "_specificClass", "_classID", "_effectivenessFound", "_className", "_hitPoints", "_hitSelections", "_point", "_woundTreatmentConfig"]; _target = _this select 0; _bandage = _this select 1; _selectionName = _this select 2; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf index 807be828e8..37627a8c5d 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf @@ -10,7 +10,7 @@ #include "script_component.hpp" -private ["_unit", "_caller", "_selectionName", "_className", "_items"]; +private ["_target", "_caller", "_selectionName", "_className", "_items"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf index 77f6d7f44c..e385c5f7c0 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf @@ -55,7 +55,7 @@ if (alive _target) exitwith { _target setvariable [QGVAR(inCardiacArrest), false, true]; _target setvariable [QGVAR(inReviveState), false, true]; _target setVariable ["ACE_isUnconscious", false, true]; - _target setvariable [QGVAR(hasLostBlood), false, true]; + _target setvariable [QGVAR(hasLostBlood), 0, true]; _target setvariable [QGVAR(isBleeding), false, true]; _target setvariable [QGVAR(hasPain), false, true]; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf index 508040b8af..c6ac2dc8e5 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf @@ -17,7 +17,7 @@ #include "script_component.hpp" -private ["_caller", "_target", "_selectionName", "_className", "_items", "_removeItem"]; +private ["_caller", "_target", "_selectionName", "_className", "_items"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; @@ -32,6 +32,6 @@ _items = _this select 4; }; }foreach _items; -[_target, "activity", "STR_ACE_MEDICAL_ACTIVITY_usedItem", [[_caller] call EFUNC(common,getName), _className]] call FUNC(addToLog); +[_target, "activity", "STR_ACE_Medical_Activity_usedItem", [[_caller] call EFUNC(common,getName), _className]] call FUNC(addToLog); true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf index bbf5aea6c0..934bc9239a 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf @@ -15,7 +15,7 @@ #include "script_component.hpp" -private ["_target", "_className", "_currentInSystem", "_medicationConfig", "_painReduce", "_hrIncreaseLow", "_hrIncreaseNorm", "_hrIncreaseHigh", "_maxDose", "_inCompatableMedication", "_timeInSystem", "_heartRate", "_pain", "_resistance", "_hrCallback"]; +private ["_target", "_className", "_currentInSystem", "_medicationConfig", "_painReduce", "_hrIncreaseLow", "_hrIncreaseNorm", "_hrIncreaseHigh", "_maxDose", "_inCompatableMedication", "_timeInSystem", "_heartRate", "_pain", "_resistance", "_hrCallback", "_varName", "_viscosityChange"]; _target = _this select 0; _className = _this select 1; @@ -77,9 +77,9 @@ if (_painReduce > 0) then { _target setvariable [QGVAR(pain), (_pain - (_pain * _painReduce)) max 0]; }; -_resistance = _unit getvariable [QGVAR(peripheralResistance), 100]; +_resistance = _target getvariable [QGVAR(peripheralResistance), 100]; _resistance = _resistance + _viscosityChange; -_unit setvariable [QGVAR(peripheralResistance), _resistance max 0]; +_target setvariable [QGVAR(peripheralResistance), _resistance max 0]; // Call back to ensure that the medication is decreased over time [_target, _classname, _varName, _maxDose, _timeInSystem, _inCompatableMedication, _viscosityChange] call FUNC(onMedicationUsage); diff --git a/addons/medical/functions/fnc_treatmentBasic_bandage.sqf b/addons/medical/functions/fnc_treatmentBasic_bandage.sqf index 4b07e989aa..75b0b6bfdd 100644 --- a/addons/medical/functions/fnc_treatmentBasic_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_bandage.sqf @@ -17,7 +17,7 @@ #include "script_component.hpp" #define BANDAGEHEAL 0.8 -private ["_caller", "_target","_selection","_className","_target","_hitSelections","_hitPoints","_point"]; +private ["_caller", "_target","_selection","_className","_target","_hitSelections","_hitPoints","_point", "_damage"]; _caller = _this select 0; _target = _this select 1; _selection = _this select 2; diff --git a/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf b/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf index 57563ad8fc..9d2c12280d 100644 --- a/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf @@ -15,12 +15,9 @@ */ #include "script_component.hpp" -#define BLOODBAGHEAL 70 -private ["_caller", "_target","_className","_blood"]; +private ["_caller", "_target"]; _caller = _this select 0; _target = _this select 1; -_className = _this select 3; -_blood = ((_target getVariable [QGVAR(bloodVolume), 100]) + BLOODBAGHEAL) min 100; -_target setVariable [QGVAR(bloodVolume), _blood, true]; +[[_target], QUOTE(DFUNC(treatmentBasic_bloodbagLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_treatmentBasic_bloodbagLocal.sqf b/addons/medical/functions/fnc_treatmentBasic_bloodbagLocal.sqf new file mode 100644 index 0000000000..9bbe04b35f --- /dev/null +++ b/addons/medical/functions/fnc_treatmentBasic_bloodbagLocal.sqf @@ -0,0 +1,21 @@ +/* + * Author: KoffeinFlummi + * Local callback when the bloodbag treatment is complete + * + * Arguments: + * 0: The patient + * + * Return Value: + * nil + * + * Public: No + */ + +#include "script_component.hpp" +#define BLOODBAGHEAL 70 + +private ["_target","_blood"]; +_target = _this select 0; + +_blood = ((_target getVariable [QGVAR(bloodVolume), 100]) + BLOODBAGHEAL) min 100; +_target setVariable [QGVAR(bloodVolume), _blood, true]; diff --git a/addons/medical/functions/fnc_treatmentBasic_morphine.sqf b/addons/medical/functions/fnc_treatmentBasic_morphine.sqf index d8d793d0bc..048b314781 100644 --- a/addons/medical/functions/fnc_treatmentBasic_morphine.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_morphine.sqf @@ -17,15 +17,8 @@ #include "script_component.hpp" #define MORPHINEHEAL 0.4 -private ["_caller", "_target","_className","_blood","_morphine","_pain"]; +private ["_caller", "_target"]; _caller = _this select 0; _target = _this select 1; -_className = _this select 3; -// reduce pain, pain sensitivity -_morphine = ((_target getVariable [QGVAR(morphine), 0]) + MORPHINEHEAL) min 1; -_target setVariable [QGVAR(morphine), _morphine, true]; -_pain = ((_target getVariable [QGVAR(pain), 0]) - MORPHINEHEAL) max 0; -_target setVariable [QGVAR(pain), _pain, true]; - -// @todo overdose +[[_target], QUOTE(DFUNC(treatmentBasic_morphineLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_treatmentBasic_morphineLocal.sqf b/addons/medical/functions/fnc_treatmentBasic_morphineLocal.sqf new file mode 100644 index 0000000000..9dddf743e2 --- /dev/null +++ b/addons/medical/functions/fnc_treatmentBasic_morphineLocal.sqf @@ -0,0 +1,27 @@ +/* + * Author: KoffeinFlummi + * Local callback when the morphine treatment is complete + * + * Arguments: + * 0: The medic + * 1: The patient + * + * Return Value: + * nil + * + * Public: No + */ + +#include "script_component.hpp" +#define MORPHINEHEAL 0.4 + +private ["_target", "_morphine", "_pain"]; +_target = _this select 0; + +// reduce pain, pain sensitivity +_morphine = ((_target getVariable [QGVAR(morphine), 0]) + MORPHINEHEAL) min 1; +_target setVariable [QGVAR(morphine), _morphine, true]; +_pain = ((_target getVariable [QGVAR(pain), 0]) - MORPHINEHEAL) max 0; +_target setVariable [QGVAR(pain), _pain, true]; + +// @todo overdose diff --git a/addons/medical/functions/fnc_treatmentIV.sqf b/addons/medical/functions/fnc_treatmentIV.sqf index c171d7364f..c0f4e4681f 100644 --- a/addons/medical/functions/fnc_treatmentIV.sqf +++ b/addons/medical/functions/fnc_treatmentIV.sqf @@ -17,7 +17,7 @@ #include "script_component.hpp" -private ["_caller", "_target", "_selectionName", "_className", "_items", "_removeItem", "_attributes"]; +private ["_caller", "_target", "_selectionName", "_className", "_items", "_removeItem"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; @@ -29,4 +29,4 @@ if (count _items == 0) exitwith {}; _removeItem = _items select 0; [[_target, _removeItem], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [_target, _removeItem] call FUNC(addToTriageCard); -[_target, "activity", "STR_ACE_MEDICAL_ACTIVITY_gaveIV", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity", "STR_ACE_Medical_Activity_gaveIV", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); diff --git a/addons/medical/functions/fnc_treatmentIVLocal.sqf b/addons/medical/functions/fnc_treatmentIVLocal.sqf index 66ecdf9d90..04708b965f 100644 --- a/addons/medical/functions/fnc_treatmentIVLocal.sqf +++ b/addons/medical/functions/fnc_treatmentIVLocal.sqf @@ -15,7 +15,7 @@ #include "script_component.hpp" -private ["_target", "_ivItem", "_config", "_volumeAdded", "_typeOf", "_varName"]; +private ["_target", "_ivItem", "_config", "_volumeAdded", "_typeOf", "_varName", "_bloodVolume"]; _target = _this select 0; _ivItem = _this select 1; @@ -27,8 +27,8 @@ _config = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "IV"); _volumeAdded = getNumber (_config >> "volume"); _typeOf = getText (_config >> "type"); -if (isClass (_config >> _className)) then { - _config = (_config >> _className); +if (isClass (_config >> _ivItem)) then { + _config = (_config >> _ivItem); if (isNumber (_config >> "volume")) then { _volumeAdded = getNumber (_config >> "volume");}; if (isText (_config >> "type")) then { _typeOf = getText (_config >> "type"); }; }; diff --git a/addons/medical/functions/fnc_treatmentTourniquet.sqf b/addons/medical/functions/fnc_treatmentTourniquet.sqf index cff9458426..c4ee10011e 100644 --- a/addons/medical/functions/fnc_treatmentTourniquet.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquet.sqf @@ -17,7 +17,7 @@ #include "script_component.hpp" -private ["_caller","_target","_part","_selectionName","_removeItem", "_tourniquets", "_items", "_output"]; +private ["_caller","_target","_part","_selectionName","_removeItem", "_tourniquets", "_items", "_output", "_className"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; @@ -40,10 +40,10 @@ if ((_tourniquets select _part) > 0) exitwith { }; _removeItem = _items select 0; -[[_target, _removeItem], QUOTE(DFUNC(treatmentTourniquetLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ +[[_target, _removeItem, _selectionName], QUOTE(DFUNC(treatmentTourniquetLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [_target, _removeItem] call FUNC(addToTriageCard); -[_target, "activity", "STR_ACE_MEDICAL_ACTIVITY_appliedTourniquet", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity", "STR_ACE_Medical_Activity_appliedTourniquet", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); true; diff --git a/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf b/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf index 064761aea0..02484bbca6 100644 --- a/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf @@ -13,15 +13,13 @@ */ #include "script_component.hpp" -private ["_target", "_tourniquetItem", "_part", "_tourniquets", "_applyingTo"]; +private ["_target", "_tourniquetItem", "_part", "_tourniquets", "_applyingTo", "_selectionName"]; _target = _this select 0; _tourniquetItem = _this select 1; +_selectionName = _this select 2; -//[_target,"treatment",format["%1 applied a tourniquet on %2",[_caller] call EFUNC(common,getName),_selectionName]] call FUNC(addActivityToLog); -//[_target,_removeItem] call FUNC(addToTriageList); [_target] call FUNC(addToInjuredCollection); - _part = [_selectionName] call FUNC(selectionNameToNumber); // Place a tourniquet on the bodypart @@ -31,7 +29,7 @@ _tourniquets set[_part, _applyingTo]; _target setvariable [QGVAR(tourniquets), _tourniquets, true]; [{ - private ["_args","_target","_applyingTo","_part", "_tourniquets"]; + private ["_args","_target","_applyingTo","_part", "_tourniquets", "_time"]; _args = _this select 0; _target = _args select 0; _applyingTo = _args select 1; diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index d4f853374c..c329bf724c 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -17,7 +17,7 @@ #include "script_component.hpp" -private ["_caller", "_target","_selectionName","_className","_config","_callback", "_usersOfItems"]; +private ["_args", "_caller", "_target","_selectionName","_className","_config","_callback", "_usersOfItems", "_weaponSelect"]; _args = _this select 0; _caller = _args select 0; @@ -34,6 +34,13 @@ if (vehicle _caller == _caller) then { }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; +_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnTreatment), ""]); +if (_weaponSelect != "") then { + _caller selectWeapon _weaponSelect; +} else { + _caller action ["SwitchWeapon", _caller, _caller, 99]; +}; + { (_x select 0) addItem (_x select 1); }foreach _usersOfItems; diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index 5910a4be86..0178ea78fd 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -17,7 +17,7 @@ #include "script_component.hpp" -private ["_caller", "_target","_selectionName","_className","_config","_callback"]; +private ["_args", "_caller", "_target","_selectionName","_className","_config","_callback", "_weaponSelect"]; _args = _this select 0; _caller = _args select 0; _target = _args select 1; @@ -32,6 +32,13 @@ if (vehicle _caller == _caller) then { }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; +_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnTreatment), ""]); +if (_weaponSelect != "") then { + _caller selectWeapon _weaponSelect; +} else { + _caller action ["SwitchWeapon", _caller, _caller, 99]; +}; + // Record specific callback _config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className); if (GVAR(level) >= 2) then { diff --git a/addons/medical/functions/fnc_unconsciousPFH.sqf b/addons/medical/functions/fnc_unconsciousPFH.sqf new file mode 100644 index 0000000000..f0759a66ba --- /dev/null +++ b/addons/medical/functions/fnc_unconsciousPFH.sqf @@ -0,0 +1,134 @@ +/* + * Author: Glowbal + * PFH logic for unconscious state + * + * Arguments: + * 0: PFEH - Args + * 0: The unit that will be put in an unconscious state + * 1: unitPos (stance) + * 2: Starting Time + * 3: Minimum Waiting Time + * 4: Has Moved Out + * 5: Parachute Check + * 1: PFEH ID + * + * ReturnValue: + * nil + * + * Public: yes + */ + +#include "script_component.hpp" + +private ["_unit", "_minWaitingTime", "_slotInfo", "_hasMovedOut", "_parachuteCheck", "_args", "_originalPos", "_startingTime", "_awakeInVehicleAnimation", "_oldVehicleAnimation", "_vehicle"]; +_args = _this select 0; +_unit = _args select 0; +_originalPos = _args select 1; +_startingTime = _args select 2; +_minWaitingTime = _args select 3; +_hasMovedOut = _args select 4; +_parachuteCheck = _args select 5; + +if (!alive _unit) exitwith { + if (GVAR(moveUnitsFromGroupOnUnconscious)) then { + [_unit, false, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide); + }; + [_unit, QGVAR(unconscious), false] call EFUNC(common,setCaptivityStatus); + [_unit, false] call EFUNC(common,disableAI); + //_unit setUnitPos _originalPos; + _unit setUnconscious false; + + [_unit, "isUnconscious"] call EFUNC(common,unmuteUnit); + ["medical_onUnconscious", [_unit, false]] call EFUNC(common,globalEvent); + + [(_this select 1)] call cba_fnc_removePerFrameHandler; +}; + +// In case the unit is no longer in an unconscious state, we are going to check if we can already reset the animation +if !(_unit getvariable ["ACE_isUnconscious",false]) exitwith { + // TODO, handle this with carry instead, so we can remove the PFH here. + // Wait until the unit isn't being carried anymore, so we won't end up with wierd animations + if !(([_unit] call FUNC(isBeingCarried)) || ([_unit] call FUNC(isBeingDragged))) then { + if (vehicle _unit == _unit) then { + if (animationState _unit == "AinjPpneMstpSnonWrflDnon") then { + [_unit,"AinjPpneMstpSnonWrflDnon_rolltofront", 2] call EFUNC(common,doAnimation); + [_unit,"amovppnemstpsnonwnondnon", 1] call EFUNC(common,doAnimation); + } else { + [_unit,"amovppnemstpsnonwnondnon", 2] call EFUNC(common,doAnimation); + }; + } else { + _vehicle = vehicle _unit; + _oldVehicleAnimation = _unit getVariable [QGVAR(vehicleAwakeAnim), []]; + _awakeInVehicleAnimation = ""; + if (((count _oldVehicleAnimation) > 0) && {(_oldVehicleAnimation select 0) == _vehicle}) then { + _awakeInVehicleAnimation = _oldVehicleAnimation select 1; + }; + //Make sure we have a valid, non-terminal animation: + if ((_awakeInVehicleAnimation != "") && {(getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> _awakeInVehicleAnimation >> "terminal")) == 0}) then { + [_unit, _awakeInVehicleAnimation, 2] call EFUNC(common,doAnimation); + } else { + //Don't have a valid animation saved, reset the unit animation with a moveInXXX + TRACE_1("No Valid Animation, doing seat reset", _awakeInVehicleAnimation); + _slotInfo = []; + {if ((_x select 0) == _unit) exitWith {_slotInfo = _x;};} forEach (fullCrew _vehicle); + if (_slotInfo isEqualTo []) exitWith {ERROR("No _slotInfo?");}; + //Move the unit out: + _unit setPosASL ((getPosASL _unit) vectorAdd [0,0,100]); + //Move the unit back into old seat: + if ((_slotInfo select 1) == "driver") then { + _unit moveInDriver _vehicle; + } else { + if ((_slotInfo select 1) == "cargo") then { + _unit moveInCargo [_vehicle, (_slotInfo select 2)]; + } else { + _unit moveInTurret [_vehicle, (_slotInfo select 3)]; + }; + }; + }; + }; + _unit setVariable [QGVAR(vehicleAwakeAnim), nil]; + + ["medical_onUnconscious", [_unit, false]] call EFUNC(common,globalEvent); + // EXIT PFH + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + if (!_hasMovedOut) then { + // Reset the unit back to the previous captive state. + [_unit, QGVAR(unconscious), false] call EFUNC(common,setCaptivityStatus); + + // Swhich the unit back to its original group + //Unconscious units shouldn't be put in another group #527: + if (GVAR(moveUnitsFromGroupOnUnconscious)) then { + [_unit, false, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide); + }; + [_unit, false] call EFUNC(common,disableAI); + _unit setUnitPos _originalPos; // This is not position but stance (DOWN, MIDDLE, UP) + + _unit setUnconscious false; + + [_unit, "isUnconscious"] call EFUNC(common,unmuteUnit); + + // ensure this statement runs only once + _args set [4, true]; + }; +}; + +if (_parachuteCheck) then { + if !(vehicle _unit isKindOf "ParachuteBase") then { + [_unit, [_unit] call EFUNC(common,getDeathAnim), 1, true] call EFUNC(common,doAnimation); + _args set [5, false]; + }; +}; + +if (!local _unit) exitwith { + _args set [3, _minWaitingTime - (time - _startingTime)]; + _unit setvariable [QGVAR(unconsciousArguments), _args, true]; + [(_this select 1)] call cba_fnc_removePerFrameHandler; +}; + +// Ensure we are waiting at least a minimum period before checking if we can wake up the unit again, allows for temp knock outs +if ((time - _startingTime) >= _minWaitingTime) exitwith { + if (!([_unit] call FUNC(getUnconsciousCondition))) then { + _unit setvariable ["ACE_isUnconscious", false, true]; + }; +}; diff --git a/addons/medical/sounds/Inject.ogg b/addons/medical/sounds/Inject.ogg new file mode 100644 index 0000000000..8418078e0f Binary files /dev/null and b/addons/medical/sounds/Inject.ogg differ diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 145c14b264..fdc62a427a 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1,6 +1,50 @@  + + INJURIES + VERLETZUNGEN + LESIONI + ТРАВМЫ + BLESSURES + OBRAŻENIA + HERIDAS + SÉRÜLÉSEK + ZRANĚNÍ + + + No injuries on this bodypart ... + Körperteil nicht verletzt ... + Non ci sono lesioni in questa parte del corpo ... + Данная часть тела не повреждена ... + Aucune blessures sur cette partie du corps ... + Brak obrażeń na tej części ciała ... + Sin heridas en esta parte del cuerpo ... + Ezen a testrészen nincs sérülés ... + Žádné zranění na této části těla ... + + + Litter Simulation Detail + Detale zużytych medykamentów + Detalle de simulación de basura + Количество мусора от медицины + Dettagli Simulazione Rifiuti + Niveau de simulation des détritus + Abfall-Detaillevel + Hulladékszimuláció részletessége + Úroveň počtu zobrazených předmětů z použitých léků + + + Litter simulation detail level sets the number of litter items which will be locally spawned in the client. Excessive amounts in local areas could cause FPS lag, so this is a client only setting. + Opcja ta ustawia liczbę zużytych medykamentów, jakie pojawiają się lokalnie wokół gracza. Ich zbyt duża ilość może spowodować spadki FPS, dlatego jest to ustawienie tylko po stronie klienta. + Detalle simulación de basura establece el número de artículos de basura que se generan a nivel local en el cliente. Las cantidades excesivas en áreas locales podrían causar caída de rendimiento, así que esto es un ajuste de cliente únicamente. + Устанавливает количество мусора, который появляется после использования мед. препаратов. Большое количество мусора может уменьшить производительность, поэтому данная настройка локальна для клиента. + Il livello di dettagli della simulazione dei rifiuti indica il numero di rifiuti che verranno creati localmente nel client. La creazione di troppi rifiuti in aree locali potrebbe causare lag e calo di FPS. Questo è un settaggio client. + Le niveau de simulation des détritus règle la quantité de déchets qui vont être créés localement chez le client. Des quantitées excessive chez certains clients peuvent causer des chutes de FPS, c'est donc une option client uniquement. + Die Einstellung für das Abfall-Detaillevel stellt die Menge der lokal erzeugten medizinischen Abfälle ein. Zuviel erzeugte Abfälle können FPS-Lags erzeugen, deswegen ist diese Einstellung nur clientseitig. + A hulladékszimuláció részletessége megszabja a kliens által megjelenített hulladékobjektumok mennyiségét. Súlyos mennyiségek izolált területeken alacsony FPS-t okozhatnak, így ez egy kliensoldali beállítás. + Úroveň počtu zobrazených předmětů z použitých léků ovlivňuje počet objektů, které budou zobrazeny klientovi . Vyšší množství objektů může způsobovat poklesy FPS a proto je toto nastavení čistě na klientovi. + Inject Atropine Atropin injizieren @@ -9,6 +53,9 @@ Wstrzyknij atropinę Injecter de l'atropine Ввести атропин + Atropin beadása + Inietta atropina + Injetar Atropina Inject Epinephrine @@ -18,10 +65,9 @@ Aplikovat adrenalin Injecter de l'épinéphrine Ввести адреналин - Adrénaline - Adrenalin + Epinefrin beadása Injetar Epinefrina - Inietta Epinefrina + Inietta epinefrina Inject Morphine @@ -30,8 +76,8 @@ Wstrzyknij morfinę Aplikovat morfin Ввести морфин - Morphine - Morfium + Injecter de la morphine + Morfium beadása Injetar Morfina Inietta Morfina @@ -43,44 +89,51 @@ Transfúze krve Перелить кровь Transfusion - Infúzió + Infúzió (vér) Transfundir Sangue - Effettua Trasfusione + Effettua trasfusione di sangue Transfuse Plasma - Plasma Plasmatransfusion Transfundir plasma Transfúze plazmy Przetocz osocze Transfuser du Plasma Перелить плазму + Infúzió (vérplazma) + Effettua trasfusione di plasma + Transfundir Plasma Transfuse Saline - Solution Saline Salzlösungtransfusion Transfundir salino Transfúze fyziologický roztoku - Przetocz solankę - Transfuser de la Saline + Przetocz sól fizjologiczną + Transfuser de la solution saline Перелить физраствор + Infúzió (sós víz) + Effettua trasfusione di soluzione salina + Transfundir Soro Apply Tourniquet - Garrot - Aderpresse anwenden + Tourniquet anwenden Aplicar torniquete Aplikovat škrtidlo Załóż stazę Appliquer un garrot + Наложить жгут + Applica laccio emostatico + Aplicar Torniquete + Érszorító alkalmazása Bandage Verbinden Venda - Bandaż + Bandażuj Obvázat Pansement Benda @@ -108,7 +161,7 @@ Obvázat hruď Перевязать торс Pansement Torse - Felsőtest kötözése + Testtörzs kötözése Atar Tronco Benda il torso @@ -166,9 +219,9 @@ Inyectando Morfina ... Wstrzykiwanie morfiny ... Aplikuji morfin ... - Введение морфина... + Введение морфина ... Injection de Morphine... - Morfium beadása... + Morfium beadása ... Injetando Morfina ... Inietto la morfina ... @@ -178,21 +231,23 @@ Inyectando Epinefrina ... Wstrzykiwanie adrenaliny ... Aplikuji adrenalin ... - Введение адреналина... + Введение адреналина ... Injection d'Adrénaline ... - Adrenalin beadása... + Epinefrin beadása ... Injetando Epinefrina ... Inietto l'epinefrina ... Injecting Atropine ... - Injection d'Atropine ... Atropin injizieren ... Inyectando Atropina ... Aplikuji atropin ... Wstrzykiwanie atropiny ... Injection d'Atropine ... - Введение атропина... + Введение атропина ... + Atropin beadása ... + Inietto l'atropina ... + Injetando Atropina Transfusing Blood ... @@ -200,31 +255,35 @@ Transfusión de sangre ... Przetaczanie krwi ... Probíhá transfúze krve ... - Переливание крови... + Переливание крови ... Transfusion Sanguine ... - Infúzió... + Infúzió vérrel ... Transfundindo Sangue ... - Effettuo la trasfusione ... + Effettuo la trasfusione di sangue ... Transfusing Saline ... - Transfusion de Solution Saline Sallösungtransfusion ... Transfusión de salino ... Probíha transfúze fyziologický roztoku ... - Przetaczanie solanki ... + Przetaczanie soli fizjologicznej ... Transfusion de saline ... - Переливание физраствора... + Переливание физраствора ... + Infúzió sós vizzel ... + Effettuo la rasfusione di salina + Transfundindo Soro... Transfusing Plasma ... - Transfusion de Plasma Plasmatransfusion ... Transfusión de plasma ... Probíha transfúze plazmy ... Przetaczanie osocza ... Transfusion de Plasma ... - Переливание плазмы... + Переливание плазмы ... + Infúzió vérplazmával ... + Effettu la trasfusione di plasma ... + Transfundindo Plasma... Bandaging ... @@ -234,20 +293,23 @@ Obvazuji ... Pansement ... Sto applicando la benda ... - Bekötözés... + Bekötözés ... Atando ... - Перевязывание... + Перевязывание ... Applying Tourniquet ... - Setze Aderpresse an ... + Setze Tourniquet an ... Aplicando torniquete ... Aplikuji škrtidlo Zakładanie stazy ... Mise en place du Garrot ... - Наложение жгута... + Наложение жгута ... + Érszorító felhelyezése ... + Sto applicando il laccio emostatico ... + Applicando Torniquete - + Medical Zdravotní Médical @@ -257,8 +319,9 @@ Médico Медик Médico + Orvosi - + Field Dressing Verbandpäckchen Compresa de campaña @@ -266,15 +329,22 @@ Obinadlo Bandaż jałowy Bandage rapide + Zárókötszer + Bendaggio rapido + Curativo de Campo - + Packing Bandage Mullbinde Vendaje compresivo Компресионный пакет Bandaż uciskowy + Nyomókötszer + Bendaggio compressivo + Bandage gauze + Bandagem de Compressão - + Elastic Bandage Elastischer Verband Vendaje elástico @@ -282,226 +352,354 @@ Elastické obinadlo Bandaż elastyczny Pansement élastique + Rögzitő kötszer + Bendaggio elastico + Bandagem Elástica - + QuikClot QuikClot QuikClot - QuickClot + QuikClot Opatrunek QuikClot QuikClot Hémostatique + QuikClot + QuikClot(polvere emostatica) + QuikClot - + Check Pulse - Vérification du Pouls Puls überprüfen Comprobar pulso Проверить пульс Zkontrolovat pulz Sprawdź tętno - Vérifier les pulsations + Vérifier le pouls + Pulzus ellenőrzése + Controlla il polso + Checar Pulso - + Check Blood Pressure Blutdruck überprüfen Comprobar presión arterial Проверить давление Zkontrolovat krevní tlak Sprawdź ciśnienie krwi - Vérification de la Tension + Vérification de la tension + Vérnyomás megmérése + Controlla pressionsa sanguigna + Chegar Pressão Sanguínea - + Triage Card - Verletztenanhängekarte - Tarjeta de triaje + Triagekarte + Tarjeta de clasificación Медкарта Karta segregacyjna - Karta Triage - Carte de Triage + Štítek + Carte de triage + Orvosi lap + Triage Card + Cartão de Triagem - + + No entries on this triage card. + Keine Einträge auf der Triagekarte + Nessuna voce sulla Triage Card + Нет записей. + Aucune entrée sur cette carte de triage + Brak wpisów w tej karcie segregacyjnej. + Sin entradas en esta tarjeta de clasificación. + Ez az orvosi lap nem tartalmaz bejegyzést. + Žádné záznamy na tomto štítku + + Tourniquet - Aderpresse + Tourniquet Torniquete Жгут Škrtidlo Staza - Garrot + Tourniquet + Érszorító + Laccio emostatico + Torniquete - + Remove Tourniquet - Aderpresse entfernen + Tourniquet entfernen Quitar torniquete Снять жгут Sundat škrtidlo Zdejmij stazę - Enlever le Garrot + Enlever le Tourniquet + Érszorító leszedése + Rimuovi laccio emostatico + Remover Torniquete - + + Diagnose + Diagnose + Diagnosi + Диагностика + Diagnostiquer + Diagnoza + Diagnosticar + Diagnosztizálás + Diagnóza + + + Diagnosing ... + Diagnostizieren ... + Diagnosi in corso... + Диагностика ... + Diagnostic en cours + Diagnozowanie ... + Diagnosticando ... + Diagnózis folyamatban... + Diagnostika ... + + + CPR + HLW + RCP + Сердечно-лёгочная реанимация + RPC + RKO + RCP + Újraélesztés + KPR + + + Performing CPR ... + HLW durchführen ... + Eseguendo RCP... + Сердечно-лёгочная реанимация ... + RPC en cours + Przeprowadzanie RKO ... + Realizando RCP ... + Újraélesztés folyamatban... + Provádím KPR ... + + Give Blood IV (1000ml) Bluttransfusion IV (1000ml) Dar Sangre IV (1000ml) - Дать кровь для в/в вливания (1000 мл) + Перелить пакет крови (1000 мл) Podaj krew IV (1000ml) - Administrer du Sang en IV (1000ml) + Administrer du sang en IV (1000ml) Podat krev. transfúzi (1000ml) + Vér adása intravénásan (1000ml) + Effettua trasfusione sangue IV (1000ml) + Administrar Sangue IV (1000ml) - + Give Blood IV (500ml) Bluttransfusion IV (500ml) Dar Sangre IV (500ml) - Дать кровь для в/в вливания (500 мл) + Перелить пакет крови (500 мл) Podaj krew IV (500ml) - Administrer du Sang en IV (500ml) + Administrer du sang en IV (500ml) Podat krev. transfúzi (500ml) + Vér adása intravénásan (500ml) + Effettua trasfusione sangue IV (500ml) + Administrar Sangue IV (500ml) - + Give Blood IV (250ml) Bluttransfusion IV (250ml) Dar Sangre IV (250ml) - Дать кровь для в/в вливания (250 мл) + Перелить пакет крови (250 мл) Podaj krew IV (250ml) - Administrer du Sang en IV (250ml) + Administrer du sang en IV (250ml) Podat krev. transfúzi (250ml) + Vér adása intravénásan (250ml) + Effettua trasfusione sangue IV (250ml) + Administrar Sangue IV (250ml) - + Give Plasma IV (1000ml) Plasmatransfusion IV (1000ml) Dar Plasma IV (1000ml) - Дать плазму для в/в вливания (1000 мл) + Перелить пакет плазмы (1000 мл) Podaj osocze IV (1000ml) - Administrer du Plasma en IV (1000ml) + Administrer du plasma en IV (1000ml) Podat plazmu (1000ml) + Vérplazma adása intravénásan (1000ml) + Effettua trasfusione plasma IV (1000ml) + Administrar Plasma IV (1000ml) - + Give Plasma IV (500ml) Plasmatransfusion IV (500ml) Dar Plasma IV (500ml) - Дать плазму для в/в вливания (500 мл) + Перелить пакет плазмы (500 мл) Podaj osocze IV (500ml) - Administrer du Plasma en IV (500ml) + Administrer du plasma en IV (500ml) Podat plazmu (500ml) + Vérplazma adása intravénásan (500ml) + Effettua trasfusione plasma IV (500ml) + Administrar Plasma IV (500ml) - + Give Plasma IV (250ml) Plasmatransfusion IV (250ml) Dar Plasma IV (250ml) - Дать плазму для в/в вливания (250 мл) + Перелить пакет плазмы (250 мл) Podaj osocze IV (250ml) - Administrer du Plasma en IV (250ml) + Administrer du plasma en IV (250ml) Podat plazmu (250ml) + Vérplazma adása intravénásan (250ml) + Effettua trasfusione plasma IV (250ml) + Administrar Plasma IV (250ml) - + Give Saline IV (1000ml) - Kochsaltzlösung IV (1000ml) + Kochsalzlösung IV (1000ml) Dar Salino IV (1000ml) - Дать физраствор для в/в вливания (1000 мл) - Podaj solankę IV (1000ml) - Administrer de la Solution Saline en IV (1000ml) + Перелить пакет физраствора (1000 мл) + Podaj sól fizjologiczną IV (1000ml) + Administrer de la solution saline en IV (1000ml) Podaz fyz. roztok (1000ml) + Sós víz adása intravénásan (1000ml) + Effettua trasfusione salina IV (1000ml) + Administrar Soro IV (1000ml) - + Give Saline IV (500ml) - Kochsaltzlösung IV (500ml) + Kochsalzlösung IV (500ml) Dar Salino IV (500ml) - Дать физраствор для в/в вливания (500 мл) - Podaj solankę IV (500ml) - Administrer de la Solution Saline en IV (500ml) + Перелить пакет физраствора (500 мл) + Podaj sól fizjologiczną IV (500ml) + Administrer de la solution saline en IV (500ml) Podaz fyz. roztok (500ml) + Sós víz adása intravénásan (500ml) + Effettua trasfusione salina IV (500ml) + Administrar Soro IV (500ml) - + Give Saline IV (250ml) - Kochsaltzlösung IV (250ml) + Kochsalzlösung IV (250ml) Dar Salino IV (250ml) - Дать физраствор для в/в вливания (250 мл) - Podaj solankę IV (250ml) - Administrer de la Solution Saline en IV (250ml) + Перелить пакет физраствора (250 мл) + Podaj sól fizjologiczną IV (250ml) + Administrer de la solution saline en IV (250ml) Podaz fyz. roztok (250ml) + Sós víz adása intravénásan (250ml) + Effettua trasfusione salina IV (250ml) + Administrar Soro IV (250ml) - + Minor - Blessé léger Gering Menor - Незначительная + Несрочная помощь Normalny Mineur Minimální + Enyhe + Minore + Leve - + Delayed Retrasado - Груз 300 + Срочная помощь Opóźniony Différé Verzögert Odložitelný + Késleltetett + Differito + Atrasado - + Immediate Inmediato - Помощь отложена + Неотложная помощь Natychmiastowy Urgence Immédiate Sofort Okamžiý + Azonnali + Immediata + Imediato - + Deceased Fallecido - Груз 200 + Труп Nie żyje Décédé Verstorben Mrtvý + Elhalálozott + Deceduto + Falecido - + None Ninguno - Нет + Отсутствует Brak Aucun Keine Nic + Semmi + Nessuna + Nenhum - + Normal breathing Дыхание в норме Respiración normal - Respiration Normale + Respiration normale Normalny oddech Normale Atmung Dýchá normálně + Normális légzés + Respiro normale + Respiração normal - + No breathing Keine Atmung Дыхание отсутствует No respira - Aucune Respiration + Aucune respiration Brak oddechu Nedýchá + Nincs légzés + Mancanza di respiro + Não respira - + Difficult breathing Дыхание затруднено Dificultad para respirar - Difficultée Respiratoire + Difficultée respiratoire Trudności z oddychaniem Schwere Atmung Dýchá s obtížemi + Nehéz légzés + Difficoltà a respirare + Dificuldade para respirar - + Almost no breathing Fast keine Atmung Дыхание очень слабое Casi sin respiración - Respiration Faible + Respiration faible Prawie brak oddechu Skoro nedýchá + Alig van légzés + Respira a fatica + Quase não respira - + Bleeding Blutet Кровотечение @@ -509,35 +707,47 @@ Saignement Krwawienie zewnętrzne Krvácí + Vérzik + Sanguinando + Sangrando - + In Pain Hat Schmerzen Испытывает боль Con dolor - Ressent de la Douleur + Ressent de la douleur W bólu V bolestech + Fájdalom alatt + Con dolore + Com dor - + Lost a lot of Blood Hat eine große Menge Blut verloren Большая кровопотеря Mucha sangre perdida - A Perdu Bcp de Sang + A perdu beaucoup de sang Stracił dużo krwi Ztratil hodně krve + Sok vért vesztett + Ha perso parecchio sangue + Perdeu muito sangue - + Tourniquet [CAT] - Aderpresse [CAT] + Tourniquet [CAT] Жгут Torniquete [CAT] - Garrot [CAT] + Tourniquet [CAT] Staza [typ. CAT] Škrtidlo [CAT] + Érszorító [CAT] + Laccio emostatico [CAT] + Torniquete [CAT] - + Receiving IV [%1ml] Erhalte IV [%1ml] Reciviendo IV [%1ml] @@ -545,8 +755,11 @@ Otrzymywanie IV [%1ml] Transfusion en IV [%1ml] Přijímání transfúze [%1ml] + Infúzióra kötve [%1ml] + Ricevendo IV [%1ml] + Recebendo IV [%1ml] - + Bandage (Basic) Bandage (Standard) Повязка (обычная) @@ -554,47 +767,67 @@ Bandage (Standard) Bandaż (jałowy) Bandáž (standartní) + Kötszer (Általános) + Bendaggio (base) + Bandagem(Básico) - + Used to cover a wound Для перевязки ран Utilizado para cubrir una herida - Utilisé Pour Couvrir Une Blessure + Utilisé pour couvrir une blessure Używany w celu przykrycia i ochrony miejsca zranienia Verwendet, um Wunden abzudecken + Sebesülések befedésére alkalmas + Usato per coprire una ferita + Usado para cobrir um ferimento + Slouží k překrytí poranění - + A dressing, that is a particular material used to cover a wound, which is applied over the wound once bleeding has been stemmed. Ein Verband, der aus einem besonderen Material besteht um die Wunde zu schützen, nachdem die Blutung gestoppt wurde. Повязка, накладываемая поверх раны после остановки кровотечения. Un apósito, material específico utilizado para cubrir una herida, se aplica sobre la herida una vez ha dejado de sangrar. Bandage fait d'un matériel spécial utilisé pour couvrir une blessure, qui peut etre appliqué dès que le saignement a été stoppé. Opatrunek materiałowy, używany do przykrywania ran, zakładany na ranę po zatamowaniu krwawienia. + Egy különleges anyagú kötszer sebek betakarására, amelyet a vérzés elállítása után helyeznek fel. + Una benda apposita, utilizzata per coprire una ferita, la quale è applicata sopra di essa una volta fermata l'emorragia. + Uma curativo, material específico para cobrir um ferimento que é aplicado assim que o sangramento é estancando. - + Packing Bandage Mullbinde Тампонирующая повязка Vendaje compresivo - Bandage Mèche + Bandage gauze Bandaż (uciskowy) + Nyomókötszer + Bendaggio compressivo + Bandagem de Compressão - + Used to pack medium to large wounds and stem the bleeding - Verwendet, um mittlere bis große Wunden abzudecken und Blutungen zu stoppen + Wird verwendet, um mittlere bis große Wunden abzudecken und Blutungen zu stoppen Для тампонирования ран среднего и большого размера и остановки кровотечения. Se utiliza para vendar heridas medianas o grandes y detener el sangrado - Utilisé pour remplir la cavité créée dans une blessure de taille moyenne à grande. + Utilisé pour couvrir des blessures de taille moyenne à grande. Arrête l'hémorragies Używany w celu opatrywania średnich i dużych ran oraz tamowania krwawienia. + Közepestől nagyig terjedő sebek betakarására és vérzés elállítására használt kötszer + Usato su medie o larghe ferite per fermare emorragie. + Usado para o preenchimento de cavidades geradas por ferimentos médios e grandes e estancar o sangramento. - + A bandage used to pack the wound to stem bleeding and facilitate wound healing. Packing a wound is an option in large polytrauma injuries. - Повязка для тампонирования раны, остановки кровотечения и лучшего заживления. При тяжелых сочетанных ранениях возможно тампонирование раны. + Повязка для тампонирования раны, остановки кровотечения и лучшего заживления. При тяжёлых сочетанных ранениях возможно тампонирование раны. Se utiliza para detener la hemorragia de una herida y favorecer su cicatrización. Se usa en grandes lesiones o politraumatismos. - Bandage pouvant être inseré dans les blessures pour éponger le saignement et faciliter la guerrison. Ce bandage est optionnel pour soigner les lésions polytraumatique. + Bandage servant à recouvrir les blessures pour arrêter les hémmoragies et faciliter la guérisson. Recouvrir une blessure est optionnel dans le cas de blessures polytraumatiques Opatrunek stosowany w celu zatrzymania krwawienia i osłony większych ran. + Egy kötszerfajta, melyet a sebek nyomására használnak a vérzés elállítása és sebgyógyulás érdekében. A nyomókötés egy lehetőség nagyobb polytraumatikus sérülések esetén. + Un bendaggio usato per coprire la ferita, fermare il sanguinamento e facilitarne la guarigione. Questa tecnica è opzionale su ferite multiple. + Ein Verband, um die Wunde abzudecken und die Wundheilung zu fördern. Wunden abdecken ist eine Option bei größeren Polytraumen + Uma bandagem usada para preencher o ferimento para estancar o sangramento e facilitar a cicatrização. Preenchimento de feridas é uma opção em ferimentos de politrauma grandes. - + Bandage (Elastic) Bandage (Elastisch) Повязка (давящая) @@ -602,49 +835,67 @@ Bandage (Élastique) Bandaż (elastyczny) Bandáž (elastická) + Rögzító kötszer + Benda (Elastica) + Bandagem (Elástica) - + Bandage kit, Elastic Elastische Binde (Kompressionsbinde) Давящая повязка Kit de vendaje (Elástico) - Bandage Compressif Élastique + Bandage compressif élastique Zestaw bandaży elastycznych. + Rugalmas kötszercsomag, "rögzítő" + Kit bendaggio, elastico + Kit de Bandagem, Elástica - + Allows an even compression and extra support to the injured area. - - Давящая повязка обеспечивает равномерное сжатие и дополнительную поддержку поврежденной области + Ermöglicht eine gleichmäßige Kompression und zusätzliche Unterstützung für den verletzten Bereich. + Давящая повязка обеспечивает равномерное сжатие и дополнительную поддержку повреждённой области Ce bandage peut être utilisé pour compresser la plaie afin de ralentir le saignement et assurer la tenue du bandage lors de mouvement. Elastyczna opaska podtrzymująca opatrunek oraz usztywniająca okolice stawów. Brinda una compresión uniforme y ofrece soporte extra a una zona lesionada + Egyenletes nyomást és támogatást biztosít a sebesült felületnek. + Permette di comprimevere e aiutare la zone ferita. + Esta bandagem pode ser utilizada para comprimir o ferimento e diminuir o sangramento e garantir que o ferimento não abra em movimento. - + Tourniquet (CAT) - Aderpresse (CAT) + Tourniquet [CAT] Жгут Torniquete (CAT) - Garrot (CAT) + Tourniquet (CAT) Staza (typ. CAT) Škrtidlo (CAT) + Érszorító (CAT) + Laccio emostatico (CAT) + Torniquete (CAT) - + Slows down blood loss when bleeding Замедляет кровопотерю при кровотечении Reduce la velocidad de pérdida de sangre Ralentit le saignement Zmniejsza ubytek krwi z kończyn w przypadku krwawienia. Verringert den Blutverlust während einer Blutung + Lelassítja a vérvesztést vérzés esetén + Rallenta la perdita di sangue in caso di sanguinamento + Reduz a velocidade da perda de sangue - + A constricting device used to compress venous and arterial circulation in effect inhibiting or slowing blood flow and therefore decreasing loss of blood. Жгут используется для прижатия сосудов к костным выступам, которое приводит к остановке или значительному уменьшению кровотечения Dispositivo utilizado para eliminar el pulso distal y de ese modo controlar la pérdida de sangre Un dispositif permettant de compresser les artères et veines afin de réduire la perte de sang. Opaska uciskowa CAT służy do tamowanie krwotoków w sytuacji zranienia kończyn z masywnym krwawieniem tętniczym lub żylnym. Ein Gerät, das Druck auf Venen und Arterien ausübt und so den Blutfluss verringert. + Egy szűkítőeszköz, mely a vénás és artériás nyomás keringés helyi összenyomására szolgál, ezzel lelassítva vagy megállítva az adott területen a vérkeringést. Ez csökkenti a vérvesztés mértékét. + Un laccio emostatico usato per comprimere le vene e arterie per bloccare o rallentare la circolazione del sangue e quindi rallentare dissanguamenti. + A aparelho que comprime as artérias e veias para diminuir a perda de sangue. - + Morphine autoinjector Morphium Autoinjektor Морфин в пневмошприце @@ -652,24 +903,33 @@ Auto-injecteur de Morphine Autostrzykawka z morfiną Autoinjektor morfin + Morfium autoinjektor + Autoiniettore di morfina + Auto-injetor de morfina - + Used to combat moderate to severe pain experiences Wird verwendet um moderate bis starke Schmärzen zu lindern. Для снятия средних и сильных болевых ощущений Usado para combatir los estados dolorosos de moderados a severos Utilisé pour réduire les douleurs modérées à sévères. Morfina. Ma silne działanie przeciwbólowe. + Mérsékelttől erős fájdalomig, ellene alkalmazandó termék + Usato per combattere il dolore. + Usado para combater dores moderadas e severas - + An analgesic used to combat moderate to severe pain experiences. Обезболивающее для снятия средних и сильных болевых ощущений. Analgésico usado para combatir los estados dolorosos de moderados a severos. - Un Analgésique puissant servant à réduire les douleurs modérées à sévères. + Un analgésique puissant servant à réduire les douleurs modérées à sévères. Organiczny związek chemiczny z grupy alkaloidów. Ma silne działanie przeciwbólowe. Ein Schmerzmittel um mäßige bis starke Schmerzen zu behandeln + Egy fájdalomcsillapító anyag, jellemzően mérsékelt vagy erős fájdalom esetén alkalmazandó. + Un analgesico usato per combattere il dolore. + Um analgésico usado para combater dores moderadas e fortes. - + Atropin autoinjector Атропин в пневмошприце Atropina auto-inyectable @@ -677,24 +937,33 @@ Autostrzykawka AtroPen Atropin Autoinjektor Autoinjektor atropin + Atropin autoinjektor + Autoiniettore di Atropina + Auto-injetor de Atropina - + Used in NBC scenarios Применяется для защиты от ОМП Usado en escenarios NBQ Utilisé en cas d'attaque CBRN Atropina. Stosowana jako lek rozkurczowy i środek rozszerzający źrenice. Verwendet bei ABC Kontamination + NBK helyzetek esetén használandó + Usato in situazioni con gas nervino. + Usado em casos de ataque QBRN - + A drug used by the Military in NBC scenarios. Препарат, используемый в войсках для защиты от оружия массового поражения. Medicamento usado por militares en escenarios NBQ Médicament utilisé par l'armée en cas d'attaque CBRN Atropina. Stosowana jako lek rozkurczowy i środek rozszerzający źrenice. Środek stosowany w przypadku zagrożeń NBC. Ein Medikament, das vom Militär bei ABC Kontamination verwendet wird. + Egy instabil alkaloid, NBK helyzetek esetén a katonai szervezetek veszik használatba. + E' un farmaco usato in ambito militare in scenari con presenza di gas nervino. + Uma droga usada por militares em casos de ataque QBRN. - + Epinephrine autoinjector Адреналин в пневмошприце Epinefrina auto-inyectable @@ -702,473 +971,910 @@ Autostrzykawka EpiPen Epiniphrin Autoinjektor Autoinjektor adrenalin + Epinefrin autoinjektor + Autoiniettore di Epinefrina + Auto-injetor de epinefrina - + Increase heart rate and counter effects given by allergic reactions Стимулирует работу сердца и купирует аллергические реакции Aumenta la frecuencia cardiaca y contraresta los efectos de las reacciones alérgicas Augmente la fréquence cadiaque et annule les effets d'une réaction anaphylactique Adrenalina. Zwiększa puls i przeciwdziała efektom wywołanym przez reakcje alergiczne - Steigert die Herzfrequenz, um den Effekt von allergischen Reaktionen zu bekämpfen + Steigert die Herzfrequenz und bekämpft Symptome von allergischen Reaktionen. + Növeli a szívverést és ellenzi az allergiás reakciók hatásait + Aumenta il battito cardiaco e combatte gli effetti di reazioni allergiche. + Aumenta a frequência cardíaca e combate efeitos causados por reações alérgicas + Zvyšuje srdeční frekvenci a chrání před alergickými reakcemi - + A drug that works on a sympathetic response to dilate the bronchi, increase heart rate and counter such effects given by allergic reactions (anaphylaxis). Used in sudden cardiac arrest scenarios with decreasing positive outcomes. Препарат, вызывающий симпатическую реакцию, приводящую к расширению бронхов, увеличению частоты сердечных сокращений и купированию аллергических реакций (анафилактического шока). Применяется при остановке сердца с уменьшенной вероятностью благоприятного исхода. Medicamento que dilata los bronquios, aumenta la frecuencia cardiaca y contrarresta los efectos de las reacciones alérgicas (anafilaxis). Se utiliza en caso de paros cardiacos repentinos. Medicament qui fonctionne sur le système nerveux sympathique créant une dilatation des bronches, augmente la fréquence cardiaque et annule les effets d'une réaction allergique (anaphylaxie). Utilisé lors d'arrêt cardio-respiratoire pour augmenter les chances de retrouver un pouls. EpiPen z adrenaliną ma działanie sympatykomimetyczne, tj. pobudza receptory alfa- i beta-adrenergiczne. Pobudzenie układu współczulnego prowadzi do zwiększenia częstotliwości pracy serca, zwiększenia pojemności wyrzutowej serca i przyśpieszenia krążenia wieńcowego. Pobudzenie oskrzelowych receptorów beta-adrenergicznych wywołuje rozkurcz mięśni gładkich oskrzeli, co w efekcie zmniejsza towarzyszące oddychaniu świsty i duszności. + Una sostanza che permette di dilatare i bronchi, aumentare il battito cardiaco e combattere effetti di reazioni allergiche. Usato anche in casi di arresto cardiaco. + Ein Medikament, dass die Bronchien erweitert, die Herzfrequenz erhöht und Symptome von allergischen Reaktionen(Anaphylaxie) bekämpft. Wird bei plötzlichem Herzstillstand verabreicht. + Uma droga trabalha dilatando os bronquios, aumentando a frequência cardíaca e combate efeitos de reações alérgicas(anáfilaticas). Usado em casos de parada cardiaca com poucas changes de recuperação. + Egy hormon, mely a szimpatikus idegrendszer által kitágítja a hörgőket, valamint megnöveli a szívverést, ezzel ellensúlyozva ilyen jellegű allergiás reakciókat (anafilaxiás sokk). Hirtelen szívmegállás esetén is használt, idő alatt csökkenő hatásfokkal. - + Plasma IV (1000ml) Плазма для в/в вливания (1000 мл) Plasma IV (1000ml) Plasma Sanguin IV (1000ml) Osocze IV (1000ml) Plasma IV (1000ml) + Vérplazma-infúzió (1000ml) + Plasma IV (1000ml) + Plasma IV (1000ml) + Krevní plazma (1000ml) - + A volume-expanding blood supplement. Дополнительный препарат, применяемый при возмещении объема крови. Suplemento para expandir el volumen sanguíneo. Supplément visant à remplacer les volumes sanguin Składnik krwi, używany do zwiększenia jej objętości. + Egy térfogatnövelő vérkiegészítmény. + Aiuta ad aumentare il volume sanguigno. + Volumenerweiterungsmittel (künstliches Blutvolumen) + Suplemento para expandir o volume sanguíneo. - + A volume-expanding blood supplement. Дополнительный препарат, применяемый при возмещении объема крови. Suplemento para expandir el volumen sanguíneo. Supplément visant à remplacer le volume sanguin et remplace les plaquettes. Składnik krwi, używany do zwiększenia jej objętości. + Egy térfogatnövelő vérkiegészítmény. + Aiuta ad aumentare il volume sanguigno. + Volumenerweiterungsmittel (künstliches Blutvolumen) + Suplemento para expandir o volume sanguíneo. - + Plasma IV (500ml) Плазма для в/в вливания (500 мл) Plasma IV (500ml) - Plasma Sanguin IV (500ml) + Plasma sanguin IV (500ml) Osocze IV (500ml) Plasma IV (500ml) + Vérplazma-infúzió (500ml) + Plasma IV (500ml) + Plasma IV (500ml) + Krevní plazma (500ml) - + Plasma IV (250ml) Плазма для в/в вливания (250 мл) Plasma IV (250ml) - Plasma Sanguin (250ml) + Plasma sanguin (250ml) Osocze IV (250ml) Plasma IV (250ml) + Vérplazma-infúzió (250ml) + Plasma IV (250ml) + Plasma IV (250ml) + Krevní plazma (250ml) - + Blood IV (1000ml) Кровь для переливания (1000 мл) Sangre IV (1000ml) - Cullot Sanguin IV (1000ml) + Cullot sanguin IV (1000ml) Krew IV (1000ml) Blut IV (1000ml) + Vér-infúzió (1000ml) + Sangue IV (1000ml) + Sangue IV (1000ml) + Krevní transfúze (1000ml) - + Blood IV, for restoring a patients blood (keep cold) - Пакет крови для возмещения объема потерянной крови (хранить в холодильнике) + Пакет крови для возмещения объёма потерянной крови (хранить в холодильнике) Sangre intravenosa, para restarurar el volumen sanguíneo (mantener frío) - Cullot Sanguin O- ,utiliser seulement lors de perte sanguine majeur afin de remplacer le volume sanguin perdu. Habituelment utiliser lors du transport ou dans un etablisement de soin. + Cullot sanguin O- ,utiliser seulement lors de perte sanguine majeur afin de remplacer le volume sanguin perdu. Habituelment utiliser lors du transport ou dans un etablisement de soin. Krew IV, używana do uzupełnienia krwi u pacjenta, trzymać w warunkach chłodniczych + Vér-infúzió, intravénás bejuttatásra egy páciensnek (hidegen tárolandó) + Sangue usato per ripristinare pazienti in cui si è verificata una perdita di sangue (conservare al fresco) + Blut IV, Bluthaushalt des Patienten wiederherstellen. (Kühl halten) + Sangue intravenoso, para restaurar o volume sanguinio do paciente.(Manter frio) + Krev IV, pro doplňění krve pacienta (udržujte v chladu) - + O Negative infusion blood used in strict and rare events to replenish blood supply usually conducted in the transport phase of medical care. Кровь I группы, резус-отрицательная, применяется по жизненным показаниям для возмещения объема потерянной крови на догоспитальном этапе оказания медицинской помощи. Krew 0 Rh-, używana w rzadkich i szczególnych przypadkach do uzupełnienia krwi u pacjenta, zazwyczaj w trakcie fazie transportu rannej osoby do szpitala. Utilice sólo durante gran pérdida de sangre para reemplazar el volumen de sangre perdida. Uso habitual durante el transporte de heridos. + Sangue 0 negativo usato per ripristinare sangue in pazienti in cui si è verificata una perdita di sangue. + Cullot sanguin O- utilisé dans de rares et stricts cas pour compléter une perte de sang importante. Administré normalement lors d'un MEDEVAC + O Negative Blutinfusion wird nur in seltenen Fällen verwendet, um den Bluthaushalt des Patienten zu ergänzen. Wird in der Regel wärend der Transportphase durchgeführt. + Sangue O- , utilizado em casos raros para rapidamente repor o sangue. Uso habitual ocorre durante o transporte ou em estações de tratamento. + Nullás vércsoportú, Rh-negatív vér-infúzió, melyet kritikus és ritka helyzetekben vérutánpótlásra használnak, jellemzően az orvosi ellátás szállítási fázisa közben. - + Blood IV (500ml) Кровь для переливания (500 мл) Sangre IV (500ml) - Cullot Sanguin IV (500ml) + Cullot sanguin IV (500ml) Krew IV (500ml) Blut IV (500ml) + Vér-infúzió (500ml) + Sangue IV (500ml) + Sangue IV (500ml) + Krevní transfúze (500ml) - + Blood IV (250ml) Кровь для переливания (250 мл) Sangre IV (250ml) - Cullot Sanguin IV (250ml) + Cullot sanguin IV (250ml) Krew IV (250ml) Blut IV (250ml) + Vér-infúzió (250ml) + Samgue IV (250ml) + Sangue IV (250ml) + Krevní transfúze (250ml) - + Saline IV (1000ml) Физраствор для в/в вливания (1000 мл) Solución Salina IV (1000ml) - Solution Saline 0.9% IV (1000ml) - Solanka 0,9% IV (1000ml) + Solution saline 0.9% IV (1000ml) + Sól fizjologiczna IV (1000ml) Kochsalzlösung (1000ml) + 0,9%-os sósvíz-infúzió (1000ml) + Soluzione salina IV (1000ml) + Soro IV (1000ml) + Fyziologický roztok (1000ml) - + Saline IV, for restoring a patients blood - Пакет физраствора для возмещения объема потерянной крови + Пакет физраствора для возмещения объёма потерянной крови Solución salina intravenosa, para restaurar el volumen sanguíneo - Solution Saline 0.9% IV, pour rétablir temporairement la tension artérielle - Solanka 0,9%, podawana dożylnie (IV), używana w celu uzupełnienia krwi u pacjenta + Solution saline 0.9% IV, pour rétablir temporairement la tension artérielle + Sól fizjologiczna, podawana dożylnie (IV), używana w celu uzupełnienia krwi u pacjenta + 0,9%-os sósvíz-infúzió, a páciens vérmennyiségének helyreállítására + Soluzione salina, usata per ripristinare sangue nei pazienti. + Kochsalzlösung, ein medizinisches Volumenersatzmittel + Solução Salina Intravenosa 0.9%, para restaurar o volume de sangue temporariamente. - + A medical volume-replenishing agent introduced into the blood system through an IV infusion. - Пакет физиологического раствора для возмещения объема потерянной крови путем внутривенного вливания + Пакет физиологического раствора для возмещения объёма потерянной крови путем внутривенного вливания Suero fisiológico inoculado al torrente sanguíneo de forma intravenosa. - Un remplacement temporaire pour rétablir la tension artérielle lors de perte sanguine, administré par intra-veineuse + Un remplacant temporaire pour rétablir la tension artérielle lors de perte sanguine, administré par intra-veineuse Używany w medycynie w formie płynu infuzyjnego jako środek nawadniający i uzupełniający niedobór elektrolitów, podawany dożylnie (IV). + Egy orvosi térfogat-helyreállító készítmény, melyet intravénás módon lehet a szervezetbe juttatni. + Una soluzione medica per ripristinare il volume del sangue introdotta tramite trasfusione IV. + Ein medizinisches Volumenersatzmittel, dass durch einen intravenösen Zugang in den Blutkreislauf verabreicht wird. + Uma reposição temporaria para restaurar a pressão arterial perdida por perda de sangue. - + Saline IV (500ml) Физраствор для в/в вливания (500 мл) Salino IV (500ml) - Solution Saline 0.9% IV (500ml) - Solanka 0,9% IV (500ml) + Solution saline 0.9% IV (500ml) + Sól fizjologiczna IV (500ml) Kochsalzlösung (500ml) + 0,9%-os sósvíz-infúzió (500ml) + Soluzione salina IV (500ml) + Soro IV (1000ml) + Fyziologický roztok (500ml) - + Saline IV (250ml) Физраствор для в/в вливания (250 мл) Salino IV (250ml) - Solution Saline 0.9% IV (250ml) - Solanka 0,9% IV (250ml) + Solution saline 0.9% IV (250ml) + Sól fizjologiczna IV (250ml) Kochsalzlösung (250ml) + 0,9%-os sósvíz-infúzió (250ml) + Soluzione salina IV (250ml) + Soro IV (1000ml) + Fyziologický roztok (250ml) - + Basic Field Dressing (QuikClot) Первичный перевязочный пакет (QuikClot) Vendaje básico (QuickClot) - Bandage Regulier (Coagulant) + Bandage basique (Hémostatique) Podstawowy pakiet opatrunkowy (QuikClot) Verbandpäckchen(Gerinnungsmittel) + Általános zárókötszer (QuikClot) + Bendaggio emostatico (QuikClot) + Bandagem básica (Coagulante) - + QuikClot bandage Гемостатический пакет QuikClot Vendaje QuikClot - Bandage coagulant + Bandage hémostatique Hemostatyczny pakiet QuikClot. Podstawowy opatrunek stosowany na rany. Bandage mit Gerinnungsmittel + QuikClot kötszer + Bendaggio emostatico (QuikClot) + Bandagem com agente coagulante - + Hemostatic bandage with coagulant that stops bleeding. Медицинский коагулянт для экстренной остановки кровотечения Un bandage aidant à coaguler les saignements mineurs à moyens. Proszkowy opatrunek adsorpcyjny przeznaczony do tamowania zagrażających życiu krwawień średniej i dużej intensywności. Vendaje hemostático con coagulante que detiene el sangrado. Verband mit Gerinnungsmittel, um starke Blutung zu behandeln. + Hemostatikus kötszer egy vérzésgátló anyaggal. + Bendaggio emostatico con coagulante che permette di arrestare perdite di sangue + Bandagem Hemostática com coagulante que controla hemorragia médias e grandes com risco de vida. - + Personal Aid Kit Аптечка - Botiquín de primeros auxilios - Équipement de support vital + Trousse de premiers soins + Equipo de primeros auxilios Apteczka osobista Persönliches Verbandpäckchen + Elsősegélycsomag + Pronto soccorso personale + Kit De Primeiros Socorros Pessoal + Balíček první pomoci - + Includes various treatment kit needed for stitching or advanced treatment Содержит различные материалы и инструменты для зашивания ран и оказания специальной медпомощи. Incluye material médico para tratamientos avanzados Inclue du matériel medical pour les traitements avancés, tel les points de suture. Zestaw środków medycznych do opatrywania ran i dodatkowego leczenia po-urazowego Beinhaltet medizinisches Material für fortgeschrittene Behandlung und zum Nähen. + Változatos segédfelszereléseket tartalmaz sebvarráshoz és haladó elsősegélynyújtáshoz + Include vario materiale medico per trattamenti avanzati. + Inclui vários tratamentos materiais para custura e tratamento avançado - - - - - + + Personal Aid Kit for in field stitching or advanced treatment W znacznym stopniu poprawia stan pacjenta + Полевая аптчека для продвинутого лечения и зашивания ран + Persönliches Verbandspäckchen zum ambulanten Nähen und fortgeschrittener Behandlung. + Trousse de premiers soins pour coudre sur le terrain et traitements avancés. + Equipo de primeros auxilios para sutura de campaña o tratamientos avanzados + Elsősegélycsomag, terepen való sebvarráshoz és haladó ellátáshoz - + + Use Personal Aid Kit + Verbandpäckchen benutzen + Использовать аптечку + Utiliser la Trousse de premier soins + Użyj apteczki osobistej + Usar equipo de primeros auxilios + Elsősegélycsomag használata + Použít balíček první pomoci + + Surgical Kit Trousse chirurgicale Хирургический набор Kit quirúrgico Zestaw do szycia ran Operationsset + Sebészeti készlet + Kit chirurgico + Kit Cirurgico + Chirurgická sada - + Surgical Kit for in field advanced medical treatment Trousse chirurgicale pour le traitement sur le terrain Набор для хирургической помощи в полевых условиях Kit quirúrgico para el tratamiento avanzado en el campo de batalla Zestaw pozwalający na zszywanie ran w polu Operationsset für fortgeschrittene medizinische Feldversorgung + Sebészeti készlet komplex orvosi feladatok terepen való ellátására + Kit chirurgico per trattamenti avanzati sul campo. + Kit Cirurgico para uso de tratamento médico avançado em campo + Chirurgická sada pro pokročilé vyléčení v poli - + Surgical Kit for in field advanced medical treatment Набор для хирургической помощи в полевых условиях Kit quirúrgico para el tratamiento avanzado en el campo de batalla Zestaw pozwalający na zszywanie ran w polu Operationsset für fortgeschrittene medizinische Feldversorgung Trousse chirurgicale pour le traitement sur le terrain + Sebészeti készlet komplex orvosi feladatok terepen való ellátására + Kit chirurgico per trattamenti avanzati sul campo. + Kit Cirurgico para uso de tratamento médico avançado em campo. + Chirurgická sada pro pokročilé vyléčení v poli - + + Use Surgical Kit + Operationsset benutzen + Usa kit chirurgico + Использовать хирургический набор + Utiliser la trousse chirugicale + Zszyj rany + Usar equipo quirúrgico + Sebészeti készlet használata + Použít chirurgickou sadu + + Bodybag - Sac à corps - Мешок для трупов Housse mortuaire + Мешок для трупов Bolsa para cadáveres Worek na zwłoki Leichensack + Hullazsák + Sacca per corpi + Saco para cadáver + Pytel na tělo - + A bodybag for dead bodies Housse de transport des corps Мешок для упаковки трупов Una bolsa para cadáveres Worek do pakowania zwłok Ein Leichensack für Tote + Egy hullazsák a holttestek számára + Una sacca nera per trasportare cadaveri. + Um saco para corpos mortos + Pytel na mrtvá těla - + A bodybag for dead bodies Housse de transport des corps Мешок для упаковки трупов Una bolsa para cadáveres Worek do pakowania zwłok Ein Leichensack für Tote + Egy hullazsák a holttestek számára + Una sacca nera per trasportare cadaveri. + Um saco para corpos mortos. + Pytel na mrtvá těla - + Blood Pressure Tension artérielle Артериальное давление Presión arterial Ciśnienie krwi Blutdruck + Vérnyomás + Pressione sanguigna + Pressão Arterial + Krevní tlak - + Checking Blood Pressure.. Mesure de la tension ... - Проверка артериального давления... + Проверка артериального давления ... Comprobando presión arterial... Sprawdzanie ciśnienia krwi... Blutdruck kontrollieren... + Vérnyomás megmérése... + Controllando la pressione sanguigna.. + Aferindo Pressão Arterial... + Kontroluji krevní tlak ... - + + %1 checked Blood Pressure: %2 + %1 kontrollierte Blutdruck: %2 + %1 controllata pressione sanguigna: %2 + %1 проверил артериальное давление: %2 + %1 à vérifié la tension: %2 + %1 sprawdził ciśnienie krwi: %2 + %1 verificada la presión arterial: %2 + %1 ellenőrizte a vérnyomást: %2 + %1 zkontrolován krevní tlak: %2 + + You checked %1 Vous diagnostiquez %1 Вы осмотрели раненого %1 - Vous examinez %1 Examinando a %1 Zbadałeś %1 Kontrolliert %1 + A %1 ellenőrizve + Hai diagnosticato %1 + Você aferiu o paciente %1 + Zkontroloval jsi %1 - + You find a blood pressure of %2/%3 Vous avez trouvé une tension de %2/%3 Артериальное давление %2/%3 La Presión Arterial es %2/%3 + A vérnyomás %2/%3 + Hai riscontrato una pressione di %2/%3 + Wyczuwasz ciśnienie krwi o wartości %2/%3 + Der Blutdruck liegt bei %2/%3 + A Pressão Arterial é de %2/%3 + Našel jsi krevní tlak u %2/%3 - + You find a low blood pressure Tension basse Давление низкое La presión arterial es baja Wyczuwasz niskie ciśnienie krwi Blutdruck ist niedrig + A vérnyomás alacsony + La pressione sanguigna è bassa + Pressão Arterial baixa + Naměřil jsi nízký krevní tlak - + You find a normal blood pressure Tension normale Давление нормальное La presión arterial es normal Wyczuwasz normalne ciśnienie krwi Blutdruck ist normal + A vérnyomás normális + La pressione sanguigna è normale + Pressão Arterial normal + Naměřil jsi normální krevní tlak - + You find a high blood pressure Tension haute Давление высокое La presión arterial es alta Wyczuwasz wysokie ciśnienie krwi Blutdruck ist hoch + A vérnyomás magas + La pressione sanguigna è alta + Pressão Arterial Alta + Naměřil jsi vysoký krevní tlak - + You find no blood pressure Pas de tension Давления нет No hay presión arterial Nie wyczuwasz ciśnienia krwi Patient hat keinen Blutdruck + Nem észlelhető vérnyomás + La pressione sanguigna è assente + Sem Pressão Arterial + Nenaměřil jsi žádný krevní tlak - + You fail to find a blood pressure Vous n'avez pas pu mesurer de tension Артериальное давление не определяется No puedes encontrar presión arterial Nie udało Ci się sprawdzić ciśnienia krwi Blutdruck konnte nicht gefunden werden + Nem sikerült a vérnyomás megmérése + Manca strumento per misurare pressione sanguigna + Você falhou em aferir a Pressão Arterial + Nedokázal jsi změřit krevní tlak - + + Low + Niedrig + Basso + Низкое + Faible + Niskie + Baja + Alacsony + Nízký + + + Normal + Normal + Normale + Нормальное + Normale + Normalne + Normal + Normális + Normální + + + High + Hoch + Alto + Высокое + Haute + Wysokie + Alta + Magas + Vysoký + + + No Blood Pressure + Kein Blutdruck + Nessuna Pressione Sanguigna + Артериальное давление отсутствует + Aucune tension + Brak ciśnienia krwi + Sin presión arterial + Nincs vérnyomás + Žádný krevní tlak + + Pulse - Pulsations Пульс Pouls Pulso Tętno Puls + Pulzus + Polso + Pulso + Tep - - Checking Heart Rate.. + + Checking Heart Rate ... Vérification du rythme cardiaque ... - Проверка пульса... - Comprobando ritmo cardíaco... - Sprawdzanie tętna... - Kontrolliere Herzfrequenz + Проверка пульса ... + Comprobando ritmo cardíaco ... + Sprawdzanie tętna ... + Kontrolliere Herzfrequenz ... + Szívverés-szám mérése... + Controllando il battito cardiaco ... + Aferindo Pulso ... + Kontroluji srdeční tep ... - + You checked %1 - Vous avez Diagnostiqué %1 Вы осмотрели раненого %1 Vous examinez %1 Examinando a %1 Zbadałeś %1 - Kontrolliertt %1 + Kontrolliert %1 + A %1 ellenőrizve + Hai diagnosticato %1 + Você aferiu o paciente %1 + Zkontroloval jsi %1 - + + %1 checked Heart Rate: %2 + %1 kontrollierte Herzfrequenz: %2 + %1 Controllata Frequenza Cardiaca: %2 + %1 проверил пульс: %2 + %1 à vérifié le rythme cardiaque: %2 + %1 sprawdził tętno: %2 + %1 verificado el ritmo cardíaco: %2 + %1 ellenőrizte a szívverés-számot: %2 + %1 zkontroloval srdeční tep: %2 + + + Weak + Schwach + Lento + Слабый + Faible + Słabe + Débil + Gyenge + Slabý + + + Normal + Normal + Normale + Нормальный + Normal + Normalne + Normal + Normális + Normální + + + Strong + Stark + Veloce + Сильный + Fort + Silne + Fuerte + Erős + Silný + + You find a Heart Rate of %2 - Rythme carquiaque de %2 + Rythme cardiaque de %2 Пульс %2 уд./мин. El ritmo cardíaco es de %2 Wyczuwasz tętno o wartości %2 Herzfrequenz ist %2 + A szívverés-szám %2 + Il battito cardiaco è %2 + A Freqüência Cardíaca é de %2 + Nahmatal jsi srdeční tep u %2 - + You find a weak Heart Rate Rythme cardiaque faible Пульс слабый El ritmo cardíaco es débil Wyczuwasz słabe tętno Schwacher Puls + A szívverés-szám alacsony + Hai riscontrato un debole battito cardiaco + Freqüência Cardíaca baixa + Nahmatal jsi slabý srdeční tep - + You find a strong Heart Rate Rythme cardiaque élevé Пульс учащенный El ritmo cardíaco está acelerado Wyczuwasz silne tętno Starker Puls + A szívverés-szám magas + Hai riscontrato un forte battito cardiaco + Freqüência Cardíaca normal + Nahmatal jsi silný srdeční tep - + You find a normal Heart Rate Rythme cardiaque normal Пульс в норме El ritmo cardíaco es bueno Wyczuwasz normalne tętno Normaler Puls + A szívverés-szám normális + Hai riscontrato un normale battito cardiaco + Freqüência Cardíaca alta + Nahmatal jsi normální srdeční tep - + You find no Heart Rate Pas de rythme cardiaque Пульс не прощупывается No tiene ritmo cardíaco Wyczuwasz brak tętna Kein Puls gefunden + Nem észlelhető szívverés + Hai riscontrato una assenza di battito cardiaco + Sem Freqüência Cardíaca + Nenašel jsi - + Response Etat de Conscience Реакция Respuesta Przytomność Ansprechbarkeit + Reagálóképesség + Risposta + Reação + Odezva - + You check response of patient Vous vérifiez la réponse du patient Вы проверяете реакцию раненого - Vérification de l'état de conscience du patient Compruebas si el paciente reacciona Sprawdzasz przytomność pacjenta Du prüfst ob der Patient ansprechbar ist + Ellenőrzöd a páciens reagálóképességét + Controlli la risposta del paziente + Aferindo se o paciente tem reação... + Zkontroloval jsi reakci pacienta - + %1 is responsive - %1 est conscient %1 реагирует на раздражители %1 est conscient %1 ha reaccionado %1 jest przytomny %1 ist anprechbar + %1 reakcióképes + %1 e' cosciente + %1 está respondendo + %1 odpovídá - + %1 is not responsive - %1 n'est pas conscient - %1 не реагирует + %1 не реагирует на раздражители %1 est inconscient %1 no reacciona %1 jest nieprzytomny %1 ist nicht ansprechbar + %1 nem reagál + %1 e' incosciente + %1 não está respondendo + %1 neodpovídá - + You checked %1 - Vous diagnostiqué %1 Вы осмотрели раненого %1 Vous avez examiné %1 Examinas a %1 Zbadałeś %1 - Du versucht %1 anzusprechen + Du hast versucht, %1 anzusprechen + Megnézted %1-t + Hai controllato %1 + Você aferiu o paciente %1 + Zkontroloval jsi %1 - + + Patient %1<br/>is %2.<br/>%3.<br/>%4 + Paziente %1<br/>è %2.<br/>%3.<br/>%4 + Пациент %1<br/>%2.<br/>%3.<br/>%4 + Patient %1<br/>ist %2.<br/>%3.<br/>%4 + Patient %1<br/>est %2.<br/>%3.<br/> + Pacjent %1<br/>jest %2.<br/>%3.<br/>%4 + Paciente %1<br/>is %2.<br/>%3.<br/>%4 + A páciens, %1,<br/>%2.<br/>%3.<br/>%4 + Pacient %1<br/>je %2.<br/>%3.<br/>%4 + + + alive + Vivo + жив + lebendig + vivant + żywy + vivo + élő + naživu + + + dead + Morto + мёртв + muerto + tot + mort + martwy + halott + mrtev + + + He's lost some blood + Ha perso molto sangue + Ha perdido un poco de sangre + Есть кровопотеря + Er hat etwas Blut verloren + Il a perdu du sang + Stracił trochę krwi + Valamennyi vért vesztett + Ztratil trochu krve + + + He's lost a lot of blood + Er hat viel Blut verloren + Sok vért vesztett + Stracił sporo krwi + Большая кровопотеря + Ha perdido mucha sangre + Il a perdu beaucoup de sang + Ztratil hodně krve + + + He hasn't lost blood + Non ha perso sangue + Нет кровопотери + Er hat kein Blut verloren + Il n'a pas perdu de sang + Nie stracił krwi + No ha perdido sangre + Nem vesztett vért + Neztratil žádnou krev + + + He is in pain + è affetto da dolore + Испытывает боль + Er hat Schmerzen + Il souffre + Odczuwa ból + Siente dolor + Fájdalmai vannak + Je v bolestech + + + He is not in pain + Non è affetto da dolore + Не испытывает боли + Er hat keine Schmerzen + Il ne souffre pas + Nie odczuwa bólu + No siente dolor + Nincsenek fájdalmai + Nemá žádné bolesti + + Bandaged Bandé Повязка наложена - Pansement appliqué Vendado Zabandażowano + Bekötözve + Bendato + verbunden + Enfaixado + Obvázaný - + You bandage %1 (%2) Vous bandez %1 (%2) Вы перевязали раненого %1 (%2) - Vous avez pansé %1 (%2) Aplicas vendaje a %1 en %2 Bandażujesz %1 (%2) + Bekötözöd %1-t (%2) + Stai bendando %1 (%2) + Du verbindest %1 (%2) + Você aplica bandagem no paciente %1 (%2) + Obvazuješ %1 (%2) - + %1 is bandaging you %1 vous bande %1 перевязывает вас - %1 vous applique un pansement %1 te está vendando %1 bandażuje Ciebie + %1 bekötöz téged + %1 ti sta bendando + %1 verbindet dich + %1 está aplicando uma bandagem em você + %1 tě obvazuje - - You start stitching injures from %1 (%2) + + You start stitching injuries from %1 (%2) Вы зашиваете ранения от %1 (%2) + Du nähst die Wunden von %1 (%2) Vous suturez %1 (%2) Estás suturando heridas de %1 en %2 Zszywasz rany %1 (%2) + Elkezded összevarni %1 sérüléseit (%2) + Stai suturando le ferite di %1 (%2) + Você começa a suturar os ferimentos do %1 (%2) - + Stitching Наложение швов - Sutures Suturando + Nähen + Sutures Szycie + Összevarrás + Suturando + Suturando... + Šití - + You treat the airway of %1 Вы интубируете раненого %1 - Vous traitez les voies respiratoires de %1 Estás intubando a %1 + Du behandelst die Atemwege von %1 + Vous traitez les voies respiratoires de %1 Udrażniasz drogi oddechowe %1 + Kezeled %1 légútját + Controlli le vie respiratorie di %1 + Você entuba o %1 - + Airway Дыхательные пути Vías aéreas Drogi oddechowe Atemwege Voies respiratoires + Légút + Vie respiratorie + Vias Aéreas + Dýchací cesty - + %1 is treating your airway %1 проводит вам интубацию %1 traite vos voies respiratoires %1 te está intubando %1 udrażnia Twoje drogi oddechowe + %1 behandelt deine Atemwege + %1 kezeli a légútadat + %1 ti sta trattando le vie respiratorie + %1 está te entubando - + Drag Ziehen Arrastrar @@ -1180,7 +1886,7 @@ Arrastar Trascina - + Carry Tragen Cargar @@ -1192,7 +1898,7 @@ Carregar Trasporta - + Release Loslassen Soltar @@ -1200,89 +1906,642 @@ Položit Отпустить Déposer - Elenged - Largar - Lascia + Elengedés + Soltar + Rrilascia - + Load Patient Into Patient Einladen - Cargar el paciente en + Cargar al paciente en Załaduj pacjenta Naložit pacianta do Погрузить пациента в - Embarquer le Patient + Embarquer le patient Sebesült berakása Carregar Paciente Em Carica paziente nel - + Unload Patient Patient Ausladen - Descargar el paciente + Descargar al paciente Wyładuj pacjenta Vyložit pacienta Выгрузить пациента - Débarquer le Patient + Débarquer le patient Sebesült kihúzása Descarregar Paciente Scarica il paziente Unload patient - Descargar el paciente + Descargar al paciente Выгрузить пациента + Patient Ausladen Wyładuj pacjenta - Débarquer le Patient + Débarquer le patient + Sebesült kihúzása + Scarica il paziente + Descarregar Paciente + Vyložit pacienta Load patient - Cargar el paciente en + Cargar al paciente en Погрузить пациента + Patient Einladen Załaduj pacjenta - Embarquer le Patient + Embarquer le patient + Sebesült berakása + Carica il paziente + Carregar Paciente Em + Naložit pacienta - + Place body in bodybag Colocar cuerpo en bolsa para cadáveres Поместить тело в мешок для трупов + Körper in Leichesack verstauen Zapakuj ciało do worka na zwłoki Mettre le corps dans la housse mortuaire + Test hullazsákba helyezése + Metti il corpo nella sacca per cadaveri + Colocar corpo dentro do saco para cadáver + Umístni tělo do pytle na mrtvoly - + Placing body in bodybag Colocando cuerpo en bolsa para cadáveres - Упаковка тела + Упаковка тела ... + Verstaue Körper in Leichensack Pakowanie ciała do worka na zwłoki Placement du corps dans la housse + Test hullazsákba helyezése ... + Stai mettendo il corpo nella sacca + Colocando corpo dentro do saco para cadáver... + Umístňuji tělo do pytle na mrtvoly - + %1 has bandaged patient %1 has vendado al paciente %1 перевязал пациента + %1 hat den Patienten verbunden %1 zabandażował pacjenta %1 a pansé le patient + %1 bekötözte a pácienst + %1 ha bendato il paziente + %1 aplicou bandagem no paciente + %1 již obvázal pacienta - + %1 used %2 %1 usó %2 + %1 benutzt %2 %1 использовал %2 %1 użył %2 %1 utilise %2 + %1 használta a %2-t + %1 ha usato %2 + %1 usou %2 + %1 použil %2 - + %1 has given an IV - %1 has puesto una IV - %1 провел переливание + %1 провёл переливание + %1 ha puesto una IV + %1 hat eine Infusion verabreicht %1 podał IV %1 a administré une IV + %1 infúziót adott + %1 ha somministrato una IV + %1 aplicou um intravenoso + %1 již aplikoval IV - + %1 applied a tourniquet %1 aplicado torniquete %1 наложил жгут + %1 hat einen Tourniquet angelegt %1 założył stazę %1 a appliqué un garrot + %1 felhelyezett egy érszorítót + %1 ha applicato un laccio emostatico + %1 aplicou um torniquete + %1 použil škrtidlo + + + Heavily wounded + Schwer verwundet: + Ciężko ranny + Тяжелые ранения + Gravemente ferito + Gravemente herido + Lourdement blessé + Erősen sérült + Těžce zraněn + + + Lightly wounded + Leicht verwundet: + Lekko ranny + Легкие ранения + Leggermente ferito + Levemente herido + Légèrement blessé + Enyhén sérült + Lehce zraněn + + + Very lightly wounded + Sehr leicht verwundet: + B. lekko ranny + Царапины + Ferito lievemente + Muy levemente herido + Très légèrement blessé + Nagyon enyhén sérült + Velmi lehce zraněn + + + Head + Kopf + Głowa + Головы + Testa + Cabeza + Tête + Fej + Hlava + + + Torso + Torso + Tors + Торса + Torso + Torso + Torse + Testtörzs + Trup + + + Left Arm + Linker Arm + Lewe ramię + Левой руки + Braccio sinistro + Brazo izquierdo + Bras gouche + Bal kar + Levá ruka + + + Right Arm + Rechter Arm + Prawe ramię + Правой руки + Braccio destro + Brazo derecho + Bras droit + Jobb kar + Pravá ruka + + + Left Leg + Linkes Bein + Lewa noga + Левой ноги + Gamba sinistra + Pierna izquierda + Jambe gauche + Bal láb + Levá noha + + + Right Leg + Rechtes Bein + Prawa noga + Правой ноги + Gamba destra + Pierna derecha + Jambe droite + Jobb láb + Pravá noha + + + Pain Effect Type + Schmerzeffekt-Typ + Rodzaj efektu bólu + Визуальный эффект боли + Pain Effect Type + Tipo de efecto de dolor + Type d'effet de douleur + Fájdalom-effekt típusa + + + Colour Flashing + Farbblinken + Pulsujące kolory + Пульсирующий свет + Colore lampeggiante + Parpadeo de color + Flash de couleur + Színvillódzás + + + Chromatic Aberration + Chromatische Aberration + Aberracja chromatyczna + Хроматическая аберрация + Aberrazione cromatica + Aberración cromática + Aberration chromatique + Kromatikus aberráció + Chromatická aberace + + + Style of menu (Medical) + Styl menu medycznego + Style de menu (Médical) + Menü-Stil (Medical) + Вид меню (медицина) + Tipo de menú (Medico) + Styl menu (Zdravotní) + + + Select the type of menu you prefer; default 3d selections or radial. + Wybierz rodzaj menu, który preferujesz: domyślne pozycje 3D lub radialne + Selctionne le type de menu préféré; par défaut la sélection 3D ou radiale + Wähle den Menü-Stil: Standard 3D-Selektion oder kreisförmig. + Выберите тип меню: стандартный вариант (3D) или радиальный + Selecciona el tipo de menú que prefieres: selecciones 3d por defecto o radial. + Vyberte typ menu který preferujete: výchozí 3D nebo radiální. + + + Selections (3d) + Pozycje (3D) + sélections (3D) + 3D-Selektion + Стандартный (3D) + Selecciones (3d) + + + Radial + Radialne + Radiale + Kreisförmig + Радиальный + Radial + Radiální + + + Scrape + Kratzer + Scorticatura + Ссадина + Eraflure + Draśnięcie + Arañazo + Horzsolás + + + Minor Scrape + Kleiner Kratzer + Minima Scorticatura + Малая ссадина + Petite éraflure + Pomniejsze draśnięcie + Arañazo menor + Kis horzsolás + + + Medium Scrape + Mittlerer Kratzer + Media Scorticatura + Средняя ссадина + Moyenne éraflure + Średnie draśnięcie + Arañazo medio + Közepes horzsolás + + + Large Scrape + Großer Kratzer + Alta Scorticatura + Большая ссадина + Grande éraflure + Duże draśnięcie + Arañazo severo + Nagy horzsolás + + + Avulsion + Avulsion + Avulsione + Рваная рана + Avulsion + Rana płatowa + Avulsión + Leszakadás + + + Minor Avulsion + Kleine Avulsion + Minima Avulsione + Малая рваная рана + Petite avulsion + Pomniejsza rana płatowa + Avulsión menor + Kis leszakadás + + + Medium Avulsion + Mittlere Avulsion + Media Avulsione + Средняя рваная рана + Moyenne avulsion + Średnia rana płatowa + Avulsión media + Közepes leszakadás + + + Large Avulsion + Große Avulsion + Alta Avulsione + Большая рваная рана + Grande avulsion + Duża rana płatowa + Avulsión severa + Nagy leszakadás + + + Bruise + Prellung + Contusione + Ушиб + Hématome + Stłuczenie + Contusión + Zúzódás + + + Minor Bruise + Kleine Prellung + Minima Contusione + Малый ушиб + Petit hématome + Pomniejsze stłuczenie + Contusión menor + Kis zúzódás + + + Medium Bruise + Mittlere Prellung + Media Contusione + Средний ушиб + Hématome moyen + Średnie stłuczenie + Contusión media + Közepes zúzódás + + + Large Bruise + Große Prellung + Alta Contusione + Большой ушиб + Hématome important + Duże stłuczenie + Contusión severa + Nagy zúzódás + + + Crushed tissue + Quetschverletzung + Tessuto Schiacciato + Компресионная травма + Tissu écrasé + Zgniecienie tkanek miękkich + Tejido triturado + Zúzott szövet + + + Minor crushed tissue + Kleine Quetschverletzung + Minimo Tessuto Schiacciato + Малая компрессионная травма + Tissu écrasé léger + Pomniejsze zgniecienie tkanek miękkich + Tejido triturado menor + Kis zúzott szövet + + + Medium crushed tissue + Mittlere Quetschverletzung + Medio Tessuto Schiacciato + Средняя компрессионная травма + Tissu écrasé moyen + Średnie zgniecienie tkanek miękkich + Tejido triturado medio + Közepes zúzott szövet + + + Large crushed tissue + Große Quetschverletzung + Alto Tessuto Schiacciato + Большая компрессионная травма + Tissu écrasé large + Duże zgniecienie tkanek miękkich + Tejido triturado severo + Nagy zúzött szövet + + + Cut + Schnittwunde + Taglio + Резаная рана + Coupure + Rana cięta + Corte + Vágás + + + Small Cut + Kleine Schnittwunde + Piccolo Taglio + Малая резаная рана + Pomniejsza rana cięta + Corte menor + Kis vágás + Petite coupure + + + Medium Cut + Mittlere Schnittwunde + Medio Taglio + Средняя резаная рана + Średnia rana cięta + Corte mediano + Közepes vágás + Moyenne coupure + + + Large Cut + Große Schnittwunde + Grande Taglio + Большая резаная рана + Duża rana cięta + Corte severo + Nagy vágás + Large coupure + + + Tear + Riss + Strappo + Рваная рана + Rozerwanie skóry + Déchirure + Desgarro + Szakadás + + + Small Tear + Kleiner Riss + Piccolo Strappo + Малая рваная рана + Pomniejsze rozerwanie skóry + Petite Déchirure + Desgarro menor + Kis szakadás + + + Medium Tear + Mittlerer Riss + Medio Strappo + Средняя рваная рана + Średnie rozerwanie skóry + Desgarro medio + Közepes szakadás + Moyenne déchirure + + + Large Tear + Großer Riss + Grande Strappo + Большая рваная рана + Duże rozerwanie skóry + Desgarro severo + Nagy szakadás + Large déchirure + + + Velocity Wound + Ballistisches Trauma + Velocità Ferita + Огнестрельная рана + Rana postrzałowa + Blessure de vélocité + Herida de bala + Lőtt seb + + + Smal Velocity Wound + Kleines Ballistisches Trauma + Lenta Velocità Ferita + Малая огнестрельная рана + Pomniejsza rana postrzałowa + Herida de bala menor + Kis lőtt seb + Petite blessure de vélocité + + + Medium Velocity Wound + Mittleres Ballistisches Trauma + Media Velocità Ferita + Средняя огнестрельная рана + Średnia rana postrzałowa + Herida de bala media + Közepes lőtt seb + Moyenne blessure de vélocité + + + Large Velocity Wound + Großes Ballistisches Trauma + Alta Velocità Ferita + Большая огнестрельная рана + Duża rana postrzałowa + Herida de bala severa + Nagy lőtt seb + Large blessure de vélocité + + + Puncture Wound + Stichwunde + Puntura Ferita + Колотая рана + Rana kłuta + Blessure de perforation + Herida punzante + Szúrt seb + + + Minor Puncture Wound + Kleine Stichwunde + Piccola Puntura Ferita + Малая колотая рана + Pomniejsza rana kłuta + Herida punzante menor + Kis szúrt seb + Légère blessure de perforation + + + Medium Puncture Wound + Mittlere Stichwunde + Media Puntura Ferita + Средняя колотая рана + Średnia rana kłuta + Herida punzante media + Közepes szúrt seb + Moyenne blessure de perforation + + + Large Puncture Wound + Große Stichwunde + Grande Puntura Ferita + Большая колотая рана + Duża rana kłuta + Herida punzante severa + Nagy szúrt seb + Large blessure de perforation + + + Broken Femur + Gebrochener Oberschenkelknochen + Femore Rotto + Перелом + Zkłamana kość udowa + Fémur cassé + Femur roto + Törött combcsont + Zlomená kost stehenní + + + Treating ... + Behandeln ... + Ellátás ... + Leczenie ... + Traitement ... + Лечение ... + Tratando ... + Léčím ... + + + Removing Tourniquet ... + Tourniquet entfernen ... + Zdejmowanie stazy ... + Quitando torniquete ... + Retire le tourniquet ... diff --git a/addons/medical/ui/RscTitles.hpp b/addons/medical/ui/RscTitles.hpp index 1962daec80..dece0e0a8d 100644 --- a/addons/medical/ui/RscTitles.hpp +++ b/addons/medical/ui/RscTitles.hpp @@ -60,7 +60,7 @@ class Rsctitles { font = "PuristaMedium"; colorText[] = {0.95, 0.95, 0.95, 0.75}; colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; - text = "INJURIES"; + text = "$STR_ACE_Medical_Injuries"; }; class InjuryList: ACE_gui_listBoxBase { idc = 200; diff --git a/addons/medical/ui/icons/medical_crossRed.paa b/addons/medical/ui/icons/medical_crossRed.paa new file mode 100644 index 0000000000..5a0c8e9f9c Binary files /dev/null and b/addons/medical/ui/icons/medical_crossRed.paa differ diff --git a/addons/medical/ui/icons/medical_crossYellow.paa b/addons/medical/ui/icons/medical_crossYellow.paa new file mode 100644 index 0000000000..74ddefd837 Binary files /dev/null and b/addons/medical/ui/icons/medical_crossYellow.paa differ diff --git a/addons/medical/ui/triagecard.hpp b/addons/medical/ui/triagecard.hpp index f1b98f1e2d..c4d3145964 100644 --- a/addons/medical/ui/triagecard.hpp +++ b/addons/medical/ui/triagecard.hpp @@ -49,7 +49,7 @@ class GVAR(triageCard) { font = "PuristaMedium"; colorText[] = {0,0,0,1}; colorBackground[] = {0,0,0,0}; - text = "TRIAGE CARD"; + text = "$STR_ACE_Medical_Actions_TriageCard"; }; class TriageList: ACE_gui_listBoxBase { idc = 200; @@ -103,7 +103,7 @@ class GVAR(triageCard) { y = 0; w = 0; h = 0; - text = $STR_ACE_MEDICAL_TRIAGE_STATUS_NONE; + text = $STR_ACE_Medical_Triage_Status_None; style = 0x02; size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; @@ -121,7 +121,7 @@ class GVAR(triageCard) { y = 0; w = 0; h = 0; - text = $STR_ACE_MEDICAL_TRIAGE_STATUS_MINOR; + text = $STR_ACE_Medical_Triage_Status_Minor; style = 0x02; size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; @@ -139,7 +139,7 @@ class GVAR(triageCard) { y = 0; w = 0; h = 0; - text = $STR_ACE_MEDICAL_TRIAGE_STATUS_DELAYED; + text = $STR_ACE_Medical_Triage_Status_Delayed; style = 0x02; size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; @@ -157,7 +157,7 @@ class GVAR(triageCard) { y = 0; w = 0; h = 0; - text = $STR_ACE_MEDICAL_TRIAGE_STATUS_IMMEDIATE; + text = $STR_ACE_Medical_Triage_Status_Immediate; style = 0x02; size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; @@ -175,7 +175,7 @@ class GVAR(triageCard) { y = 0; w = 0; h = 0; - text = $STR_ACE_MEDICAL_TRIAGE_STATUS_DECEASED; + text = $STR_ACE_Medical_Triage_Status_Deceased; style = 0x02; size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; diff --git a/addons/microdagr/XEH_clientInit.sqf b/addons/microdagr/XEH_clientInit.sqf index c917eb0a8d..587bf85ef5 100644 --- a/addons/microdagr/XEH_clientInit.sqf +++ b/addons/microdagr/XEH_clientInit.sqf @@ -4,7 +4,7 @@ if (!hasInterface) exitWith {}; //Add Keybinds: -["ACE3", QGVAR(openGPS), (localize "STR_ACE_microdagr_toggleUnit"), +["ACE3 Equipment", QGVAR(openGPS), (localize "STR_ACE_microdagr_toggleUnit"), { // canInteractWith (can use on map) if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -17,7 +17,7 @@ if (!hasInterface) exitWith {}; {false}, [0xC7, [false, false, false]], false] call cba_fnc_addKeybind; //Home Key -["ACE3", QGVAR(closeGPS), (localize "STR_ACE_microdagr_closeUnit"), +["ACE3 Equipment", QGVAR(closeGPS), (localize "STR_ACE_microdagr_closeUnit"), { // canInteractWith (can use on map) if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -54,6 +54,8 @@ GVAR(rangeFinderPositionASL) = []; GVAR(mapAltitude) = getNumber (configFile >> "CfgWorlds" >> worldName >> "elevationOffset"); +private ["_worldMapLong", "_worldMapLat", "_zone", "_band", "_squareID"]; + //Calculate the map's MGRS: _worldMapLong = getNumber (configFile >> "CfgWorlds" >> worldName >> "longitude"); _worldMapLat = getNumber (configFile >> "CfgWorlds" >> worldName >> "latitude"); diff --git a/addons/microdagr/config.cpp b/addons/microdagr/config.cpp index e337aa96d5..4e459c126c 100644 --- a/addons/microdagr/config.cpp +++ b/addons/microdagr/config.cpp @@ -21,6 +21,6 @@ class ACE_Settings { class GVAR(MapDataAvailable) { value = 2; typeName = "SCALAR"; - isClientSetable = 0; + isClientSettable = 0; }; }; diff --git a/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf b/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf index 6912810f58..c383d0a95e 100644 --- a/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf +++ b/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf @@ -19,6 +19,8 @@ PARAMS_2(_waypointName,_waypointPosASL); +private "_waypoints"; + _waypoints = ace_player getVariable [QGVAR(waypoints), []]; _waypoints pushBack [_waypointName, _waypointPosASL]; ace_player setVariable [QGVAR(waypoints), _waypoints]; diff --git a/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf b/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf index 3d1e8ec852..62ca5a222a 100644 --- a/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf +++ b/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf @@ -18,6 +18,8 @@ PARAMS_1(_wpIndex); +private "_waypoints"; + _waypoints = ace_player getVariable [QGVAR(waypoints), []]; if ((_wpIndex < 0) || (_wpIndex > ((count _waypoints) - 1))) exitWith {ERROR("out of bounds wp");}; diff --git a/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf b/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf index f36d5f2548..21a164ff2e 100644 --- a/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf +++ b/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf @@ -20,6 +20,8 @@ PARAMS_4(_theMap,_mouseButton,_xPos,_yPos); +private ["_worldPos"]; + //Only handle LMB if (_mouseButton != 0) exitWith {}; diff --git a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf index 3acf3e889c..644064d069 100644 --- a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf +++ b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf @@ -17,7 +17,8 @@ PARAMS_1(_theMap); -_theMap = _this select 0; +private ["_mapSize", "_waypoints", "_size", "_targetPos", "_relBearing", "_wpName", "_wpPos", "_alpha"]; + _mapSize = (ctrlPosition _theMap) select 3; _waypoints = [] call FUNC(deviceGetWaypoints); @@ -48,11 +49,11 @@ if (GVAR(currentApplicationPage) == 1) then { } else { //Map Mode: if (GVAR(mapAutoTrackPosition)) then { - _theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), GVAR(gpsPositionASL)]; + _theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), (getPosASL ace_player)]; ctrlMapAnimCommit _theMap; }; _size = 48 * _mapSize; - _theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], GVAR(gpsPositionASL), _size, _size, (getDir ace_player), '', 0 ]; + _theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], (getPosASL ace_player), _size, _size, (getDir ace_player), '', 0 ]; if (GVAR(settingShowAllWaypointsOnMap)) then { _size = 32 * _mapSize; diff --git a/addons/microdagr/functions/fnc_openDisplay.sqf b/addons/microdagr/functions/fnc_openDisplay.sqf index ae5f7f47f5..b4cec0fe46 100644 --- a/addons/microdagr/functions/fnc_openDisplay.sqf +++ b/addons/microdagr/functions/fnc_openDisplay.sqf @@ -83,7 +83,6 @@ if ((_oldShowMode == DISPLAY_MODE_CLOSED) && {GVAR(currentShowMode) != DISPLAY_M }; [_pfID] call CBA_fnc_removePerFrameHandler; } else { - GVAR(gpsPositionASL) = getPosAsl ace_player; if (GVAR(currentShowMode) == DISPLAY_MODE_HIDDEN) then { //If display is hidden, and we can show, then swithc modes: if ([DISPLAY_MODE_DISPLAY] call FUNC(canShow)) then { diff --git a/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf b/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf index 1f4982d87f..64a5cab991 100644 --- a/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf +++ b/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf @@ -1,7 +1,7 @@ /* * Author: PabstMirror * Saves the current mode and sets a new mode - * Used to backup display when switching display modes + * Used to backup display when switching display modes * * Arguments: * 0: New Mode @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -private ["_display", "_theMap", "_mapSize", "_centerPos"]; +private ["_display", "_theMap", "_mapSize", "_centerPos", "_mapCtrlPos"]; PARAMS_1(_newMode); @@ -36,16 +36,16 @@ if (GVAR(currentApplicationPage) == 2) then { _centerPos = [((_mapCtrlPos select 0) + (_mapCtrlPos select 2) / 2), ((_mapCtrlPos select 1) + (_mapCtrlPos select 3) / 2)]; GVAR(mapPosition) = _theMap ctrlMapScreenToWorld _centerPos; GVAR(mapZoom) = (ctrlMapScale _theMap) * _mapSize; - + //Hit button again, toggle map modes: if (_newMode == 2) then { - if (GVAR(mapShowTexture)) then { - GVAR(mapShowTexture) = false; - } else { + if (GVAR(mapShowTexture)) then { + GVAR(mapShowTexture) = false; + } else { if (GVAR(MapDataAvailable) == MAP_DETAIL_SAT) then { GVAR(mapShowTexture) = true; }; - }; + }; }; }; diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index 2a5f34a12c..26e5ef8638 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -44,7 +44,7 @@ case (APP_MODE_INFODISPLAY): { (_display displayCtrl IDC_MODEDISPLAY_NORTHING) ctrlSetText _northingText; //Elevation: - _numASL = (GVAR(gpsPositionASL) select 2) + GVAR(mapAltitude); + _numASL = ((getPosASL ace_player) select 2) + GVAR(mapAltitude); _aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber; _aboveSeaLevelText = if (_numASL > 0) then {"+" + _aboveSeaLevelText + " MSL"} else {_aboveSeaLevelText + " MSL"}; (_display displayCtrl IDC_MODEDISPLAY_ELEVATIONNUM) ctrlSetText _aboveSeaLevelText; @@ -88,13 +88,13 @@ case (APP_MODE_INFODISPLAY): { }; if (!(_targetPosLocationASL isEqualTo [])) then { - _bearing = [GVAR(gpsPositionASL), _targetPosLocationASL] call BIS_fnc_dirTo; + _bearing = [(getPosASL ace_player), _targetPosLocationASL] call BIS_fnc_dirTo; _bearingText = if (GVAR(settingUseMils)) then { [(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber; } else { ([(floor (_bearing)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; - _2dDistanceKm = ((GVAR(gpsPositionASL) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000; + _2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000; _rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)]; _numASL = (_targetPosLocationASL select 2) + GVAR(mapAltitude); _aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber; @@ -125,7 +125,7 @@ case (APP_MODE_COMPASS): { (_display displayCtrl IDC_MODECOMPASS_RANGE) ctrlSetText ""; (_display displayCtrl IDC_MODECOMPASS_TARGET) ctrlSetText ""; } else { - _playerPos2d = GVAR(gpsPositionASL) select [0,2]; + _playerPos2d = (getPosASL ace_player) select [0,2]; _targetPosName = ""; _targetPosLocationASL = []; @@ -145,13 +145,13 @@ case (APP_MODE_COMPASS): { _rangeText = "---"; if (!(_targetPosLocationASL isEqualTo [])) then { - _bearing = [GVAR(gpsPositionASL), _targetPosLocationASL] call BIS_fnc_dirTo; + _bearing = [(getPosASL ace_player), _targetPosLocationASL] call BIS_fnc_dirTo; _bearingText = if (GVAR(settingUseMils)) then { [(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber; } else { ([(floor (_bearing)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; - _2dDistanceKm = ((GVAR(gpsPositionASL) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000; + _2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000; _rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)]; }; @@ -169,7 +169,7 @@ case (APP_MODE_WAYPOINTS): { { EXPLODE_2_PVT(_x,_wpName,_wpPos); _wpListBox lbAdd _wpName; - _2dDistanceKm = ((GVAR(gpsPositionASL) select [0,2]) distance (_wpPos select [0,2])) / 1000; + _2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_wpPos select [0,2])) / 1000; _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)])]; } forEach _waypoints; diff --git a/addons/microdagr/stringtable.xml b/addons/microdagr/stringtable.xml index 0f3c1368cb..09c96705b4 100644 --- a/addons/microdagr/stringtable.xml +++ b/addons/microdagr/stringtable.xml @@ -9,6 +9,9 @@ MicroDAGR GPS MicroDAGR GPS MicroDAGR GPS + MicroDAGR GPS + MicroDAGR GPS + GPS MicroDAGR MicroDAGR advanced GPS receiver @@ -18,6 +21,9 @@ Zaawansowany odbiornik GPS MicroDAGR Récepteur GPS MicroDAGR MicroDAGR pokročílá GPS příjímač + MicroDAGR fejlett GPS vevőegység + MicroDAGR ricevitore GPS avanzato + Recepitor GPS avançado MicroDAGR Angular Unit: @@ -27,6 +33,9 @@ Unité angulaire Winkeleinheit: Úhlová jednotka: + Szögmértékegység: + Unità angolare: + Unidade Angular: Mils @@ -36,6 +45,9 @@ Tysiączne Mils Mils + Mil + Miglia + Mils: Show Waypoints On Map: @@ -45,6 +57,9 @@ Pokaż PT na mapie: Montrer points de passage sur la carte Ukázat waypointy na mapě: + Útvonalpontok mutatása a térképen: + Mostra waypoint sulla mappa: + Mostrar Waypoints no mapa: Degrees @@ -54,37 +69,45 @@ Stopnie Degrés Stupně + Fok + Gradi + Graus On Zapnuto Allumé Ein - + Acceso Wł. Ativar Вкл. Encendido + Be Off Vypnuto Eteint Aus - No + Spento Wył. Desativar Выкл. Apagado + Ki Enter Grid Cords: Introducir coordenadas de cuadrícula: - Введите координаты: + Введите сеточные координаты: Wprowadź współrzędne: Entrer coordonnées Koordinaten eingeben: Napiš souřadnice: + Add meg a rácskoordinátákat: + Introduci griglia coordinate: + Digite as Ccords. do Grid Name of [%1] @@ -94,6 +117,9 @@ Nazwa [%1] Nom de %1 Název [%1] + [%1] neve + Nome di [%1] + Nome do [%1] MGRS-New @@ -103,6 +129,9 @@ MGRS-Nowy Info-MGRS MGRS-Nový + MGRS-új + Nuovo MGRS + MGRS-Novo WGD @@ -112,15 +141,21 @@ WGD WGD WGD + WGD + WGD + WGD Range: Distancia: - Reichweite: + Distanz: Дистанция: Dystans: Distance: Vzdálenost: + Távolság: + Distanza: + Distância: Compass Direction @@ -130,6 +165,9 @@ Azymut Azimut Azimut: + Irányszög + Azimut + Direção na bússula Mark @@ -139,6 +177,9 @@ Oznacz Marque Označit + Jelölés + Marca + Marca Waypoints @@ -148,15 +189,21 @@ Waypointy Punkty trasy Point de passage + Útvonalpontok + waypoints + Waypoints Connect To Conectar a - Соединиться с + Подключиться к Verbinde zu Připojit k Podłącz do Connecter + Csatlakozás + Collega a + Conectar à Settings @@ -166,6 +213,9 @@ Настройки Nastavení Ustawienia + Beállítások + Impostaizoni + Opções SetWP @@ -175,6 +225,9 @@ Nastavit WP UstawPT Définir point de passage + UP Beállítása + Definisci WayPoints + Definir WP Add @@ -184,6 +237,9 @@ Přidat Dodaj Ajouter + Hozzáadás + Aggiungi + Adicionar Delete @@ -195,15 +251,19 @@ Excluir Удалить Borrar + Törlés Toggle MicroDAGR Display Mode - MicoDAGR Anzeigemodus Wechseln - Conmutar modo de pantalla del MicroDAGR + MicoDAGR Anzeigemodus wechseln + Cambiar modo de pantalla del MicroDAGR Сменить режим показа MicroDAGR - Przełącz tryb wyświetlania MicroDAGR + Przełącz GUI MicroDAGR Basculer le mode d'affichage MicroDAGR Přepnout zobrazení MircroDAGRu + MicroDAGR kijelzési mód váltása + Alterna modalità display MicroDAGR + Alternar Modo de Display do MicroDAGR Show MicoDAGR @@ -213,15 +273,21 @@ Ukázat MicroDAGR GPS Pokaż MicroDAGR Afficher MicroDAGR + MicroDAGR mutatása + Mostra MicroDAGR + Mostrar MicroDAGR Configure MicroDAGR - MicroDAGR Konfiguriere + Konfiguriere MicroDAGR Configurar MicroDAGR Настроить MicroDAGR Konfigurovat MicroDAGR GPS Konfiguruj MicroDAGR Configurer MicroDAGR + MicroDAGR konfigurálása + ConfiguraMicroDAGR + Configurar MicroDAGR Close MicroDAGR @@ -231,6 +297,9 @@ Zavřít MicroDAGR GPS Zamknij MicroDAGR Fermer MicroDAGR + MicroDAGR elrejtése + Chiudi MicroDAGR + Fechar MicroDAGR diff --git a/addons/missileguidance/ACE_Settings.hpp b/addons/missileguidance/ACE_Settings.hpp index 060bde199b..d489ef15f3 100644 --- a/addons/missileguidance/ACE_Settings.hpp +++ b/addons/missileguidance/ACE_Settings.hpp @@ -1,9 +1,10 @@ class ACE_Settings { class GVAR(enabled) { - value = 1; - typeName = "BOOL"; - isClientSetable = 1; + value = 2; + typeName = "SCALAR"; + isClientSettable = 1; displayName = "$STR_ACE_MissileGuidance"; description = "$STR_ACE_MissileGuidance_Desc"; + values[] = {"Off", "Player Only", "Player and AI"}; }; }; \ No newline at end of file diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index a05ecee9bc..680a410506 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -8,29 +8,29 @@ class CfgAmmo { class M_PG_AT : MissileBase { model = "\A3\Weapons_F\Ammo\Rocket_01_fly_F"; - proxyShape = "\A3\Weapons_F\Ammo\Rocket_01_F"; + proxyShape = "\A3\Weapons_F\Ammo\Rocket_01_F"; irLock = 0; - laserLock = 0; - airLock = 0; - weaponLockSystem = "2 + 16"; + laserLock = 0; + airLock = 0; + weaponLockSystem = "2 + 16"; - maxSpeed = 720; - maxControlRange = 5000; - maneuvrability = 8; - timeToLive = 60; - simulationStep = 0.01; - airFriction = 0.1; - sideAirFriction = 0.16; - initTime = 0.002; - thrustTime = 1.07; - thrust = 530; - fuseDistance = 2; + maxSpeed = 720; + maxControlRange = 5000; + maneuvrability = 8; + timeToLive = 60; + simulationStep = 0.01; + airFriction = 0.1; + sideAirFriction = 0.16; + initTime = 0.002; + thrustTime = 1.07; + thrust = 530; + fuseDistance = 2; - effectsMissileInit = "MissileDAR1"; - effectsMissile = "missile2"; - whistleDist = 4; - muzzleEffect = ""; + effectsMissileInit = "MissileDAR1"; + effectsMissile = "missile2"; + whistleDist = 4; + muzzleEffect = ""; // Turn off arma crosshair-guidance manualControl = 0; @@ -46,9 +46,8 @@ class CfgAmmo { minDeflection = 0.00025; // Minium flap deflection for guidance maxDeflection = 0.001; // Maximum flap deflection for guidance incDeflection = 0.0005; // The incrmeent in which deflection adjusts. - //minDeflection = 0.005; - //maxDeflection = 0.5; - //incDeflection = 0.005; + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode // Guidance type for munitions defaultSeekerType = "SALH"; @@ -71,17 +70,17 @@ class CfgAmmo { class ACE_Hydra70_DAGR : M_PG_AT { displayName = "$STR_ACE_Hydra70_DAGR"; - displayNameShort = "$STR_ACE_Hydra70_DAGR_Short"; + displayNameShort = "$STR_ACE_Hydra70_DAGR_Short"; description = "$STR_ACE_Hydra70_DAGR"; - descriptionShort = "$STR_ACE_Hydra70_DAGR_Desc"; + descriptionShort = "$STR_ACE_Hydra70_DAGR_Desc"; }; class ACE_Hellfire_AGM114K : ACE_Hydra70_DAGR { displayName = "$STR_ACE_Hellfire_AGM114K"; - displayNameShort = "$STR_ACE_Hellfire_AGM114K_Short"; + displayNameShort = "$STR_ACE_Hellfire_AGM114K_Short"; - description = "$STR_ACE_Hellfire_AGM114K_desc"; + description = "$STR_ACE_Hellfire_AGM114K_desc"; descriptionShort = "$STR_ACE_Hellfire_AGM114K_desc"; // @TODO: placeholder model to at least make it look different @@ -90,21 +89,22 @@ class CfgAmmo { hit = 1400; indirectHit = 71; - indirectHitRange = 4.5; - effectsMissile = "missile2"; + indirectHitRange = 4.5; + effectsMissile = "missile2"; }; // Titan class M_Titan_AT : MissileBase { irLock = 0; - laserLock = 0; - airLock = 0; + laserLock = 0; + airLock = 0; // Turn off arma crosshair-guidance manualControl = 0; - hit = 1400; - + hit = 1400; // default: 800 + indirectHit = 20; + indirectHitRange = 2; // ACE uses these values //trackOversteer = 1; //trackLead = 0; @@ -116,9 +116,8 @@ class CfgAmmo { minDeflection = 0.00005; // Minium flap deflection for guidance maxDeflection = 0.025; // Maximum flap deflection for guidance incDeflection = 0.00005; // The incrmeent in which deflection adjusts. - //minDeflection = 0.005; - //maxDeflection = 0.5; - //incDeflection = 0.005; + + canVanillaLock = 0; // Guidance type for munitions defaultSeekerType = "Optic"; diff --git a/addons/missileguidance/CfgEventhandlers.hpp b/addons/missileguidance/CfgEventhandlers.hpp index 49f067ff46..8afeb9245e 100644 --- a/addons/missileguidance/CfgEventhandlers.hpp +++ b/addons/missileguidance/CfgEventhandlers.hpp @@ -12,6 +12,12 @@ class Extended_PostInit_EventHandlers { class Extended_FiredBIS_EventHandlers { class All { - ADDON = QUOTE(_this call FUNC(fired)); + ADDON = QUOTE(_this call FUNC(onFired)); + }; +}; + +class Extended_IncomingMissile_EventHandlers { + class All { + ADDON = QUOTE(_this call FUNC(onIncomingMissile)); }; }; \ No newline at end of file diff --git a/addons/missileguidance/CfgVehicles.hpp b/addons/missileguidance/CfgVehicles.hpp index 7707717c9e..0d9ef54d07 100644 --- a/addons/missileguidance/CfgVehicles.hpp +++ b/addons/missileguidance/CfgVehicles.hpp @@ -17,8 +17,9 @@ class CfgVehicles { class MainTurret; }; }; - + class ACE_Comanche_Test : B_Heli_Attack_01_F { + scope = 1; displayName = "ACE_Comanche_Test"; author = "ACE Team"; class Library { @@ -30,4 +31,5 @@ class CfgVehicles { }; }; }; + }; diff --git a/addons/missileguidance/Example_ACE_MissileGuidance.hpp b/addons/missileguidance/Example_ACE_MissileGuidance.hpp deleted file mode 100644 index 400a3a9a41..0000000000 --- a/addons/missileguidance/Example_ACE_MissileGuidance.hpp +++ /dev/null @@ -1,65 +0,0 @@ -THIS IS A WIP FUNCTIONALITY, DUE TO CHANGE - - - class M_PG_AT : MissileBase { - model = "\A3\Weapons_F\Ammo\Rocket_01_fly_F"; - proxyShape = "\A3\Weapons_F\Ammo\Rocket_01_F"; - - irLock = 0; - laserLock = 0; - airLock = 0; - weaponLockSystem = "2 + 16"; - - maxSpeed = 720; - maxControlRange = 5000; - maneuvrability = 8; - timeToLive = 60; - simulationStep = 0.01; - airFriction = 0.1; - sideAirFriction = 0.16; - initTime = 0.002; - thrustTime = 1.07; - thrust = 530; - fuseDistance = 2; - - effectsMissileInit = "MissileDAR1"; - effectsMissile = "missile2"; - whistleDist = 4; - muzzleEffect = ""; - - // Turn off arma crosshair-guidance - manualControl = 0; - - // ACE uses these values - trackOversteer = 1; - trackLead = 0; - - // Begin ACE guidance Configs - class ACE_MissileGuidance { - enabled = 1; - - minDeflection = 0.005; // Minium flap deflection for guidance - maxDeflection = 0.025; // Maximum flap deflection for guidance - incDeflection = 0.005; // The incrmeent in which deflection adjusts. - //minDeflection = 0.005; - //maxDeflection = 0.5; - //incDeflection = 0.005; - - // Guidance type for munitions - defaultSeekerType = "SALH"; - seekerTypes[] = { "SALH", "LIDAR", "SARH", "Optic", "Thermal", "GPS", "SACLOS", "MCLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - seekerAngle = 90; // Angle in front of the missile which can be searched - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 1; - seekerMaxRange = 2500; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "LIN"; - attackProfiles[] = { "LIN", "DIR", "MID", "HI", "TOP", "PYM" }; - }; - }; \ No newline at end of file diff --git a/addons/missileguidance/XEH_post_init.sqf b/addons/missileguidance/XEH_post_init.sqf index dc30361926..deaeef669d 100644 --- a/addons/missileguidance/XEH_post_init.sqf +++ b/addons/missileguidance/XEH_post_init.sqf @@ -1,2 +1,3 @@ #include "script_component.hpp" +[QGVAR(handoff), {_this call FUNC(handleHandoff)}] call EFUNC(common,addEventHandler); diff --git a/addons/missileguidance/XEH_pre_init.sqf b/addons/missileguidance/XEH_pre_init.sqf index 8d277bc3b0..08219e02f0 100644 --- a/addons/missileguidance/XEH_pre_init.sqf +++ b/addons/missileguidance/XEH_pre_init.sqf @@ -7,12 +7,16 @@ PREP(changeMissileDirection); PREP(checkSeekerAngle); PREP(checkLos); -PREP(fired); +PREP(onFired); +PREP(onIncomingMissile); PREP(guidancePFH); PREP(doAttackProfile); PREP(doSeekerSearch); +PREP(doHandoff); +PREP(handleHandoff); + // Attack Profiles PREP(attackProfile_LIN); PREP(attackProfile_DIR); diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf index da01b7d900..d84b3b126b 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf @@ -9,6 +9,7 @@ EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_state"]; +private["_cruisAlt", "_distanceShooterToTarget", "_shooterPos"]; _seekerTargetPos = _this select 0; _launchParams = _this select 1; @@ -43,21 +44,17 @@ switch( (_state select 0) ) do { }; case STAGE_CLIMB: { TRACE_1("STAGE_CLIMB",""); - _cruisAlt = 60; - if(_distanceShooterToTarget < w) then { - _cruisAlt = 60 * (_distanceShooterToTarget/2000); - TRACE_1("_cruisAlt", _cruisAlt); - }; - + _cruisAlt = 60 * (_distanceShooterToTarget/2000); + if( ((ASLToATL _projectilePos) select 2) - ((ASLToATL _seekerTargetPos) select 2) >= _cruisAlt) then { _state set[0, STAGE_TERMINAL]; } else { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2]; + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*1.5]; }; }; case STAGE_TERMINAL: { TRACE_1("STAGE_TERMINAL",""); - //_returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget * 0.02]; + _returnTargetPos = _seekerTargetPos; }; }; diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf index 4e83e046ff..393abebc19 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf @@ -9,6 +9,8 @@ EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_state"]; +private["_cruisAlt", "_distanceShooterToTarget", "_shooterPos"]; + _seekerTargetPos = _this select 0; _launchParams = _this select 1; @@ -48,23 +50,29 @@ switch( (_state select 0) ) do { _cruisAlt = 140 * (_distanceShooterToTarget/1250); TRACE_1("_cruisAlt", _cruisAlt); }; - if( ((ASLToATL _projectilePos) select 2) - ((ASLToATL _seekerTargetPos) select 2) >= _cruisAlt) then { - _state set[0, STAGE_COAST]; + if(_cruisAlt < 140) then { + _state set[0, STAGE_TERMINAL]; + } else { + _state set[0, STAGE_COAST]; + }; } else { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2]; + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*1.5]; }; }; case STAGE_COAST: { TRACE_1("STAGE_COAST",""); - if(_distanceShooterToTarget < 1250 || _distanceToTarget < ( ((ASLToATL _projectilePos) select 2) - (( ASLToATL _seekerTargetPos) select 2) )) then { + TRACE_1("", ((ASLToATL _projectilePos) select 2) - (( ASLToATL _seekerTargetPos) select 2) ); + if(_distanceToTarget < ( ((ASLToATL _projectilePos) select 2) - (( ASLToATL _seekerTargetPos) select 2) ) * 1.5) then { _state set[0, STAGE_TERMINAL]; + } else { + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,(_projectilePos select 2)]; }; - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,(_projectilePos select 2)]; }; case STAGE_TERMINAL: { TRACE_1("STAGE_TERMINAL",""); //_returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget * 0.02]; + _returnTargetPos = _seekerTargetPos; }; }; diff --git a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf index 032ae51791..8c67e68402 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf @@ -3,7 +3,7 @@ EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; -private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos"]; +private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_shooterPos"]; _seekerTargetPos = _this select 0; _launchParams = _this select 1; diff --git a/addons/missileguidance/functions/fnc_doAttackProfile.sqf b/addons/missileguidance/functions/fnc_doAttackProfile.sqf index fa7c6f4f8b..b9a3502035 100644 --- a/addons/missileguidance/functions/fnc_doAttackProfile.sqf +++ b/addons/missileguidance/functions/fnc_doAttackProfile.sqf @@ -2,8 +2,7 @@ #include "script_component.hpp" EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private["_attackProfilePos"]; - +private["_testName", "_attackProfilePos", "_attackProfile", "_attackProfileName", "_attackProfilesCfg", "_i", "_launchParams", "_testame", "_testProfile"]; _launchParams = ((_this select 1) select 1); _attackProfileName = _launchParams select 3; diff --git a/addons/missileguidance/functions/fnc_doHandoff.sqf b/addons/missileguidance/functions/fnc_doHandoff.sqf new file mode 100644 index 0000000000..d99998c8c4 --- /dev/null +++ b/addons/missileguidance/functions/fnc_doHandoff.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" +PARAMS_2(_target,_args); + +[QGVAR(handoff), [_target, _args]] call EFUNC(common,globalEvent); \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_doSeekerSearch.sqf b/addons/missileguidance/functions/fnc_doSeekerSearch.sqf index 1e43d83218..081ab16353 100644 --- a/addons/missileguidance/functions/fnc_doSeekerSearch.sqf +++ b/addons/missileguidance/functions/fnc_doSeekerSearch.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private["_seekerProfilePos"]; +private["_seekerProfilePos", "_i", "_launchParams", "_seekerType", "_seekerTypeName", "_seekerTypesCfg", "_testName", "_testProfile"]; _launchParams = ((_this select 1) select 1); _seekerTypeName = _launchParams select 2; diff --git a/addons/missileguidance/functions/fnc_fired.sqf b/addons/missileguidance/functions/fnc_fired.sqf deleted file mode 100644 index 8b90b2353f..0000000000 --- a/addons/missileguidance/functions/fnc_fired.sqf +++ /dev/null @@ -1,80 +0,0 @@ -//#define DEBUG_MODE_FULL -#include "script_component.hpp" - -// Bail if guidance is disabled -if(!GVAR(enabled)) exitWith { false }; - -// Bail on locality of the projectile, it should be local to us -if(!local _projectile) exitWith { false }; - -private["_config", "_enabled", "_target", "_seekerType", "_attackProfile"]; -PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - -// Bail on not missile -if(! (_ammo isKindOf "MissileBase") ) exitWith { false }; - -_config = configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON); -_enabled = getNumber ( _config >> "enabled"); - -// Bail if guidance is not enabled -if(isNil "_enabled" || {_enabled != 1}) exitWith { false }; - -_target = (vehicle _shooter) getVariable [QGVAR(target), nil]; -_seekerType = (vehicle _shooter) getVariable [QGVAR(seekerType), nil]; -_attackProfile = (vehicle _shooter) getVariable [QGVAR(attackProfile), nil]; -_lockMode = (vehicle _shooter) getVariable [QGVAR(lockMode), nil]; - -TRACE_3("Begin guidance", _target, _seekerType, _attackProfile); - -if ( isNil "_seekerType" || { ! ( _seekerType in (getArray (_config >> "seekerTypes" ) ) ) } ) then { - _seekerType = getText (_config >> "defaultSeekerType"); -}; -if ( isNil "_attackProfile" || { ! ( _attackProfile in (getArray (_config >> "attackProfiles" ) ) ) } ) then { - _attackProfile = getText (_config >> "defaultAttackProfile"); -}; -if ( isNil "_lockMode" || { ! ( _lockMode in (getArray (_config >> "seekerLockModes" ) ) ) } ) then { - _lockMode = getText (_config >> "defaultSeekerLockMode"); -}; - -// If we didn't get a target, try to fall back on tab locking -if(isNil "_target") then { - _canUseLock = getNumber (_config >> "canVanillaLock"); - if(_canUseLock > 0) then { - // @TODO: Get vanilla target - _vanillaTarget = cursorTarget; - - TRACE_1("Using Vanilla Locking", _vanillaTarget); - if(!isNil "_vanillaTarget") then { - _target = _vanillaTarget; - }; - }; -}; - -TRACE_4("Beginning ACE guidance system",_target,_ammo,_seekerType,_attackProfile); -[FUNC(guidancePFH), 0, [_this, - [ACE_player, - [_target, _targetPos, _launchPos], - _seekerType, - _attackProfile, - _lockMode - ], - [ - getNumber ( _config >> "minDeflection" ), - getNumber ( _config >> "maxDeflection" ), - getNumber ( _config >> "incDeflection" ) - ], - [ - getNumber ( _config >> "seekerAngle" ), - getNumber ( _config >> "seekerAccuracy" ), - getNumber ( _config >> "seekerMaxRange" ) - ], - [ diag_tickTime, [], [] ] - ] -] call cba_fnc_addPerFrameHandler; - -/* Clears locking settings -(vehicle _shooter) setVariable [QGVAR(target), nil]; -(vehicle _shooter) setVariable [QGVAR(seekerType), nil]; -(vehicle _shooter) setVariable [QGVAR(attackProfile), nil]; -(vehicle _shooter) setVariable [QGVAR(lockMode), nil]; -*/ \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index f7fd56c164..614323d63f 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -7,6 +7,7 @@ private["_launchParams", "_targetLaunchParams", "_flightParams", "_seekerParams" private["_lastRunTime", "_runtimeDelta", "_adjustTime", "_args", "_seekerTargetPos", "_projectilePos"]; private["_profileAdjustedTargetPos", "_incDeflection", "_minDeflection", "_maxDeflection"]; private["_targetVector", "_adjustVector", "_finalAdjustVector", "_changeVector", "_pitch", "_yaw", "_roll"]; +private["_PS", "_distanceToTarget", "_targetRelativeVector", "_vectorTo"]; _args = _this select 0; EXPLODE_7_PVT((_args select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); @@ -92,6 +93,10 @@ if(accTime > 0) then { drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _projectilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; drawLine3D [ASLtoATL _projectilePos, ASLtoATL _profileAdjustedTargetPos, [1,0,0,1]]; +_ps = "#particlesource" createVehicleLocal (ASLtoATL _projectilePos); +_PS setParticleParams [["\A3\Data_f\cl_basic", 8, 3, 1], "", "Billboard", 1, 3.0141, [0, 0, 2], [0, 0, 0], 1, 1.275, 1, 0, [1, 1], [[1, 0, 0, 1], [1, 0, 0, 1], [1, 0, 0, 1]], [1], 1, 0, "", "", nil]; +_PS setDropInterval 3.0; + hintSilent format["d: %1", _distanceToTarget]; #endif diff --git a/addons/missileguidance/functions/fnc_handleHandoff.sqf b/addons/missileguidance/functions/fnc_handleHandoff.sqf new file mode 100644 index 0000000000..017a9c0160 --- /dev/null +++ b/addons/missileguidance/functions/fnc_handleHandoff.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" +PARAMS_2(_target,_args); + +if(isNil "_target" || {isNull _target} || {!local _target} ) exitWith { false }; + +[FUNC(guidancePFH), 0, _args] call cba_fnc_addPerFrameHandler; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf new file mode 100644 index 0000000000..c5053c6e73 --- /dev/null +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -0,0 +1,115 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +// Bail if guidance is disabled +// Bail on locality of the projectile, it should be local to us +if(GVAR(enabled) < 1 || {!local _projectile} ) exitWith { false }; + +if( !isPlayer _shooter && { GVAR(enabled) < 2 } ) exitWith { false }; + +private["_config", "_configs", "_enabled", "_target", "_seekerType", "_attackProfile"]; +private["_args", "_canUseLock", "_guidingUnit", "_launchPos", "_lockMode", "_targetPos", "_vanillaTarget"]; + +PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + +// Bail on not missile +if(! (_ammo isKindOf "MissileBase") ) exitWith { false }; + +_configs = configProperties [configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON), "true", false]; +if( (count _configs) < 1) exitWith {}; +_config = (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON)); +_enabled = getNumber ( _config >> "enabled"); + +// Bail if guidance is not enabled +if(isNil "_enabled" || {_enabled != 1}) exitWith { false }; + +_target = (vehicle _shooter) getVariable [QGVAR(target), nil]; +_targetPos = (vehicle _shooter) getVariable [QGVAR(targetPosition), nil]; +_seekerType = (vehicle _shooter) getVariable [QGVAR(seekerType), nil]; +_attackProfile = (vehicle _shooter) getVariable [QGVAR(attackProfile), nil]; +_lockMode = (vehicle _shooter) getVariable [QGVAR(lockMode), nil]; + +// @TODO: make this vehicle shooter, but we need to differentiate where its set in ace_laser +_laserCode = _shooter getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; +_laserInfo = [_laserCode, ACE_DEFAULT_LASER_WAVELENGTH, ACE_DEFAULT_LASER_WAVELENGTH]; + +_launchPos = getPosASL (vehicle _shooter); + +TRACE_3("Begin guidance", _target, _seekerType, _attackProfile); + +if ( isNil "_seekerType" || { ! ( _seekerType in (getArray (_config >> "seekerTypes" ) ) ) } ) then { + _seekerType = getText (_config >> "defaultSeekerType"); +}; +if ( isNil "_attackProfile" || { ! ( _attackProfile in (getArray (_config >> "attackProfiles" ) ) ) } ) then { + _attackProfile = getText (_config >> "defaultAttackProfile"); +}; +if ( isNil "_lockMode" || { ! ( _lockMode in (getArray (_config >> "seekerLockModes" ) ) ) } ) then { + _lockMode = getText (_config >> "defaultSeekerLockMode"); +}; + +// If we didn't get a target, try to fall back on tab locking +if(isNil "_target") then { + if(!isPlayer _shooter) then { + // This was an AI shot, lets still guide it on the AI target + _target = _shooter getVariable[QGVAR(vanilla_target), nil]; + TRACE_1("Detected AI Shooter!", _target); + } else { + _canUseLock = getNumber (_config >> "canVanillaLock"); + // @TODO: Get vanilla target + if(_canUseLock > 0 || difficulty < 1) then { + _vanillaTarget = cursorTarget; + + TRACE_1("Using Vanilla Locking", _vanillaTarget); + if(!isNil "_vanillaTarget") then { + _target = _vanillaTarget; + }; + }; + }; +}; + +TRACE_4("Beginning ACE guidance system",_target,_ammo,_seekerType,_attackProfile); +_args = [_this, + [_shooter, + [_target, _targetPos, _launchPos], + _seekerType, + _attackProfile, + _lockMode, + _laserInfo + ], + [ + getNumber ( _config >> "minDeflection" ), + getNumber ( _config >> "maxDeflection" ), + getNumber ( _config >> "incDeflection" ) + ], + [ + getNumber ( _config >> "seekerAngle" ), + getNumber ( _config >> "seekerAccuracy" ), + getNumber ( _config >> "seekerMaxRange" ) + ], + [ diag_tickTime, [], [] ] + ]; + +// Hand off to the guiding unit. We just use local player so local PFH fires for now +// Laser code needs to give us a shooter for LOBL, or the seeker unit needs to be able to shift locality +// Based on its homing laser +// Lasers need to be handled in a special LOAL/LOBL case + +//if(isPlayer _shooter) then { +// _guidingUnit = ACE_player; +// +// if(local _guidingUnit) then { +// [FUNC(guidancePFH), 0, _args ] call cba_fnc_addPerFrameHandler; +// } else { +// [QGVAR(handoff), [_guidingUnit, _args] ] call FUNC(doHandoff); +// }; +//} else { + [FUNC(guidancePFH), 0, _args ] call cba_fnc_addPerFrameHandler; +//}; + + +/* Clears locking settings +(vehicle _shooter) setVariable [QGVAR(target), nil]; +(vehicle _shooter) setVariable [QGVAR(seekerType), nil]; +(vehicle _shooter) setVariable [QGVAR(attackProfile), nil]; +(vehicle _shooter) setVariable [QGVAR(lockMode), nil]; +*/ \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_onIncomingMissile.sqf b/addons/missileguidance/functions/fnc_onIncomingMissile.sqf new file mode 100644 index 0000000000..33ebeb34e2 --- /dev/null +++ b/addons/missileguidance/functions/fnc_onIncomingMissile.sqf @@ -0,0 +1,8 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +PARAMS_3(_target,_ammo,_shooter); + +if(GVAR(enabled) < 1) exitWith {}; // bail if enabled +if !(local (gunner _shooter) || {local _shooter}) exitWith {}; // bail if not shooter + +_shooter setVariable [QGVAR(vanilla_target),_target, false]; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_rotateVectLine.sqf b/addons/missileguidance/functions/fnc_rotateVectLine.sqf index b0360cc330..b9904f0e5a 100644 --- a/addons/missileguidance/functions/fnc_rotateVectLine.sqf +++ b/addons/missileguidance/functions/fnc_rotateVectLine.sqf @@ -1,4 +1,5 @@ #include "script_component.hpp" +private["_d", "_map", "_p", "_theta", "_u"]; _map = _this select 0; _theta = _this select 1; diff --git a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf index 74d3b0fc71..872f33a917 100644 --- a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf @@ -3,6 +3,7 @@ EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); private["_targets", "_foundTargetPos", "_launchParams", "_seekerParams", "_targetLaunchParams"]; +private["_angleFov", "_angleOkay", "_losOkay", "_seekerTargetPos", "_sensorPos", "_target"]; _seekerTargetPos = _this select 0; @@ -17,6 +18,7 @@ TRACE_1("", _launchParams); _foundTargetPos = [0,0,0]; if(!isNil "_target") then { _foundTargetPos = getPosASL _target; + //_foundTargetPos = (_target modelToWorldVisual (getCenterOfMass _target)); }; // @TODO: This is seeker LOS and angle checks for LOAL only; LOBL does not need visual diff --git a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf index b6ed8d65a4..6297d21dfa 100644 --- a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf @@ -2,16 +2,22 @@ #include "script_component.hpp" EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); +private["_angleFov", "_canSeeTarget", "_foundTargetPos", "_laserResult", "_launchParams", "_seekerParams", "_laserCode", "_laserParams", "_seekerTargetPos", "_sensorPos", "_target"]; _seekerTargetPos = _this select 0; - _launchParams = _this select 1; _seekerParams = _launchParams select 3; _angleFov = _seekerParams select 0; -_laserResult = [(getPosASL _projectile), (velocity _projectile), _angleFov, [ACE_DEFAULT_LASER_WAVELENGTH,ACE_DEFAULT_LASER_WAVELENGTH], ACE_DEFAULT_LASER_CODE] call EFUNC(laser,seekerFindLaserSpot); -_foundTargetPos = _laserResult select 0; -TRACE_1("Search", _laserResult); - +_laserParams = (_launchParams select 1) select 5; +TRACE_2("", _launchParams, _laserParams); +if(!isNil "_target") then { + // Handle AI or moving vanilla lasers + _foundTargetPos = getPosASL _target; +} else { + _laserResult = [(getPosASL _projectile), (velocity _projectile), _angleFov, [(_laserParams select 1),(_laserParams select 2)], (_laserParams select 0)] call EFUNC(laser,seekerFindLaserSpot); + _foundTargetPos = _laserResult select 0; + TRACE_1("Search", _laserResult); +}; if(!isNil "_foundTargetPos") then { //_canSeeTarget = [_projectile, _foundTargetPos, _angleFov] call FUNC(checkSeekerAngle); diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index 3ee166a6ff..fac53325f4 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -3,99 +3,97 @@ Advanced Missile Guidance - Avanzada Misiles Orientación - Avancée Missile orientation + Guiado Avanzado de Misiles + Guidage avancé de missile Zaawansowane naprowadzanie rakiet - Erweiterte Raketenlenkung + Erweitertes Raketenlenksystem Pokročilé řízení střel - Avanzato Missile Guidance + Guida missili avanzata Avançado Missile Guidance - Részletes rakéta irányító - Расширенный ракетой + Fejlett rakétairányító + Продвинутое наведение ракет - Enables advanced guidance mechanics and selection for different missiles and fire modes. - - - Włącza zaawansowaną mechanikę i wybór dla różnych rakiet i trybów strzału. - Aktiviert die erweiterten Mechaniken für unterschiedliche Raketen und Feuermodi. - Povoluje pokročilou mechaniku řízení střel. - - - - + Advanced missile guidance, or AMG, provides multiple enhancements to missile locking and firing. It is also a framework required for missile weapon types. + Zaawansowane namierzanie rakiet, lub ZNR, dostarcza wiele poprawek do systemu namierzania rakiet oraz dodaje nowe tryby strzału. Jest to wymagana opcja dla broni rakietowych. + Guida dei missili avanzata, o AMG, offre diversi miglioramenti alla teleguida di missili. E' anche un sistema necessario per i tipi di armi missile. + Продвинутое наведение ракет, или ПНР, обеспечивает множество усовершествований для наведения и стрельбы ракет. Также, это система, необходимая для всех ракетных типов оружия. + Guiado Avanzado de Misiles, o AMG en sus siglas en inglés, ofrece múltiples mejoras en el fijado y disparo de misiles. Es también un sistema requerido para armas de tipo misil. + Das Erweiterte Raketenlenksystem, auch ERls genannt, bietet viele Verbesserungen zum Aufschalten und Feuern mittels gelenkten Raketen. + Le guidage avancé de missile, ou AMG en anglais, apporte de multiple améliorations au verouillage et au tir de missiles. C'est aussi un framework requis pour tout arme de type missile. + A fejlett rakétairányító (vagy AMG) többféle módosítást tartalmaz a rakéták célkövetéséhez és tüzeléséhez. Ez egy szükséges keresztrendszer a rakéta-alapú fegyverekhez. Hydra-70 DAGR Missile - - + Misil Hydra-70 DAGR + Hydra-70 DAGR Hydra-70 DAGR Hydra-70 DAGR Rackete Hydra-70 DAGR - + Missile Hydra-70 DAGR - - + Hydra-70 DAGR rakéta + Hydra-70 DAGR DAGR - - + DAGR + DAGR DAGR DAGR DAGR - + DAGR - - + DAGR + DAGR Hydra-70 DAGR Laser Guided Missile - - + Misil guiado por láser Hydra-70 DAGR + Missile à guidage laser Hydra-70 DAGR Laserowo naprowadzana rakieta Hydra-70 DAGR - Hydra-70 Lasergelenkte DAGR Rakete + Hydra-70 DAGR lasergelenkte Rakete Hydra-70 DAGR laserem naváděná střela - + Hydra-70 DAGR missile guida laser - - + Hydra-70 DAGR lézer-irányított rakéta + Управляемая ракета лазерного наведения Hydra-70 DAGR Hellfire II AGM-114K Missile - - + Misil Hellfire II AGM-114K + Hellfire II AGM-114K Hellfire II AGM-114K Hellfire II AGM-114K Hellfire II AGM-114K - + Missile Hellfire II AGM-114K - - + Hellfire II AGM-114K rakéta + Hellfire II AGM-114K AGM-114K - - + AGM-114K + AGM-114K AGM-114K AGM-114K AGM-114K - + AGM-114K - - + AGM-114K + AGM-114K Hellfire II AGM-114K Laser Guided Missile - - + Misil guiado por láser Hellfire II AGM-114K + Missile à guidage laser Hellfire II AGM-114K Laserowo naprowadzana rakieta Hellfire II AGM-114K Hellfire II AGM-114K Lasergelenkte Rakete Hellfire II AGM-114K laserem naváděná střela - + Missile guida laser Hellfire II AGM-114K - - + Hellfire II AGM-114K lézer-irányított rakéta + Управляемая ракета лазерного наведения Hellfire II AGM-114K diff --git a/addons/mk6mortar/$PBOPREFIX$ b/addons/mk6mortar/$PBOPREFIX$ new file mode 100644 index 0000000000..a21eaf95f0 --- /dev/null +++ b/addons/mk6mortar/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\Addons\mk6mortar \ No newline at end of file diff --git a/addons/mk6mortar/CfgEventHandlers.hpp b/addons/mk6mortar/CfgEventHandlers.hpp new file mode 100644 index 0000000000..34c6ecc22c --- /dev/null +++ b/addons/mk6mortar/CfgEventHandlers.hpp @@ -0,0 +1,17 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) ); + }; +}; +class Extended_FiredBIS_EventHandlers { + class Mortar_01_base_F { + class ADDON { + firedBIS = QUOTE(_this call FUNC(handleFired)); + }; + }; +}; diff --git a/addons/mk6mortar/CfgVehicles.hpp b/addons/mk6mortar/CfgVehicles.hpp new file mode 100644 index 0000000000..baf74fa2c4 --- /dev/null +++ b/addons/mk6mortar/CfgVehicles.hpp @@ -0,0 +1,83 @@ +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_Equipment { + class GVAR(rangetable) { + displayName = "$STR_ACE_MK6MORTAR_rangetable_action"; + condition = QUOTE(_this call FUNC(rangeTableCanUse)); + statement = QUOTE(_this call FUNC(rangeTableOpen)); + priority = 0; + icon = QUOTE(PATHTOF(UI\icon_rangeTable.paa)); + exceptions[] = {"notOnMap", "isNotInside"}; + }; + }; + }; + }; + + class LandVehicle; + class StaticWeapon: LandVehicle { + class Turrets { + class MainTurret; + }; + }; + class StaticMortar: StaticWeapon { + class Turrets: Turrets { + class MainTurret: MainTurret { + }; + }; + }; + class Mortar_01_base_F: StaticMortar { + class Turrets: Turrets { + class MainTurret: MainTurret { + turretInfoType = "ACE_Mk6_RscWeaponRangeArtillery"; + }; + }; + class ACE_SelfActions { + class GVAR(toggleMils) { + displayName = "Toggle MILS"; + condition = QUOTE(true); + statement = QUOTE(_this call FUNC(toggleMils)); + exceptions[] = {}; + }; + }; + }; + + class Logic; + class Module_F: Logic { + class ModuleDescription {}; + }; + class GVAR(module): Module_F { + author = "$STR_ACE_Common_ACETeam"; + category = "ACE"; + displayName = "MK6 Settings"; + function = QFUNC(moduleInit); + scope = 2; + isGlobal = 0; + icon = QUOTE(PATHTOF(UI\Icon_Module_mk6_ca.paa)); + functionPriority = 0; + class Arguments { + class airResistanceEnabled { + displayName = "Air Resistance"; + description = "For Player Shots, Model Air Resistance and Wind Effects"; + typeName = "BOOL"; + defaultValue = 1; + }; + class allowComputerRangefinder { + displayName = "Allow MK6 Computer"; + description = "Show the Computer and Rangefinder (these NEED to be removed if you enable air resistance)"; + typeName = "BOOL"; + defaultValue = 0; + }; + class allowCompass { + displayName = "Allow MK6 Compass"; + description = "Show the MK6 Digital Compass"; + typeName = "BOOL"; + defaultValue = 1; + }; + }; + class ModuleDescription: ModuleDescription { + description = ""; + }; + }; +}; diff --git a/addons/mk6mortar/CfgWeapons.hpp b/addons/mk6mortar/CfgWeapons.hpp new file mode 100644 index 0000000000..7d5153e9ad --- /dev/null +++ b/addons/mk6mortar/CfgWeapons.hpp @@ -0,0 +1,15 @@ +class CfgWeapons { + class ACE_ItemCore; + class InventoryItem_Base_F; + + class ACE_RangeTable_82mm: ACE_ItemCore { + author = "$STR_ACE_Common_ACETeam"; + scope = 2; + displayName = "$STR_ACE_MK6MORTAR_rangetable_name"; + descriptionShort = "$STR_ACE_MK6MORTAR_rangetable_description"; + picture = QUOTE(PATHTOF(UI\icon_rangeTable.paa)); + class ItemInfo: InventoryItem_Base_F { + mass = 0.5; + }; + }; +}; diff --git a/addons/mk6mortar/README.md b/addons/mk6mortar/README.md new file mode 100644 index 0000000000..84c7a6e984 --- /dev/null +++ b/addons/mk6mortar/README.md @@ -0,0 +1,10 @@ +ace_mk6mortar +========== + +Tweaks the mk6 mortar from Arma3 + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [PabstMirror](https://github.com/PabstMirror) diff --git a/addons/mk6mortar/RscInGameUI.hpp b/addons/mk6mortar/RscInGameUI.hpp new file mode 100644 index 0000000000..102362216a --- /dev/null +++ b/addons/mk6mortar/RscInGameUI.hpp @@ -0,0 +1,44 @@ +class RscInGameUI { + class RscWeaponRangeArtillery { + class CA_IGUI_elements_group: RscControlsGroup {}; + }; + class ACE_Mk6_RscWeaponRangeArtillery: RscWeaponRangeArtillery { + onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_Mk6_RscWeaponRangeArtillery',(_this select 0))]; _this call FUNC(turretDisplayLoaded);); + controls[] = {"ACE_MILS_GROUP", "CA_IGUI_elements_group","CA_RangeElements_group"}; + class ACE_MILS_GROUP: CA_IGUI_elements_group { + idc = 80170; + class controls { + class CA_Heading_MILS: RscText { + idc = 80156; + style = 2; + colorText[] = {0.706,0.0745,0.0196,1}; + sizeEx = "0.028*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "015"; + x = "25.0 * (0.01875 * SafezoneH)"; + y = "6.3 * (0.025 * SafezoneH)"; + w = "3.3333 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class CA_Elev_MILS: RscText { + idc = 80175; + style = 1; + sizeEx = "0.038*SafezoneH"; + colorText[] = {0.706,0.0745,0.0196,1}; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "80.5"; + x = "36.8 * (0.01875 * SafezoneH)"; + y = "29.3 * (0.025 * SafezoneH)"; + w = "5.2 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; + }; + class CA_Elev_Need_MILS: CA_Elev_MILS { + idc = 80176; + y = "30.8 * (0.025 * SafezoneH)"; + }; + }; + }; + }; +}; diff --git a/addons/mk6mortar/RscRangeTable.hpp b/addons/mk6mortar/RscRangeTable.hpp new file mode 100644 index 0000000000..6bf0e51619 --- /dev/null +++ b/addons/mk6mortar/RscRangeTable.hpp @@ -0,0 +1,87 @@ +class ACE_82mm_RangeTable_Dialog { + idd = -1; + movingEnable = 1; + onLoad = "uiNamespace setVariable ['ACE_82mm_RangeTable_Dialog', _this select 0];"; + objects[] = {}; + + class ControlsBackground { + class TableBackground: RscPicture { + idc = -1; + text = QUOTE(PATHTOF(UI\RangeTable_background.paa)); + x = "18 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; + y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; + w = "16.2634559672906 * (safeZoneH / 40)"; + h = "23 * ((safeZoneH / 1.2) / 25)"; + colorBackground[] = {1,1,1,1}; + }; + class ChargeBackground: RscText { + idc = -1; + x = "14 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; + y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; + w = "4 * (safeZoneH / 40)"; + h = "5 * ((safeZoneH / 1.2) / 25)"; + colorBackground[] = {0,0,0,1}; + }; + }; + class controls { + class TheTable: RscListNBox { + idc = 20001; + // style = ST_CENTER + ST_MULTI + LB_TEXTURES; + // style = ST_LEFT + ST_MULTI + LB_TEXTURES; + // style = LB_MULTI + ST_LEFT; // Style + x = "18 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; + y = "3.76 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; + w = "16.2634559672906 * (safeZoneH / 40)"; + h = "20.24 * ((safeZoneH / 1.2) / 25)"; + columns[] = {(10/867),(86/867),(171/867),(238/867),(320/867),(405/867), + (485/867),(546/867),(607/867),(668/867),(729/867),(790/867)}; + rowHeight = 0.015 * safeZoneH; + sizeEx = "0.014 * safeZoneH"; + font = "EtelkaMonospacePro"; + drawSideArrows = 1; + idcLeft = 14124; + idcRight = 412343243; + colorText[] = {0, 0, 0, 1}; + shadow = "0"; + // colorBorder[] = {1,0,0,1}; + // colorBackground[] = {1, 0, 0, 1}; + colorSelectBackground[] = {0, 0, 0, 0.025}; + colorSelectBackground2[] = {0, 0, 0, 0.025}; + colorScrollbar[] = {0.95,0,0.95,1}; + class ListScrollBar: ScrollBar{ + color[] = {0,0,0,0.6}; + }; + }; + class ChargeListBox: RscListbox { + idc = 1501; + style = ST_RIGHT; + x = "14 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; + y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; + w = "4 * (safeZoneH / 40)"; + h = "5 * ((safeZoneH / 1.2) / 25)"; + onLBSelChanged = QUOTE(_this call FUNC(rangeTablePageChange)); + }; + class CloseBackground: RscText { + idc = -1; + x = "33.7634559672906 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; + y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; + w = "0.5 * (safeZoneH / 40)"; + h = "0.5 * ((safeZoneH / 1.2) / 25)"; + colorBackground[] = {0,0,0,0.5}; + }; + class CloseActiveText: RscActiveText { + idc = -1; + style = 48; + color[] = {1,1,1,0.7}; + text = "A3\Ui_f\data\GUI\Rsc\RscDisplayArcadeMap\icon_exit_cross_ca.paa"; + x = "33.7634559672906 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; + y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; + w = "0.5 * (safeZoneH / 40)"; + h = "0.5 * ((safeZoneH / 1.2) / 25)"; + colorText[] = {1,1,1,0.7}; + colorActive[] = {1,1,1,1}; + tooltip = "Close"; + onButtonClick = "closeDialog 0"; + }; + }; +}; diff --git a/addons/mk6mortar/UI/Icon_Module_mk6_ca.paa b/addons/mk6mortar/UI/Icon_Module_mk6_ca.paa new file mode 100644 index 0000000000..8abfb4bdd3 Binary files /dev/null and b/addons/mk6mortar/UI/Icon_Module_mk6_ca.paa differ diff --git a/addons/mk6mortar/UI/RangeTable_background.paa b/addons/mk6mortar/UI/RangeTable_background.paa new file mode 100644 index 0000000000..bf4b5ee044 Binary files /dev/null and b/addons/mk6mortar/UI/RangeTable_background.paa differ diff --git a/addons/mk6mortar/UI/icon_rangeTable.paa b/addons/mk6mortar/UI/icon_rangeTable.paa new file mode 100644 index 0000000000..9273b849d7 Binary files /dev/null and b/addons/mk6mortar/UI/icon_rangeTable.paa differ diff --git a/addons/mk6mortar/UI/ui_charges.paa b/addons/mk6mortar/UI/ui_charges.paa new file mode 100644 index 0000000000..7041c654e0 Binary files /dev/null and b/addons/mk6mortar/UI/ui_charges.paa differ diff --git a/addons/mk6mortar/XEH_clientInit.sqf b/addons/mk6mortar/XEH_clientInit.sqf new file mode 100644 index 0000000000..973772c96a --- /dev/null +++ b/addons/mk6mortar/XEH_clientInit.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +["playerVehicleChanged", {_this call FUNC(handlePlayerVehicleChanged);}] call EFUNC(common,addEventHandler); diff --git a/addons/mk6mortar/XEH_preInit.sqf b/addons/mk6mortar/XEH_preInit.sqf new file mode 100644 index 0000000000..9af89ccb35 --- /dev/null +++ b/addons/mk6mortar/XEH_preInit.sqf @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(dev_buildTable); +PREP(dev_formatNumber); +PREP(dev_simulateCalcRangeTableLine); +PREP(dev_simulateFindSolution); +PREP(dev_simulateShot); + +PREP(handleFired); +PREP(handlePlayerVehicleChanged); +PREP(moduleInit); +PREP(rangeTableCanUse); +PREP(rangeTableOpen); +PREP(rangeTablePageChange); +PREP(rangeTablePreCalculatedValues); +PREP(toggleMils); +PREP(turretDisplayLoaded); + +ADDON = true; diff --git a/addons/mk6mortar/config.cpp b/addons/mk6mortar/config.cpp new file mode 100644 index 0000000000..6751cea5fb --- /dev/null +++ b/addons/mk6mortar/config.cpp @@ -0,0 +1,47 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {"ACE_RangeTable_82mm"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interaction"}; + author[] = {"PabstMirror"}; + authorUrl = "https://github.com/acemod"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" + +class RscText; +class RscListbox; +class RscListNBox; +class RscPicture; +class RscControlsGroup; +class ScrollBar; +class RscActiveText; + +#include "RscInGameUI.hpp" +#include "RscRangeTable.hpp" + +class ACE_Settings { + //These settings effect gameplay difficutly: defaults will leave the mortar the same as vanilla + class GVAR(airResistanceEnabled) { + value = 0; + typeName = "BOOL"; + isClientSetable = 0; + }; + class GVAR(allowComputerRangefinder) { + value = 1; + typeName = "BOOL"; + isClientSetable = 0; + }; + class GVAR(allowCompass) { + value = 1; + typeName = "BOOL"; + isClientSetable = 0; + }; +}; diff --git a/addons/mk6mortar/functions/fnc_dev_buildTable.sqf b/addons/mk6mortar/functions/fnc_dev_buildTable.sqf new file mode 100644 index 0000000000..7a60e91e68 --- /dev/null +++ b/addons/mk6mortar/functions/fnc_dev_buildTable.sqf @@ -0,0 +1,87 @@ +/* + * Author: PabstMirror + * DEV function to build mortar tables, very cpu intensive (never used durring normal gameplay) + * + * Arguments: + * 0: Muzzle Velocity + * 1: Air Friction + * + * Return Value: + * + * + * Example: + * [100, -0.0001] spawn ace_mk6mortar_fnc_dev_buildTable; //spawn (scheduled) is slower + * [100, -0.0001] call ace_mk6mortar_fnc_dev_buildTable; //faster, but will lock while processing + * + * Public: No + */ +#include "script_component.hpp" + + +private ["_muzzleVelocity", "_airFriction", "_stillInRange", "_currentRange", "_increasePerRow", "_outputArray", "_rangeToHit", "_lineElevation", "_lineHeightElevation", "_lineTimeOfFlight", "_lineCrosswindDeg", "_lineHeadwindMeters", "_lineTailWindMeters", "_lineTempDec", "_lineTempInc", "_lineAirDensDec", "_lineAirDensInc", "_result", "_outputString"]; + +_muzzleVelocity = _this select 0; +_airFriction = _this select 1; +_stillInRange = true; +_currentRange = 100; +_increasePerRow = 50; +_outputArray = []; + + +//[_rangeToHit, _lineElevation, _lineHeightElevation, _lineHeightTimeDelta, _lineTimeOfFlight, _lineCrosswindDeg, _lineHeadwindMeters, _lineTailWindMeters, _lineTempDec, _lineTempInc, _lineAirDensDec, _lineAirDensInc] + +while {_stillInRange} do { + _result = [_muzzleVelocity, _currentRange, _airFriction] call FUNC(dev_simulateCalcRangeTableLine); + if (_result isEqualTo []) then { + _stillInRange = false; + } else { + if (_airFriction == 0) then { + _result set [4, 0]; + _result set [5, 0]; + _result set [6, 0]; + _result set [7, 0]; + _result set [8, 0]; + _result set [9, 0]; + _result set [10, 0]; + }; + if ((_result select 1) < 88) then { + _outputArray pushBack [ + ([(_result select 0), "meters", false] call FUNC(dev_formatNumber)), + ([(_result select 1), "mil", true] call FUNC(dev_formatNumber)), + ([(_result select 2), "mil", true] call FUNC(dev_formatNumber)), + ([(_result select 3), "sec", false] call FUNC(dev_formatNumber)), + ([(_result select 4), "sec", false] call FUNC(dev_formatNumber)), + ([(_result select 5), "milPrecise", true] call FUNC(dev_formatNumber)), + ([(_result select 6), "metersprecise", false] call FUNC(dev_formatNumber)), + ([(_result select 7), "metersprecise", false] call FUNC(dev_formatNumber)), + ([(_result select 8), "metersprecise", false] call FUNC(dev_formatNumber)), + ([(_result select 9), "metersprecise", false] call FUNC(dev_formatNumber)), + ([(_result select 10), "metersprecise", false] call FUNC(dev_formatNumber)), + ([(_result select 11), "metersprecise", false] call FUNC(dev_formatNumber)) + ]; + }; + _currentRange = _currentRange + _increasePerRow; + }; + hintSilent str _currentRange; +}; + +//handle floating point rounding errors +_outputString = format ["case ((abs(_muzzleVelocity - %1) < 0.00001) && {(abs(_airFriction - %2) < 0.00001)}): { +[ +", _muzzleVelocity, _airFriction]; + +{ + if (_forEachIndex < ((count _outputArray) - 1)) then { + _outputString = _outputString + format ["%1, + ", _x]; + } else { + _outputString = _outputString + format ["%1 + ] + };", _x]; + }; +} forEach _outputArray; + +copyToClipboard _outputString; +rangeTableOutput = _outputString; + +hint "done"; \ No newline at end of file diff --git a/addons/mk6mortar/functions/fnc_dev_formatNumber.sqf b/addons/mk6mortar/functions/fnc_dev_formatNumber.sqf new file mode 100644 index 0000000000..f89c3a1b8f --- /dev/null +++ b/addons/mk6mortar/functions/fnc_dev_formatNumber.sqf @@ -0,0 +1,80 @@ +/* +Author: Pabst Mirror + +Description: +Converts numbers into nicely formated strings. + +Parameters: +0: NUMBER - Input number +1: STRING - Output type (see case statement) +2: BOOL - If output type is mil, convert input type from deg->mil + +Returns: +STRING - Formatted number + +Example: +[45, "mil4", true] call ace_mk6mortar_fnc_dev_formatNumber = "0800" + */ +#include "script_component.hpp" + +private ["_theNumber", "_inputType", "_convertToMils", "_decimalPlaces", "_integerPlaces", "_prefix", "_return"]; + +_theNumber = _this select 0; +_inputType = _this select 1; +_convertToMils = _this select 2; + +_decimalPlaces = -1; +_integerPlaces = -1; + +switch (toLower _inputType) do { +case ("meters"): { + _decimalPlaces = 0; + _integerPlaces = 1; + }; +case ("metersprecise"): { + _decimalPlaces = 1; + _integerPlaces = 1; + }; +case ("meters4"): { + _decimalPlaces = 0; + _integerPlaces = 4; + }; +case ("deg3precise"): { + _decimalPlaces = 2; + _integerPlaces = 3; + }; +case ("mil"): { + _decimalPlaces = 0; + _integerPlaces = 1; + if (_convertToMils) then { + _theNumber = _theNumber * (6400 / 360); + }; + }; +case ("mil4"): { + _decimalPlaces = 0; + _integerPlaces = 4; + if (_convertToMils) then { + _theNumber = _theNumber * (6400 / 360); + }; + }; +case ("milprecise"): { + _decimalPlaces = 1; + _integerPlaces = 1; + if (_convertToMils) then { + _theNumber = _theNumber * (6400 / 360); + }; + }; +case ("sec"): { + _decimalPlaces = 1; + _integerPlaces = 1; + }; + default {systemChat format ["badtype %1", _inputType];}; +}; + +//CBA_fnc_formatNumber is silly: [-9.58545, 1, 1, false] call CBA_fnc_formatNumber == "-9.-6" + +_prefix = if (_theNumber < 0) then {"-"} else {""}; + +_return = [abs (_theNumber), _integerPlaces, _decimalPlaces, false] call CBA_fnc_formatNumber; + +(_prefix + _return) diff --git a/addons/mk6mortar/functions/fnc_dev_simulateCalcRangeTableLine.sqf b/addons/mk6mortar/functions/fnc_dev_simulateCalcRangeTableLine.sqf new file mode 100644 index 0000000000..d1e0a8dd05 --- /dev/null +++ b/addons/mk6mortar/functions/fnc_dev_simulateCalcRangeTableLine.sqf @@ -0,0 +1,79 @@ +/* +Author: Pabst Mirror + +Description: +Builds a rangeTable line for a certian range, given muzzle velocity and air friction, returns [] if out of range. + +Parameters: +0: NUMBER - Muzzle Velocity +1: NUMBER - Air Friction +2: NUMBER - Range To Hit + +Returns: +ARRAY - Range Table Line Data (see return line) + +Example: +[300, -0.0001, 3000] call ace_mk6mortar_fnc_simulateCalcRangeTableLine + */ +#include "script_component.hpp" + +#define TIME_STEP (1/50) + +private ["_startTime", "_muzzleVelocity", "_rangeToHit", "_airFriction", "_vacElevation", "_radicand", "_maxElev", "_minElev", "_error", "_solutionElevation", "_lastTestResult", "_numberOfAttempts", "_lineElevation", "_lineTimeOfFlight", "_lineHeightElevation", "_lineHeightTimeDelta", "_lineCrosswindDeg", "_lineHeadwindMeters", "_lineTailWindMeters", "_result"]; + +_startTime = diag_tickTime; + +_muzzleVelocity = _this select 0; +_rangeToHit = _this select 1; +_airFriction = _this select 2; + +//Run Binary search for correct elevation +_solution = [_rangeToHit, 0, _muzzleVelocity, _airFriction, TIME_STEP] call FUNC(dev_simulateFindSolution); +if (_solution isEqualTo []) exitWith {[]}; + +//Real Elevation +_lineElevation = _solution select 0; + +//Time Of Flight: +_lineTimeOfFlight = _solution select 1; + +//Height Adjustment for -100m (another binary search) +_solution = [_rangeToHit, -100, _muzzleVelocity, _airFriction, TIME_STEP] call FUNC(dev_simulateFindSolution); +if (_solution isEqualTo []) exitWith {[]};//should never be triggered (lower elevation easier to hit) + +_lineHeightElevation = ((_solution select 0) - _lineElevation); +_lineHeightTimeDelta = (_solution select 1) - _lineTimeOfFlight; + +//Compute for 10x and divide to minimize rounding errors + +//Crosswind +_lastTestResult = [_lineElevation, _muzzleVelocity, _airFriction, 15, 1, 0, 10, 0, TIME_STEP] call FUNC(dev_simulateShot); +_lineCrosswindDeg = (_lastTestResult select 2) / 10; + +//Headwind: +_lastTestResult = [_lineElevation, _muzzleVelocity, _airFriction, 15, 1, -10, 0, 0, TIME_STEP] call FUNC(dev_simulateShot); +_lineHeadwindMeters = (_rangeToHit - (_lastTestResult select 0)) / 10; + +//TailWind: +_lastTestResult = [_lineElevation, _muzzleVelocity, _airFriction, 15, 1, 10, 0, 0, TIME_STEP] call FUNC(dev_simulateShot); +_lineTailWindMeters = (_rangeToHit - (_lastTestResult select 0)) / 10; + +//Air Temp Dec +_lastTestResult = [_lineElevation, _muzzleVelocity, _airFriction, (15 - 10), 1, 0, 0, 0, TIME_STEP] call FUNC(dev_simulateShot); +_lineTempDec = (_rangeToHit - (_lastTestResult select 0)) / 10; + +//Air Temp Inc +_lastTestResult = [_lineElevation, _muzzleVelocity, _airFriction, (15 + 10), 1, 0, 0, 0, TIME_STEP] call FUNC(dev_simulateShot); +_lineTempInc = (_rangeToHit - (_lastTestResult select 0)) / 10; + +//Air Density Dec +_lastTestResult = [_lineElevation, _muzzleVelocity, _airFriction, 15, 0.9, 0, 0, 0, TIME_STEP] call FUNC(dev_simulateShot); +_lineAirDensDec = (_rangeToHit - (_lastTestResult select 0)) / 10; + +//Air Density Inc +_lastTestResult = [_lineElevation, _muzzleVelocity, _airFriction, 15, 1.1, 0, 0, 0, TIME_STEP] call FUNC(dev_simulateShot); +_lineAirDensInc = (_rangeToHit - (_lastTestResult select 0)) / 10; + +// systemChat format ["debug: Range %1 - in %2 sec", _rangeToHit, (diag_tickTime - _startTime)]; + +[_rangeToHit, _lineElevation, _lineHeightElevation, _lineHeightTimeDelta, _lineTimeOfFlight, _lineCrosswindDeg, _lineHeadwindMeters, _lineTailWindMeters, _lineTempDec, _lineTempInc, _lineAirDensDec, _lineAirDensInc] diff --git a/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf b/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf new file mode 100644 index 0000000000..a45c415b40 --- /dev/null +++ b/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf @@ -0,0 +1,55 @@ +/* + * Author: PabstMirror + * DEV to find a firing solution for a given range + * + * Arguments: + * 0: Range to Hit (Meters) + * 1: Height To Hit (Meters) + * 2: Muzzle Velocity (M/S) + * 3: Air Friction + * 4: Time Step (seconds) (eg 1/50 will simulate 50 cycles per second) + * + * Return Value: + * ARRAY - [NUMBER - Elevation In Degrees, NUMBER - Shot Durration] + * + * Example: + * [_rangeToHit, _heightToHit, _muzzleVelocity, _airFriction, TIME_STEP] call FUNC(simulateFindSolution); + * + * Public: No + */ +#include "script_component.hpp" + +private ["_rangeToHit", "_heightToHit", "_muzzleVelocity", "_airFriction", "_maxElev", "_minElev", "_error", "_solutionElevation", "_lastTestResult", "_numberOfAttempts"]; + +#define MAX_ATTEMPTS 22 + +_rangeToHit = _this select 0; +_heightToHit = _this select 1; +_muzzleVelocity = _this select 2; +_airFriction = _this select 3; +_timeStep = _this select 4; + +_maxElev = 90; +_minElev = 45; //todo - Low Angle Howitzers??? + +_error = 10000; +_solutionElevation = -1; +_lastTestResult = []; +_numberOfAttempts = 0; + +//(binary search) +while {(_numberOfAttempts < MAX_ATTEMPTS) && {(abs _error) > 0.2}} do { + _numberOfAttempts = _numberOfAttempts + 1; + _solutionElevation = (_maxElev + _minElev) / 2; + _lastTestResult = [_solutionElevation, _muzzleVelocity, _airFriction, 15, 1, 0, 0, _heightToHit, _timeStep] call FUNC(dev_simulateShot); + _error = _rangeToHit - (_lastTestResult select 0); + if (_error > 0) then { + _maxElev = _solutionElevation; //test range was short + } else { + _minElev = _solutionElevation; //test range was long + }; +}; +if (_numberOfAttempts >= MAX_ATTEMPTS) exitWith {[]}; + +//return the elevation and time required +[_solutionElevation, (_lastTestResult select 1)] diff --git a/addons/mk6mortar/functions/fnc_dev_simulateShot.sqf b/addons/mk6mortar/functions/fnc_dev_simulateShot.sqf new file mode 100644 index 0000000000..0e53807a6b --- /dev/null +++ b/addons/mk6mortar/functions/fnc_dev_simulateShot.sqf @@ -0,0 +1,73 @@ +/* + * Author: PabstMirror + * DEV function to build mortar tables, very cpu intensive (never used durring normal gameplay) + * + * Arguments: + * 0: Shot Angle (degrees) + * 1: Muzzle Velocity (m/s) + * 2: Air Friction + * 3: Tempeture (degres celcius) + * 4: Relative Air Denisty + * 5: Tail Wind (m/s) + * 6: Cross Wind (m/s) + * 7: Height Of Target (M) + * 8: Time Step (fraction of a second) + * + * Return Value: + * [Distance Traveled, Shot Time, Offset (degrees)] + * + * Example: + * [45, 180, -0.0001, 15, 1, 10, 0, 0, 1/50] call ace_mk6mortar_fnc_dev_simulateShot; + * + * Public: No + */ +#include "script_component.hpp" + +private ["_angleDeg", "_muzzleVelocity", "_airFriction", "_temp", "_relDensity", "_tailWind", "_crosswind", "_heightOfTarget", "_timeStep", "_wind", "_gravity", "_currentPos", "_currentVelocity", "_currentTime", "_lastPos", "_kCoefficent", "_aparentWind", "_changeInVelocity", "_linConversion", "_middlePos", "_middlePosOld", "_middleTotalTravelTime", "_offsetDeg"]; + +_angleDeg = _this select 0; +_muzzleVelocity = _this select 1; +_airFriction = _this select 2; +_temp = _this select 3; +_relDensity = _this select 4; +_tailWind = _this select 5; +_crosswind = _this select 6; +_heightOfTarget = _this select 7; +_timeStep = _this select 8; + +_wind = [_crosswind, _tailWind, 0]; +_gravity = [0,0,-9.8]; + +_currentPos = [0,0,0]; +_muzzleVelocity = _muzzleVelocity * (((_temp + 273.13) / 288.13 - 1) / 40 + 1); +_currentVelocity = [0, (_muzzleVelocity * cos _angleDeg), (_muzzleVelocity * sin _angleDeg)]; + +_currentTime = 0; +_lastPos = _currentPos; + +_kCoefficent = -1 * _relDensity * _airFriction; //save time in the loop and compute once + +while {((_currentVelocity select 2) > 0) || ((_currentPos select 2) >= _heightOfTarget)} do { + _lastPos = _currentPos; + + _aparentWind = _wind vectorDiff _currentVelocity; + _changeInVelocity = _gravity vectorAdd (_aparentWind vectorMultiply ((vectorMagnitude _aparentWind) * _kCoefficent)); + + _currentVelocity = _currentVelocity vectorAdd (_changeInVelocity vectorMultiply _timeStep); + + _currentPos = _currentPos vectorAdd (_currentVelocity vectorMultiply _timeStep); + _currentTime = _currentTime + _timeStep; +}; + +//Uses linearConversion to get a weighted average betwen points before and after dropping below target height +_linConversion = linearConversion [(_lastPos select 2), (_currentPos select 2), _heightOfTarget, 0, 1, true]; +_middlePos = (_lastPos vectorMultiply (1 - _linConversion)) vectorAdd (_currentPos vectorMultiply (_linConversion)); +// _middlePosOld = (_lastPos vectorAdd _currentPos) vectorMultiply 0.5; + +//Same to find travel time +_middleTotalTravelTime = _currentTime - (_timeStep * (1-_linConversion)); + +//Find shot offset (from crosswind), in degrees +_offsetDeg = (_middlePos select 0) aTan2 (_middlePos select 1); + +[(_middlePos select 1), _middleTotalTravelTime, _offsetDeg] diff --git a/addons/mk6mortar/functions/fnc_handleFired.sqf b/addons/mk6mortar/functions/fnc_handleFired.sqf new file mode 100644 index 0000000000..e2b440c520 --- /dev/null +++ b/addons/mk6mortar/functions/fnc_handleFired.sqf @@ -0,0 +1,89 @@ +/* + * Author: PabstMirror + * Called when the mortar is fired. + * + * Arguments: + * 0: mortar - Object the event handler is assigned to + * 1: weapon - Fired weapon + * 2: muzzle - Muzzle that was used + * 3: mode - Current mode of the fired weapon + * 4: ammo - Ammo used + * 5: magazine - magazine name which was used + * 6: projectile - Object of the projectile that was shot + * + * Return Value: + * Nothing + * + * Example: + * [clientFiredBIS-XEH] call ace_mk6mortar_fnc_handleFired + * + * Public: No + */ +#include "script_component.hpp" + +private ["_shooterMan", "_bisAirFriction", "_temperature", "_newMuzzleVelocityCoefficent", "_bulletVelocity", "_bulletSpeed", "_muzzleVelocity", "_muzzleVelocityShift"]; + +disableSerialization; + +PARAMS_7(_vehicle,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + +if (!GVAR(airResistanceEnabled)) exitWith {}; +// Large enough distance to not simulate any wind deflection +if (_vehicle distance ACE_player > 8000) exitWith {false}; + +//AI will have no clue how to use: +_shooterMan = gunner _vehicle; +if (!([_shooterMan] call EFUNC(common,isPlayer))) exitWith {false}; + +//Should be zero, just make sure: +_bisAirFriction = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction"); +if (_bisAirFriction != 0) exitWith {ERROR("Non zero base airFriction");}; + + +//Calculate air density: +_altitude = (getPosASL _vehicle) select 2; +#define GET_TEMPERATURE_AT_HEIGHT(h) (EGVAR(weather,currentTemperature) - 0.0065 * (h)) +_temperature = GET_TEMPERATURE_AT_HEIGHT(_altitude); +_pressure = _altitude call EFUNC(weather,calculateBarometricPressure); +_relativeHumidity = EGVAR(weather,currentHumidity); +_airDensity = [_temperature, _pressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); +_relativeDensity = _airDensity / 1.225; + +TRACE_5("FiredWeather",_temperature,_pressure,_relativeHumidity,_airDensity,_relativeDensity); + +//powder effects: +_newMuzzleVelocityCoefficent = (((_temperature + 273.13) / 288.13 - 1) / 40 + 1); +if (_newMuzzleVelocityCoefficent != 1) then { + _bulletVelocity = velocity _projectile; + _bulletSpeed = vectorMagnitude _bulletVelocity; + _bulletVelocity = (vectorNormalized _bulletVelocity) vectorMultiply (_bulletSpeed * _newMuzzleVelocityCoefficent); + _projectile setVelocity _bulletVelocity; + _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift; +}; + + +[{ + private ["_deltaT", "_bulletVelocity", "_bulletSpeed", "_trueVelocity", "_trueSpeed", "_dragRef", "_accelRef", "_drag", "_accel"]; + PARAMS_2(_args,_pfID); + EXPLODE_4_PVT(_args,_shell,_airFriction,_time,_relativeDensity); + + if (isNull _shell || {!alive _shell}) exitwith { + [_pfID] call cba_fnc_removePerFrameHandler; + }; + + _deltaT = time - _time; + _args set[2, time]; + + _bulletVelocity = velocity _shell; + _bulletSpeed = vectorMagnitude _bulletVelocity; + + _trueVelocity = _bulletVelocity vectorDiff ACE_wind; + _trueSpeed = vectorMagnitude _trueVelocity; + + _drag = _deltaT * _airFriction * _trueSpeed * _relativeDensity; + _accel = _trueVelocity vectorMultiply (_drag); + _bulletVelocity = _bulletVelocity vectorAdd _accel; + + _shell setVelocity _bulletVelocity; + +}, 0, [_projectile, MK6_82mm_AIR_FRICTION, time, _relativeDensity]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf new file mode 100644 index 0000000000..91657fdbe2 --- /dev/null +++ b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf @@ -0,0 +1,108 @@ +/* + * Author: PabstMirror + * Handles player getting into new vehicle. Loads PFEG for mortar display if it is a mortar. + * + * Arguments: + * 0:Player + * 1: New Vehicle + * + * Return Value: + * No + * + * Example: + * [bob, mortar] call ace_mk6mortar_fnc_handlePlayerVehicleChanged; + * + * Public: No + */ +#include "script_component.hpp" + +private ["_chargeText", "_xPos", "_yPos", "_wPos", "_hPos", "_tubeWeaponName", "_fireModes"]; + +PARAMS_2(_player,_newVehicle); + +if (isNull _newVehicle) exitWith {}; +if (!(_newVehicle isKindOf "Mortar_01_base_F")) exitWith {}; + +_chargeText = (findDisplay 46) ctrlCreate ["RscStructuredText", 80085]; + +_xPos = (profilenamespace getvariable ["IGUI_GRID_WEAPON_X", ((safezoneX + safezoneW) - (12.4 * (((safezoneW / safezoneH) min 1.2) / 40)) - 0.5 * (((safezoneW / safezoneH) min 1.2) / 40))]); +_yPos = 2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (profilenamespace getvariable ["IGUI_GRID_WEAPON_Y", (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))]); +_wPos = 10 * (((safezoneW / safezoneH) min 1.2) / 40); +_hPos = 1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25); + +_chargeText ctrlSetPosition [_xPos, _yPos, _wPos, _hPos]; +_chargeText ctrlCommit 0; + +_tubeWeaponName = (weapons _newVehicle) select 0; +_fireModes = getArray (configFile >> "CfgWeapons" >> _tubeWeaponName >> "modes"); + +[{ + PARAMS_2(_args,_pfID); + EXPLODE_3_PVT(_args,_mortarVeh,_chargeText,_fireModes); + + if ((vehicle ACE_player) != _mortarVeh) then { + [_pfID] call CBA_fnc_removePerFrameHandler; + ctrlDelete _chargeText; + } else { + + _useMils = _mortarVeh getVariable [QGVAR(useMils), true]; + + //Compute: 'charge' from weaponstate + _currentFireMode = (weaponState [_mortarVeh, [0]]) select 2; + _currentChargeMode = _fireModes find _currentFireMode; + + _text = format ["%1: %2 ", (localize "STR_ACE_MK6MORTAR_rangetable_charge"), _currentChargeMode, QUOTE(PATHTOF(UI\ui_charges.paa))]; + _chargeText ctrlSetStructuredText parseText _text; + if (shownArtilleryComputer && {!GVAR(allowComputerRangefinder)}) then { + //Don't like this solution, but it works + closeDialog 0; + [parseText "Computer Disabled"] call EFUNC(common,displayTextStructured); + }; + + _display = uiNamespace getVariable ["ACE_Mk6_RscWeaponRangeArtillery", displayNull]; + if (isNull _display) exitWith {}; //It may be null for the first frame + + //Hud should hidden in 3rd person + _notGunnerView = cameraView != "GUNNER"; + + //Update CurrentElevation Display: + if (_notGunnerView) then { + (_display displayCtrl 80175) ctrlSetText ""; + } else { + _elevDeg = parseNumber ctrlText (_display displayCtrl 175); + if (_useMils) then { + (_display displayCtrl 80175) ctrlSetText str round (_elevDeg * 6400 / 360); + } else { + (_display displayCtrl 80175) ctrlSetText str _elevDeg; + }; + }; + + //Update ElevationNeeded Display: + if (_notGunnerView || (!GVAR(allowComputerRangefinder))) then { + (_display displayCtrl 80176) ctrlSetText ""; + } else { + _elevDeg = parseNumber ctrlText (_display displayCtrl 176); + if (_elevDeg <= 0) then { //Bad data means "----" out of range + (_display displayCtrl 80176) ctrlSetText (ctrlText (_display displayCtrl 176)); + } else { + if (_useMils) then { + (_display displayCtrl 80176) ctrlSetText str round (_elevDeg * 6400 / 360); + } else { + (_display displayCtrl 80176) ctrlSetText str _elevDeg; + }; + }; + }; + + //Update Heading Display: + if (_notGunnerView || (!GVAR(allowCompass))) then { + (_display displayCtrl 80156) ctrlSetText ""; + } else { + _rotationDegrees = ((getDir _mortarVeh) + (((-180 / PI) * (_mortarVeh animationPhase "mainTurret")) + 360)) % 360; + if (_useMils) then { + (_display displayCtrl 80156) ctrlSetText str round (_rotationDegrees * 6400 / 360); + } else { + (_display displayCtrl 80156) ctrlSetText (ctrlText (_display displayCtrl 156)); + }; + }; + }; +}, 0, [_newVehicle, _chargeText,_fireModes]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/mk6mortar/functions/fnc_moduleInit.sqf b/addons/mk6mortar/functions/fnc_moduleInit.sqf new file mode 100644 index 0000000000..75bab4cee9 --- /dev/null +++ b/addons/mk6mortar/functions/fnc_moduleInit.sqf @@ -0,0 +1,27 @@ +/* + * Author: PabstMirror + * Loads settings from the module. + * + * Arguments: + * 0: The Module Logic Object + * 1: synced objects + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [fromModule] call ace_mk6mortar_fnc_moduleInit + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_3(_logic,_syncedUnits,_activated); + +if (!_activated) exitWith {WARNING("Module - placed but not active");}; +if (!isServer) exitWith {}; + +[_logic, QGVAR(airResistanceEnabled), "airResistanceEnabled"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(allowComputerRangefinder), "allowComputerRangefinder"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(allowCompass), "allowCompass"] call EFUNC(common,readSettingFromModule); diff --git a/addons/mk6mortar/functions/fnc_rangeTableCanUse.sqf b/addons/mk6mortar/functions/fnc_rangeTableCanUse.sqf new file mode 100644 index 0000000000..04ca9c3278 --- /dev/null +++ b/addons/mk6mortar/functions/fnc_rangeTableCanUse.sqf @@ -0,0 +1,21 @@ +/* + * Author: PabstMirror + * Can player open 82mm rangetable. + * + * Arguments: + * 0: Vehicle + * 1: Player + * + * Return Value: + * Can Open + * + * Example: + * [bob, bob] call ace_mk6mortar_fnc_rangeTableCanUse + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_2(_vehicle,_player); + +"ACE_RangeTable_82mm" in (items _player); \ No newline at end of file diff --git a/addons/mk6mortar/functions/fnc_rangeTableOpen.sqf b/addons/mk6mortar/functions/fnc_rangeTableOpen.sqf new file mode 100644 index 0000000000..dfb53842ab --- /dev/null +++ b/addons/mk6mortar/functions/fnc_rangeTableOpen.sqf @@ -0,0 +1,48 @@ +/* + * Author: PabstMirror + * Opens the rangetable and fills the charge listbox. + * + * Arguments: + * No + * + * Return Value: + * No + * + * Example: + * [] call ace_mk6mortar_fnc_rangeTableOpen + * + * Public: No + */ +#include "script_component.hpp" + +#define LIST_CHARGE ((uiNamespace getVariable "ACE_82mm_RangeTable_Dialog") displayCtrl 1501) + +private ["_weaponName", "_magazines", "_initSpeed", "_fireModes", "_muzzleVelocities", "_showToPlayer", "_artilleryCharge"]; + +_weaponName = "mortar_82mm"; //todo: work on other weapons + +createDialog "ACE_82mm_RangeTable_Dialog"; +if (isNull (uiNamespace getVariable ["ACE_82mm_RangeTable_Dialog", displayNull])) exitWith {ERROR("Dialog failed to open");}; + +//Get Magazine Types +_magazines = getArray (configFile >> "CfgWeapons" >> _weaponName >> "magazines"); + +//For now just get settings from first mag, all rounds have same flight characteristics: +if ((count _magazines) < 1) exitWith {ERROR("No Magazines for weapon");}; +_initSpeed = getNumber (configFile >> "CfgMagazines" >> (_magazines select 0) >> "initSpeed"); + +//Get Charge Modes +_fireModes = getArray (configFile >> "CfgWeapons" >> _weaponName >> "modes"); + +_muzzleVelocities = []; +{ + _showToPlayer = getNumber (configFile >> "CfgWeapons" >> _weaponName >> _x >> "showToPlayer"); + if (_showToPlayer == 1) then { + _artilleryCharge = getNumber (configFile >> "CfgWeapons" >> _weaponName >> _x >> "artilleryCharge"); + LIST_CHARGE lbAdd format ["%1: %2", (localize "STR_ACE_MK6MORTAR_rangetable_charge"), (count _muzzleVelocities)]; + LIST_CHARGE lbSetData [(count _muzzleVelocities), str (_artilleryCharge * _initSpeed)]; + _muzzleVelocities pushBack _artilleryCharge; + }; +} forEach _fireModes; + +LIST_CHARGE lbSetCurSel 0; diff --git a/addons/mk6mortar/functions/fnc_rangeTablePageChange.sqf b/addons/mk6mortar/functions/fnc_rangeTablePageChange.sqf new file mode 100644 index 0000000000..c0cc40ccdc --- /dev/null +++ b/addons/mk6mortar/functions/fnc_rangeTablePageChange.sqf @@ -0,0 +1,37 @@ +/* + * Author: PabstMirror + * Called when listbox selection changes. Updates the rangetable with new values. + * + * Arguments: + * No + * + * Return Value: + * No + * + * Example: + * [] call ace_mk6mortar_fnc_rangeTablePageChange + * + * Public: No + */ +#include "script_component.hpp" + +#define RANGE_TABLE ((uiNamespace getVariable "ACE_82mm_RangeTable_Dialog") displayCtrl 20001) +#define LIST_CHARGE ((uiNamespace getVariable "ACE_82mm_RangeTable_Dialog") displayCtrl 1501) + +private ["_listBoxData", "_muzzleVelocity", "_airFriction", "_precalcArray"]; + +_listBoxData = LIST_CHARGE lbData (lbCurSel LIST_CHARGE); +if (isNil "_listBoxData" || {_listBoxData == ""}) exitWith {ERROR("lbCurSel out of bounds or no data");}; +_muzzleVelocity = parseNumber _listBoxData; + +_airFriction = if (GVAR(airResistanceEnabled)) then {MK6_82mm_AIR_FRICTION} else {0}; + +_precalcArray = [_muzzleVelocity, _airFriction] call FUNC(rangeTablePreCalculatedValues); + +lnbClear RANGE_TABLE; +{ + RANGE_TABLE lnbAddRow _x; +} forEach _precalcArray; + +//put dummy line at end because scrolling is fucked and can't see last line +RANGE_TABLE lnbAddRow ["", "", "", "", "", "", "", "", "", "", ""]; diff --git a/addons/mk6mortar/functions/fnc_rangeTablePreCalculatedValues.sqf b/addons/mk6mortar/functions/fnc_rangeTablePreCalculatedValues.sqf new file mode 100644 index 0000000000..d775b87365 --- /dev/null +++ b/addons/mk6mortar/functions/fnc_rangeTablePreCalculatedValues.sqf @@ -0,0 +1,271 @@ +/* + * Author: PabstMirror + * Simple Lookup Table for various muzzle velocities and air frictions. + * Use ace_mk6mortar_fnc_dev_buildTable to build + * + * Arguments: + * 0: Muzzle Velocity + * 1: Air Friction + * + * Return Value: + * + * + * Example: + * [200, 0] call ace_mk6mortar_fnc_rangeTablePreCalculatedValues + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_2(_muzzleVelocity,_airFriction); + +switch (true) do { + +case ((abs(_muzzleVelocity - 70) < 0.00001) && {(abs(_airFriction - -0.0001) < 0.00001)}): { + [ + ["100","1493","9","1.4","14.0","3.7","0.4","-0.3","0.0","-0.0","-0.0","0.0"], + ["150","1438","14","1.4","13.9","2.5","0.4","-0.4","0.0","-0.0","-0.1","0.0"], + ["200","1381","20","1.4","13.8","1.9","0.5","-0.4","0.0","-0.0","-0.1","0.1"], + ["250","1321","27","1.5","13.6","1.5","0.5","-0.4","0.0","-0.0","-0.1","0.1"], + ["300","1256","36","1.6","13.3","1.3","0.6","-0.5","0.0","-0.1","-0.1","0.1"], + ["350","1183","49","1.7","12.9","1.1","0.6","-0.5","0.1","-0.1","-0.1","0.1"], + ["400","1097","70","1.9","12.4","0.9","0.6","-0.5","0.1","-0.1","-0.2","0.1"], + ["450","979","113","2.3","11.6","0.8","0.6","-0.5","0.1","-0.1","-0.2","0.2"] + ] + }; +case ((abs(_muzzleVelocity - 140) < 0.00001) && {(abs(_airFriction - -0.0001) < 0.00001)}): { + [ + ["150","1556","1","0.8","27.2","16.3","2.5","-2.4","0.0","-0.0","-0.2","0.2"], + ["200","1541","1","0.8","27.2","12.3","2.5","-2.4","0.0","-0.0","-0.3","0.2"], + ["250","1527","2","0.8","27.2","9.9","2.6","-2.4","0.0","-0.0","-0.3","0.3"], + ["300","1512","2","0.8","27.2","8.3","2.7","-2.4","0.1","-0.0","-0.4","0.4"], + ["350","1497","3","0.8","27.1","7.1","2.7","-2.5","0.0","-0.1","-0.5","0.4"], + ["400","1482","3","0.8","27.1","6.2","2.7","-2.5","0.1","-0.1","-0.5","0.5"], + ["450","1467","3","0.8","27.0","5.6","2.8","-2.5","0.1","-0.1","-0.6","0.6"], + ["500","1451","4","0.8","27.0","5.0","2.9","-2.6","0.1","-0.1","-0.6","0.6"], + ["550","1436","4","0.8","26.9","4.6","2.9","-2.6","0.1","-0.1","-0.7","0.7"], + ["600","1420","5","0.8","26.8","4.2","3.0","-2.7","0.1","-0.1","-0.8","0.8"], + ["650","1404","5","0.8","26.8","3.9","3.0","-2.7","0.1","-0.1","-0.9","0.8"], + ["700","1388","6","0.8","26.7","3.6","3.1","-2.8","0.1","-0.1","-0.9","0.9"], + ["750","1372","6","0.8","26.6","3.4","3.2","-2.8","0.1","-0.1","-1.0","1.0"], + ["800","1355","7","0.8","26.5","3.2","3.2","-2.9","0.1","-0.1","-1.1","1.1"], + ["850","1338","8","0.8","26.4","3.0","3.3","-2.9","0.1","-0.1","-1.1","1.1"], + ["900","1321","8","0.8","26.2","2.8","3.4","-3.0","0.1","-0.1","-1.2","1.2"], + ["950","1303","9","0.9","26.1","2.7","3.4","-3.1","0.1","-0.2","-1.3","1.2"], + ["1000","1285","10","0.9","26.0","2.6","3.5","-3.1","0.2","-0.1","-1.4","1.3"], + ["1050","1266","11","0.9","25.8","2.4","3.5","-3.2","0.1","-0.2","-1.4","1.4"], + ["1100","1247","12","0.9","25.7","2.3","3.6","-3.3","0.1","-0.2","-1.5","1.4"], + ["1150","1228","13","0.9","25.5","2.2","3.7","-3.3","0.2","-0.2","-1.6","1.5"], + ["1200","1207","14","1.0","25.3","2.1","3.7","-3.4","0.2","-0.2","-1.7","1.6"], + ["1250","1186","15","1.0","25.1","2.0","3.8","-3.4","0.2","-0.2","-1.7","1.7"], + ["1300","1163","17","1.0","24.8","1.9","3.8","-3.5","0.2","-0.2","-1.8","1.7"], + ["1350","1140","19","1.0","24.6","1.9","3.9","-3.5","0.2","-0.2","-1.9","1.8"], + ["1400","1115","21","1.1","24.3","1.8","3.9","-3.6","0.2","-0.2","-1.9","1.9"], + ["1450","1088","24","1.1","23.9","1.7","4.0","-3.6","0.2","-0.2","-2.0","1.9"], + ["1500","1060","27","1.2","23.6","1.6","4.0","-3.7","0.2","-0.2","-2.1","2.0"], + ["1550","1028","32","1.3","23.1","1.5","4.0","-3.7","0.2","-0.2","-2.1","2.1"], + ["1600","991","38","1.4","22.6","1.5","4.0","-3.7","0.2","-0.2","-2.2","2.1"], + ["1650","947","49","1.7","21.9","1.4","4.0","-3.7","0.2","-0.3","-2.3","2.2"], + ["1700","888","71","2.1","21.0","1.3","3.9","-3.6","0.3","-0.3","-2.3","2.2"] + ] + }; +case ((abs(_muzzleVelocity - 200) < 0.00001) && {(abs(_airFriction - -0.0001) < 0.00001)}): { + [ + ["250","1559","1","0.6","37.3","23.8","6.1","-5.9","0.0","-0.0","-0.6","0.5"], + ["300","1551","1","0.6","37.3","20.0","6.1","-5.9","0.1","-0.0","-0.7","0.7"], + ["350","1543","1","0.6","37.3","17.2","6.2","-5.9","0.0","-0.1","-0.8","0.7"], + ["400","1535","1","0.6","37.3","15.1","6.2","-5.9","0.1","-0.0","-0.9","0.9"], + ["450","1527","1","0.6","37.3","13.4","6.3","-6.0","0.1","-0.1","-1.0","1.0"], + ["500","1519","1","0.6","37.2","12.1","6.3","-6.0","0.1","-0.1","-1.1","1.1"], + ["550","1510","1","0.6","37.2","11.0","6.4","-6.0","0.1","-0.1","-1.3","1.2"], + ["600","1502","1","0.6","37.2","10.1","6.4","-6.1","0.1","-0.1","-1.4","1.3"], + ["650","1494","1","0.6","37.2","9.4","6.5","-6.1","0.1","-0.1","-1.5","1.4"], + ["700","1485","2","0.6","37.1","8.7","6.5","-6.2","0.1","-0.1","-1.6","1.5"], + ["750","1477","2","0.6","37.1","8.2","6.6","-6.2","0.1","-0.1","-1.7","1.6"], + ["800","1468","2","0.6","37.0","7.7","6.7","-6.3","0.1","-0.1","-1.8","1.8"], + ["850","1460","2","0.6","37.0","7.2","6.7","-6.3","0.1","-0.1","-2.0","1.9"], + ["900","1451","2","0.6","37.0","6.8","6.8","-6.4","0.1","-0.1","-2.1","2.0"], + ["950","1443","2","0.6","36.9","6.5","6.9","-6.4","0.1","-0.1","-2.2","2.1"], + ["1000","1434","2","0.6","36.9","6.2","6.9","-6.5","0.1","-0.1","-2.3","2.2"], + ["1050","1425","2","0.6","36.8","5.9","7.0","-6.6","0.1","-0.2","-2.5","2.3"], + ["1100","1417","3","0.6","36.8","5.6","7.1","-6.6","0.1","-0.2","-2.6","2.4"], + ["1150","1408","3","0.6","36.7","5.4","7.1","-6.7","0.2","-0.2","-2.7","2.5"], + ["1200","1399","3","0.6","36.6","5.2","7.2","-6.7","0.2","-0.2","-2.8","2.7"], + ["1250","1390","3","0.6","36.6","5.0","7.3","-6.8","0.2","-0.2","-2.9","2.8"], + ["1300","1381","3","0.6","36.5","4.8","7.4","-6.9","0.2","-0.2","-3.0","2.9"], + ["1350","1372","3","0.6","36.4","4.6","7.4","-6.9","0.2","-0.2","-3.2","3.0"], + ["1400","1362","4","0.6","36.4","4.4","7.5","-7.0","0.2","-0.2","-3.3","3.1"], + ["1450","1353","4","0.6","36.3","4.3","7.6","-7.1","0.2","-0.2","-3.4","3.2"], + ["1500","1344","4","0.6","36.2","4.2","7.7","-7.1","0.2","-0.2","-3.5","3.4"], + ["1550","1334","4","0.6","36.1","4.0","7.7","-7.2","0.2","-0.2","-3.7","3.5"], + ["1600","1324","4","0.6","36.0","3.9","7.8","-7.3","0.2","-0.2","-3.8","3.6"], + ["1650","1314","4","0.7","35.9","3.8","7.9","-7.3","0.2","-0.2","-3.9","3.7"], + ["1700","1304","5","0.7","35.8","3.7","7.9","-7.4","0.2","-0.2","-4.0","3.8"], + ["1750","1294","5","0.7","35.7","3.6","8.0","-7.5","0.2","-0.2","-4.2","3.9"], + ["1800","1284","5","0.7","35.6","3.5","8.1","-7.6","0.2","-0.3","-4.3","4.0"], + ["1850","1274","5","0.7","35.5","3.4","8.2","-7.6","0.2","-0.3","-4.4","4.2"], + ["1900","1263","6","0.7","35.4","3.3","8.2","-7.7","0.2","-0.3","-4.5","4.3"], + ["1950","1253","6","0.7","35.2","3.2","8.3","-7.8","0.2","-0.3","-4.7","4.4"], + ["2000","1242","6","0.7","35.1","3.1","8.4","-7.8","0.3","-0.3","-4.8","4.5"], + ["2050","1231","7","0.7","35.0","3.0","8.4","-7.9","0.3","-0.3","-4.9","4.7"], + ["2100","1219","7","0.7","34.8","2.9","8.5","-8.0","0.3","-0.3","-5.0","4.8"], + ["2150","1208","7","0.7","34.7","2.9","8.5","-8.0","0.3","-0.3","-5.2","4.9"], + ["2200","1196","8","0.7","34.5","2.8","8.6","-8.1","0.3","-0.3","-5.3","5.0"], + ["2250","1184","8","0.7","34.3","2.7","8.7","-8.2","0.3","-0.3","-5.4","5.1"], + ["2300","1171","9","0.8","34.2","2.7","8.7","-8.2","0.3","-0.3","-5.5","5.2"], + ["2350","1158","9","0.8","34.0","2.6","8.8","-8.3","0.3","-0.3","-5.7","5.4"], + ["2400","1145","10","0.8","33.8","2.5","8.8","-8.3","0.3","-0.3","-5.8","5.5"], + ["2450","1132","10","0.8","33.6","2.5","8.9","-8.4","0.3","-0.3","-5.9","5.6"], + ["2500","1118","11","0.8","33.3","2.4","8.9","-8.4","0.3","-0.3","-6.0","5.7"], + ["2550","1103","12","0.8","33.1","2.4","9.0","-8.5","0.3","-0.3","-6.1","5.8"], + ["2600","1088","13","0.9","32.8","2.3","9.0","-8.5","0.4","-0.3","-6.2","5.9"], + ["2650","1072","14","0.9","32.6","2.2","9.0","-8.6","0.4","-0.4","-6.4","6.0"], + ["2700","1056","15","0.9","32.3","2.2","9.0","-8.6","0.3","-0.4","-6.5","6.1"], + ["2750","1038","16","1.0","31.9","2.1","9.1","-8.6","0.4","-0.4","-6.6","6.3"], + ["2800","1020","18","1.0","31.6","2.1","9.1","-8.6","0.4","-0.4","-6.7","6.4"], + ["2850","1000","20","1.1","31.2","2.0","9.1","-8.6","0.4","-0.4","-6.8","6.5"], + ["2900","978","22","1.1","30.8","1.9","9.0","-8.6","0.4","-0.4","-6.9","6.5"], + ["2950","954","26","1.2","30.3","1.9","9.0","-8.6","0.4","-0.4","-7.0","6.6"], + ["3000","927","31","1.4","29.7","1.8","8.9","-8.5","0.4","-0.4","-7.1","6.7"], + ["3050","894","38","1.6","29.0","1.7","8.8","-8.4","0.4","-0.4","-7.2","6.8"], + ["3100","849","54","2.0","27.9","1.6","8.5","-8.3","0.4","-0.4","-7.2","6.8"] + ] + }; +case ((abs(_muzzleVelocity - 70) < 0.00001) && {(abs(_airFriction - 0) < 0.00001)}): { + [ + ["100","1497","9","1.3","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["150","1445","14","1.3","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["200","1390","19","1.4","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["250","1333","26","1.4","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["300","1272","34","1.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["350","1204","45","1.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["400","1127","61","1.8","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["450","1028","91","2.1","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"] + ] + }; +case ((abs(_muzzleVelocity - 140) < 0.00001) && {(abs(_airFriction - 0) < 0.00001)}): { + [ + ["150","1562","1","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["200","1549","1","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["250","1536","2","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["300","1523","2","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["350","1510","2","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["400","1497","3","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["450","1484","3","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["500","1471","3","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["550","1458","4","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["600","1445","4","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["650","1431","4","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["700","1418","5","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["750","1404","5","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["800","1390","6","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["850","1376","6","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["900","1362","6","0.8","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["950","1348","7","0.8","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["1000","1333","7","0.8","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1050","1318","8","0.8","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1100","1303","9","0.8","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1150","1288","9","0.8","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1200","1272","10","0.8","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1250","1256","11","0.8","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["1300","1239","12","0.8","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1350","1222","13","0.9","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1400","1205","13","0.9","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1450","1187","15","0.9","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1500","1168","16","0.9","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1550","1148","18","1.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1600","1127","19","1.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1650","1105","21","1.1","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1700","1082","24","1.1","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1750","1057","27","1.2","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1800","1029","31","1.3","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["1850","997","37","1.4","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1900","960","46","1.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1950","912","63","1.9","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"] + ] + }; +case ((abs(_muzzleVelocity - 200) < 0.00001) && {(abs(_airFriction - 0) < 0.00001)}): { + [ + ["300","1563","0","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["350","1556","1","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["400","1550","1","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["450","1544","1","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["500","1537","1","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["550","1531","1","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["600","1525","1","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["650","1519","1","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["700","1512","1","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["750","1506","1","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["800","1499","1","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["850","1493","1","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["900","1487","1","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["950","1480","1","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["1000","1474","2","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["1050","1467","2","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["1100","1461","2","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1150","1454","2","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1200","1448","2","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["1250","1441","2","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["1300","1435","2","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1350","1428","2","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1400","1422","2","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1450","1415","2","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["1500","1408","2","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["1550","1402","3","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1600","1395","3","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1650","1388","3","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["1700","1381","3","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["1750","1374","3","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["1800","1367","3","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["1850","1360","3","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["1900","1353","3","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["1950","1346","4","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["2000","1339","4","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["2050","1332","4","0.5","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["2100","1325","4","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["2150","1317","4","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["2200","1310","4","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["2250","1302","4","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["2300","1295","5","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["2350","1287","5","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["2400","1280","5","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["2450","1272","5","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["2500","1264","5","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["2550","1256","5","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["2600","1248","6","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["2650","1240","6","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["2700","1232","6","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["2750","1223","6","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["2800","1215","7","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["2850","1206","7","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["2900","1197","7","0.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["2950","1188","7","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["3000","1179","8","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["3050","1170","8","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["3100","1160","8","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["3150","1151","9","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["3200","1141","9","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["3250","1131","10","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["3300","1120","10","0.7","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["3350","1109","11","0.8","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["3400","1098","11","0.8","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["3450","1087","12","0.8","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["3500","1075","13","0.8","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["3550","1062","14","0.8","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["3600","1049","15","0.9","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["3650","1036","16","0.9","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["3700","1021","17","0.9","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["3750","1006","19","1.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["3800","990","21","1.1","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["3850","971","24","1.1","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["3900","952","27","1.2","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["3950","929","32","1.4","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"], + ["4000","900","40","1.6","0.0","0.0","0.0","0.0","0.0","0.0","0.0","-0.0"], + ["4050","861","56","2.1","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"] + ] + }; + default { + ERROR("MuzzleVelocity not found in LUT"); + [] + }; +}; \ No newline at end of file diff --git a/addons/mk6mortar/functions/fnc_toggleMils.sqf b/addons/mk6mortar/functions/fnc_toggleMils.sqf new file mode 100644 index 0000000000..923a553f43 --- /dev/null +++ b/addons/mk6mortar/functions/fnc_toggleMils.sqf @@ -0,0 +1,24 @@ +/* + * Author: PabstMirror + * Toggles the mortart to show mils or degrees + * + * Arguments: + * 0: Vehicle + * 1: Player + * + * Return Value: + * No + * + * Example: + * [mortar,bob] call ace_mk6mortar_fnc_toggleMils; + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_2(_mortarVeh,_unit); + +private "_currentSetting"; + +_currentSetting = _mortarVeh getVariable [QGVAR(useMils), true]; +_mortarVeh setVariable [QGVAR(useMils), (!_currentSetting)]; diff --git a/addons/mk6mortar/functions/fnc_turretDisplayLoaded.sqf b/addons/mk6mortar/functions/fnc_turretDisplayLoaded.sqf new file mode 100644 index 0000000000..c81ff32132 --- /dev/null +++ b/addons/mk6mortar/functions/fnc_turretDisplayLoaded.sqf @@ -0,0 +1,67 @@ +/* + * Author: PabstMirror + * Called when the mk6's in game UI is loaded. Hides rangefinder data if it is disabled. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_mk6mortar_fnc_turretDisplayLoaded + * + * Public: No + */ +#include "script_component.hpp" + +#define CTRL_CA_OPTICSPITCH (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_OPTICSPITCH") +#define CTRL_CA_OPTICSZOOM (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_OPTICSZOOM") +#define CTRL_CA_SOLUTION_TEXT (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_SOLUTION_TEXT") +#define CTRL_CA_DISTANCE_TEXT (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_DISTANCE_TEXT") +#define CTRL_CA_DISTANCE (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_DISTANCE") +#define CTRL_CA_TIME_TEXT (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_TIME_TEXT") +#define CTRL_CA_TIME (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_TIME") +#define CTRL_CA_ELEV_NEED_TEXT (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_ELEV_NEED_TEXT") +#define CTRL_CA_RANGEELEMENTS_GROUP (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_RangeElements_group") + +#define CTRL_CA_HEADING (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_Heading") +#define CTRL_CA_ELEV (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_ELEV") +#define CTRL_CA_ELEV_NEED (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_ELEV_NEED") + +private ["_display", "_fnc_hideControl"]; + +disableSerialization; + +_display = uiNamespace getVariable ["ACE_Mk6_RscWeaponRangeArtillery", displayNull]; +if (isNull _display) exitWith {}; + +_fnc_hideControl = { + private "_idc"; + PARAMS_2(_path,_hideCtrl); + _idc = getNumber (_path >> "IDC"); + _pos = []; + if (_hideCtrl) then { + _pos = [-9,-9,0,0]; + } else { + { + if (isNumber (_path >> _x)) then { + _pos pushBack (getNumber (_path >> _x)); + } else { + _pos pushBack (call compile (getText (_path >> _x))); + }; + } forEach ["x", "y", "w", "h"]; + }; + (_display displayCtrl _idc) ctrlSetPosition _pos; + (_display displayCtrl _idc) ctrlCommit 0; +}; + +{ + [_x, (!GVAR(allowComputerRangefinder))] call _fnc_hideControl; +} forEach [CTRL_CA_OPTICSPITCH, CTRL_CA_OPTICSZOOM, CTRL_CA_SOLUTION_TEXT, CTRL_CA_DISTANCE_TEXT, CTRL_CA_DISTANCE, CTRL_CA_TIME_TEXT, CTRL_CA_TIME, CTRL_CA_ELEV_NEED_TEXT, CTRL_CA_RANGEELEMENTS_GROUP]; + +//Always hide these, handled by the mil convertions PFEH in handlePlayerVehChanged +[CTRL_CA_HEADING, true] call _fnc_hideControl; +[CTRL_CA_ELEV, true] call _fnc_hideControl; +[CTRL_CA_ELEV_NEED, true] call _fnc_hideControl; + diff --git a/addons/mk6mortar/functions/script_component.hpp b/addons/mk6mortar/functions/script_component.hpp new file mode 100644 index 0000000000..9980d4fc88 --- /dev/null +++ b/addons/mk6mortar/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\mk6mortar\script_component.hpp" \ No newline at end of file diff --git a/addons/mk6mortar/script_component.hpp b/addons/mk6mortar/script_component.hpp new file mode 100644 index 0000000000..cb74d552de --- /dev/null +++ b/addons/mk6mortar/script_component.hpp @@ -0,0 +1,14 @@ +#define COMPONENT mk6mortar +#include "\z\ace\Addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_MK6MORTAR + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_MK6MORTAR + #define DEBUG_SETTINGS DEBUG_SETTINGS_MK6MORTAR +#endif + +#include "\z\ace\Addons\main\script_macros.hpp" + +#define MK6_82mm_AIR_FRICTION -0.0001 \ No newline at end of file diff --git a/addons/mk6mortar/stringtable.xml b/addons/mk6mortar/stringtable.xml new file mode 100644 index 0000000000..15d42d04a8 --- /dev/null +++ b/addons/mk6mortar/stringtable.xml @@ -0,0 +1,41 @@ + + + + + 82mm Rangetable + 82mm Distanztabelle + Tabela strzelnicza 82mm + Table de tir 82mm + 82 мм Таблица дальностей и прицелов + Tabla de distancias de 82mm + 82mm hatótáv-tábla + + + Range Table for the MK6 82mm Mortar + Distanztabelle für den Mk6 82mm Mortar + Tabela strzelnicza dla moździerza 82mm MK6 + Table de tir pour le mortier MK6 82mm + Таблица дальностей и прицелов для MK6 82 мм мортиры + Tabla de distancias para el mortero MK6 de 82mm + Hatótáv-tábla a MK6 82mm-es mozsárhoz + + + Open 82mm Rangetable + Öffne 82mm Distanztabelle + Otwórz tabelę strzelniczą 82mm + Ouvrir la table de tir 82mm + Открыть 82 мм Таблицу дальностей и прицелов + Abrir tabla de distancias de 82mm + 82mm hatótáv-tábla megnyitása + + + Charge + Ladung + Charge + Ładunek + Зарядить + Carga + Töltés + + + diff --git a/addons/modules/XEH_preInit.sqf b/addons/modules/XEH_preInit.sqf index a8b9bd061e..dfbbe2c2b9 100644 --- a/addons/modules/XEH_preInit.sqf +++ b/addons/modules/XEH_preInit.sqf @@ -3,6 +3,8 @@ ADDON = false; PREP(moduleInit); +PREP(bi_moduleProjectile); + GVAR(moduleInitCollection) = []; ADDON = true; diff --git a/addons/modules/config.cpp b/addons/modules/config.cpp index bffcec4faf..4fc3b8b60d 100644 --- a/addons/modules/config.cpp +++ b/addons/modules/config.cpp @@ -23,6 +23,9 @@ class CfgVehicles { init = QUOTE(_this call DFUNC(moduleInit)); }; }; + class ModuleOrdnance_F: Module_F { + function = "ace_modules_fnc_bi_moduleProjectile"; + }; }; #include "CfgEventHandlers.hpp" diff --git a/addons/modules/functions/fnc_bi_moduleProjectile.sqf b/addons/modules/functions/fnc_bi_moduleProjectile.sqf new file mode 100644 index 0000000000..56e3eb9883 --- /dev/null +++ b/addons/modules/functions/fnc_bi_moduleProjectile.sqf @@ -0,0 +1,191 @@ +/* + * Author: Bohemia Interactive + * Module function for spawning projectiles + * Used by Curator artillery modules etc + * + * Arguments: + * 0: The logic object + * + * Return Value: + * nil + * + * Public: No + */ + +_fnc_scriptNameParentTemp = if !(isnil '_fnc_scriptName') then {_fnc_scriptName} else {'BIS_fnc_moduleProjectile'}; +private ['_fnc_scriptNameParent']; +_fnc_scriptNameParent = _fnc_scriptNameParentTemp; +_fnc_scriptNameParentTemp = nil; + +private ['_fnc_scriptName']; +_fnc_scriptName = 'BIS_fnc_moduleProjectile'; +scriptname _fnc_scriptName; + +private ["_logic", "_units", "_activated"]; +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; + +if ({local _x} count (objectcurators _logic) > 0) then { + //--- Reveal the circle to curators + _logic hideobject false; + _logic setpos position _logic; +}; +if !(isserver) exitwith {}; + +if (_activated) then { + _ammo = _logic getvariable ["type",gettext (configfile >> "cfgvehicles" >> typeof _logic >> "ammo")]; + if (_ammo != "") then { + _cfgAmmo = configfile >> "cfgammo" >> _ammo; + //if !(isclass _cfgAmmo) exitwith {["CfgAmmo class '%1' not found.",_ammo] call bis_fnc_error;}; + _dirVar = _fnc_scriptname + typeof _logic; + _logic setdir (missionnamespace getvariable [_dirVar,direction _logic]); //--- Restore custom direction + _pos = getposatl _logic; + _posAmmo = +_pos; + _posAmmo set [2,0]; + _dir = direction _logic; + _simulation = tolower gettext (configfile >> "cfgammo" >> _ammo >> "simulation"); + _altitude = 0; + _velocity = []; + _attach = false; + _radio = ""; + _delay = 60; + _sound = ""; + _soundSourceClass = ""; + _hint = []; + _shakeStrength = 0; + _shakeRadius = 0; + switch (_simulation) do { + case "shotshell": { + _altitude = 1000; + _velocity = [0,0,-100]; + _radio = "SentGenIncoming"; + _sounds = if (getnumber (_cfgAmmo >> "hit") < 200) then {["mortar1","mortar2"]} else {["shell1","shell2","shell3","shell4"]}; + _sound = _sounds call bis_fnc_selectrandom; + _hint = ["Curator","PlaceOrdnance"]; + _shakeStrength = 0.01; + _shakeRadius = 300; + }; + case "shotsubmunitions": { + _posAmmo = [_posAmmo,500,_dir + 180] call bis_fnc_relpos; + _altitude = 1000 - ((getterrainheightasl _posAmmo) - (getterrainheightasl _pos)); + _posAmmo set [2,_altitude]; + _velocity = [sin _dir * 68,cos _dir * 68,-100]; + _radio = "SentGenIncoming"; + _hint = ["Curator","PlaceOrdnance"]; + _shakeStrength = 0.02; + _shakeRadius = 500; + }; + case "shotilluminating": { + _altitude = 66; + _velocity = [wind select 0,wind select 1,30]; + _sound = "SN_Flare_Fired_4"; + _soundSourceClass = "SoundFlareLoop_F"; + }; + case "shotnvgmarker"; + case "shotsmokex": { + _altitude = 0; + _velocity = [0,0,0]; + _attach = true; + }; + default {["Ammo simulation '%1' is not supported",_simulation] call bis_fnc_error;}; + }; + _fnc_playRadio = { + if (_radio != "") then { + _entities = (getposatl _logic) nearentities ["All",100]; + _sides = []; + { + if (isplayer _x) then { + _side = side group _x; + if (_side in [east,west,resistance,civilian]) then { + //--- Play radio (only if it wasn't played recently) + if (time > _x getvariable ["BIS_fnc_moduleProjectile_radio",-_delay]) then { + [[_side,_radio,"side"],"bis_fnc_sayMessage",_x] call bis_fnc_mp; + _x setvariable ["BIS_fnc_moduleProjectile_radio",time + _delay]; + }; + }; + }; + } foreach _entities; + }; + }; + if (count _hint > 0) then { + [[_hint,nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",objectcurators _logic] call bis_fnc_mp; + }; + if (count _velocity == 3) then { + _altitude = (_logic getvariable ["altitude",_altitude]) call bis_fnc_parsenumber; + _radio = _logic getvariable ["radio",_radio]; + + //--- Create projectile + _posAmmo set [2,_altitude]; + _projectile = createvehicle [_ammo,_posAmmo,[],0,"none"]; + _projectile setpos _posAmmo; + _projectile setvelocity _velocity; + if (_attach) then {_projectile attachto [_logic,[0,0,_altitude]];}; + + // This is our addition to this function + if (!isnil "ace_frag_fnc_addManualTrack") then { + [_projectile] call ace_frag_fnc_addManualTrack + }; + + //--- Play sound + if (_sound != "") then {[[_logic,_sound,"say3D"],"bis_fnc_sayMessage"] call bis_fnc_mp;}; + + //--- Create sound source + _soundSource = if (_soundSourceClass != "") then {createSoundSource [_soundSourceClass,_pos,[],0]} else {objnull}; + + //--- Play radio warning + [] call _fnc_playRadio; + + //--- Update + if (_attach) then { + waituntil { + _soundSource setposatl getposatl _projectile; + sleep 1; + isnull _projectile || isnull _logic + }; + } else { + waituntil { + _soundSource setposatl getposatl _projectile; + + if (getposatl _logic distance _pos > 0 || direction _logic != _dir) then { + _posNew = getposasl _logic; + _dirDiff = direction _logic - _dir; + _posNew = [_posNew,[getposasl _projectile,_pos] call bis_fnc_distance2d,direction _logic + 180] call bis_fnc_relpos; + _posNew set [2,getposasl _projectile select 2]; + _projectile setvelocity ([velocity _projectile,-_dirDiff] call bis_fnc_rotatevector2d); + _projectile setposasl _posNew; + _pos = getposatl _logic; + _dir = direction _logic; + missionnamespace setvariable [_dirVar,_dir]; + }; + sleep 0.1; + isnull _projectile || isnull _logic + }; + }; + deletevehicle _projectile; + deletevehicle _soundSource; + if (count objectcurators _logic > 0) then { + + //--- Delete curator spawned logic + if (_shakeStrength > 0) then { + if (_simulation == "shotsubmunitions") then {sleep 0.5;}; + [[_shakeStrength,0.7,[position _logic,_shakeRadius]],"bis_fnc_shakeCuratorCamera"] call bis_fnc_mp; + }; + deletevehicle _logic; + } else { + + //--- Repeat to achieve permanent effect + _repeat = _logic getvariable ["repeat",0] > 0; + if (_repeat) then { + [_logic,_units,_activated] call bis_fnc_moduleprojectile; + } else { + deletevehicle _logic; + }; + }; + } else { + deletevehicle _logic; + }; + } else { + ["Cannot create projectile, 'ammo' config attribute is missing in %1",typeof _logic] call bis_fnc_error; + }; +}; diff --git a/addons/movement/CfgMoves.hpp b/addons/movement/CfgMoves.hpp index 677ad3dc94..bd9519b013 100644 --- a/addons/movement/CfgMoves.hpp +++ b/addons/movement/CfgMoves.hpp @@ -5,10 +5,35 @@ class CfgMovesBasic { }; class Actions { - class RifleStandActionsNoAdjust; - class RifleLowStandActionsNoAdjust; + class RifleBaseStandActions; + class RifleKneelActions: RifleBaseStandActions { + Civil = "AmovPknlMstpSnonWnonDnon"; + }; + class RifleProneActions: RifleBaseStandActions { + Civil = "AmovPpneMstpSnonWnonDnon"; + SecondaryWeapon = "AmovPpneMstpSrasWlnrDnon"; + }; + + class PistolStandActions; + class PistolProneActions: PistolStandActions { + SecondaryWeapon = "AmovPpneMstpSrasWlnrDnon"; + }; + + class LauncherKneelActions; + /*class LauncherStandActions: LauncherKneelActions { + PlayerProne = "AmovPpneMstpSrasWlnrDnon"; + Down = "AmovPpneMstpSrasWlnrDnon"; + };*/ + + class LauncherProneActions: LauncherKneelActions { + TurnL = "AmovPpneMstpSrasWlnrDnon_turnl"; + TurnLRelaxed = "AmovPpneMstpSrasWlnrDnon_turnl"; + TurnR = "AmovPpneMstpSrasWlnrDnon_turnr"; + TurnRRelaxed = "AmovPpneMstpSrasWlnrDnon_turnr"; + }; // WEAPON RAISED - RUNNING + class RifleStandActionsNoAdjust; class RifleStandActionsRunF: RifleStandActionsNoAdjust { getOver = "AovrPercMrunSrasWrflDf"; }; @@ -18,6 +43,7 @@ class CfgMovesBasic { class RifleStandActionsRunFR: RifleStandActionsNoAdjust { getOver = "AovrPercMrunSrasWrflDf"; }; + // WEAPON RAISED - SPRINTING class RifleStandEvasiveActionsF: RifleStandActionsNoAdjust { getOver = "AovrPercMrunSrasWrflDf"; @@ -28,7 +54,9 @@ class CfgMovesBasic { class RifleStandEvasiveActionsFR: RifleStandActionsNoAdjust { getOver = "AovrPercMrunSrasWrflDf"; }; + // WEAPON LOWERED - RUNNING + class RifleLowStandActionsNoAdjust; class RifleLowStandActionsRunF: RifleLowStandActionsNoAdjust { getOver = "AovrPercMrunSrasWrflDf"; }; diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf index 224cd93273..0e451832d9 100644 --- a/addons/movement/XEH_postInit.sqf +++ b/addons/movement/XEH_postInit.sqf @@ -20,7 +20,7 @@ if (!hasInterface) exitWith {}; }] call EFUNC(common,addEventHandler); -["ACE3", QGVAR(climb), localize "STR_ACE_Movement_Climb", +["ACE3 Movement", QGVAR(climb), localize "STR_ACE_Movement_Climb", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/movement/config.cpp b/addons/movement/config.cpp index 51ab97b80a..6cf2c9470c 100644 --- a/addons/movement/config.cpp +++ b/addons/movement/config.cpp @@ -21,7 +21,7 @@ class ACE_Settings { class GVAR(useImperial) { value = 0; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Movement_UseImperial"; }; }; diff --git a/addons/movement/functions/fnc_canClimb.sqf b/addons/movement/functions/fnc_canClimb.sqf index 27753d8a12..671ab0b808 100644 --- a/addons/movement/functions/fnc_canClimb.sqf +++ b/addons/movement/functions/fnc_canClimb.sqf @@ -9,15 +9,15 @@ * The return value * * Example: - * _bool = [player] call ace_movement_fnc_canClimb + * [player] call ace_movement_fnc_canClimb * * Public: No */ #include "script_component.hpp" -private ["_unit", "_pos", "_dir"]; +private ["_pos", "_dir"]; -_unit = _this select 0; +PARAMS_1(_unit); _pos = getPosASL _unit; _dir = getDir _unit; @@ -25,15 +25,36 @@ _dir = [sin _dir, cos _dir, 0]; private ["_checkPos0beg", "_checkPos0end", "_checkPos1beg", "_checkPos1end"]; -_checkPos0beg = _pos vectorAdd [0, 0, 1.0]; +_checkPos0beg = _pos vectorAdd [0, 0, 0.9]; _checkPos0end = _checkPos0beg vectorAdd (_dir vectorMultiply 1.3); -_checkPos1beg = _pos vectorAdd [0, 0, 1.5]; -_checkPos1end = _checkPos1beg vectorAdd _dir; +_checkPos1beg = _pos vectorAdd [0, 0, 1.75]; +_checkPos1end = _checkPos1beg vectorAdd (_dir vectorMultiply 1.3); + +_checkPos2beg = _pos vectorAdd [0.3 * (_dir select 1), 0.3 * -(_dir select 0), 2.0]; +_checkPos2end = _checkPos2beg vectorAdd (_dir vectorMultiply 1.3); + +_checkPos3beg = _pos vectorAdd [-0.2 * (_dir select 1), -0.2 * -(_dir select 0), 2.0]; +_checkPos3end = _checkPos3beg vectorAdd (_dir vectorMultiply 1.3); + +_checkPos4beg = _pos vectorAdd [0.3 * (_dir select 1), 0.3 * -(_dir select 0), 1.5]; +_checkPos4end = _checkPos4beg vectorAdd (_dir vectorMultiply 1.3); + +_checkPos5beg = _pos vectorAdd [-0.2 * (_dir select 1), -0.2 * -(_dir select 0), 1.5]; +_checkPos5end = _checkPos5beg vectorAdd (_dir vectorMultiply 1.3); /* -drawLine3D [ASLToATL _checkPos0beg, ASLToATL _checkPos0end, [1,0,0,1]]; +drawLine3D [ASLToATL _checkPos0beg, ASLToATL _checkPos0end, [0,1,0,1]]; drawLine3D [ASLToATL _checkPos1beg, ASLToATL _checkPos1end, [1,0,0,1]]; - */ +drawLine3D [ASLToATL _checkPos2beg, ASLToATL _checkPos2end, [1,0.5,0.5,1]]; +drawLine3D [ASLToATL _checkPos3beg, ASLToATL _checkPos3end, [1,0.5,0.5,1]]; +drawLine3D [ASLToATL _checkPos4beg, ASLToATL _checkPos4end, [1,0.5,0.5,1]]; +drawLine3D [ASLToATL _checkPos5beg, ASLToATL _checkPos5end, [1,0.5,0.5,1]]; +*/ -lineIntersects [_checkPos0beg, _checkPos0end] && {!(lineIntersects [_checkPos1beg, _checkPos1end])} + lineIntersects [_checkPos0beg, _checkPos0end] +&& {!(lineIntersects [_checkPos1beg, _checkPos1end])} +&& {!(lineIntersects [_checkPos2beg, _checkPos2end])} +&& {!(lineIntersects [_checkPos3beg, _checkPos3end])} +&& {!(lineIntersects [_checkPos4beg, _checkPos4end])} +&& {!(lineIntersects [_checkPos5beg, _checkPos5end])} diff --git a/addons/movement/functions/fnc_climb.sqf b/addons/movement/functions/fnc_climb.sqf index aff27ffe9d..f88884195e 100644 --- a/addons/movement/functions/fnc_climb.sqf +++ b/addons/movement/functions/fnc_climb.sqf @@ -24,6 +24,15 @@ if !([_unit] call FUNC(canClimb)) exitWith { }; if !(_unit getVariable [QGVAR(isClimbInit), false]) then { + _unit addEventHandler ["AnimChanged", { + if (local (_this select 0) && {_this select 1 == "ACE_Climb"}) then { + // abort climb animation + if !(_this call FUNC(canClimb)) then { + [_this select 0, "AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); + }; + }; + }]; + _unit addEventHandler ["AnimDone", { if (local (_this select 0) && {_this select 1 == "ACE_Climb"}) then {_this call FUNC(handleClimb)}; }]; @@ -32,5 +41,5 @@ if !(_unit getVariable [QGVAR(isClimbInit), false]) then { }; [_unit] call EFUNC(common,fixLoweredRifleAnimation); -[_unit, "AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); +[_unit, "AmovPercMstpSnonWnonDnon", 0] call EFUNC(common,doAnimation); [_unit, "ACE_Climb", 0] call EFUNC(common,doAnimation); diff --git a/addons/movement/functions/fnc_getWeight.sqf b/addons/movement/functions/fnc_getWeight.sqf index 955be1a215..6941173fde 100644 --- a/addons/movement/functions/fnc_getWeight.sqf +++ b/addons/movement/functions/fnc_getWeight.sqf @@ -9,7 +9,7 @@ * The return value * * Example: - * _bool = [player] call ace_movement_fnc_getWeight + * [player] call ace_movement_fnc_getWeight * * Public: No */ diff --git a/addons/movement/stringtable.xml b/addons/movement/stringtable.xml index 9de9e9033f..af5ce71af4 100644 --- a/addons/movement/stringtable.xml +++ b/addons/movement/stringtable.xml @@ -11,7 +11,7 @@ Mostra peso in libbre Mostrar peso em libras Súly megjelenítése fontban. - Показать вес в фунтах + Показывать вес в фунтах Weight: @@ -32,7 +32,10 @@ Wspinaczka Trepar Vylézt - Подняться + Взобраться + Mászás + Arrampicati + Subir Can't climb here @@ -41,7 +44,10 @@ Nie możesz wspiąć się tutaj No se puede trepar aquí Zde není možné vylézt - Не можете подняться здесь + Здесь невозможно взобраться + Itt nem tudsz mászni + Non puoi arrampicarti qui + Não se pode subir aqui diff --git a/addons/nametags/XEH_postInit.sqf b/addons/nametags/XEH_postInit.sqf index ab3cd03391..cea2025dcc 100644 --- a/addons/nametags/XEH_postInit.sqf +++ b/addons/nametags/XEH_postInit.sqf @@ -5,9 +5,10 @@ if (!hasInterface) exitWith {}; +GVAR(ShowNamesTime) = -10; // Add keybinds -["ACE3", QGVAR(showNameTags), localize "STR_ACE_NameTags_ShowNames", +["ACE3 Common", QGVAR(showNameTags), localize "STR_ACE_NameTags_ShowNames", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/nametags/XEH_preInit.sqf b/addons/nametags/XEH_preInit.sqf index 80c06cff1f..f3c9a97cba 100644 --- a/addons/nametags/XEH_preInit.sqf +++ b/addons/nametags/XEH_preInit.sqf @@ -9,9 +9,6 @@ PREP(getVehicleData); PREP(initIsSpeaking); PREP(moduleNameTags); PREP(onDraw3d); -PREP(onMouseZChanged); PREP(setText); -GVAR(ShowNamesTime) = -10; - ADDON = true; diff --git a/addons/nametags/config.cpp b/addons/nametags/config.cpp index e67703e147..dce054a9ec 100644 --- a/addons/nametags/config.cpp +++ b/addons/nametags/config.cpp @@ -19,55 +19,55 @@ class ACE_Settings { class GVAR(defaultNametagColor) { value[] = {0.77, 0.51, 0.08, 1}; typeName = "COLOR"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_NameTags_DefaultNametagColor"; }; class GVAR(showPlayerNames) { value = 1; typeName = "SCALAR"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_NameTags_ShowPlayerNames"; values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"}; }; class GVAR(showPlayerRanks) { value = 1; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_NameTags_ShowPlayerRanks"; }; class GVAR(showVehicleCrewInfo) { value = 1; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_NameTags_ShowVehicleCrewInfo"; }; class GVAR(showNamesForAI) { value = 0; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_NameTags_ShowNamesForAI"; }; class GVAR(showCursorTagForVehicles) { value = 0; typeName = "BOOL"; - isClientSetable = 0; + isClientSettable = 0; }; class GVAR(showSoundWaves) { value = 1; typeName = "SCALAR"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_NameTags_ShowSoundWaves"; values[] = {"Disabled", "Use Nametag settings", "Always Show All"}; }; class GVAR(PlayerNamesViewDistance) { value = 5; typeName = "SCALAR"; - isClientSetable = 0; + isClientSettable = 0; }; class GVAR(PlayerNamesMaxAlpha) { value = 0.8; typeName = "SCALAR"; - isClientSetable = 0; + isClientSettable = 0; }; }; diff --git a/addons/nametags/functions/fnc_drawNameTagIcon.sqf b/addons/nametags/functions/fnc_drawNameTagIcon.sqf index f0a9bb89d4..6a7db7d5ac 100644 --- a/addons/nametags/functions/fnc_drawNameTagIcon.sqf +++ b/addons/nametags/functions/fnc_drawNameTagIcon.sqf @@ -27,7 +27,7 @@ "\A3\Ui_f\data\GUI\Cfg\Ranks\colonel_gs.paa" \ ] -private ["_height", "_position", "_color", "_name", "_rank", "_size"]; +private ["_height", "_position", "_color", "_name", "_rank", "_size", "_icon"]; PARAMS_5(_player,_target,_alpha,_heightOffset,_iconType); diff --git a/addons/nametags/functions/fnc_initIsSpeaking.sqf b/addons/nametags/functions/fnc_initIsSpeaking.sqf index b7dc920fa2..c6087541a8 100644 --- a/addons/nametags/functions/fnc_initIsSpeaking.sqf +++ b/addons/nametags/functions/fnc_initIsSpeaking.sqf @@ -20,8 +20,8 @@ if (isServer) then { //If someone disconnects while speaking, reset their variable addMissionEventHandler ["HandleDisconnect", { PARAMS_1(_disconnectedPlayer); - if (_disconnectedPlayer getVariable [QGVAR(isSpeaking), false]) then { - _disconnectedPlayer setVariable [QGVAR(isSpeaking), false, true]; + if (_disconnectedPlayer getVariable [QGVAR(isSpeakingInGame), false]) then { + _disconnectedPlayer setVariable [QGVAR(isSpeakingInGame), false, true]; }; }]; }; @@ -31,46 +31,41 @@ if (!hasInterface) exitWith {}; ["playerChanged", { //When player changes, make sure to reset old unit's variable PARAMS_2(_newUnit,_oldUnit); - if (_oldUnit getVariable [QGVAR(isSpeaking), false]) then { - _oldUnit setVariable [QGVAR(isSpeaking), false, true]; + if ((!isNull _oldUnit) && {_oldUnit getVariable [QGVAR(isSpeakingInGame), false]}) then { + _oldUnit setVariable [QGVAR(isSpeakingInGame), false, true]; }; }] call EFUNC(common,addEventHandler); -//For performance, chose different code paths at mission start based on installed mods (once, instead of checking each time) -_pfEHCode = switch (true) do { -case (isClass (configFile >> "cfgPatches" >> "acre_api")): { - { - _oldSetting = ACE_player getVariable [QGVAR(isSpeaking), false]; - _newSetting = ([ACE_player] call ACRE_api_fnc_isBroadcasting) || {!(isNull findDisplay 55)}; - if (!(_oldSetting isEqualTo _newSetting)) then { - ACE_player setVariable [QGVAR(isSpeaking), _newSetting, true]; - }; - }; +if (isClass (configFile >> "cfgPatches" >> "acre_api")) then { + diag_log text format ["[ACE_nametags] - ACRE Detected"]; + DFUNC(isSpeaking) = { + PARAMS_1(_unit); + (([_unit] call acre_api_fnc_isSpeaking) || ([ACE_player] call acre_api_fnc_isBroadcasting)) && {!(_unit getVariable ["ACE_isUnconscious", false])} }; -case (isClass (configFile >> "cfgPatches" >> "task_force_radio")): { - //Note: TFAR has a TFAR_fnc_isSpeaking function, but it has a fairly costly `callExtension` - //I think it's much faster to use the internal "tf_isSpeaking" variable - //If we don't care about the built-in VON, we could switch this to a pure event driven system - { - _oldSetting = ACE_player getVariable [QGVAR(isSpeaking), false]; - _newSetting = (ACE_player getVariable ["tf_isSpeaking", false]) || {!(isNull findDisplay 55)}; - if (!(_oldSetting isEqualTo _newSetting)) then { - ACE_player setVariable [QGVAR(isSpeaking), _newSetting, true]; - }; +} else { + if (isClass (configFile >> "cfgPatches" >> "task_force_radio")) then { + diag_log text format ["[ACE_nametags] - TFR Detected"]; + DFUNC(isSpeaking) = { + PARAMS_1(_unit); + (_unit getVariable ["tf_isSpeaking", false]) && {!(_unit getVariable ["ACE_isUnconscious", false])} }; - }; - default { - //Note: class RscDisplayVoiceChat {idd = 55}; //only present when talking - { - _oldSetting = ACE_player getVariable [QGVAR(isSpeaking), false]; + } else { + //No Radio Mod - Start a PFEH to watch the internal VON icon + //Note: class RscDisplayVoiceChat {idd = 55} - only present when talking + + [{ + private ["_oldSetting", "_newSetting"]; + _oldSetting = ACE_player getVariable [QGVAR(isSpeakingInGame), false]; _newSetting = (!(isNull findDisplay 55)); if (!(_oldSetting isEqualTo _newSetting)) then { - ACE_player setVariable [QGVAR(isSpeaking), _newSetting, true]; + ACE_player setVariable [QGVAR(isSpeakingInGame), _newSetting, true]; }; + } , 0.1, []] call CBA_fnc_addPerFrameHandler; + + DFUNC(isSpeaking) = { + PARAMS_1(_unit); + (_unit getVariable [QGVAR(isSpeakingInGame), false]) && {!(_unit getVariable ["ACE_isUnconscious", false])} }; }; }; - -//Is 0.05sec precision enough?? -[_pfEHCode, 0.05, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/nametags/functions/fnc_moduleNameTags.sqf b/addons/nametags/functions/fnc_moduleNameTags.sqf index 6050b99c67..1bbd4d8efb 100644 --- a/addons/nametags/functions/fnc_moduleNameTags.sqf +++ b/addons/nametags/functions/fnc_moduleNameTags.sqf @@ -14,9 +14,7 @@ if !(isServer) exitWith {}; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; diff --git a/addons/nametags/functions/fnc_onDraw3d.sqf b/addons/nametags/functions/fnc_onDraw3d.sqf index 8aa503d377..9efc70aeb9 100644 --- a/addons/nametags/functions/fnc_onDraw3d.sqf +++ b/addons/nametags/functions/fnc_onDraw3d.sqf @@ -1,9 +1,9 @@ #include "script_component.hpp" -_player = ACE_player; +private ["_onKeyPressAlphaMax", "_defaultIcon", "_distance", "_alpha", "_icon", "_targets", "_pos2", "_vecy", "_relPos", "_projDist", "_pos", "_target"]; //don't show nametags in spectator -if (!alive _player) exitWith {}; +if (!alive ACE_player) exitWith {}; _onKeyPressAlphaMax = if ((GVAR(showPlayerNames) in [3,4])) then { 2 + (GVAR(ShowNamesTime) - time); //after release 1 second of full opacity, 1 second of fading to 0 @@ -24,14 +24,14 @@ if (GVAR(showCursorTagForVehicles) && {_onKeyPressAlphaMax > 0}) then { if ((!(_target isKindOf "CAManBase")) && {!(_target in allUnitsUAV)}) then { _target = effectiveCommander _target; if ((!isNull _target) && - {(side (group _target)) == (side (group _player))} && - {_target != _player} && + {(side (group _target)) == (side (group ACE_player))} && + {_target != ACE_player} && {GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} && {!(_target getVariable ["ACE_hideName", false])}) then { - _distance = _player distance _target; + _distance = ACE_player distance _target; _alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min 1) * GVAR(PlayerNamesMaxAlpha); _alpha = _alpha min _onKeyPressAlphaMax; - [_player, _target, _alpha, _distance * 0.026, _defaultIcon] call FUNC(drawNameTagIcon); + [ACE_player, _target, _alpha, _distance * 0.026, _defaultIcon] call FUNC(drawNameTagIcon); }; }; }; @@ -41,21 +41,21 @@ if ((GVAR(showPlayerNames) in [2,4]) && {_onKeyPressAlphaMax > 0}) then { _target = cursorTarget; if ((!isNull _target) && {_target isKindOf "CAManBase"} && - {(side (group _target)) == (side (group _player))} && - {_target != _player} && + {(side (group _target)) == (side (group ACE_player))} && + {_target != ACE_player} && {GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} && {!(_target getVariable ["ACE_hideName", false])}) then { - _distance = _player distance _target; + _distance = ACE_player distance _target; _alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min 1) * GVAR(PlayerNamesMaxAlpha); _alpha = _alpha min _onKeyPressAlphaMax; _icon = ICON_NONE; if (GVAR(showSoundWaves) == 2) then { //icon will be drawn below, so only show name here - _icon = if ((_target getVariable [QGVAR(isSpeaking), false]) && {(vehicle _target) == _target}) then {ICON_NAME} else {_defaultIcon}; + _icon = if (([_target] call FUNC(isSpeaking)) && {(vehicle _target) == _target}) then {ICON_NAME} else {_defaultIcon}; } else { - _icon = if ((_target getVariable [QGVAR(isSpeaking), false]) && {(vehicle _target) == _target} && {GVAR(showSoundWaves) > 0}) then {ICON_NAME_SPEAK} else {_defaultIcon}; + _icon = if (([_target] call FUNC(isSpeaking)) && {(vehicle _target) == _target} && {GVAR(showSoundWaves) > 0}) then {ICON_NAME_SPEAK} else {_defaultIcon}; }; - [_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon); + [ACE_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon); }; }; @@ -77,32 +77,32 @@ if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(sho _icon = ICON_NONE; if ((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) then { - if ((_target getVariable [QGVAR(isSpeaking), false]) && {(vehicle _target) == _target} && {GVAR(showSoundWaves) > 0}) then {_icon = ICON_NAME_SPEAK;} else {_icon = _defaultIcon}; + if (([_target] call FUNC(isSpeaking)) && {(vehicle _target) == _target} && {GVAR(showSoundWaves) > 0}) then {_icon = ICON_NAME_SPEAK;} else {_icon = _defaultIcon}; } else { //showSoundWaves must be 2, only draw speak icon - if ((_target getVariable [QGVAR(isSpeaking), false]) && {(vehicle _target) == _target}) then {_icon = ICON_SPEAK;}; + if (([_target] call FUNC(isSpeaking)) && {(vehicle _target) == _target}) then {_icon = ICON_SPEAK;}; }; if ((_icon != ICON_NONE) && - {(side (group _target)) == (side (group _player))} && - {_target != _player} && + {(side (group _target)) == (side (group ACE_player))} && + {_target != ACE_player} && {GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} && {!(_target getVariable ["ACE_hideName", false])}) then { - if (lineIntersects [_pos, (visiblePositionASL _target) vectorAdd [0,0,1], vehicle _player, _target]) exitWith {}; // Check if there is line of sight + if (lineIntersects [_pos, (visiblePositionASL _target) vectorAdd [0,0,1], vehicle ACE_player, _target]) exitWith {}; // Check if there is line of sight _relPos = (visiblePositionASL _target) vectorDiff _pos; _distance = vectorMagnitude _relPos; _projDist = _relPos vectorDistance (_vecy vectorMultiply (_relPos vectorDotProduct _vecy)); _alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min (1 - 0.15 * (_projDist * 5 - _distance - 3)) min 1) * GVAR(PlayerNamesMaxAlpha); - if ((GVAR(showSoundWaves) == 2) && {(_target getVariable [QGVAR(isSpeaking), false]) && {(vehicle _target) == _target}}) then { + if ((GVAR(showSoundWaves) == 2) && {([_target] call FUNC(isSpeaking)) && {(vehicle _target) == _target}}) then { _alpha = 1; } else { _alpha = _alpha min _onKeyPressAlphaMax; }; - [_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon); + [ACE_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon); }; } forEach _targets; }; diff --git a/addons/nametags/functions/fnc_onMouseZChanged.sqf b/addons/nametags/functions/fnc_onMouseZChanged.sqf deleted file mode 100644 index 8892f201bc..0000000000 --- a/addons/nametags/functions/fnc_onMouseZChanged.sqf +++ /dev/null @@ -1,18 +0,0 @@ -/* - Author: aeroson - - Description: - Callback for mouse wheel change - - Parameters: - None - - Returns: - Nothing -*/ - -#include "script_component.hpp" - -if(call FUNC(canShow)) then { - call FUNC(doShow); -}; diff --git a/addons/nametags/stringtable.xml b/addons/nametags/stringtable.xml index 7fc4b8e6cc..7c2d0356a9 100644 --- a/addons/nametags/stringtable.xml +++ b/addons/nametags/stringtable.xml @@ -10,40 +10,44 @@ Pokaż imiona Nevek mutatása Показать имена + Mostra i nomi + Mostrar nomes Show player names Spielernamen anzeigen Mostrar nombres de jugadores Pokaż imiona graczy - Afficher nom des joueurs + Afficher les nom des joueurs Játékosnevek mutatása Zobrazit jména hráčů Mostrar nomes de jogadores Mostra i nomi dei giocatori - Показать имена игроков + Показывать имена игроков (включить имена) Show player name only on cursor (requires player names) Pokaż imiona graczy tylko pod kursorem (wymagana opcja Pokaż imiona graczy) - Mostrar nombres solo en el cursor (requiere Mostrar nombres de jugadores) + Mostrar nombres de jugadores solo al apuntarles (requiere Mostrar nombres de jugadores) Zeige Spielernamen nur an, wenn die Maus auf sie gerrichtet ist (benötigt Spielernamen) Noms uniquement sous le curseur (si noms affichés) Zobrazit jméno hráče jenom na kurzor (vyžaduje jména hráčů) - Mostra i nomi solo se puntati (richiede i nomi dei giocatori abilitati) + Mostra i nomi solo se puntati (richiede mostra nomi abilitato) Mostrar nome de jogador somente no cursor (requer nome de jogadores) - Játékosok nevének mutatása (névcímke szükséges) - Показать имена игроков только под курсором (требует имен игроков) + Játékosok nevének mutatása csak a kurzoron (a nevek mutatása szükséges) + Показать имена игроков только под курсором (при включенных именах) Show player name only on keypress (requires player names) Spielernamen nur auf Tastendruck anzeigen (benötigt Spielernamen) - Mostrar nombres solo al pulsar (requiere Mostrar nombres de jugadores) + Mostrar nombres solo al pulsar la tecla(requiere Mostrar nombres de jugadores) Noms uniquement sur pression de la touche (si noms affichés) Zobrazit jména hráčů jen na klávesu (vyžaduje jména hráčů) Pokaż imiona graczy tylko po przytrzymaniu klawisza (wymagana opcja Pokaż imiona graczy) - Játékosnevek mutatása gombnyomásra(névcíme szükséges) - Показать имена игроков только по нажатию клавиши (требует имен игроков) + Játékosnevek mutatása csak gombnyomásra (a nevek mutatása szükséges) + Показать имена игроков только по нажатию клавиши (при включенных именах) + Mostra i nomi solo se si preme il tasto (richiede mostra nomi abilitato) + Mostrar nomes somente ao pressionar teclar (requer nome de jogadores) Show player ranks (requires player names) @@ -52,37 +56,46 @@ Mostrar rango de los jugadores (requiere Mostrar nombres de jugadores) Grade des joueurs (si noms affichés) Zobrazit hodnosti hráčů (vyžaduje jména hráčů) - Mostra i gradi (richiede i nomi dei giocatori abilitati) + Mostra i gradi (richiede mostra nomi abilitato) Mostrar patente de jogadores (requer nome de jogadores) - Játékosok rendfokozatának mutatása (névcímke szükséges) - Показать звания игроков (требует имен игроков) + Játékosok rendfokozatának mutatása (a nevek mutatása szükséges) + Показывать звания игроков (при вкл. именах) Show vehicle crew info Afficher les informations de l'équipage - Zeige Fahrzeugbesatzung + Fahrzeugbesatzung anzeigen Mostrar tripulantes Pokaż załogę pojazdu Zobrazit info o posádce vozidla - Показать экипаж + Показывать информацию об экипаже + Jármű-legénység adatainak mutatása + Mostra le informazioni sull'equipaggio del veicolo + Mostrar tripulantes Show name tags for AI units - Zeige Namen für KI Einheiten + Namen für KI Einheiten anzeigen Mostrar etiquetas de nombre para unidades IA - Показывать именые метки ИИ + Показывать имена ботов Zobrazit jména AI Wyświetl imiona jednostek AI Afficher les noms des IA + Névcímkék mutatása MI-egységeknél + Mostra le tag nomi per le unità AI + Mostrar nomes para unidades de IA Show SoundWaves (requires player names) - Zeigen Schallwellen (benötigt Spielernamen) + Schallwellen anzeigen (benötigt Spielernamen) Mostrar onda sonora (requiere Mostrar nombres de jugadores) - Показывать звуковые волны (требует имен игроков) + Индикатор разговора (при вкл. именах) Zobrazit SoundWaves (vyžaduje jména hráčů) Pokaż fale dźwiękowe (wymagana opcja Pokaż imiona graczy) Afficher "qui parle" (si noms affichés) + "Hanghullámok" mutatása (a nevek mutatása szükséges) + Mostra barra movimento audio (richiede mostra nomi abilitato) + Mostrar onda sonora (requer nome de jogadores) Default Nametag Color (Non Group Members) @@ -92,6 +105,9 @@ Domyślny kolor imion (członkowie spoza grupy) Couleur d'affichage par défaut (si dans aucun groupe) Standardní barva jmenovek (pro nečleny jednotky) + Alap névcímke-szín (csoporton kívüli személyek) + Colore nametag di default (membri non del gruppo) + Cor padrão do nome (unidades fora do grupo) diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf index 376059ce1b..3edc3edad5 100644 --- a/addons/nightvision/XEH_postInitClient.sqf +++ b/addons/nightvision/XEH_postInitClient.sqf @@ -37,12 +37,12 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; ["playerTurretChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); // Add keybinds -["ACE3", QGVAR(IncreaseNVGBrightness), localize "STR_ACE_NightVision_IncreaseNVGBrightness", +["ACE3 Equipment", QGVAR(IncreaseNVGBrightness), localize "STR_ACE_NightVision_IncreaseNVGBrightness", { // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if ((currentVisionMode _player != 1)) exitWith {false}; + if ((currentVisionMode ACE_player != 1)) exitWith {false}; // Statement [ACE_player, 1] call FUNC(changeNVGBrightness); @@ -51,12 +51,12 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; {false}, [201, [false, false, true]], false] call cba_fnc_addKeybind; //PageUp + ALT -["ACE3", QGVAR(DecreaseNVGBrightness), localize "STR_ACE_NightVision_DecreaseNVGBrightness", +["ACE3 Equipment", QGVAR(DecreaseNVGBrightness), localize "STR_ACE_NightVision_DecreaseNVGBrightness", { // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if ((currentVisionMode _player != 1)) exitWith {false}; + if ((currentVisionMode ACE_player != 1)) exitWith {false}; // Statement [ACE_player, -1] call FUNC(changeNVGBrightness); diff --git a/addons/nightvision/functions/fnc_updatePPEffects.sqf b/addons/nightvision/functions/fnc_updatePPEffects.sqf index a90186fe10..9906a440fc 100644 --- a/addons/nightvision/functions/fnc_updatePPEffects.sqf +++ b/addons/nightvision/functions/fnc_updatePPEffects.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config"]; +private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config", "_hmd", "_cameraView", "_turret"]; _currentVehicle = vehicle ACE_player; @@ -41,7 +41,7 @@ _fnc_isUsingHMD = { !("NVG" in getArray (_config >> "ViewOptics" >> "visionMode")); }; - private ["_result", "_turretConfig", "_turretConfigOpticsIn"]; + private ["_result", "_turretConfig", "_turretConfigOpticsIn", "_index"]; _result = true; _turretConfig = [_config, _turret] call EFUNC(common,getTurretConfigPath); _turretConfigOpticsIn = _turretConfig >> "OpticsIn"; diff --git a/addons/nightvision/stringtable.xml b/addons/nightvision/stringtable.xml index 9b14279d3c..c84d648678 100644 --- a/addons/nightvision/stringtable.xml +++ b/addons/nightvision/stringtable.xml @@ -10,7 +10,8 @@ Gogle noktowizyjne (Gen1) Óculos de visão noturna (Gen1) ПНВ (Gen1) - Sistema de visión nocturna (Gen1) + Gafas de visión nocturna (Gen1) + Éjjellátó szemüveg (1. Gen.) NV Goggles (Gen2) @@ -21,7 +22,8 @@ Gogle noktowizyjne (Gen2) Óculos de visão noturna (Gen2) ПНВ (Gen2) - Sistema de visión nocturna (Gen2) + Gafas de visión nocturna (Gen2) + Éjjellátó szemüveg (2. Gen.) NV Goggles (Gen3) @@ -32,7 +34,8 @@ Gogle noktowizyjne (Gen3) Óculos de visão noturna (Gen3) ПНВ (Gen3) - Sistema de visión nocturna (Gen3) + Gafas de visión nocturna (Gen3) + Éjjellátó szemüveg (3. Gen.) NV Goggles (Gen3, Brown) @@ -43,7 +46,8 @@ Gogle noktowizyjne (Gen3, brązowe) Óculos de visão noturna (Gen3, marrons) ПНВ (Gen3, коричневый) - Sistema de visión nocturna (Gen3, marrón) + Gafas de visión nocturna (Gen3, marrón) + Éjjellátó szemüveg (3. Gen., barna) NV Goggles (Gen3, Green) @@ -54,7 +58,8 @@ Gogle noktowizyjne (Gen3, zielone) Óculos de visão noturna (Gen3, verdes) ПНВ (Gen3, зеленый) - Sistema de visión nocturna (Gen3, verde) + Gafas de visión nocturna (Gen3, verde) + Éjjellátó szemüveg (3. Gen., zöld) NV Goggles (Gen3, Black) @@ -65,7 +70,8 @@ Gogle noktowizyjne (Gen3, czarne) Óculos de visão noturna (Gen3, pretos) ПНВ (Gen3, черный) - Sistema de visión nocturna (Gen3, negro) + Gafas de visión nocturna (Gen3, negro) + Éjjellátó szemüveg (3. Gen., fekete) NV Goggles (Gen4) @@ -76,16 +82,19 @@ Gogle noktowizyjne (Gen4) Óculos de visão noturna (Gen4) ПНВ (Gen4) - Sistema de visión nocturna (Gen4) + Gafas de visión nocturna (Gen4) + Éjjellátó szemüveg (4. Gen.) NV Goggles (Wide) NS-Brille (Weitwinkel) - Sistema de visión nocturna (Panorámicas) + Gafas de visión nocturna (Panorámicas) Gogle noktowizyjne (panoramiczne) Noktovizor (Širokoúhlý) - ПНВ (Широкий) + ПНВ (Широкоугольный) JVN (Large) + Éjjellátó szemüveg (széles látószögű) + Óculos de visão noturna (Panorâmico) Brightness: %1 @@ -94,7 +103,7 @@ Czułość: %1 Jas: %1 Luminosité : %1 - Контраст: + Яркость: %1 Fényerő: %1 Luminosidade: %1 Luminosità: %1 @@ -107,7 +116,7 @@ Zvýšení jasu noktovizoru Augmenter la luminosité des JVN Увеличить яркость ПНВ - Fényerő növelése + Éjjellátó fényerejének növelése Aumentar Luminosidade do EVN Aumenta la luminosità dell'NVG @@ -119,7 +128,7 @@ Snížení jasu noktovizoru Baisser la luminosité des JVN Уменьшить яркость ПНВ - Fényerő csökkentése + Éjjellátó fényerejének csökkentése Diminuir Luminosidade do EVN Riduci la luminosità dell'NVG diff --git a/addons/noradio/XEH_post_initClient.sqf b/addons/noradio/XEH_post_initClient.sqf index 4f35a1ced9..ecd80a6436 100644 --- a/addons/noradio/XEH_post_initClient.sqf +++ b/addons/noradio/XEH_post_initClient.sqf @@ -2,15 +2,13 @@ #include "script_component.hpp" /* -_setupPlayer = { +[{ if (!isNull ACE_player) then { [(_this select 1)] call cba_fnc_removePerFrameHandler; [ACE_player, "isPlayer"] call EFUNC(common,muteUnit); }; -}; - -[_setupPlayer, 0, []] call CBA_fnc_addPerFrameHandler; +}, 0, []] call CBA_fnc_addPerFrameHandler; */ if (!hasInterface) exitWith {}; diff --git a/addons/optics/CfgWeapons.hpp b/addons/optics/CfgWeapons.hpp index 7749db0bc4..5aa06f41a0 100644 --- a/addons/optics/CfgWeapons.hpp +++ b/addons/optics/CfgWeapons.hpp @@ -5,20 +5,20 @@ class CfgWeapons { class Default; class Binocular: Default { - forceOptics = 0; // Allow using compass with Binocular - opticsZoomMin = 0.056889; // 5.25x power - opticsZoomMax = 0.056889; // 9 px/mil - modelOptics = "\z\ace\addons\optics\models\NWD_M22_5x"; // 7 horizontal field of view - visionMode[] = {"Normal"}; // Can't use nvgs with binoculars any more than you can with scopes - // Fix AI using Binocs on short range - #18737 + forceOptics = 0; // Allow using compass with Binocular + opticsZoomMin = 0.056889; // 5.25x power + opticsZoomMax = 0.056889; // 9 px/mil + modelOptics = "\z\ace\addons\optics\models\NWD_M22_5x"; // 7 horizontal field of view + visionMode[] = {"Normal"}; // Can't use nvgs with binoculars any more than you can with scopes + // Fix AI using Binocs on short range - #18737 // minRange = 300; // 300 = uses Rangefinder often (runs a few meters, stops, uses RF, repeats) minRange = 500; //500 = seem almost never use it..? - minRangeProbab = 0.001; + minRangeProbab = 0.001; midRange = 1000; midRangeProbab = 0.01; maxRange = 5000; maxRangeProbab = 0.01; - }; + }; // zooming reticle scopes class optic_DMS: ItemCore { @@ -98,7 +98,7 @@ class CfgWeapons { class ACE_optic_Hamr_PIP: ACE_optic_Hamr_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_Hamr_PIP"; - scopeArsenal = 1; + //scopeArsenal = 1; displayName = "$STR_ACE_optic_hamr_pip"; class ItemInfo: ItemInfo { @@ -147,7 +147,7 @@ class CfgWeapons { class ACE_optic_Arco_PIP: ACE_optic_Arco_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_Arco_PIP"; - scopeArsenal = 1; + //scopeArsenal = 1; displayName = "$STR_ACE_optic_arco_pip"; class ItemInfo: ItemInfo { @@ -197,7 +197,7 @@ class CfgWeapons { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_MRCO_PIP"; scope = 1; - scopeArsenal = 1; + //scopeArsenal = 1; displayName = "$STR_ACE_optic_valdada_pip"; class ItemInfo: ItemInfo { @@ -239,7 +239,7 @@ class CfgWeapons { class ACE_optic_SOS_PIP: ACE_optic_SOS_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_SOS_PIP"; - scopeArsenal = 1; + //scopeArsenal = 1; displayName = "$STR_ACE_optic_sos_pip"; class ItemInfo: ItemInfo { @@ -290,7 +290,7 @@ class CfgWeapons { class ACE_optic_LRPS_PIP: ACE_optic_LRPS_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_LRPS_PIP"; - scopeArsenal = 1; + //scopeArsenal = 1; displayName = "$STR_ACE_optic_lrps_pip"; class ItemInfo: ItemInfo { diff --git a/addons/optics/XEH_postInit.sqf b/addons/optics/XEH_postInit.sqf index cb3918cbc3..7f68aece74 100644 --- a/addons/optics/XEH_postInit.sqf +++ b/addons/optics/XEH_postInit.sqf @@ -22,3 +22,19 @@ if (!hasInterface) exitWith {}; uiNamespace setVariable [QGVAR(RscWeaponInfo2D), _this select 0]; }; }] call EFUNC(common,addEventHandler); + +// camera has to be re-created every time another camera is created. Otherwise r2t is either black or transparent. @todo Add popular custom cameras to the event in ACE_common. +["activeCameraChanged", { + if !(_this select 1) then { + deleteVehicle GVAR(camera); + + // PiP technique by BadBenson + GVAR(camera) = "camera" camCreate positioncameratoworld [0,0,0]; + GVAR(camera) camSetFov 0.7; + GVAR(camera) camSetTarget ACE_player; + GVAR(camera) camCommit 1; + + "ace_optics_rendertarget0" setPiPEffect [2, 1.0, 1.0, 1.0, 0.0, [0.0, 1.0, 0.0, 0.25], [1.0, 0.0, 1.0, 1.0], [0.199, 0.587, 0.114, 0.0]]; + GVAR(camera) cameraEffect ["INTERNAL", "BACK", "ace_optics_rendertarget0"]; + }; +}] call EFUNC(common,addEventHandler); diff --git a/addons/optics/stringtable.xml b/addons/optics/stringtable.xml index 3e518a63d1..f9964c4310 100644 --- a/addons/optics/stringtable.xml +++ b/addons/optics/stringtable.xml @@ -1,125 +1,125 @@  - - - - RCO (2D) - RCO (2D) - RCO (2D) - RCO (2D) - RCO (2D) - RCO (2D) - RCO (2D) - RCO (2D) - RCO (2D) - - - - RCO (PIP) - RCO (PIP) - RCO (PIP) - RCO (BIB) - RCO (PIP) - RCO (PIP) - RCO (PIP) - RCO (PIP) - RCO (PIP) - - - - ARCO (2D) - ARCO (2D) - ARCO (2D) - ARCO (2D) - ARCO (2D) - ARCO (2D) - ARCO (2D) - ARCO (2D) - ARCO (2D) - - - - ARCO (PIP) - ARCO (PIP) - ARCO (PIP) - ARCO (BIB) - ARCO (PIP) - ARCO (PIP) - ARCO (PIP) - ARCO (PIP) - ARCO (PIP) - - - - MRCO (2D) - MRCO (2D) - MRCO (2D) - MRCO (2D) - MRCO (2D) - MRCO (2D) - MRCO (2D) - Прицел MRCO (2D) - MRCO (2D) - - - - MRCO (PIP) - MRCO (PIP) - MRCO (PIP) - MRCO (BIB) - MRCO (PIP) - MRCO (PIP) - MRCO (PIP) - Прицел MRCO (PIP) - MRCO (PIP) - - - - MOS (2D) - MOS (2D) - MOS (2D) - MOS (2D) - MOS (2D) - MOS (2D) - MOS (2D) - MOS (2D) - MOS (2D) - - - - MOS (PIP) - MOS (PIP) - MOS (PIP) - MOS (BIB) - MOS (PIP) - MOS (PIP) - MOS (PIP) - MOS (PIP) - MOS (PIP) - - - - LRPS (2D) - LRPS (2D) - LRPS (2D) - LRPS (2D) - LRPS (2D) - LRPS (2D) - LRPS (2D) - LRPS (2D) - MPLD (2D) - - - - LRPS (PIP) - LRPS (PIP) - LRPS (PIP) - LRPS (BIB) - LRPS (PIP) - LRPS (PIP) - LRPS (PIP) - LRPS (PIP) - MPLD (PIP) - - - + + + RCO (2D) + RCO (2D) + RCO (2D) + RCO (2D) + RCO (2D) + RCO (2D) + RCO (2D) + RCO (2D) + RCO (2D) + RCO (2D) + + + RCO (PIP) + RCO (PIP) + RCO (PIP) + RCO (BIB) + RCO (PIP) + RCO (PIP) + RCO (PIP) + RCO (PIP) + RCO (PIP) + RCO (PIP) + + + ARCO (2D) + ARCO (2D) + ARCO (2D) + ARCO (2D) + ARCO (2D) + ARCO (2D) + ARCO (2D) + ARCO (2D) + ARCO (2D) + ARCO (2D) + + + ARCO (PIP) + ARCO (PIP) + ARCO (PIP) + ARCO (BIB) + ARCO (PIP) + ARCO (PIP) + ARCO (PIP) + ARCO (PIP) + ARCO (PIP) + ARCO (PIP) + + + MRCO (2D) + MRCO (2D) + MRCO (2D) + MRCO (2D) + MRCO (2D) + MRCO (2D) + MRCO (2D) + MRCO (2D) + MRCO (2D) + MRCO (2D) + + + MRCO (PIP) + MRCO (PIP) + MRCO (PIP) + MRCO (BIB) + MRCO (PIP) + MRCO (PIP) + MRCO (PIP) + MRCO (PIP) + MRCO (PIP) + MRCO (PIP) + + + MOS (2D) + MOS (2D) + MOS (2D) + MOS (2D) + MOS (2D) + MOS (2D) + MOS (2D) + MOS (2D) + MOS (2D) + MOS (2D) + + + MOS (PIP) + MOS (PIP) + MOS (PIP) + MOS (BIB) + MOS (PIP) + MOS (PIP) + MOS (PIP) + MOS (PIP) + MOS (PIP) + MOS (PIP) + + + LRPS (2D) + LRPS (2D) + LRPS (2D) + LRPS (2D) + LRPS (2D) + LRPS (2D) + LRPS (2D) + LRPS (2D) + MPLD (2D) + LRPS (2D) + + + LRPS (PIP) + LRPS (PIP) + LRPS (PIP) + LRPS (BIB) + LRPS (PIP) + LRPS (PIP) + LRPS (PIP) + LRPS (PIP) + MPLD (PIP) + LRPS (PIP) + + + \ No newline at end of file diff --git a/addons/optionsmenu/config.cpp b/addons/optionsmenu/config.cpp index 89d5768603..69249b36c4 100644 --- a/addons/optionsmenu/config.cpp +++ b/addons/optionsmenu/config.cpp @@ -1,23 +1,23 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {"ACE_moduleAllowConfigExport"}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common"}; - author[] = {"Glowbal", "PabstMirror"}; - authorUrl = "http://github.com/Glowbal"; - VERSION_CONFIG; - }; + class ADDON { + units[] = {"ACE_moduleAllowConfigExport"}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"Glowbal", "PabstMirror"}; + authorUrl = "http://github.com/Glowbal"; + VERSION_CONFIG; + }; }; class CfgAddons { - class PreloadAddons { - class ADDON { - list[] = {QUOTE(ADDON)}; + class PreloadAddons { + class ADDON { + list[] = {QUOTE(ADDON)}; + }; }; - }; }; @@ -26,4 +26,14 @@ class CfgAddons { #include "gui\settingsMenu.hpp" #include "gui\pauseMenu.hpp" -#include "CFgVehicles.hpp" +#include "CfgVehicles.hpp" + +class ACE_Settings { + class GVAR(optionMenuDisplaySize) { + value = 0; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = "$STR_ACE_optionsMenu_uiScaing"; + values[] = {"$str_medium", "$str_large", "$str_very_large"}; + }; +}; diff --git a/addons/optionsmenu/functions/fnc_exportSettings.sqf b/addons/optionsmenu/functions/fnc_exportSettings.sqf index 3ac2455a64..f98c3548e8 100644 --- a/addons/optionsmenu/functions/fnc_exportSettings.sqf +++ b/addons/optionsmenu/functions/fnc_exportSettings.sqf @@ -16,6 +16,8 @@ #include "script_component.hpp" +private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_value", "_compiledConfigEntry"]; + _compiledConfig = " "; { @@ -52,6 +54,10 @@ class %1 { typeName = %3; force = 1; };", _name, _value, format['"%1"', _typeName]]; + + //clipboard seems to be getting cuttoff, so do a backup dump to rpt: + diag_log text _compiledConfigEntry; + _compiledConfig = _compiledConfig + _compiledConfigEntry; }; } forEach EGVAR(common,settings); diff --git a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf index ca4a00891a..b8eb630f85 100644 --- a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf +++ b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf @@ -16,28 +16,28 @@ #include "script_component.hpp" -private ["_settingIndex", "_inputText"]; +private ["_settingIndex", "_inputText", "_setting", "_settingName", "_convertedValue"]; _settingIndex = lbCurSel 200; //Index of left list _inputText = ctrlText 414; //Index of right drop down switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_VALUES): { - if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(serverSideValues)))) then { - try { - _setting = (GVAR(serverSideValues) select _settingIndex); - _settingName = _setting select 0; + if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(serverSideValues)))) then { + try { + _setting = (GVAR(serverSideValues) select _settingIndex); + _settingName = _setting select 0; - _convertedValue = switch (toUpper (_setting select 1)) do { + _convertedValue = switch (toUpper (_setting select 1)) do { case "STRING": {format ['"%1"', _inputText]}; case "ARRAY": {format [call compile "[%1]", _inputText]}; case "SCALAR": {parseNumber _inputText;}; - default {throw "Error"}; + default {throw "Error"}; + }; + [MENU_TAB_SERVER_VALUES, _settingName, _convertedValue] call FUNC(updateSetting); + } catch { }; - [MENU_TAB_SERVER_VALUES, _settingName, _convertedValue] call FUNC(updateSetting); - } catch { }; + [false] call FUNC(serverSettingsMenuUpdateList); }; - [false] call FUNC(serverSettingsMenuUpdateList); - }; }; diff --git a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf index 7894d2ff1a..f5501d0860 100644 --- a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf @@ -16,6 +16,8 @@ #include "script_component.hpp" +private ["_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_setting", "_menu", "_settingsMenu"]; + if (GVAR(serverConfigGeneration) == 0 || isMultiplayer) exitwith {closeDialog 145246;}; // Filter only user setable setting @@ -54,7 +56,6 @@ GVAR(serverSideValues) = []; //Delay a frame [{ [MENU_TAB_SERVER_OPTIONS] call FUNC(onServerListBoxShowSelectionChanged) }, []] call EFUNC(common,execNextFrame); -private "_menu"; disableSerialization; _menu = uiNamespace getvariable "ACE_serverSettingsMenu"; (_menu displayCtrl 1003) ctrlEnable false; diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf index 3a4c6ec561..050abcf295 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -16,9 +16,12 @@ #include "script_component.hpp" +private ["_setting", "_menu"]; + // Filter only user setable setting GVAR(clientSideOptions) = []; GVAR(clientSideColors) = []; + { // If the setting is user setable and not forced if ((_x select 2) && !(_x select 6)) then { @@ -40,7 +43,6 @@ GVAR(clientSideColors) = []; //Delay a frame [{ [MENU_TAB_OPTIONS] call FUNC(onListBoxShowSelectionChanged) }, []] call EFUNC(common,execNextFrame); -private "_menu"; disableSerialization; _menu = uiNamespace getvariable "ACE_settingsMenu"; (_menu displayCtrl 1002) ctrlEnable false; diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf index 2dcf9f7fe7..52984b78f3 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor"]; +private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor", "_expectedType"]; disableSerialization; _settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf index ad5d647c16..dad3012e1b 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView"]; +private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue"]; DEFAULT_PARAM(0,_updateKeyView,true); disableSerialization; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf index 0138b9e87d..513b187d7d 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView"]; +private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue"]; DEFAULT_PARAM(0,_updateKeyView,true); disableSerialization; diff --git a/addons/optionsmenu/gui/pauseMenu.hpp b/addons/optionsmenu/gui/pauseMenu.hpp index d6a831c2aa..c4cbae9916 100644 --- a/addons/optionsmenu/gui/pauseMenu.hpp +++ b/addons/optionsmenu/gui/pauseMenu.hpp @@ -96,11 +96,14 @@ class RscDisplayInterruptEditor3D: RscStandardDisplay { }; }; class RscDisplayMain: RscStandardDisplay { + //Hide the button if there is no world (-world=empty) + //Seems odd to use onMouseMoving, but I don't want to overload onLoad + onMouseMoving = "((_this select 0) displayCtrl 80085) ctrlShow (missionName != '');"; class controls { class ACE_Open_settingsMenu_Btn : ACE_Open_SettingsMenu_BtnBase { action = "if (missionName != '') then {createDialog 'ACE_settingsMenu';};"; y = "4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + safezoneY"; + idc = 80085; }; }; }; - diff --git a/addons/optionsmenu/gui/settingsMenu.hpp b/addons/optionsmenu/gui/settingsMenu.hpp index 93d35b284c..04e7ee5aaa 100644 --- a/addons/optionsmenu/gui/settingsMenu.hpp +++ b/addons/optionsmenu/gui/settingsMenu.hpp @@ -1,438 +1,452 @@ class ACE_settingsMenu { - idd = 145246; - movingEnable = false; - onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', _this select 0)]; [] call FUNC(onSettingsMenuOpen);); - onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', nil)]; saveProfileNamespace;); + idd = 145246; + movingEnable = false; + onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', _this select 0)]; [] call FUNC(onSettingsMenuOpen);); + onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', nil)]; saveProfileNamespace;); - #define SIZEX (((safezoneW / safezoneH) min 1.2)) - #define SIZEY (SIZEX / 1.2) - #define UNITX (SIZEX / 40) - #define UNITY (SIZEY / 25) - #define OFFSETX (safezoneX + (safezoneW - SIZEX)/2) - #define OFFSETY (safezoneY + (safezoneH - (SIZEX / 1.2))/2) +#define SIZEX (((safezoneW / safezoneH) min 1.2)) +#define SIZEY (SIZEX / 1.2) +#define X_ORIGINAL(num) (num * (SIZEX / 40) + (safezoneX + (safezoneW - SIZEX)/2)) +#define Y_ORIGINAL(num) (num * (SIZEY / 25) + (safezoneY + (safezoneH - (SIZEX / 1.2))/2)) +#define W_ORIGINAL(num) (num * (SIZEX / 40)) +#define H_ORIGINAL(num) (num * (SIZEY / 25)) - class controlsBackground { - class HeaderBackground: ACE_gui_backgroundBase { - idc = -1; - type = CT_STATIC; - x = 1 * UNITX + OFFSETX; - y = 1 * UNITY + OFFSETY; - w = 38 * UNITX; - h = 1 * UNITY; - style = ST_LEFT + ST_SHADOW; - font = "PuristaMedium"; - SizeEx = (UNITY * 1); - colorText[] = {0.95, 0.95, 0.95, 0.75}; - colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; - text = ""; - }; - class CenterBackground: HeaderBackground { - y = 2.1 * UNITY + OFFSETY; - h = 2.5 * UNITY; - text = ""; - colorText[] = {0, 0, 0, "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; - colorBackground[] = {0,0,0,"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; - }; - class LeftBackground: CenterBackground { - y = 4.8 * UNITY + OFFSETY; - h = 17.4 * UNITY; - w = 25 * UNITX; - }; - class RightBackground: LeftBackground { - x = 26.1 * UNITX + OFFSETX; - w = 12.9 * UNITX; - }; - class RightBackgroundHeader: RightBackground { - h = 1.4 * UNITY; - colorBackground[] = {0,0,0,1}; - }; - }; +#define X_MAKEITBIGGA(num) (num * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)) +#define Y_MAKEITBIGGA(num) (num * (safeZoneH / 30) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)) +#define W_MAKEITBIGGA(num) (num * (safeZoneH / 40)) +#define H_MAKEITBIGGA(num) (num * (safeZoneH / 30)) - class controls { - class HeaderName { - idc = 1; - type = CT_STATIC; - x = 1 * UNITX + OFFSETX; - y = 1 * UNITY + OFFSETY; - w = 38 * UNITX; - h = 1 * UNITY; - style = ST_LEFT + ST_SHADOW; - font = "PuristaMedium"; - SizeEx = (UNITY * 1); - colorText[] = {0.95, 0.95, 0.95, 0.75}; - colorBackground[] = {0,0,0,0}; - text = "$STR_ACE_OptionsMenu_OpenConfigMenu"; +#define X_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(optionMenuDisplaySize)), 0)]), X_ORIGINAL(num), X_MAKEITBIGGA(num))]) +#define Y_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(optionMenuDisplaySize)), 0)]), Y_ORIGINAL(num), Y_MAKEITBIGGA(num))]) +#define W_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(optionMenuDisplaySize)), 0)]), W_ORIGINAL(num), W_MAKEITBIGGA(num))]) +#define H_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(optionMenuDisplaySize)), 0)]), H_ORIGINAL(num), H_MAKEITBIGGA(num))]) + + class controlsBackground { + class HeaderBackground: ACE_gui_backgroundBase { + idc = -1; + type = CT_STATIC; + x = X_PART(1); + y = Y_PART(1); + w = W_PART(38); + h = H_PART(1); + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = H_PART(1); + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + text = ""; + }; + class CenterBackground: HeaderBackground { + y = Y_PART(2.1); + h = H_PART(2.5); + text = ""; + colorText[] = {0, 0, 0, "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + colorBackground[] = {0,0,0,"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + }; + class LeftBackground: CenterBackground { + y = Y_PART(4.8); + h = H_PART(17.4); + w = W_PART(25); + }; + class RightBackground: LeftBackground { + x = X_PART(26.1); + w = W_PART(12.9); + }; + class RightBackgroundHeader: RightBackground { + h = H_PART(1.4); + colorBackground[] = {0,0,0,1}; + }; }; - class labelSubHeader: ACE_gui_staticBase { - idc = 13; - x = 2 * UNITX + OFFSETX; - y = 3.4 * UNITY + OFFSETY; - w = 30 * UNITX; - h = 1 * UNITY; - text = ""; + + class controls { + class HeaderName { + idc = 1; + type = CT_STATIC; + x = X_PART(1); + y = Y_PART(1); + w = W_PART(38); + h = H_PART(1); + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = H_PART(1); + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {0,0,0,0}; + text = "$STR_ACE_OptionsMenu_OpenConfigMenu"; + }; + class labelSubHeader: ACE_gui_staticBase { + idc = 13; + x = X_PART(2); + y = Y_PART(3.4); + w = W_PART(30); + h = H_PART(1); + text = ""; + }; + class selectionAction_1: ACE_gui_buttonBase { + idc = 1000; + text = "$STR_ACE_OptionsMenu_TabOptions"; + x = X_PART(1); + y = Y_PART(2.1); + w = W_PART(9.5); + h = H_PART(1); + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 1}; + color2[] = {0,0,0, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {1,1,1,1}; + colorFocused[] = {0,0,0,1}; + periodFocus = 1; + periodOver = 1; + action = QUOTE([MENU_TAB_OPTIONS] call FUNC(onListBoxShowSelectionChanged);); + SizeEx = H_PART(1); + Size = H_PART(1); + }; + class selectionAction_2: selectionAction_1 { + idc = 1001; + text = "$STR_ACE_OptionsMenu_TabColors"; + x = X_PART(10.5); + action = QUOTE([MENU_TAB_COLORS] call FUNC(onListBoxShowSelectionChanged);); + }; + class selectionAction_3: selectionAction_1 { + idc = 1002; + text = ""; + x = X_PART(20); + action = ""; + }; + class selectionAction_4: selectionAction_1 { + idc = 1003; + text = ""; + x = X_PART(29.5); + action = ""; + }; + class listBoxSettingsList: ACE_gui_listNBox { + idc = 200; + x = X_PART(2); + y = Y_PART(5.5); + w = W_PART(23); + h = H_PART(15); + SizeEx = H_ORIGINAL(0.8); + colorBackground[] = {0, 0, 0, 0.9}; + colorSelectBackground[] = {0, 0, 0, 0.9}; + columns[] = {0.0, 0.6}; + onLBSelChanged = QUOTE(_this call FUNC(settingsMenuUpdateKeyView)); + }; + class labelTitle: ACE_gui_staticBase { + idc = 250; + x = X_PART(27.1); + y = Y_PART(5.1); + w = W_PART(11); + h = H_PART(1); + text = ""; + SizeEx = H_PART(1); + }; + class labelKey: ACE_gui_staticBase { //Variable Name + idc = 300; + x = X_PART(27.1); + y = Y_PART(6.2); + w = W_PART(11); + h = H_PART(1); + text = ""; + SizeEx = H_PART(0.65); + }; + class Label2: labelKey { + idc = 301; + y = Y_PART(7.3); + text = "$STR_ACE_OptionsMenu_Setting"; + SizeEx = H_PART(1); + }; + class comboBox1: ACE_gui_comboBoxBase { + idc = 400; + x = X_PART(31.1); + y = Y_PART(7.3); + w = W_PART(7); + h = H_PART(1); + onLBSelChanged = QUOTE( call FUNC(onListBoxSettingsChanged)); + SizeEx = H_PART(0.9); + }; + class sliderBar1: RscXSliderH { + idc = 410; + x = X_PART(27.1); + y = Y_PART(7.3); + w = W_PART(11); + h = H_PART(0.75); + onSliderPosChanged = QUOTE(_this call FUNC(onSliderPosChanged)); + color[] = {1,0,0,0.4}; + colorActive[] = {1,0,0,1}; + }; + class sliderBar2: sliderBar1 { + idc = 411; + y = Y_PART(8.2); + color[] = {0,1,0,0.4}; + colorActive[] = {0,1,0,1}; + }; + class sliderBar3: sliderBar1 { + idc = 412; + y = Y_PART(9.1); + color[] = {0,0,1,0.4}; + colorActive[] = {0,0,1,1}; + }; + class sliderBar4: sliderBar1 { + idc = 413; + y = Y_PART(10); + color[] = {1,1,1,0.4}; + colorActive[] = {1,1,1,1}; + }; + class labelDesc: ACE_gui_staticBase { + idc = 251; + x = X_PART(27.1); + y = Y_PART(11); + w = W_PART(11); + h = H_PART(11); + text = ""; + style = ST_LEFT + ST_MULTI; + lineSpacing = 1; + SizeEx = H_PART(0.8); + }; + class actionClose: ACE_gui_buttonBase { + idc = 10; + text = "$STR_DISP_CLOSE"; + x = X_PART(1); + y = Y_PART(22.3); + w = W_PART(7.5); + h = H_PART(1); + style = ST_LEFT; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 1}; + color2[] = {0,0,0, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {0.5,0.5,0.5,0.8}; + colorFocused[] = {0,0,0,1}; + periodFocus = 1; + periodOver = 1; + action = "closedialog 0;"; + SizeEx = H_PART(1); + Size = H_PART(1); + }; + class action_reset: actionClose { + idc = 1100; + text = "$STR_ACE_OptionsMenu_ResetAll"; + x = X_PART(9.5); + action = QUOTE([] call FUNC(resetSettings)); + }; + class action_exportServerConfig: actionClose { + idc = 1102; + text = "$STR_ACE_OptionsMenu_OpenExport"; + x = X_PART(18); + action = QUOTE(if (GVAR(serverConfigGeneration) > 0) then {createDialog 'ACE_serverSettingsMenu'; }); + }; }; - class selectionAction_1: ACE_gui_buttonBase { - idc = 1000; - text = "$STR_ACE_OptionsMenu_TabOptions"; - x = 1 * UNITX + OFFSETX; - y = 2.1 * UNITY + OFFSETY; - w = 9.5 * UNITX; - h = 1 * UNITY; - animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; - color[] = {1, 1, 1, 1}; - color2[] = {0,0,0, 1}; - colorBackgroundFocused[] = {1,1,1,1}; - colorBackground[] = {1,1,1,1}; - colorbackground2[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,1}; - colorFocused[] = {0,0,0,1}; - periodFocus = 1; - periodOver = 1; - action = QUOTE([MENU_TAB_OPTIONS] call FUNC(onListBoxShowSelectionChanged);); - }; - class selectionAction_2: selectionAction_1 { - idc = 1001; - text = "$STR_ACE_OptionsMenu_TabColors"; - x = 10.5 * UNITX + OFFSETX; - action = QUOTE([MENU_TAB_COLORS] call FUNC(onListBoxShowSelectionChanged);); - }; - class selectionAction_3: selectionAction_1 { - idc = 1002; - text = ""; - x = 20 * UNITX + OFFSETX; - action = ""; - }; - class selectionAction_4: selectionAction_1 { - idc = 1003; - text = ""; - x = 29.5 * UNITX + OFFSETX; - action = ""; - }; - class listBoxSettingsList: ACE_gui_listNBox { - idc = 200; - x = 2 * UNITX + OFFSETX; - y = 5.5 * UNITY + OFFSETY; - w = 23 * UNITX; - h = 15 * UNITY; - SizeEx = (UNITY * 0.8); - colorBackground[] = {0, 0, 0, 0.9}; - colorSelectBackground[] = {0, 0, 0, 0.9}; - columns[] = {0.0, 0.6}; - onLBSelChanged = QUOTE(_this call FUNC(settingsMenuUpdateKeyView)); - }; - class labelTitle: ACE_gui_staticBase { - idc = 250; - x = 27.1 * UNITX + OFFSETX; - y = 5.1 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 1 * UNITY; - text = ""; - SizeEx = (UNITY *1); - }; - class labelKey: ACE_gui_staticBase { //Variable Name - idc = 300; - x = 27.1 * UNITX + OFFSETX; - y = 6.2 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 1 * UNITY; - text = ""; - SizeEx = (UNITY * 0.65); - }; - class Label2: labelKey { - idc = 301; - y = 7.3 * UNITY + OFFSETY; - text = "$STR_ACE_OptionsMenu_Setting"; - SizeEx = (UNITY * 1); - }; - class comboBox1: ACE_gui_comboBoxBase { - idc = 400; - x = 31.1 * UNITX + OFFSETX; - y = 7.3 * UNITY + OFFSETY; - w = 7 * UNITX; - h = 1 * UNITY; - onLBSelChanged = QUOTE( call FUNC(onListBoxSettingsChanged)); - SizeEx = (UNITY * 0.9); - }; - class sliderBar1: RscXSliderH { - idc = 410; - x = 27.1 * UNITX + OFFSETX; - y = 7.3 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 0.75 * UNITY; - onSliderPosChanged = QUOTE(_this call FUNC(onSliderPosChanged)); - color[] = {1,0,0,0.4}; - colorActive[] = {1,0,0,1}; - }; - class sliderBar2: sliderBar1 { - idc = 411; - y = 8.2 * UNITY + OFFSETY; - color[] = {0,1,0,0.4}; - colorActive[] = {0,1,0,1}; - }; - class sliderBar3: sliderBar1 { - idc = 412; - y = 9.1 * UNITY + OFFSETY; - color[] = {0,0,1,0.4}; - colorActive[] = {0,0,1,1}; - }; - class sliderBar4: sliderBar1 { - idc = 413; - y = 10 * UNITY + OFFSETY; - color[] = {1,1,1,0.4}; - colorActive[] = {1,1,1,1}; - }; - class labelDesc: ACE_gui_staticBase { - idc = 251; - x = 27.1 * UNITX + OFFSETX; - y = 11 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 11 * UNITY; - text = ""; - style = ST_LEFT + ST_MULTI; - lineSpacing = 1; - SizeEx = (UNITY * 0.8); - }; - class actionClose: ACE_gui_buttonBase { - idc = 10; - text = "$STR_DISP_CLOSE"; - x = 1 * UNITX + OFFSETX; - y = 22.3 * UNITY + OFFSETY; - w = 7.5 * UNITX; - h = 1 * UNITY; - style = ST_LEFT; - animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; - color[] = {1, 1, 1, 1}; - color2[] = {0,0,0, 1}; - colorBackgroundFocused[] = {1,1,1,1}; - colorBackground[] = {1,1,1,1}; - colorbackground2[] = {1,1,1,1}; - colorDisabled[] = {0.5,0.5,0.5,0.8}; - colorFocused[] = {0,0,0,1}; - periodFocus = 1; - periodOver = 1; - action = "closedialog 0;"; - }; - class action_reset: actionClose { - idc = 1100; - text = "$STR_ACE_OptionsMenu_ResetAll"; - x = 26.1 * (SIZEX / 40) + OFFSETX; - action = QUOTE([] call FUNC(resetSettings)); - }; - class action_exportServerConfig: actionClose { - idc = 1102; - text = "$STR_ACE_OptionsMenu_OpenExport"; - x = 1 * (SIZEX / 40) + OFFSETX; - action = QUOTE(if (GVAR(serverConfigGeneration) > 0) then {createDialog 'ACE_serverSettingsMenu'; }); - }; - }; }; class ACE_serverSettingsMenu: ACE_settingsMenu { onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_serverSettingsMenu', _this select 0)]; [] call FUNC(onServerSettingsMenuOpen);); onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_serverSettingsMenu', nil)];); - class controls: controls { - class HeaderName { - idc = 1; - type = CT_STATIC; - x = 1 * UNITX + OFFSETX; - y = 1 * UNITY + OFFSETY; - w = 38 * UNITX; - h = 1 * UNITY; - style = ST_LEFT + ST_SHADOW; - font = "PuristaMedium"; - SizeEx = (UNITY * 1); - colorText[] = {0.95, 0.95, 0.95, 0.75}; - colorBackground[] = {0,0,0,0}; - text = "$STR_ACE_OptionsMenu_OpenConfigMenu"; + class controls: controls { + class HeaderName { + idc = 1; + type = CT_STATIC; + x = X_PART(1); + y = Y_PART(1); + w = W_PART(38); + h = H_PART(1); + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = H_PART(1); + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {0,0,0,0}; + text = "$STR_ACE_OptionsMenu_OpenConfigMenu"; + }; + class labelSubHeader: ACE_gui_staticBase { + idc = 13; + x = X_PART(2); + y = Y_PART(3.4); + w = W_PART(30); + h = H_PART(1); + text = ""; + }; + class selectionAction_1: ACE_gui_buttonBase { + idc = 1000; + text = "$STR_ACE_OptionsMenu_TabOptions"; + x = X_PART(1); + y = Y_PART(2.1); + w = W_PART(9.5); + h = H_PART(1); + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 1}; + color2[] = {0,0,0, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {1,1,1,1}; + colorFocused[] = {0,0,0,1}; + periodFocus = 1; + periodOver = 1; + action = QUOTE([MENU_TAB_SERVER_OPTIONS] call FUNC(onServerListBoxShowSelectionChanged);); + }; + class selectionAction_2: selectionAction_1 { + idc = 1001; + text = "$STR_ACE_OptionsMenu_TabColors"; + x = X_PART(10.5); + action = QUOTE([MENU_TAB_SERVER_COLORS] call FUNC(onServerListBoxShowSelectionChanged);); + }; + class selectionAction_3: selectionAction_1 { + idc = 1002; + text = "$STR_ACE_OptionsMenu_TabValues"; + x = X_PART(20); + action = QUOTE([MENU_TAB_SERVER_VALUES] call FUNC(onServerListBoxShowSelectionChanged);); + }; + class selectionAction_4: selectionAction_1 { + idc = 1003; + text = ""; + x = X_PART(29.5); + action = ""; + }; + class listBoxSettingsList: ACE_gui_listNBox { + idc = 200; + x = X_PART(2); + y = Y_PART(5.5); + w = W_PART(23); + h = H_PART(15); + SizeEx = H_ORIGINAL(0.8); + colorBackground[] = {0, 0, 0, 0.9}; + colorSelectBackground[] = {0, 0, 0, 0.9}; + columns[] = {0.0, 0.6}; + onLBSelChanged = QUOTE(_this call FUNC(serverSettingsMenuUpdateKeyView)); + }; + class labelTitle: ACE_gui_staticBase { + idc = 250; + x = X_PART(27.1); + y = Y_PART(5.1); + w = W_PART(11); + h = H_PART(1); + text = ""; + SizeEx = H_PART(1); + }; + class labelKey: ACE_gui_staticBase { //Variable Name + idc = 300; + x = X_PART(27.1); + y = Y_PART(6.2); + w = W_PART(11); + h = H_PART(1); + text = ""; + SizeEx = H_PART(0.65); + }; + class Label2: labelKey { + idc = 301; + y = Y_PART(7.3); + text = "$STR_ACE_OptionsMenu_Setting"; + SizeEx = H_PART(1); + }; + class comboBox1: ACE_gui_comboBoxBase { + idc = 400; + x = X_PART(31.1); + y = Y_PART(7.3); + w = W_PART(7); + h = H_PART(1); + onLBSelChanged = QUOTE( call FUNC(onListBoxSettingsChanged)); + SizeEx = H_PART(0.9); + }; + class sliderBar1: RscXSliderH { + idc = 410; + x = X_PART(27.1); + y = Y_PART(7.3); + w = W_PART(11); + h = H_PART(0.75); + onSliderPosChanged = QUOTE(_this call FUNC(onSliderPosChanged)); + color[] = {1,0,0,0.4}; + colorActive[] = {1,0,0,1}; + }; + class sliderBar2: sliderBar1 { + idc = 411; + y = Y_PART(8.2); + color[] = {0,1,0,0.4}; + colorActive[] = {0,1,0,1}; + }; + class sliderBar3: sliderBar1 { + idc = 412; + y = Y_PART(9.1); + color[] = {0,0,1,0.4}; + colorActive[] = {0,0,1,1}; + }; + class sliderBar4: sliderBar1 { + idc = 413; + y = Y_PART(10); + color[] = {1,1,1,0.4}; + colorActive[] = {1,1,1,1}; + }; + class inputField1: ACE_gui_editBase { + idc = 414; + x = X_PART(27.1); + y = Y_PART(7.3); + w = W_PART(11); + h = H_PART(0.75); + }; + class inputFieldTypeLabel: ACE_gui_staticBase { + idc = 415; + x = X_PART(27.1); + y = Y_PART(8.2); + w = W_PART(11); + h = H_PART(0.75); + text = ""; + style = ST_LEFT + ST_MULTI; + lineSpacing = 1; + SizeEx = H_PART(0.8); + }; + class saveInputButton: selectionAction_1 { + idc = 416; + text = "$STR_ACE_OptionsMenu_SaveInput"; + x = X_PART(27.1); + y = Y_PART(9.1); + w = W_PART(11); + h = H_PART(1); + action = QUOTE([] call FUNC(onServerSaveInputField);); + }; + class labelDesc: ACE_gui_staticBase { + idc = 251; + x = X_PART(27.1); + y = Y_PART(11); + w = W_PART(11); + h = H_PART(11); + text = ""; + style = ST_LEFT + ST_MULTI; + lineSpacing = 1; + SizeEx = H_PART(0.8); + }; + class actionClose; + class action_reset: actionClose { + idc = 1100; + text = "$STR_ACE_OptionsMenu_ResetAll"; + x = X_PART(26.1); + action = QUOTE([] call FUNC(serverResetSettings)); + }; + class action_exportServerConfig: actionClose { + idc = 1101; + text = "$STR_ACE_OptionsMenu_Export"; + x = X_PART(1); + action = QUOTE([] call FUNC(exportSettings)); + }; + class action_toggleIncludeClientSettings: actionClose { + idc = 1102; + text = "$STR_ACE_OptionsMenu_inClientSettings"; + x = X_PART(9); + action = QUOTE([] call FUNC(toggleIncludeClientSettings)); + }; }; - class labelSubHeader: ACE_gui_staticBase { - idc = 13; - x = 2 * UNITX + OFFSETX; - y = 3.4 * UNITY + OFFSETY; - w = 30 * UNITX; - h = 1 * UNITY; - text = ""; - }; - class selectionAction_1: ACE_gui_buttonBase { - idc = 1000; - text = "$STR_ACE_OptionsMenu_TabOptions"; - x = 1 * UNITX + OFFSETX; - y = 2.1 * UNITY + OFFSETY; - w = 9.5 * UNITX; - h = 1 * UNITY; - animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; - color[] = {1, 1, 1, 1}; - color2[] = {0,0,0, 1}; - colorBackgroundFocused[] = {1,1,1,1}; - colorBackground[] = {1,1,1,1}; - colorbackground2[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,1}; - colorFocused[] = {0,0,0,1}; - periodFocus = 1; - periodOver = 1; - action = QUOTE([MENU_TAB_SERVER_OPTIONS] call FUNC(onServerListBoxShowSelectionChanged);); - }; - class selectionAction_2: selectionAction_1 { - idc = 1001; - text = "$STR_ACE_OptionsMenu_TabColors"; - x = 10.5 * UNITX + OFFSETX; - action = QUOTE([MENU_TAB_SERVER_COLORS] call FUNC(onServerListBoxShowSelectionChanged);); - }; - class selectionAction_3: selectionAction_1 { - idc = 1002; - text = "$STR_ACE_OptionsMenu_TabValues"; - x = 20 * UNITX + OFFSETX; - action = QUOTE([MENU_TAB_SERVER_VALUES] call FUNC(onServerListBoxShowSelectionChanged);); - }; - class selectionAction_4: selectionAction_1 { - idc = 1003; - text = ""; - x = 29.5 * UNITX + OFFSETX; - action = ""; - }; - class listBoxSettingsList: ACE_gui_listNBox { - idc = 200; - x = 2 * UNITX + OFFSETX; - y = 5.5 * UNITY + OFFSETY; - w = 23 * UNITX; - h = 15 * UNITY; - SizeEx = (UNITY * 0.8); - colorBackground[] = {0, 0, 0, 0.9}; - colorSelectBackground[] = {0, 0, 0, 0.9}; - columns[] = {0.0, 0.6}; - onLBSelChanged = QUOTE(_this call FUNC(serverSettingsMenuUpdateKeyView)); - }; - class labelTitle: ACE_gui_staticBase { - idc = 250; - x = 27.1 * UNITX + OFFSETX; - y = 5.1 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 1 * UNITY; - text = ""; - SizeEx = (UNITY *1); - }; - class labelKey: ACE_gui_staticBase { //Variable Name - idc = 300; - x = 27.1 * UNITX + OFFSETX; - y = 6.2 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 1 * UNITY; - text = ""; - SizeEx = (UNITY * 0.65); - }; - class Label2: labelKey { - idc = 301; - y = 7.3 * UNITY + OFFSETY; - text = "$STR_ACE_OptionsMenu_Setting"; - SizeEx = (UNITY * 1); - }; - class comboBox1: ACE_gui_comboBoxBase { - idc = 400; - x = 31.1 * UNITX + OFFSETX; - y = 7.3 * UNITY + OFFSETY; - w = 7 * UNITX; - h = 1 * UNITY; - onLBSelChanged = QUOTE( call FUNC(onListBoxSettingsChanged)); - SizeEx = (UNITY * 0.9); - }; - class sliderBar1: RscXSliderH { - idc = 410; - x = 27.1 * UNITX + OFFSETX; - y = 7.3 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 0.75 * UNITY; - onSliderPosChanged = QUOTE(_this call FUNC(onSliderPosChanged)); - color[] = {1,0,0,0.4}; - colorActive[] = {1,0,0,1}; - }; - class sliderBar2: sliderBar1 { - idc = 411; - y = 8.2 * UNITY + OFFSETY; - color[] = {0,1,0,0.4}; - colorActive[] = {0,1,0,1}; - }; - class sliderBar3: sliderBar1 { - idc = 412; - y = 9.1 * UNITY + OFFSETY; - color[] = {0,0,1,0.4}; - colorActive[] = {0,0,1,1}; - }; - class sliderBar4: sliderBar1 { - idc = 413; - y = 10 * UNITY + OFFSETY; - color[] = {1,1,1,0.4}; - colorActive[] = {1,1,1,1}; - }; - class inputField1: ACE_gui_editBase { - idc = 414; - x = 27.1 * UNITX + OFFSETX; - y = 7.3 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 0.75 * UNITY; - }; - class inputFieldTypeLabel: ACE_gui_staticBase { - idc = 415; - x = 27.1 * UNITX + OFFSETX; - y = 8.2 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 0.75 * UNITY; - text = ""; - style = ST_LEFT + ST_MULTI; - lineSpacing = 1; - SizeEx = (UNITY * 0.8); - }; - class saveInputButton: selectionAction_1 { - idc = 416; - text = "$STR_ACE_OptionsMenu_SaveInput"; - x = 27.1 * UNITX + OFFSETX; - y = 9.1 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 1 * UNITY; - action = QUOTE([] call FUNC(onServerSaveInputField);); - }; - class labelDesc: ACE_gui_staticBase { - idc = 251; - x = 27.1 * UNITX + OFFSETX; - y = 11 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 11 * UNITY; - text = ""; - style = ST_LEFT + ST_MULTI; - lineSpacing = 1; - SizeEx = (UNITY * 0.8); - }; - class actionClose; - class action_reset: actionClose { - idc = 1100; - text = "$STR_ACE_OptionsMenu_ResetAll"; - x = 26.1 * (SIZEX / 40) + OFFSETX; - action = QUOTE([] call FUNC(serverResetSettings)); - }; - class action_exportServerConfig: actionClose { - idc = 1101; - text = "$STR_ACE_OptionsMenu_Export"; - x = 1 * (SIZEX / 40) + OFFSETX; - action = QUOTE([] call FUNC(exportSettings)); - }; - class action_toggleIncludeClientSettings: actionClose { - idc = 1102; - text = "$STR_ACE_OptionsMenu_inClientSettings"; - x = 9 * (SIZEX / 40) + OFFSETX; - action = QUOTE([] call FUNC(toggleIncludeClientSettings)); - }; - }; }; diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index cf3f94cf19..20a03c1454 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -10,7 +10,7 @@ Options ACE ACE Настройки Opções do ACE - ACE Opciók + ACE Beállítások Opzioni ACE @@ -21,15 +21,21 @@ Opravit animace Napraw animację Corriger animation + Animációk kijavítása + Fixa l'animazione + Arrumar Animação Reset All - Alles Zurücksetzen + Alles zurücksetzen Reiniciar todo Полный сброс Vyresetovat vše Resetuj wszystko Défaut + Minden visszaállítása + Resetta tutto + Resetar Tudo Colors @@ -39,6 +45,9 @@ Цвета Barvy Kolory + Színek + Colori + Cores Options @@ -49,7 +58,7 @@ Options Настройки Opções - Opciók + Beállítások Opzioni @@ -60,6 +69,9 @@ Wartości Valeurs Werte + Értékek + Valori + Valores Yes @@ -91,8 +103,11 @@ Einstellung: Установки: Ajuste: - Ustawienie: + Ustaw: Paramètres + Opció: + Parametri: + Opção: Export @@ -102,23 +117,33 @@ Exportovat Eksport Exporter + Exportálás + Esporta + Exportar Open Export Menu Öffne Exportmenü - Abrir menu d'exportación + Abrir menú de exportación Открыть меню экспорта Otevřít exportovací menu Otwórz menu eksportowania Ouvrir le menu d'exportation + Exportálási menü megnyitása + Apri menù esportazione + Abrir menu de exportação String input. - String input. - Introducir frase + Zeichenketteneingabe + Introducir cadena de texto. Строчный ввод. Wpisywanie tekstu. + Vkládání textu. Entrée + String bevitel. + Stringa di unput. + Input de String Array. Seperate elements by using ,. @@ -128,15 +153,21 @@ Tablica. Oddziel elementy używając ,. Tableau. Séparation par ,. Tabulka. Odděl elementy použitím ,. + Array. Válasszad el az elemeket vesszővel. + Array. Separa gli elementi usando ,. + Vetor. Separe elementos usando *,*. Number - Nummer - Numero + Zahl + Número Число Číslo Cyfra Nombre + Szám + Numero + Número Uknown input type @@ -146,6 +177,9 @@ Neznámý vstup Nieznany rodzaj danych Type d'entrée inconnue + Ismeretlen beviteli típus + Input inserito sconosciuto + Tipo desonhecido de input Save input @@ -155,15 +189,21 @@ Uložit vstup Zapisz dane Sauvegarder + Bevitel elmentése + Salva input + Salvar input Include Client Settings - Beinhalte Client-Einstellungen + Schließe Client-Einstellungen ein Incluir configuración de cliente Включить настройки клиента Zahrnout nastavení klienta Zawrzyj ustawienia klienta Inclure paramètres client + Kliens-beállítások melléklése + Includi i parametri del client + Incluir opções do cliente Exclude Client Settings @@ -173,6 +213,9 @@ Nezahrnout nastavení klienta Wyklucz ustawienia klienta Exclure paramètres client + Kliens-beállítások elhagyása + Escludi i parametri del client + Excluir opções do cliente Settings exported to clipboard @@ -182,6 +225,19 @@ Nastevení exportována do schránky Ustawienia wyeksportowano do schowka Paramètres exportés dans le presse papier + Beállítások exportálva a vágólapba + Parametri esportati alla clipboard + Opções exportadas para o clipboard. + + + Option Menu UI Scaling + Menu option: taille de l'UI + Skalowanie UI menu ustawień + Měřítko UI v menu nastavení + Размер интерфейса меню настройки + Opción de escalado del menú IU + UI Skalierung + Beállításmenü kezelőfelületének skálázása diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf index 2281a1eeac..5e7089ab75 100644 --- a/addons/overheating/XEH_postInit.sqf +++ b/addons/overheating/XEH_postInit.sqf @@ -4,7 +4,7 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", QGVAR(unjamWeapon), localize "STR_ACE_Overheating_UnjamWeapon", +["ACE3 Weapons", QGVAR(unjamWeapon), localize "STR_ACE_Overheating_UnjamWeapon", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/overheating/config.cpp b/addons/overheating/config.cpp index 3ccc8ee603..bd6cdbbdd3 100644 --- a/addons/overheating/config.cpp +++ b/addons/overheating/config.cpp @@ -23,7 +23,7 @@ class CfgPatches { class ACE_Settings { class GVAR(DisplayTextOnJam) { typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; value = 1; displayName = "$STR_ACE_overheating_SettingDisplayTextName"; description = "$STR_ACE_overheating_SettingDisplayTextDesc"; diff --git a/addons/overheating/functions/fnc_checkTemperature.sqf b/addons/overheating/functions/fnc_checkTemperature.sqf index 6c15068815..0b811f9792 100644 --- a/addons/overheating/functions/fnc_checkTemperature.sqf +++ b/addons/overheating/functions/fnc_checkTemperature.sqf @@ -18,6 +18,8 @@ EXPLODE_2_PVT(_this,_player,_weapon); +private ["_action"]; + // Play animation and report temperature _action = getText (configFile >> "CfgWeapons" >> _weapon >> "ACE_checkTemperatureAction"); diff --git a/addons/overheating/functions/fnc_displayTemperature.sqf b/addons/overheating/functions/fnc_displayTemperature.sqf index 6112bea178..3012e480e3 100644 --- a/addons/overheating/functions/fnc_displayTemperature.sqf +++ b/addons/overheating/functions/fnc_displayTemperature.sqf @@ -16,7 +16,7 @@ EXPLODE_2_PVT(_this,_player,_weapon); // Calculate cool down of weapon since last shot -private ["_string", "_overheat", "_temperature", "_time", "_barrelMass"]; +private ["_string", "_overheat", "_temperature", "_time", "_barrelMass", "_a"]; _string = format [QGVAR(%1), _weapon]; _overheat = _player getVariable [_string, [0, 0]]; _temperature = _overheat select 0; diff --git a/addons/overheating/functions/fnc_overheat.sqf b/addons/overheating/functions/fnc_overheat.sqf index 2468265f8f..05e5bbba9c 100644 --- a/addons/overheating/functions/fnc_overheat.sqf +++ b/addons/overheating/functions/fnc_overheat.sqf @@ -17,7 +17,8 @@ */ #include "\z\ace\addons\overheating\script_component.hpp" -private ["_unit", "_weapon", "_ammo", "_projectile"]; +private ["_unit", "_weapon", "_ammo", "_projectile", "_velocity", "_variableName", "_overheat", "_temperature", "_time", "_bulletMass", "_energyIncrement", "_barrelMass", "_scaledTemperature", "_intensity", "_position", "_direction", "_dispersion", "_count", "_slowdownFactor", "_jamChance", "_surface"]; + _unit = _this select 0; _weapon = _this select 1; _ammo = _this select 4; @@ -25,8 +26,6 @@ _projectile = _this select 6; _velocity = velocity _projectile; -private ["_variableName", "_overheat", "_temperature", "_time", "_energyIncrement", "_barrelMass", "_scaledTemperature"]; - // each weapon has it's own variable. Can't store the temperature in the weapon since they are not objects unfortunately. _variableName = format [QGVAR(%1), _weapon]; diff --git a/addons/overheating/stringtable.xml b/addons/overheating/stringtable.xml index d4943b75a1..21ac4c56fb 100644 --- a/addons/overheating/stringtable.xml +++ b/addons/overheating/stringtable.xml @@ -4,20 +4,26 @@ Display text on jam Zeige Text bei Ladehemmung - Mostrar texto al encasquillar + Mostrar texto al encasquillarse Показывать текст, когда клинит оружие Zobrazit upozornění při zaseknutí Wyświetl tekst przy zacięciu broni Affiche texte si enrayé + Szöveges értesítés kijelzése a fegyver elakadásakor + Mostrar texto quando trava acontecer + Visualizza testo in caso di inceppamento Display a notification whenever your weapon gets jammed Zeige einen Hinweis, wenn die Waffe eine Ladehemmung hat. Mostrar notificación cada vez que el arma se encasquille - Демонстровать уведомление, каждый раз, когда клинит Ваше оружие. + Показывать уведомление каждый раз, когда клинит Ваше оружие. Zobrazí upozornění při zaseknutí zbraně Wyświetl powiadomienie za każdym razem, kiedy Twoja broń ulegnie zacięciu Affiche une notification lors d'un enrayement + Egy szöveges értesítés jelenik meg, amikor a fegyver megakad + Mostra uma notificação quando sua arma sofre um travamento. + Visualizza una notifica in caso la tua arma si inceppasse Spare barrel @@ -39,7 +45,7 @@ Používané k výměně hlavně Utilisé pour changer de canon. Используется для смены ствола. - Cső kicseréléséhez. + Használd a cső kicseréléséhez. Use para trocar o cano/estriamento. Usata per cambiare la canna. @@ -51,7 +57,7 @@ Zbraň se zasekla! Arme enrayée Оружие заклинило! - Elakadt a fegyver! + Megakadt a fegyver! Arma travada! Arma inceppata! @@ -63,7 +69,7 @@ Uvolnit zbraň Désenrayer l'arme Исправить клин оружия. - Hárítsd el az akadályt! + Akadás elhárítása Destravar arma Ripulisci l'arma @@ -75,7 +81,7 @@ Zbraň uvolněna Arme désenrayée Оружие исправлено - Akadály elhárítva! + Akadás elhárítva Arma destravada Arma pronta al fuoco @@ -87,20 +93,20 @@ Vyměnit hlaveň Changer de canon Сменить ствол - Cserélj csövet! + Cső cserélése Substituir cano Sostiuisci la canna - Swapping barrel... - Lauf wird gewechselt... - Cambiando el cañón... - Wymienianie lufy... + Swapping barrel ... + Lauf wird gewechselt ... + Cambiando el cañón ... + Wymienianie lufy ... Vyměňuji hlaveň ... - Changement du canon... - Смена ствола... - Cső cserélése... - Substituindo cano... + Changement du canon ... + Смена ствола ... + Cső kicserélése folyamatban ... + Substituindo cano ... Sto sostituendo la canna ... @@ -110,29 +116,34 @@ Lufa wymieniona Hlaveň vyměněna Canon changé - Ствол сменен - Cső kicserélve! + Ствол сменён + Cső kicserélve Cano substituído Canna sostituita - Check weapons temperature + Check weapon temperature Temperatur der Waffe prüfen Verificar temperatura del arma Sprawdź temperaturę broni Vérifier la température de l'arme - Hőmérséklet ellenőrzése + Fegyver hőmérsékletének ellenőrzése Zjistit teplotu zbraně Conferir temperatura da arma Controlla la temperatura della canna Проверить температуру оружия - Check weapon<br/>temperature - Verificar temperatura<br/>del arma - Sprawdź temperaturę<br/>broni - Zkontrolovat teplotu<br/>zbraně - Vérifier la<br/>température + Check weapon temperature + Waffentemperatur prüfen + Verificar temperatura del arma + Sprawdź temperaturę broni + Zkontrolovat teplotu zbraně + Vérifier la température + Fegyverhő ellenőrzése + Проверить температуру оружия + Conferir temperatura + Controlla la temperatura della canna Checking temperature ... @@ -140,7 +151,7 @@ Verificando temperatura ... Sprawdzanie temperatury ... Vérification de la température ... - Hőmérséklet ellenőrzése... + Hőmérséklet ellenőrzése ... Zjišťuju teplotu ... Conferindo temperatura ... Sto controllando la temperatura ... diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index ead4b33943..a6c589a39a 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -14,12 +14,13 @@ * Public: No */ #include "script_component.hpp" + if (!hasInterface) exitWith {}; -["ACE3", QGVAR(showAltimeter), localize "STR_ACE_Parachute_showAltimeter", +["ACE3 Equipment", QGVAR(showAltimeter), localize "STR_ACE_Parachute_showAltimeter", { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false}; if (!(missionNamespace getVariable [QGVAR(AltimeterActive), false])) then { [ace_player] call FUNC(showAltimeter); @@ -40,5 +41,4 @@ GVAR(PFH) = false; }] call EFUNC(common,addEventHandler); // don't show speed and height when in expert mode -["Parachute", {if (!cadetMode) then {_dlg = _this select 0; {(_dlg displayCtrl _x) ctrlShow false} forEach [121, 122, 1004, 1005, 1006, 1014];};}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Parachute" -["Soldier", {if (!cadetMode) then {_dlg = _this select 0; {_ctrl = (_dlg displayCtrl _x); _ctrl ctrlSetPosition [0,0,0,0]; _ctrl ctrlCommit 0;} forEach [380, 382]};}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier" +["infoDisplayChanged", {_this call FUNC(handleInfoDisplayChanged)}] call EFUNC(common,addEventHandler); diff --git a/addons/parachute/XEH_preInit.sqf b/addons/parachute/XEH_preInit.sqf index 91c24606c6..f446d955b8 100644 --- a/addons/parachute/XEH_preInit.sqf +++ b/addons/parachute/XEH_preInit.sqf @@ -18,6 +18,7 @@ ADDON = false; PREP(doLanding); +PREP(handleInfoDisplayChanged); PREP(hideAltimeter); PREP(onEachFrame); PREP(showAltimeter); diff --git a/addons/parachute/functions/fnc_handleInfoDisplayChanged.sqf b/addons/parachute/functions/fnc_handleInfoDisplayChanged.sqf new file mode 100644 index 0000000000..9b076256dd --- /dev/null +++ b/addons/parachute/functions/fnc_handleInfoDisplayChanged.sqf @@ -0,0 +1,41 @@ +/* + * Author: commy2 + * Hides the height and velocity display while freefalling or parachuting on higher difficulties. + * + * Arguments: + * Stuff from infoDisplayChanged eventhandler. + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +private ["_dialog", "_type"]; + +_dialog = _this select 0; +_type = _this select 1; + +// don't do anything in noob mode +if (cadetMode) exitWith {}; + +switch (_type) do { + case ("Parachute"): { + { + (_dialog displayCtrl _x) ctrlShow false; + } forEach [121, 122, 1004, 1005, 1006, 1014]; + }; + + case ("Soldier"): { + { + private "_control"; + _control = (_dialog displayCtrl _x); + + // these reset ctrlShow every frame by the engine. Set height/width to 0 as work around. + _control ctrlSetPosition [0,0,0,0]; + _control ctrlCommit 0; + } forEach [380, 382]; + }; +}; +nil // switch might return true if no case was found. Just to make sure the return value matches diff --git a/addons/parachute/functions/fnc_showAltimeter.sqf b/addons/parachute/functions/fnc_showAltimeter.sqf index a8200fb2ca..45816cc883 100644 --- a/addons/parachute/functions/fnc_showAltimeter.sqf +++ b/addons/parachute/functions/fnc_showAltimeter.sqf @@ -14,19 +14,24 @@ * Public: Yes */ #include "script_component.hpp" + private ["_unit"]; + _unit = _this select 0; -(["ACE_Altimeter"] call BIS_fnc_rscLayer) cutRsc ["ACE_Altimeter", "PLAIN",0,true]; + +(["ACE_Altimeter"] call BIS_fnc_rscLayer) cutRsc ["ACE_Altimeter", "PLAIN", 0, true]; if (isNull (uiNamespace getVariable ["ACE_Altimeter", displayNull])) exitWith {}; GVAR(AltimeterActive) = true; + [{ - if (!GVAR(AltimeterActive)) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler);}; + if (!GVAR(AltimeterActive)) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler)}; disableSerialization; EXPLODE_4_PVT(_this select 0,_display,_unit,_oldHeight,_prevTime); - if !("ACE_Altimeter" in assignedItems _unit) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler);call FUNC(hideAltimeter);}; + if !("ACE_Altimeter" in assignedItems _unit) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler); call FUNC(hideAltimeter)}; + + private ["_height", "_hour", "_minute", "_descentRate","_HeightText", "_DecendRate", "_TimeText", "_curTime", "_timeDiff"]; - private ["_height", "_hour", "_minute", "_descentRate","_HeightText", "_DecendRate", "_TimeText", "_curTime"]; _HeightText = _display displayCtrl 1100; _DecendRate = _display displayCtrl 1000; _TimeText = _display displayCtrl 1001; @@ -35,7 +40,8 @@ GVAR(AltimeterActive) = true; _height = (getPosASL _unit) select 2; _curTime = time; - _descentRate = floor ((_oldHeight - _height) / (_curTime - _prevTime)); + _timeDiff = _curTime - _prevTime; + _descentRate = if(_timeDiff > 0) then {floor((_oldHeight - _height) / _timeDiff)} else {0}; _TimeText ctrlSetText (format ["%1:%2",[_hour, 2] call EFUNC(common,numberToDigitsString),[_minute, 2] call EFUNC(common,numberToDigitsString)]); _HeightText ctrlSetText (format ["%1", floor(_height)]); diff --git a/addons/parachute/stringtable.xml b/addons/parachute/stringtable.xml index f97b389eeb..d3cdbd9a7d 100644 --- a/addons/parachute/stringtable.xml +++ b/addons/parachute/stringtable.xml @@ -1,46 +1,53 @@  - - - - Altimeter - Altimètre - Höhenmesser - Výškoměr - Wysokościomierz - Altímetro - Magasságmérő - Высотомер - - - Altimeter Watch - Montre altimètre - Höhenmesser - Hodinky s výškoměrem - Zegarek z wysokościomierzem - Reloj altímetro - Magasságmérő - Часы с высотомером - - - Used to show height, descent rate and the time. - Affiche la hauteur, le taux de descente et l'heure. - Zeigt Höhe, Fallgeschwindigkeit und Uhrzeit. - Používané k zjištění výšky, rychlosti sestupu a času. - Używany przez spadochroniarzy, pokazuje wysokość, prędkość opadania oraz czas. - Utilizado para mostrar altura, tasa de descenso y hora. - Mutatja a magasságot, zuhanás sebességét és az időt. - Используется для определения высоты, скорости снижения и времени. - - - Non-Steerable Parachute - Ungelenkter Fallschirm - Paracaídas no dirigible - Parachute non manœuvrable - Niesterowalny spadochron - Neříditelný padák - Irányithatatlan ejtőernyő - Неуправляемый парашют - - - \ No newline at end of file + + + Altimeter + Altimètre + Höhenmesser + Výškoměr + Wysokościomierz + Altímetro + Magasságmérő + Высотомер + Altimetro + Altímetro + + + Altimeter Watch + Montre altimètre + Höhenmesser + Hodinky s výškoměrem + Zegarek z wysokościomierzem + Reloj altímetro + Magasságmérős karóra + Часы с высотомером + Controlla l'altimetro + Relógio Altímetro + + + Used to show height, descent rate and the time. + Affiche la hauteur, le taux de descente et l'heure. + Zeigt Höhe, Fallgeschwindigkeit und Uhrzeit. + Používané k zjištění výšky, rychlosti sestupu a času. + Używany przez spadochroniarzy, pokazuje wysokość, prędkość opadania oraz czas. + Utilizado para mostrar altura, tasa de descenso y hora. + Mutatja a magasságot, a zuhanási sebességet, és az időt. + Используется для определения высоты, скорости снижения и времени. + Usato per mostrare l'altitudine, la velocità di discesa e l'ora. + Usado para mostrar altura, taxa de descida e o tempo. + + + Non-Steerable Parachute + Ungelenkter Fallschirm + Paracaídas no dirigible + Parachute non manœuvrable + Niesterowalny spadochron + Neříditelný padák + Irányíthatatlan ejtőernyő + Неуправляемый парашют + Paracadute non manovrabile + Para-querdas não controlável + + + diff --git a/addons/realisticnames/CfgWeapons.hpp b/addons/realisticnames/CfgWeapons.hpp index 56d9e3b7c8..8eb3c04577 100644 --- a/addons/realisticnames/CfgWeapons.hpp +++ b/addons/realisticnames/CfgWeapons.hpp @@ -193,7 +193,7 @@ class CfgWeapons { }; // marksmen marksman - /*class DMR_02_base_F: Rifle_Long_Base_F { + class DMR_02_base_F: Rifle_Long_Base_F { displayName = "$STR_ACE_RealisticNames_DMR_02"; //MAR-10 .338"; }; @@ -208,7 +208,6 @@ class CfgWeapons { class srifle_DMR_02_sniper_F: srifle_DMR_02_F { displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_sniper"; //MAR-10 .338 (Sand)"; }; - class DMR_03_base_F: Rifle_Long_Base_F { displayName = "$STR_ACE_RealisticNames_DMR_03"; //Mk-I EMR 7.62 mm"; }; @@ -236,7 +235,6 @@ class CfgWeapons { class srifle_DMR_03_spotter_F: srifle_DMR_03_F { displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_spotter"; //NATO DMR (provisional) spotter"; }; - class DMR_04_base_F: Rifle_Long_Base_F { displayName = "$STR_ACE_RealisticNames_DMR_04"; //ASP-1 Kir 12.7 mm"; }; @@ -264,7 +262,6 @@ class CfgWeapons { class srifle_DMR_05_tan_f: srifle_DMR_05_blk_F { displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_tan"; //Cyrus 9.3 mm (Tan)"; }; - class DMR_06_base_F: Rifle_Long_Base_F { displayName = "$STR_ACE_RealisticNames_DMR_06"; //Mk14 7.62 mm"; }; @@ -289,7 +286,6 @@ class CfgWeapons { class MMG_01_tan_F: MMG_01_hex_F { displayName = "$STR_ACE_RealisticNames_MMG_01_tan"; //Navid 9.3 mm (Tan)"; }; - class MMG_02_base_F: Rifle_Long_Base_F { displayName = "$STR_ACE_RealisticNames_MMG_02"; //SPMG .338"; }; @@ -304,7 +300,7 @@ class CfgWeapons { class MMG_02_sand_F: MMG_02_camo_F { displayName = "$STR_ACE_RealisticNames_MMG_02_sand"; //SPMG .338 (Sand)"; - };*/ + }; // vehicle weapons diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index be0cb5b5c3..7a78ef6d7a 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -82,7 +82,7 @@ Wyrzutnia Mini-Spike (AT) Mini-Spike Пусковое устройство (ПТРК) Lança-mísseis Mini-Spike (AC) - Mini-Spike rakétarendszer (páncéltörő) + Mini-Spike rakétarendszer (Tankelhárító) Lanciatore Mini-Spike (AC) @@ -94,7 +94,7 @@ Wyrzutnia Mini-Spike (AA) Mini-Spike Пусковое устройство (ВВ) Lança-mísseis Mini-Spike (AA) - Mini-Spike rakétarendszer (légvédelmi) + Mini-Spike rakétarendszer (Repülő-elhárító) Lanciatore Mini-Spike (AA) @@ -117,6 +117,8 @@ YABHON-R3 (CAS) YABHON-R3 (штурмовик) YABHON-R3 (CAS) + YABHON-R3 (Légitámogató) + YABHON-R3 (CAS) M-ATV @@ -137,9 +139,9 @@ M-ATV (CKM) M-ATV (TK) M-ATV (HMG) - M-ATV (Пулемет) + M-ATV (Пулемёт) M-ATV (HMG) - M-ATV (HMG) + M-ATV (nehézgéppuska) M-ATV (HMG) @@ -149,9 +151,9 @@ M-ATV (GMG) M-ATV (Granátomet) M-ATV (GMG) - M-ATV (Гранатомет) + M-ATV (Гранатомёт) M-ATV (GMG) - M-ATV (GMG) + M-ATV (gránátgéppuska) M-ATV (GMG) @@ -289,13 +291,13 @@ HEMTT Container HEMTT Container - HEMTT de contenedor + HEMTT con contenedor HEMTT Kontener HEMTT Skříňový HEMTT Conteneur HEMTT Контейнер HEMTT Contêiner - HEMTT Konténer + HEMTT (konténer) HEMTT portacontainer @@ -304,7 +306,7 @@ HEMTT médico HEMTT Medyczny HEMTT Zdravotnický - HEMTT Sanitaire + HEMTT Médical HEMTT Медицинский HEMTT Médico HEMTT (egészségügyi) @@ -365,9 +367,9 @@ Fennek (CKM) Fennek (TK) Fennek (HMG) - Феннек (Пулемет) + Феннек (Пулемёт) Fennek (HMG) - Fennek (HMG) + Fennek (nehézgéppuska) Fennek (HMG) @@ -377,9 +379,9 @@ Fennek (GMG) Fennek (granátomet) Fennek (GMG) - Феннек (Гранатомет) + Феннек (Гранатомёт) Fennek (GMG) - Fennek (GMG) + Fennek (gránátgéppuska) Fennek (GMG) @@ -437,7 +439,7 @@ KamAZ Transportowy (zakryty) KAMAZ Valník (krytý) KamAZ Transport (bâché) - КамАЗ Траспортный (Крытый) + КамАЗ Траспортный (крытый) KamAZ Transporte (coberto) KamAZ szállítójármű (ponyvás) KamAZ da trasporto (coperto) @@ -484,7 +486,7 @@ KamAZ médico KamAZ Medyczny KAMAZ Zdravotnický - KamAZ Sanitaire + KamAZ Médical КамАЗ Медицинский KamAZ Médico KamAZ (egészségügyi) @@ -509,21 +511,21 @@ Punisher (CKM) Punisher (TK) Punisher (HMG) - Kаратель (Пулемет) + Kаратель (Пулемёт) Punisher (HMG) - Punisher (HMG) + Punisher (nehézgéppuska) Punisher (HMG) Punisher (GMG) Punisher (GMW) Punisher (GMG) - Punisher (CKM) + Punisher (GMG) Punisher (granátomet) Punisher (GMG) - Kаратель (Гранатомет) + Kаратель (Гранатомёт) Punisher (GMG) - Punisher (GMG) + Punisher (gránátgéppuska) Punisher (GMG) @@ -533,9 +535,9 @@ T100 Black Eagle T100 Black Eagle T100 Black Eagle - T100 Черный Орел + T100 Чёрный Орел T100 Black Eagle - T100 Black Eagle + T100 Fekete Sas T100 Black Eagle @@ -605,7 +607,7 @@ Typhoon Transportowy (przykryty) Typhoon valník (krytý) Typhoon Transport (bâché) - Тайфун Транспортный (kрытый) + Тайфун Транспортный (крытый) Typhoon Transporte (coberto) Typhoon szállítójármű (ponyvás) Typhoon da trasporto (coperto) @@ -613,13 +615,13 @@ Typhoon Device Typhoon Gerät - Typhoon de dispositivo + Typhoon con dispositivo Typhoon Urządzenie Typhoon zařízení Typhoon Dispositif Тайфун Устройство Typhoon Dispositivo - Typhoon (szerkezet) + Typhoon (eszköz) Typhoon per dispositivo @@ -664,7 +666,7 @@ Typhoon médico Typhoon Medyczny Typhoon zdravotnický - Typhoon Sanitaire + Typhoon Médical Тайфун Медицинский Typhoon Médico Typhoon (egészségügyi) @@ -725,7 +727,9 @@ CH-47I Chinook (nieuzbrojony) CH-47I Chinook (невооруженный) CH-47I Chinook (neozbrojený) - CH-47I Chinook (Neozbrojený) + CH-47I Chinook (non-armé) + CH-47I Chinook (fegyvertelen) + CH-47I Chinook (disarmato) A-10D Thunderbolt II @@ -784,7 +788,7 @@ L-159 ALCA (CAS) L-159 Альбатрос (CAS) L-159 ALCA (CAS) - L-159 ALCA (CAS) + L-159 ALCA (Légitámogató) L-159 ALCA (CAS) @@ -796,7 +800,7 @@ L-159 ALCA (AA) L-159 Альбатрос (AA) L-159 ALCA (ВВ) - L-159 ALCA (AA) + L-159 ALCA (Repülő-elhárító) L-159 ALCA (AA) @@ -865,7 +869,7 @@ M18A1 Claymore Mina kierunkowa M18A1 Claymore Mina Claymore M18A1 - M18A1 Claymore Mine antipersonnel à effet dirigé + M18A1 Claymore M18A1 Клеймор M18A1 Claymore M18A1 Claymore akna @@ -889,10 +893,10 @@ Bloque de demolición M112 Ładunek burzący M112 Výbušná nálož M112 - Pétard M112 + M112 Block de Démolition M112 подрывной заряд M112 Carga de Demolição - M112 romboló töltet + M112 romboló tömb M112 Demolition Block @@ -986,7 +990,7 @@ Granat dymny M18 (Żółty) M18 Kouřový Granát (žlutý) M18 Grenade fumigène (Jaune) - M183 дымовая граната (Жёлтые) + M183 дымовая граната (Жёлтый) M18 Granada de fumaça (Amarela) M18 füstgránát (Sárga) M18 Granata fumogena (Giallo) @@ -1009,7 +1013,7 @@ Mina antipersona VS-50 Mina przeciwpiechotna VS-50 Protipěchotní mina VS-50 - VS-50 Mine antipersonnel à pression + VS-50 Mine AP VS-50 Противопехотная мина VS-50 Mina antipessoal VS-50 gyalogsági taposóakna @@ -1021,7 +1025,7 @@ Mina antipersona M26 Mina przeciwpiechotna M26 Šrapnelová mina M26 - M26 Mine antipersonnel bondissante + M26 Mine AP bondissante M26 Противопехотная мина M26 Mina saltadora antipessoal M26 gyalogsági ugróakna @@ -1033,7 +1037,7 @@ Mina antipersona de alambre PMR-3 Mina przeciwpiechotna PMR-3 Nástražná mina PMR-3 - PMR-3 Mine antipersonnel à traction + PMR-3 Mine AP à traction PMR-3 Противопехотная мина PMR-3 Mina antipessoal (armadilha) PMR-3 botlódrótos gyalogsági akna @@ -1045,6 +1049,11 @@ P99 P99 P99 + P99 + P99 + P99 + P99 + P99 MP-443 Grach @@ -1052,13 +1061,23 @@ MP-443 Grach MP-443 Grach MP-443 Grach + MP-443 Grach + MP-443 Grach + МР-443 "Грач" + MP-443 Grach + MP-443 Grach - ACP-C2 - ACP-C2 - ACP-C2 - ACP-C2 - ACP-C2 + Custom Covert II + Custom Covert II + Custom Covert II + Custom Covert II + Custom Covert II + Custom Covert II + Custom Covert II + Custom Covert II + Custom Covert II + ACP-C2 FNX-45 Tactical @@ -1066,6 +1085,11 @@ FNX-45 Tactical FNX-45 Tactical FNX-45 Tactical + FNX-45 Tactical + FNX-45 Tactical + FNX-45 Tactical + FNX-45 Tactical + FNX-45 Tactical Chiappa Rhino 60DS @@ -1073,6 +1097,11 @@ Chiappa Rhino 60DS Chiappa Rhino 60DS Chiappa Rhino 60DS + Chiappa Rhino 6DS + Chiappa Rhino 60DS + Chiappa Rhino 60DS + Chiappa Rhino 60DS + Chiappa Rhino 6DS Taurus Judge @@ -1080,6 +1109,11 @@ Taurus Judge Taurus Judge Taurus Judge + Taurus Judge + Taurus Judge + Taurus Judge + Taurus Judge + Taurus Judge NLAW @@ -1087,6 +1121,11 @@ NLAW NLAW NLAW + NLAW + NLAW + NLAW + NLAW + NLAW RPG-32 @@ -1094,6 +1133,11 @@ RPG-32 RPG-32 RPG-32 + RPG-32 + RPG-32 + РПГ-32 + RPG-32 + RPG-32 Mini-Spike (AA) @@ -1101,13 +1145,23 @@ Mini-Spike (PL) Mini-Spike (AA) Mini-Spike (AA) + Mini-Spike (Repülő-elhárító) + Mini-Spike (AA) + Mini-Spike (AA) + Mini-Spike (AA) + Mini-Spike (AA) Mini-Spike (AT) Mini-Spike (PALR) Mini-Spike (PT) - Mini-Spike (AA) - Mini-Spike (AT) + Mini-Spike (AT) + Mini-Spike (AC) + Mini-Spike (Tankelhárító) + Mini-Spike (AT) + Mini-Spike (AT) + Mini-Spike (AT) + Mini-Spike (AT) MX @@ -1115,13 +1169,23 @@ MX MX MX + MX + MX + MX + MX + MX MX (Black) MX (Schwarz) MX (Czarny) MX (černý) - MX ( Noir) + MX (Noir) + MX (Fekete) + MX (Negro) + MX (Чёрный) + MX (Preto) + MX (Nero) MXC @@ -1129,6 +1193,11 @@ MXC MXC MXC + MXC + MXC + MXC + MXC + MXC MXC (Black) @@ -1136,6 +1205,11 @@ MXC (Czarny) MXC (černý) MXC (Noir) + MXC (Fekete) + MXC (Negro) + MXC (Чёрный) + MXC (Preto) + MXC (Nero) MX 3GL @@ -1143,13 +1217,23 @@ MX 3GL MX 3GL MX 3GL + MX 3GL + MX 3GL + MX 3GL + MX 3GL + MX 3GL MX 3GL (Black) MX 3GL (Schwarz) MX 3GL (Czarny) MX 3GL (černý) - MX 3 GL (Noir) + MX 3GL (Noir) + MX 3GL (Fekete) + MX 3GL (Negro) + MX 3GL (Чёрный) + MX 3GL (Preto) + MX 3GL (Nero) MX LSW @@ -1157,6 +1241,11 @@ MX LSW MX LSW MX LSW + MX LSW + MX LSW + MX LSW + MX LSW + MX LSW MX LSW (Black) @@ -1164,6 +1253,11 @@ MX LSW (Czarny) MX LSW (černý) MX LSW (Noir) + MX LSW (Fekete) + MX LSW (Negro) + MX LSW (Чёрный) + MX LSW (Preto) + MX LSW (Nero) MXM @@ -1171,6 +1265,11 @@ MXM MXM MXM + MXM + MXM + MXM + MXM + MXM MXM (Black) @@ -1178,27 +1277,47 @@ MXM (Czarny) MXM (černý) MXM (Noir) + MXM (Fekete) + MXM (Negro) + MXM (Чёрный) + MXM (Preto) + MXM (Nero) - KT2002 Katiba - KT2002 Katiba - KT2002 Katiba - KT2002 Katiba - KT2002 Katiba + KH2002 Sama + KH2002 Sama + KH2002 Sama + KH2002 Sama + KH2002 Sama + KH2002 Sama + KH2002 Sama + KH2002 Сама + KT2002 Sama + KT2002 Katiba - KT2002C Katiba - KT2002C Katiba - KT2002C Katiba - KT2002C Katiba - KT2002C Katiba + KH2002C Sama + KH2002C Sama + KH2002C Sama + KH2002C Sama + KH2002C Sama + KH2002C Sama + KH2002C Sama + KH2002C Сама + KT2002C Sama + KT2002C Katiba - KT2002 Katiba KGL - KT2002 Katiba KGL - KT2002 Katiba KGL - KT2002 Katiba KGL - KT2002 Katiba KGL + KH2002 Sama KGL + KH2002 Sama KGL + KH2002 Sama KGL + KH2002 Sama KGL + KH2002 Sama KGL + KH2002 Sama KGL + KH2002 Sama KGL + KH2002 Сама KGL + KT2002 Sama KGL + KT2002 Katiba KGL F2000 (Camo) @@ -1206,6 +1325,11 @@ F2000 (kamuflaż) F2000 (kamufláž F2000 (Camo) + F2000 (Terepmintás) + F2000 (Camuflaje) + F2000 (Камо) + F2000 (Camo) + F2000 (Camo) F2000 @@ -1213,6 +1337,11 @@ F2000 F2000 F2000 + F2000 + F2000 + F2000 + F2000 + F2000 F2000 Tactical (Camo) @@ -1220,6 +1349,11 @@ F2000 Tactical (kamuflaż) F2000 Tactical (černý) F2000 Tactical (Camo) + F2000 Tactical (Terepmintás) + F2000 Tactical (Camuflaje) + F2000 Tactical (Камо) + F2000 Tactical (Camo) + F2000 Tactical (Camo) F2000 Tactical @@ -1227,6 +1361,11 @@ F2000 Tactical F2000 Tactical F2000 Tactical + F2000 Tactical + F2000 Tactical + F2000 Tactical + F2000 Tactical + F2000 Tactical F2000 EGLM (Camo) @@ -1234,6 +1373,11 @@ F2000 EGLM (kamuflaż) F2000 EGLM (kamufláž) F2000 EGLM (Camo) + F2000 EGLM (Terepmintás) + F2000 EGLM (Camuflaje) + F2000 EGLM (Камо) + F2000 EGLM (Camo) + F2000 EGLM (Camo) F2000 EGLM @@ -1241,6 +1385,11 @@ F2000 EGLM F2000 EGLM F2000 EGLM + F2000 EGLM + F2000 EGLM + F2000 EGLM + F2000 EGLM + F2000 EGLM TAR-21 @@ -1248,6 +1397,11 @@ TAR-21 TAR-21 TAR-21 + TAR-21 + TAR-21 + TAR-21 + TAR-21 + TAR-21 CTAR-21 @@ -1255,6 +1409,11 @@ CTAR-21 CTAR-21 CTAR-21 + CTAR-21 + CTAR-21 + CTAR-21 + CTAR-21 + CTAR-21 TAR-21 EGLM @@ -1262,6 +1421,11 @@ TAR-21 EGLM TAR-21 EGLM TAR-21 EGLM + TAR-21 EGLM + TAR-21 EGLM + TAR-21 EGLM + TAR-21 EGLM + TAR-21 EGLM Vector SMG @@ -1269,6 +1433,11 @@ Vector SMG Vector SMG Vector SMG + Vector SMG + Vector SMG + Vector SMG + Vector SMG + Vector SMG Scorpion Evo 3 A1 @@ -1276,6 +1445,11 @@ Scorpion Evo 3 A1 Scorpion Evo 3 A1 Scorpion Evo 3 A1 + Scorpion Evo 3 A1 + Scorpion Evo 3 A1 + Scorpion Evo 3 A1 + Scorpion Evo 3 A1 + Scorpion Evo 3 A1 CPW @@ -1283,6 +1457,11 @@ CPW CPW CPW + CPW + CPW + CPW + CPW + CPW RFB SDAR @@ -1290,6 +1469,11 @@ RFB SDAR RFB SDAR RFB SDAR + RFB SDAR + RFB SDAR + RFB SDAR + RFB SDAR + RFB SDAR Stoner 99 LMG @@ -1297,6 +1481,11 @@ Stoner 99 LMG Stoner 99 LMG Stoner 99 LMG + Stoner 99 Könnyűgéppuska + Stoner 99 LMG + Stoner 99 LMG + Stoner 99 LMG + Stoner 99 LMG Negev NG7 @@ -1304,6 +1493,11 @@ Negev NG7 Negev NG7 Negev NG7 + Negev NG7 + Negev NG7 + Negev NG7 + Negev NG7 + Negev NG7 Mk14 Mod 1 EBR @@ -1311,6 +1505,11 @@ Mk14 Mod 1 EBR Mk14 Mod 1 EBR Mk 14 Mod 1 EBR + Mk14 Mod 1 EBR + Mk14 Mod 1 EBR + Mk14 Mod 1 EBR + Mk14 Mod 1 EBR + Mk14 Mod 1 EBR GM6 Lynx @@ -1318,6 +1517,11 @@ GM6 Lynx GM6 Lynx GM6 Lynx + GM6 Gepárd + GM6 Lynx + GM6 Lynx + GM6 Lynx + GM6 Lynx GM6 Lynx (Camo) @@ -1325,6 +1529,11 @@ GM6 Lynx (kamuflaż) GM6 Lynx (kamufláž) GM6 Lynx (Camo) + GM6 Gepárd (Terepmintás) + GM6 Lynx (Camuflaje) + GM6 Lynx (камо) + GM6 Lynx (Camo) + GM6 Lynx (Camo) M200 Intervention @@ -1332,6 +1541,11 @@ M200 Intervention M200 Intervention M200 Intervention + M200 Intervention + M200 Intervention + M200 Intervention + M200 Intervention + M200 Intervention M200 Intervention (Camo) @@ -1339,6 +1553,11 @@ M200 Intervention (kamuflaż) M200 Intervention (kamufláž) M200 Intervention (Camo) + M200 Intervention (Terepmintás) + M200 Intervention (Camuflaje) + M200 Intervention (камо) + M200 Intervention (Camo) + M200 Intervention (Camo) VS-121 @@ -1346,146 +1565,319 @@ VS-121 VS-121 VS-121 + VS-121 + VS-121 + VS-121 + VS-121 + VS-121 - TODO: MAR-10 .338 - TODO: MAR-10 .338 - MAR-10 .338 + Noreen "Bad News" ULR + Noreen "Bad News" ULR + Noreen "Bad News" ULR + Noreen "Bad News" ULR + Noreen "Bad News" ULR + Noreen "Bad News" ULR + Noreen "Bad News" ULR + Noreen "Bad News" ULR + Noreen "Bad News"ULR - TODO: MAR-10 .338 (Black) - TODO: MAR-10 .338 (Black) - MAR-10 .338 (Noir) + Noreen "Bad News" ULR (Black) + Noreen "Bad News" ULR (Black) + Noreen "Bad News" ULR (Noir) + Noreen "Bad News" ULR (Negro) + Noreen "Bad News" ULR (Чёрный) + Noreen "Bad News" ULR (Schwarz) + Noreen "Bad News" ULR (czarny) + Noreen "Bad News" ULR (Nero) + Noreen "Bad News"ULR (Fekete) - TODO: MAR-10 .338 (Camo) - TODO: MAR-10 .338 (Camo) - MAR-10 .338 (Camo) + Noreen "Bad News" ULR (Camo) + Noreen "Bad News" ULR (Camo) + Noreen "Bad News" ULR (Camo) + Noreen "Bad News" ULR (Camuflaje) + Noreen "Bad News" ULR (Камо) + Noreen "Bad News" ULR (Camo) + Noreen "Bad News" ULR (kamuflaż) + Noreen "Bad News" ULR (Camo) + Noreen "Bad News"ULR (Terepmintás) - TODO: MAR-10 .338 (Sand) - TODO: MAR-10 .338 (Sand) - MAR-10 .338 (Beige) + Noreen "Bad News" ULR (Sand) + Noreen "Bad News" ULR (Sand) + Noreen "Bad News" ULR (Beige) + Noreen "Bad News" ULR (Arena) + Noreen "Bad News" ULR (Песочный) + Noreen "Bad News" ULR (Sand) + Noreen "Bad News" ULR (piaskowy) + Noreen "Bad News" ULR (Sabbia) + Noreen "Bad News"ULR (Homok) - TODO: Mk-I EMR 7.62 mm - TODO: Mk-I EMR 7.62 mm - Mk-l EMR 7.62 mm + SIG 556 + SIG 556 + SIG 556 + SIG 556 + SIG 556 + SIG 556 + SIG 556 + SIG 556 + SIG 556 - TODO: Mk-I EMR 7.62 mm (Black) - TODO: Mk-I EMR 7.62 mm (Black) - Mk-l EMR 7.62 mm (Noir) + SIG 556 (Black) + SIG 556 (Black) + SIG 556 (Noir) + SIG 556 (Negro) + SIG 556 (Чёрный) + SIG 556 (czarny) + SIG 556 (Schwarz) + SIG 556 (Nero) + SIG 556 (Fekete) - TODO: Mk-I EMR 7.62 mm (Khaki) - TODO: Mk-I EMR 7.62 mm (Khaki) - Mk-l EMR 7.62 mm (Kaki) + SIG 556 (Khaki) + SIG 556 (Khaki) + SIG 556 (Kaki) + SIG 556 (Caqui) + SIG 556 (Хаки) + SIG 556 (khaki) + SIG 556 (Khaki) + SIG 556 (Khaki) + SIG 556 (Khaki) - TODO: Mk-I EMR 7.62 mm (Sand) - TODO: Mk-I EMR 7.62 mm (Sand) - Mk-l EMR 7.62 mm (Beige) + SIG 556 (Sand) + SIG 556 (Sand) + SIG 556 (Beige) + SIG 556 (Arena) + SIG 556 (Песочный) + SIG 556 (piaskowy) + SIG 556 (Sand) + SIG 556 (Sabbia) + SIG 556 (Homok) - TODO: Mk-I EMR 7.62 mm (Camo) - TODO: Mk-I EMR 7.62 mm (Camo) - Mk-l EMR 7.62 mm (Camo) + SIG 556 (Camo) + SIG 556 (Camo) + SIG 556 (Camo) + SIG 556 (Camuflaje) + SIG 556 (Камо) + SIG 556 (kamuflaż) + SIG 556 (Camo) + SIG 556 (Camo) + SIG 556 (Terepmintás) - TODO: Mk-I EMR 7.62 mm (Woodland) - TODO: Mk-I EMR 7.62 mm (Woodland) - Mk-l EMR 7.62 mm (Woodland) + SIG 556 (Woodland) + SIG 556 (Woodland) + SIG 556 (Woodland) + SIG 556 (Bosque) + SIG 556 (Лесной) + SIG 556 (leśny) + SIG 556 (Woodland) + SIG 556 (Woodland) + SIG 556 (Erdőmintás) - TODO: NATO DMR (provisional) spotter - TODO: NATO DMR (provisional) spotter - NATO DMR (provisoire) Observateur + SIG 556 (provisional) spotter + SIG 556 (provisional) spotter + SIG 556 (provisoire) Observateur + SIG 556 (provisional) observador + SIG 556 (provisional) корректировщик + SIG 556 (prowizoryczny) obserwator + SIG 556 (provisorisch) Beobachter + SIG 556 (provisional) spotter + SIG 556 (Ellátmányi) Megfigyelő - TODO: ASP-1 Kir 12.7 mm - TODO: ASP-1 Kir 12.7 mm - ASP-1 Kir 12.7 mm + ASP-1 Kir + ASP-1 Kir + ASP-1 Kir + ASP-1 Kir + ASP-1 Kir + ASP-1 Kir + ASP-1 Kir + ASP-1 Kir + ASP-1 Kir - TODO: ASP-1 Kir 12.7 mm (Black) - TODO: ASP-1 Kir 12.7 mm (Black) - ASP-1 Kir 12.7 mm (Noir) + ASP-1 Kir (Black) + ASP-1 Kir (Black) + ASP-1 Kir (Noir) + ASP-1 Kir (Negro) + ASP-1 Kir (Чёрный) + ASP-1 Kir (Schwarz) + ASP-1 Kir (czarny) + ASP-1 Kir (Nero) + ASP-1 Kir (Fekete) - TODO: ASP-1 Kir 12.7 mm (Tan) - TODO: ASP-1 Kir 12.7 mm (Tan) - ASP-1 Kir 12.7 mm (Tan) + ASP-1 Kir (Tan) + ASP-1 Kir (Tan) + ASP-1 Kir (Tan) + ASP-1 Kir (Tan) + ASP-1 Kir (Бронзовый) + ASP-1 Kir (Hellbraun) + ASP-1 Kir (Tan) + ASP-1 Kir (Tan) + ASP-1 Kir (Cserszín) - TODO: Cyrus 9.3 mm - TODO: Cyrus 9.3 mm - Cyrus 9.3 mm + Cyrus + Cyrus + Cyrus + Cyrus + Cyrus + Cyrus + Cyrus + Cyrus + Cyrus - TODO: Cyrus 9.3 mm (Black) - TODO: Cyrus 9.3 mm (Black) - Cyrus 9.3 mm (Noir) + Cyrus (Black) + Cyrus (Black) + Cyrus (Noir) + Cyrus (Negro) + Cyrus (Чёрный) + Cyrus (Schwarz) + Cyrus (czarny) + Cyrus (Nero) + Cyrus (Fekete) - TODO: Cyrus 9.3 mm (Hex) - TODO: Cyrus 9.3 mm (Hex) - Cyrus 9.3 mm (Hex) + Cyrus (Hex) + Cyrus (Hex) + Cyrus (Hex) + Cyrus (Hex) + Cyrus (Гекс) + Cyrus (Hex) + Cyrus (hex) + Cyrus (Hex) + Cyrus (Hex) - TODO: Cyrus 9.3 mm (Tan) - TODO: Cyrus 9.3 mm (Tan) - Cyrus 9.3 mm (Tan) + Cyrus (Tan) + Cyrus (Tan) + Cyrus (Tan) + Cyrus (Tan) + Cyrus (Бронза) + Cyrus (Hellbraun) + Cyrus (podpalany) + Cyrus (Tan) + Cyrus (Cserszín) - TODO: Mk14 7.62 mm - TODO: Mk14 7.62 mm - Mk 14 7.62 mm + M14 + M14 + M14 + M14 + M14 + M14 + M14 + M14 + M14 - TODO: Mk14 7.62 mm (Camo) - TODO: Mk14 7.62 mm (Camo) - Mk 14 7.62 mm (Camo) + M14 (Camo) + M14 (Camo) + M14 (Camo) + M14 (Camuflaje) + M14 (Камо) + M14 (kamuflaż) + M14 (Camo) + M14 (Camo) + M14 (Terepmintás) - TODO: Mk14 7.62 mm (Olive) - TODO: Mk14 7.62 mm (Olive) - Mk 14 7.62 mm (Olive) + M14 (Olive) + M14 (Olive) + M14 (Olive) + M14 (Oliva) + M14 (Олива) + M14 (oliwkowy) + M14 (Olive) + M14 (Olive) + M14 (Olíva) - TODO: Navid 9.3 mm - TODO: Navid 9.3 mm - Navid 9.3 mm + HK121 + HK121 + HK121 + HK121 + HK121 + HK121 + HK121 + HK121 + HK121 - TODO: Navid 9.3 mm (Hex) - TODO: Navid 9.3 mm (Hex) - Navid 9.3 mm (Hex) + HK121 (Hex) + HK121 (Hex) + HK121 (Hex) + HK121 (Hex) + HK121 (Гекс) + HK121 (Hex) + HK121 (hex) + HK121 (Hex) + HK121 (Hex) - TODO: Navid 9.3 mm (Tan) - TODO: Navid 9.3 mm (Tan) - Navid 9.3 mm (Tan) + HK121 (Tan) + HK121 (Tan) + HK121 (Tan) + HK121 (Tan) + HK121 (Бронза) + HK121 (Hellbraun) + HK121 (podpalany) + HK121 (Tan) + HK121 (Cserszín) - TODO: SPMG .338 - TODO: SPMG .338 - SPMG .338 + LWMMG + LWMMG + LWMMG + LWMMG + LWMMG + LWMMG + LWMMG + LWMMG + LWMMG - TODO: SPMG .338 (MTP) - TODO: SPMG .338 (MTP) - SPMG .338 (MTP) + LWMMG (MTP) + LWMMG (MTP) + LWMMG (MTP) + LWMMG (MTP) + LWMMG (MTP) + LWMMG (MTP) + LWMMG (MTP) + LWMMG (MTP) + LWMMG (MTP) - TODO: SPMG .338 (Black) - TODO: SPMG .338 (Black) - SPMG .338 (Noir) + LWMMG (Black) + LWMMG (Black) + LWMMG (Noir) + LWMMG (Negro) + LWMMG (Чёрный) + LWMMG (czarny) + LWMMG (Schwarz) + LWMMG (Nero) + LWMMG (Fekete) - TODO: SPMG .338 (Sand) - TODO: SPMG .338 (Sand) - SPMG .338 (Beige) + LWMMG (Sand) + LWMMG (Sand) + SPMG (Beige) + LWMMG (Arena) + LWMMG (Песочный) + LWMMG (piaskowy) + LWMMG (Sand) + LWMMG (Sabbia) + LWMMG (Homok) diff --git a/addons/recoil/$PBOPREFIX$ b/addons/recoil/$PBOPREFIX$ new file mode 100644 index 0000000000..1ab9ffa5e1 --- /dev/null +++ b/addons/recoil/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\recoil \ No newline at end of file diff --git a/addons/recoil/CfgEventHandlers.hpp b/addons/recoil/CfgEventHandlers.hpp new file mode 100644 index 0000000000..60fc3892fc --- /dev/null +++ b/addons/recoil/CfgEventHandlers.hpp @@ -0,0 +1,14 @@ + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_FiredBIS_EventHandlers { + class CAManBase { + class ADDON { + clientFiredBIS = QUOTE(if (_this select 0 == ACE_player) then {_this call FUNC(camshake)};); + }; + }; +}; diff --git a/addons/recoil/CfgMoves.hpp b/addons/recoil/CfgMoves.hpp new file mode 100644 index 0000000000..ecad382cb5 --- /dev/null +++ b/addons/recoil/CfgMoves.hpp @@ -0,0 +1,85 @@ + +// Completely disable BI's camshake on fire. +#define ACE_CAMSHAKEFIRE_BASE 0 +#define ACE_CAMSHAKEFIRE_LESS 0 +#define ACE_CAMSHAKEFIRE_MORE 0 + +// Go through all modes that have a camshakefire defined and change it to ours. +class CfgMovesBasic { + class Default { + camShakeFire = ACE_CAMSHAKEFIRE_NORMAL; + }; +}; + +class CfgMovesMaleSdr: CfgMovesBasic { + class States { + class AmovPercMstpSlowWrflDnon; + class AmovPknlMstpSlowWrflDnon: AmovPercMstpSlowWrflDnon { + camShakeFire = ACE_CAMSHAKEFIRE_LESS; + }; + + class AmovPercMstpSrasWrflDnon; + class AmovPpneMstpSrasWrflDnon: AmovPercMstpSrasWrflDnon { + camShakeFire = ACE_CAMSHAKEFIRE_LESS; + }; + + class AmovPknlMstpSrasWlnrDnon: Default { + camShakeFire = ACE_CAMSHAKEFIRE_LESS; + }; + + class AmovPknlMrunSlowWrflDf; + class AmovPknlMtacSlowWrflDf: AmovPknlMrunSlowWrflDf { + camShakeFire = ACE_CAMSHAKEFIRE_MORE; + }; + + class AmovPknlMrunSlowWrflDfl; + class AmovPknlMtacSlowWrflDfl: AmovPknlMrunSlowWrflDfl { + camShakeFire = ACE_CAMSHAKEFIRE_MORE; + }; + + class AmovPknlMrunSlowWrflDl; + class AmovPknlMtacSlowWrflDl: AmovPknlMrunSlowWrflDl { + camShakeFire = ACE_CAMSHAKEFIRE_MORE; + }; + + class AmovPknlMrunSlowWrflDbl; + class AmovPknlMtacSlowWrflDbl: AmovPknlMrunSlowWrflDbl { + camShakeFire = ACE_CAMSHAKEFIRE_MORE; + }; + + class AmovPknlMrunSlowWrflDb; + class AmovPknlMtacSlowWrflDb: AmovPknlMrunSlowWrflDb { + camShakeFire = ACE_CAMSHAKEFIRE_MORE; + }; + + class AmovPknlMrunSlowWrflDbr; + class AmovPknlMtacSlowWrflDbr: AmovPknlMrunSlowWrflDbr { + camShakeFire = ACE_CAMSHAKEFIRE_MORE; + }; + + class AmovPknlMrunSlowWrflDr; + class AmovPknlMtacSlowWrflDr: AmovPknlMrunSlowWrflDr { + camShakeFire = ACE_CAMSHAKEFIRE_MORE; + }; + + class AmovPknlMrunSlowWrflDfr; + class AmovPknlMtacSlowWrflDfr: AmovPknlMrunSlowWrflDfr { + camShakeFire = ACE_CAMSHAKEFIRE_MORE; + }; + + class AmovPknlMstpSrasWrflDnon; + class AmovPknlMwlkSrasWrflDf: AmovPknlMstpSrasWrflDnon { + camShakeFire = ACE_CAMSHAKEFIRE_NORMAL; + }; + + class AmovPknlMrunSrasWrflDf; + class AmovPknlMtacSrasWrflDf: AmovPknlMrunSrasWrflDf { + camShakeFire = ACE_CAMSHAKEFIRE_MORE; + }; + + class AmovPknlMwlkSrasWpstDf; + class AmovPknlMtacSrasWpstDf: AmovPknlMwlkSrasWpstDf { + camShakeFire = ACE_CAMSHAKEFIRE_MORE; + }; + }; +}; diff --git a/addons/recoil/CfgRecoils.hpp b/addons/recoil/CfgRecoils.hpp new file mode 100644 index 0000000000..4b473919d5 --- /dev/null +++ b/addons/recoil/CfgRecoils.hpp @@ -0,0 +1,255 @@ + +#define KICKBACK 1.4 + +#define MUZZLETEMP 1.2 +#define MUZZLEPERM 0.4 + +#define MUZZLECLIMB_POS 1 +#define MUZZLERIGHT_POS 0.2 + +#define MUZZLECLIMB_MAG 1 +#define MUZZLERIGHT_MAG 1 + +class CfgRecoils { + class Default { + // doc: http://forums.bistudio.com/showthread.php?188999-Recoil-Overhaul-Feedback&s=dba8590ec07adb5ffa87f72d38dde6fc&p=2886744&viewfull=1#post2886744 + // {horizontal axis position, vertical axis position, horizontal magnitude, vertical magnitude} + muzzleOuter[] = {0*MUZZLERIGHT_POS,0.4*MUZZLECLIMB_POS,0.5*MUZZLERIGHT_MAG,0.6*MUZZLECLIMB_MAG}; + // restricted area inside the outer ellipse where the recoil cannot end + muzzleInner[] = {0,0.05,0.2,0.2}; + // minimum and maximum interval for backward force + kickBack[] = {0.05*KICKBACK,0.1*KICKBACK}; + permanent = 0.1*MUZZLEPERM; + temporary = 0.01*MUZZLETEMP; + }; + + class recoil_default: Default { + muzzleOuter[] = {0.3*MUZZLERIGHT_POS,1*MUZZLECLIMB_POS,0.3*MUZZLERIGHT_MAG,0.2*MUZZLECLIMB_MAG}; + muzzleInner[] = {0,0,0.1,0.1}; + kickBack[] = {0.03*KICKBACK,0.06*KICKBACK}; + permanent = 0.1*MUZZLEPERM; + temporary = 0.01*MUZZLETEMP; + }; + + class recoil_mk20: recoil_default { + muzzleOuter[] = {0.2*MUZZLERIGHT_POS,0.6*MUZZLECLIMB_POS,0.2*MUZZLERIGHT_MAG,0.2*MUZZLECLIMB_MAG}; + kickBack[] = {0.01*KICKBACK,0.03*KICKBACK}; + temporary = 0.01*MUZZLETEMP; + }; + + class recoil_mk20c: recoil_default { + muzzleOuter[] = {0.2*MUZZLERIGHT_POS,0.8*MUZZLECLIMB_POS,0.3*MUZZLERIGHT_MAG,0.2*MUZZLECLIMB_MAG}; + kickBack[] = {0.02*KICKBACK,0.04*KICKBACK}; + temporary = 0.015*MUZZLETEMP; + }; + + class recoil_trg20: recoil_default { + muzzleOuter[] = {0.2*MUZZLERIGHT_POS,1*MUZZLECLIMB_POS,0.3*MUZZLERIGHT_MAG,0.3*MUZZLECLIMB_MAG}; + kickBack[] = {0.02*KICKBACK,0.04*KICKBACK}; + temporary = 0.015*MUZZLETEMP; + }; + + class recoil_trg21: recoil_default { + muzzleOuter[] = {0.2*MUZZLERIGHT_POS,0.8*MUZZLECLIMB_POS,0.3*MUZZLERIGHT_MAG,0.2*MUZZLECLIMB_MAG}; + kickBack[] = {0.01*KICKBACK,0.03*KICKBACK}; + temporary = 0.01*MUZZLETEMP; + }; + + class recoil_mx: recoil_default { + muzzleOuter[] = {0.3*MUZZLERIGHT_POS,1*MUZZLECLIMB_POS,0.4*MUZZLERIGHT_MAG,0.3*MUZZLECLIMB_MAG}; + kickBack[] = {0.02*KICKBACK,0.04*KICKBACK}; + temporary = 0.01*MUZZLETEMP; + }; + + class recoil_mxc: recoil_default { + muzzleOuter[] = {0.3*MUZZLERIGHT_POS,1.2*MUZZLECLIMB_POS,0.4*MUZZLERIGHT_MAG,0.3*MUZZLECLIMB_MAG}; + kickBack[] = {0.03*KICKBACK,0.06*KICKBACK}; + temporary = 0.015*MUZZLETEMP; + }; + + class recoil_sw: recoil_default { + muzzleOuter[] = {0.3*MUZZLERIGHT_POS,0.8*MUZZLECLIMB_POS,0.5*MUZZLERIGHT_MAG,0.2*MUZZLECLIMB_MAG}; + kickBack[] = {0.02*KICKBACK,0.04*KICKBACK}; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; + }; + + class recoil_mxm: recoil_default { + muzzleOuter[] = {0.3*MUZZLERIGHT_POS,0.8*MUZZLECLIMB_POS,0.4*MUZZLERIGHT_MAG,0.3*MUZZLECLIMB_MAG}; + kickBack[] = {0.02*KICKBACK,0.04*KICKBACK}; + temporary = 0.01*MUZZLETEMP; + }; + + class recoil_ktb: recoil_default { + muzzleOuter[] = {0.3*MUZZLERIGHT_POS,1*MUZZLECLIMB_POS,0.3*MUZZLERIGHT_MAG,0.3*MUZZLECLIMB_MAG}; + kickBack[] = {0.02*KICKBACK,0.04*KICKBACK}; + temporary = 0.01*MUZZLETEMP; + }; + + class recoil_ktbc: recoil_default { + muzzleOuter[] = {0.3*MUZZLERIGHT_POS,1.2*MUZZLECLIMB_POS,0.3*MUZZLERIGHT_MAG,0.3*MUZZLECLIMB_MAG}; + kickBack[] = {0.03*KICKBACK,0.06*KICKBACK}; + temporary = 0.015*MUZZLETEMP; + }; + + class recoil_smg_01: recoil_default { + muzzleOuter[] = {0.1*MUZZLERIGHT_POS,0.8*MUZZLECLIMB_POS,0.3*MUZZLERIGHT_MAG,0.2*MUZZLECLIMB_MAG}; + kickBack[] = {0.01*KICKBACK,0.03*KICKBACK}; + temporary = 0.015*MUZZLETEMP; + }; + + class recoil_smg_02: recoil_default { + muzzleOuter[] = {0.1*MUZZLERIGHT_POS,0.6*MUZZLECLIMB_POS,0.2*MUZZLERIGHT_MAG,0.2*MUZZLECLIMB_MAG}; + kickBack[] = {0.01*KICKBACK,0.02*KICKBACK}; + temporary = 0.01*MUZZLETEMP; + }; + + class recoil_pdw: recoil_default { + muzzleOuter[] = {0.2*MUZZLERIGHT_POS,1*MUZZLECLIMB_POS,0.3*MUZZLERIGHT_MAG,0.3*MUZZLECLIMB_MAG}; + kickBack[] = {0.02*KICKBACK,0.04*KICKBACK}; + temporary = 0.02*MUZZLETEMP; + }; + + class recoil_sdar: recoil_default { + muzzleOuter[] = {0.2*MUZZLERIGHT_POS,1*MUZZLECLIMB_POS,0.3*MUZZLERIGHT_MAG,0.3*MUZZLECLIMB_MAG}; + kickBack[] = {0.02*KICKBACK,0.04*KICKBACK}; + temporary = 0.01*MUZZLETEMP; + }; + + class recoil_pistol_p07: recoil_default { + muzzleOuter[] = {0.2*MUZZLERIGHT_POS,1*MUZZLECLIMB_POS,0.2*MUZZLERIGHT_MAG,0.3*MUZZLECLIMB_MAG}; + kickBack[] = {0.03*KICKBACK,0.06*KICKBACK}; + temporary = 0.03*MUZZLETEMP; + }; + + class recoil_pistol_rook40: recoil_default { + muzzleOuter[] = {0.2*MUZZLERIGHT_POS,1*MUZZLECLIMB_POS,0.2*MUZZLERIGHT_MAG,0.3*MUZZLECLIMB_MAG}; + kickBack[] = {0.03*KICKBACK,0.06*KICKBACK}; + temporary = 0.02*MUZZLETEMP; + }; + + class recoil_pistol_acpc2: recoil_default { + muzzleOuter[] = {0.2*MUZZLERIGHT_POS,1.5*MUZZLECLIMB_POS,0.2*MUZZLERIGHT_MAG,0.3*MUZZLECLIMB_MAG}; + kickBack[] = {0.04*KICKBACK,0.08*KICKBACK}; + temporary = 0.04*MUZZLETEMP; + }; + + class recoil_pistol_4five: recoil_default { + muzzleOuter[] = {0.2*MUZZLERIGHT_POS,1.5*MUZZLECLIMB_POS,0.2*MUZZLERIGHT_MAG,0.3*MUZZLECLIMB_MAG}; + kickBack[] = {0.04*KICKBACK,0.08*KICKBACK}; + temporary = 0.06*MUZZLETEMP; + }; + + class recoil_pistol_zubr: recoil_default { + muzzleOuter[] = {0.2*MUZZLERIGHT_POS,1.5*MUZZLECLIMB_POS,0.2*MUZZLERIGHT_MAG,0.3*MUZZLECLIMB_MAG}; + kickBack[] = {0.04*KICKBACK,0.08*KICKBACK}; + temporary = 0.08*MUZZLETEMP; + }; + + class recoil_pistol_signal: recoil_default { + muzzleOuter[] = {0.2*MUZZLERIGHT_POS,1.5*MUZZLECLIMB_POS,0.2*MUZZLERIGHT_MAG,0.3*MUZZLECLIMB_MAG}; + kickBack[] = {0.02*KICKBACK,0.04*KICKBACK}; + temporary = 0.02*MUZZLETEMP; + }; + + class recoil_rpg: recoil_default { + muzzleOuter[] = {2*MUZZLERIGHT_POS,3*MUZZLECLIMB_POS,1*MUZZLERIGHT_MAG,0.5*MUZZLECLIMB_MAG}; + kickBack[] = {0.08*KICKBACK,0.1*KICKBACK}; + temporary = 0.1*MUZZLETEMP; + }; + + class recoil_nlaw: recoil_default { + muzzleOuter[] = {2*MUZZLERIGHT_POS,3*MUZZLECLIMB_POS,1*MUZZLERIGHT_MAG,0.5*MUZZLECLIMB_MAG}; + kickBack[] = {0.06*KICKBACK,0.08*KICKBACK}; + temporary = 0.08*MUZZLETEMP; + }; + + class recoil_titan_long: recoil_default { + muzzleOuter[] = {2*MUZZLERIGHT_POS,3*MUZZLECLIMB_POS,1*MUZZLERIGHT_MAG,0.5*MUZZLECLIMB_MAG}; + kickBack[] = {0.1*KICKBACK,0.12*KICKBACK}; + temporary = 0.15*MUZZLETEMP; + }; + + class recoil_titan_short: recoil_default { + muzzleOuter[] = {2*MUZZLERIGHT_POS,3*MUZZLECLIMB_POS,1*MUZZLERIGHT_MAG,0.5*MUZZLECLIMB_MAG}; + kickBack[] = {0.1*KICKBACK,0.12*KICKBACK}; + temporary = 0.12*MUZZLETEMP; + }; + + class recoil_mk200: recoil_default { + muzzleOuter[] = {0.4*MUZZLERIGHT_POS,0.6*MUZZLECLIMB_POS,0.6*MUZZLERIGHT_MAG,0.2*MUZZLECLIMB_MAG}; + kickBack[] = {0.03*KICKBACK,0.06*KICKBACK}; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; + }; + + class recoil_zafir: recoil_default { + muzzleOuter[] = {0.5*MUZZLERIGHT_POS,1*MUZZLECLIMB_POS,0.7*MUZZLERIGHT_MAG,0.3*MUZZLECLIMB_MAG}; + kickBack[] = {0.02*KICKBACK,0.08*KICKBACK}; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; + }; + + class recoil_m320: recoil_default { + muzzleOuter[] = {1*MUZZLERIGHT_POS,3*MUZZLECLIMB_POS,0.5*MUZZLERIGHT_MAG,0.6*MUZZLECLIMB_MAG}; + kickBack[] = {0.08*KICKBACK,0.1*KICKBACK}; + temporary = 0.02*MUZZLETEMP; + }; + + class recoil_gm6: recoil_default { + muzzleOuter[] = {1.4*MUZZLERIGHT_POS,3.5*MUZZLECLIMB_POS,0.7*MUZZLERIGHT_MAG,0.8*MUZZLECLIMB_MAG}; + kickBack[] = {0.1*KICKBACK,0.12*KICKBACK}; + temporary = 0.025*MUZZLETEMP; + }; + + class recoil_ebr: recoil_default { + muzzleOuter[] = {0.4*MUZZLERIGHT_POS,1.5*MUZZLECLIMB_POS,0.6*MUZZLERIGHT_MAG,0.4*MUZZLECLIMB_MAG}; + kickBack[] = {0.04*KICKBACK,0.07*KICKBACK}; + temporary = 0.01*MUZZLETEMP; + }; + + class recoil_dmr_01: recoil_default { + muzzleOuter[] = {0.5*MUZZLERIGHT_POS,2*MUZZLECLIMB_POS,0.5*MUZZLERIGHT_MAG,0.5*MUZZLECLIMB_MAG}; + kickBack[] = {0.03*KICKBACK,0.08*KICKBACK}; + temporary = 0.015*MUZZLETEMP; + }; + + class recoil_dmr_02: recoil_default { + muzzleOuter[] = {0.5*MUZZLERIGHT_POS,2.5*MUZZLECLIMB_POS,0.6*MUZZLERIGHT_MAG,0.5*MUZZLECLIMB_MAG}; + kickBack[] = {0.06*KICKBACK,0.08*KICKBACK}; + temporary = 0.01*MUZZLETEMP; + }; + + class recoil_dmr_03: recoil_default { + muzzleOuter[] = {0.3*MUZZLERIGHT_POS,1.5*MUZZLECLIMB_POS,0.5*MUZZLERIGHT_MAG,0.4*MUZZLECLIMB_MAG}; + kickBack[] = {0.03*KICKBACK,0.06*KICKBACK}; + temporary = 0.005*MUZZLETEMP; + }; + + class recoil_dmr_04: recoil_default { + muzzleOuter[] = {0.4*MUZZLERIGHT_POS,1.5*MUZZLECLIMB_POS,0.5*MUZZLERIGHT_MAG,0.4*MUZZLECLIMB_MAG}; + kickBack[] = {0.02*KICKBACK,0.04*KICKBACK}; + temporary = 0.015*MUZZLETEMP; + }; + + class recoil_dmr_05: recoil_default { + muzzleOuter[] = {0.5*MUZZLERIGHT_POS,2.5*MUZZLECLIMB_POS,0.8*MUZZLERIGHT_MAG,0.6*MUZZLECLIMB_MAG}; + kickBack[] = {0.08*KICKBACK,0.1*KICKBACK}; + temporary = 0.01*MUZZLETEMP; + }; + + class recoil_dmr_06: recoil_default { + muzzleOuter[] = {0.5*MUZZLERIGHT_POS,2*MUZZLECLIMB_POS,0.7*MUZZLERIGHT_MAG,0.5*MUZZLECLIMB_MAG}; + kickBack[] = {0.05*KICKBACK,0.1*KICKBACK}; + temporary = 0.01*MUZZLETEMP; + }; + + class recoil_mmg_01: recoil_default { + muzzleOuter[] = {0.6*MUZZLERIGHT_POS,1.5*MUZZLECLIMB_POS,0.8*MUZZLERIGHT_MAG,0.3*MUZZLECLIMB_MAG}; + kickBack[] = {0.02*KICKBACK,0.08*KICKBACK}; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; + }; + + class recoil_mmg_02: recoil_default { + muzzleOuter[] = {0.5*MUZZLERIGHT_POS,1.5*MUZZLECLIMB_POS,0.6*MUZZLERIGHT_MAG,0.4*MUZZLECLIMB_MAG}; + kickBack[] = {0.04*KICKBACK,0.08*KICKBACK}; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; + }; +}; diff --git a/addons/recoil/XEH_preInit.sqf b/addons/recoil/XEH_preInit.sqf new file mode 100644 index 0000000000..f6d04886c1 --- /dev/null +++ b/addons/recoil/XEH_preInit.sqf @@ -0,0 +1,8 @@ +// by commy2 +#include "script_component.hpp" + +ADDON = false; + +PREP(camshake); + +ADDON = true; diff --git a/addons/recoil/config.cpp b/addons/recoil/config.cpp new file mode 100644 index 0000000000..5b8002bc37 --- /dev/null +++ b/addons/recoil/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"commy2"}; + authorUrl = ""; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" + +#include "CfgMoves.hpp" +#include "CfgRecoils.hpp" + +class CfgCameraShake { + // What does this do, really? It seems like the engine no longer respects it. + defaultCaliberCoefWeaponFire = 0; +}; diff --git a/addons/recoil/functions/fnc_camshake.sqf b/addons/recoil/functions/fnc_camshake.sqf new file mode 100644 index 0000000000..806d48760b --- /dev/null +++ b/addons/recoil/functions/fnc_camshake.sqf @@ -0,0 +1,67 @@ +// TMR: Small Arms - Recoil initialization and functions +// (C) 2013 Ryan Schultz. See LICENSE. +// Edited prefixes for compatability in AGM_Realism by KoffeinFlummi +// Edited by commy2 +#include "script_component.hpp" + +#define BASE_POWER 0.40 +#define BASE_TIME 0.19 +#define BASE_FREQ 13 +#define RECOIL_COEF 40 + +private ["_unit", "_weapon", "_muzzle"]; + +_unit = _this select 0; +_weapon = _this select 1; +_muzzle = _this select 2; + +if (toLower _weapon in ["throw", "put"]) exitWith {}; + +private ["_powerMod", "_timeMod", "_freqMod"]; + +_powerMod = ([0, -0.1, -0.1, 0, -0.2] select (["STAND", "CROUCH", "PRONE", "UNDEFINED", ""] find stance _unit)) + ([0, -1, 0, -1] select (["INTERNAL", "EXTERNAL", "GUNNER", "GROUP"] find cameraView)); +_timeMod = 0; +_freqMod = 0; + +// to get camshake read kickback +private ["_config", "_recoil"]; + +_config = configFile >> "CfgWeapons" >> _weapon; +_recoil = if (_muzzle == _weapon) then { + getText (_config >> "recoil") +} else { + getText (_config >> _muzzle >> "recoil") +}; + +if (isClass (configFile >> "CfgRecoils" >> _recoil)) then { + _recoil = getArray (configFile >> "CfgRecoils" >> _recoil >> "kickBack"); + if (count _recoil < 2) then { + _recoil = [0, 0]; + }; +} else { + _recoil = [0, 0]; +}; + +// parse numbers +_recoil set [0, call compile format ["%1", _recoil select 0]]; +_recoil set [1, call compile format ["%1", _recoil select 1]]; + +private "_powerCoef"; +_powerCoef = RECOIL_COEF * linearConversion [0, 1, random 1, _recoil select 0, _recoil select 1, false]; + +if (isWeaponRested _unit) then {_powerMod = _powerMod - 0.07}; +if (isWeaponDeployed _unit) then {_powerMod = _powerMod - 0.11}; + +private "_camshake"; +_camshake = [ + _powerCoef * (BASE_POWER + _powerMod) max 0, + BASE_TIME + _timeMod max 0, + BASE_FREQ + _freqMod max 0 +]; + +/* + systemChat str _camshake; + copyToClipboard format ["addCamShake %1;", _camshake]; +*/ + +addCamShake _camshake; diff --git a/addons/recoil/functions/script_component.hpp b/addons/recoil/functions/script_component.hpp new file mode 100644 index 0000000000..24cb1ba776 --- /dev/null +++ b/addons/recoil/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\recoil\script_component.hpp" \ No newline at end of file diff --git a/addons/recoil/script_component.hpp b/addons/recoil/script_component.hpp new file mode 100644 index 0000000000..b5a74ec8dd --- /dev/null +++ b/addons/recoil/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT recoil +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_RECOIL + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_RECOIL + #define DEBUG_SETTINGS DEBUG_ENABLED_RECOIL +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/reload/CfgActions.hpp b/addons/reload/CfgActions.hpp index bdef8adf28..a76be64ba3 100644 --- a/addons/reload/CfgActions.hpp +++ b/addons/reload/CfgActions.hpp @@ -1,4 +1,3 @@ - class CfgActions { class LoadMagazine; class LoadEmptyMagazine : LoadMagazine { diff --git a/addons/reload/CfgEventHandlers.hpp b/addons/reload/CfgEventHandlers.hpp index c93f74e0bd..75c2280e24 100644 --- a/addons/reload/CfgEventHandlers.hpp +++ b/addons/reload/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); diff --git a/addons/reload/CfgVehicles.hpp b/addons/reload/CfgVehicles.hpp index 84333a1a09..b6bd212015 100644 --- a/addons/reload/CfgVehicles.hpp +++ b/addons/reload/CfgVehicles.hpp @@ -3,13 +3,13 @@ class CfgVehicles { class CAManBase: Man { class ACE_Actions { class ACE_Weapon { - class ACE_LinkBelt { + class GVAR(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 { + class GVAR(CheckAmmo) { displayName = "$STR_ACE_Reload_checkAmmo"; distance = 2.0; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canCheckAmmo)); @@ -23,7 +23,7 @@ class CfgVehicles { class StaticWeapon: LandVehicle { class ACE_Actions { class ACE_MainActions { - class ACE_CheckAmmo { + class GVAR(CheckAmmo) { displayName = "$STR_ACE_Reload_checkAmmo"; distance = 2.0; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canCheckAmmo)); diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf index faefbe449d..149317c136 100644 --- a/addons/reload/XEH_postInit.sqf +++ b/addons/reload/XEH_postInit.sqf @@ -4,13 +4,12 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", QGVAR(checkAmmo), localize "STR_ACE_Reload_checkAmmo", +["ACE3 Weapons", QGVAR(checkAmmo), localize "STR_ACE_Reload_checkAmmo", { // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, (vehicle ACE_player), ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon) || - {(vehicle ACE_player) isKindOf 'StaticWeapon'}) exitWith {false}; + if !([ACE_player] call EFUNC(common,canUseWeapon) || {(vehicle ACE_player) isKindOf "StaticWeapon"}) exitWith {false}; // Statement [ACE_player] call FUNC(checkAmmo); diff --git a/addons/reload/config.cpp b/addons/reload/config.cpp index 372292de89..02f5014379 100644 --- a/addons/reload/config.cpp +++ b/addons/reload/config.cpp @@ -25,7 +25,7 @@ class CfgPatches { class ACE_Settings { class GVAR(DisplayText) { typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; value = 1; displayName = "$STR_ACE_reload_SettingDisplayTextName"; description = "$STR_ACE_reload_SettingDisplayTextDesc"; diff --git a/addons/reload/functions/fnc_canCheckAmmo.sqf b/addons/reload/functions/fnc_canCheckAmmo.sqf index 63c302bf07..95ac2582a2 100644 --- a/addons/reload/functions/fnc_canCheckAmmo.sqf +++ b/addons/reload/functions/fnc_canCheckAmmo.sqf @@ -7,12 +7,19 @@ * 1: Target * * Return value: - * Can link belt + * Can link belt + * + * Example: + * [player, bob] call ace_reload_fnc_canCheckAmmo + * + * Public: No */ #include "script_component.hpp" EXPLODE_2_PVT(_this,_player,_target); +private ["_magazineType", "_magazineCfg"]; + // Return true for static weapons if they have been fired once, @todo 1.40 this work-around doesn't work anymore if (_target isKindOf "StaticWeapon") exitWith { if (currentMagazine _target != "") exitWith {true}; diff --git a/addons/reload/functions/fnc_checkAmmo.sqf b/addons/reload/functions/fnc_checkAmmo.sqf index a1001890cd..2499a9a893 100644 --- a/addons/reload/functions/fnc_checkAmmo.sqf +++ b/addons/reload/functions/fnc_checkAmmo.sqf @@ -33,8 +33,6 @@ if (count _this > 1) then { if (_unit == _target) then { _unit playActionNow "Gear"; -} else { - _unit playActionNow "PutDown"; }; [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 index 77578caa68..ce08fbd062 100644 --- a/addons/reload/functions/fnc_displayAmmo.sqf +++ b/addons/reload/functions/fnc_displayAmmo.sqf @@ -14,7 +14,7 @@ EXPLODE_1_PVT(_this,_target); -private ["_weapon","_muzzle","_magazine","_showNumber","_ammo","_maxRounds","_count","_text","_color","_picture"]; +private ["_weapon","_muzzle","_magazine","_showNumber","_ammo","_maxRounds","_count","_text","_color","_picture","_ammoBarsStructuredText", "_a", "_loadedName", "_string"]; _weapon = currentWeapon _target; _muzzle = currentMuzzle _target; @@ -22,23 +22,23 @@ _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 (_magazine == "") then { - // Try to get magazine using magazinesAmmoFull - private ["_magazines"]; - _magazines = magazinesAmmoFull _target; - { - if (_x select 2) exitWith { - _magazine = _x select 0; + if (_weapon == "") then { + if (count (weapons _target) == 1) then { + _weapon = (weapons _target) select 0; + _muzzle = _weapon; }; - } forEach _magazines; - }; + }; + + if (_magazine == "") then { + // Try to get magazine using magazinesAmmoFull + private ["_magazines"]; + _magazines = magazinesAmmoFull _target; + { + if (_x select 2) exitWith { + _magazine = _x select 0; + }; + } forEach _magazines; + }; }; if (_magazine == "") exitWith {}; @@ -52,55 +52,56 @@ _count = 0; // not grenade launcher if (_muzzle == _weapon) then { - _maxRounds = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count") max 1; + _maxRounds = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count") max 1; - _ammo = _target ammo _weapon; - if (_maxRounds >= COUNT_BARS) then { - _count = round (COUNT_BARS * _ammo / _maxRounds); + _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; - }; + if (_ammo > 0) then {_count = _count max 1}; + if (_ammo < _maxRounds) then {_count = _count min (COUNT_BARS - 1)}; + } else { + _count = _ammo; + }; -// grenade launcher + // grenade launcher } else { - _showNumber = true; + _showNumber = true; - _count = if (_magazine != "") then { - {_x == _magazine} count (magazines _target + [_magazine]) - } else { - {_x in getArray (configFile >> "CfgWeapons" >> _weapon >> _muzzle >> "Magazines")} count magazines _target - }; + _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] +_ammoBarsStructuredText = if (_showNumber) then { + parseText format ["%1x", _count] } else { - _color = [ - 2 * (1 - _ammo / _maxRounds) min 1, - 2 * _ammo / _maxRounds min 1, - 00 - ]; + _color = [((2 * (1 - _ammo / _maxRounds)) min 1), ((2 * _ammo / _maxRounds) min 1), 0]; - _string = ""; - for "_a" from 1 to _count do { - _string = _string + "|"; - }; - _text = [_string, _color] call EFUNC(common,stringToColoredText); + _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 + "|"; - }; + _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) - ] + 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); +if (_target isKindOf "StaticWeapon") then { + //Vehicle mags (usualy) don't have pictures, so just show the text above ammo count + _loadedName = getText (configFile >> "CfgMagazines" >> _magazine >> "displaynameshort"); + _loadedName = parseText format ["%1", _loadedName]; + _text = composeText [_loadedName, linebreak, _ammoBarsStructuredText]; + [_text] call EFUNC(common,displayTextStructured); +} else { + _picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture"); + [_ammoBarsStructuredText, _picture] call EFUNC(common,displayTextPicture); +}; diff --git a/addons/reload/functions/fnc_startLinkingBelt.sqf b/addons/reload/functions/fnc_startLinkingBelt.sqf index 412fcabb97..8b9145c237 100644 --- a/addons/reload/functions/fnc_startLinkingBelt.sqf +++ b/addons/reload/functions/fnc_startLinkingBelt.sqf @@ -15,7 +15,7 @@ EXPLODE_2_PVT(_this,_player,_target); if (vehicle _target != _target) exitWith {false}; -private ["_magazineCfg","_magazineType"]; +private ["_magazineCfg","_magazineType", "_condition", "_onFailure", "_onFinish"]; _magazineType = currentMagazine _target; _magazineCfg = configFile >> "CfgMagazines" >> _magazineType; if (getNumber (_magazineCfg >> "ACE_isBelt") == 0) exitWith {false}; @@ -54,7 +54,7 @@ _onFinish = { _onFailure = { EXPLODE_3_PVT((_this select 0),_player,_target,_magazine); - [_caller, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); + [_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); // Add back the magazine with the former ammo count _player addMagazine _magazine; diff --git a/addons/reload/stringtable.xml b/addons/reload/stringtable.xml index 9bd4a1ccea..316c7f2236 100644 --- a/addons/reload/stringtable.xml +++ b/addons/reload/stringtable.xml @@ -1,35 +1,41 @@ - + Check ammo on weapon reload Prüfe Munition beim Nachladen - Comprovar munición al recargar el arma + Comprobar munición al recargar el arma Проверять боезапас при перезарядке Zkontrolovat munici při nabití Sprawdź stan amunicji przy przeładowaniu broni Vérification des munitions au rechargement + Lőszer ellenőrzése a fegyver újratöltésekor + Controlla le munizioni ricaricando + Conferir munição ao recarregar a arma Check the ammo in your new magazine on magazine reload. Prüfe nachgeladenes Magazin - Comprueva la munición del nuevo cargador al recargar. + Comprueba la munición del nuevo cargador al recargar. Проверяет количество патронов в новом магазине при перезарядке. Kontroluje munice při nabití nového zásobníku. Pokaż stan amunicji w nowym magazynku przy przeładowaniu broni Vérification du nombre de munition au rechargement + A lőszer ellenőrzése az új tárad behelyezésekor újratöltés közben. + Controlla le munizioni rimanenti nel caricatore in fase di cambio caricatore. + Confere a munição no seu novo carregador ao recarregar a arma Check Ammo Munition prüfen - Verificar munición + Comprobar munición Sprawdź amunicję Vérifier Munitions Lőszerellenőrzés Zkontrolovat Munici Controlla le munizioni Conferir munições - Kонтроль Боеприпасы + Проверить боеприпасы Ammo @@ -51,15 +57,21 @@ Spojit pás munice Podłącz taśmę Gurt anhängen + Töltényheveder összekötése + Attacca la tracolla + Ligar cintos de munição Linking belt... - Attache d'une bande + Attache d'une bande... Enlazando cinta... Сцепка лент ... Spojuji pás... Podłączanie taśmy... Gurt anhängen ... + Töltényheveder összekötése folyamatban... + Attacco la tracolla... + Ligando cintos... diff --git a/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf b/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf index 36772f9dfd..fc802a025c 100644 --- a/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf +++ b/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf @@ -14,12 +14,7 @@ */ #include "script_component.hpp" -private ["_unit", "_weapon", "_magazine"]; - -_unit = _this select 0; -_target = _this select 1; -_weapon = _this select 2; -_magazine = _this select 3; +PARAMS_4(_unit,_target,_weapon,_magazine); _target selectWeapon _weapon; diff --git a/addons/reloadlaunchers/stringtable.xml b/addons/reloadlaunchers/stringtable.xml index ce78dbf102..2585358591 100644 --- a/addons/reloadlaunchers/stringtable.xml +++ b/addons/reloadlaunchers/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -9,24 +9,33 @@ Nabít odpalovač Załaduj wyrzutnię Charger lanceur + Kilövö betöltése + Carica lanciamissili + Recarregar lançador Loading launcher ... - Chargement du lanceur + Chargement du lanceur ... Panzerabwehr wird geladen ... Cargando lanzador ... Зарядка ПУ ... Nabíjím odpalovač ... Ładowanie wyrzutni ... + Kilövő betöltés alatt ... + Carico il lanciamissili ... + Recarregando lançador... Launcher loaded Lanceur chargé Panzerabwehr geladen Lanzador cargado - ПУ заряжено + ПУ заряжена Odpalovač nabit Wyrzutnia załadowana + Kilövő betöltve + Lanciamissili caricato + Lançador Carregado Load %1 @@ -36,6 +45,9 @@ Загрузка %1 Nabít %1 Załadowano %1 + %1 betöltése + Caricato %1 + Recarregar %1 diff --git a/addons/respawn/CfgEventHandlers.hpp b/addons/respawn/CfgEventHandlers.hpp index c4a50615d1..00b6f01cea 100644 --- a/addons/respawn/CfgEventHandlers.hpp +++ b/addons/respawn/CfgEventHandlers.hpp @@ -1,20 +1,75 @@ + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; + class Extended_Killed_EventHandlers { class CAManBase { - class GVAR(HandleGear) { + class ADDON { killed = QUOTE(_this call FUNC(handleKilled)); }; }; }; + class Extended_Respawn_EventHandlers { class CAManBase { - class GVAR(HandleGear) { + class ADDON { respawn = QUOTE(_this call FUNC(handleRespawn)); }; }; }; + +class Extended_Init_EventHandlers { + class ACE_Rallypoint_West { + class ADDON { + init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_nato_CO.paa'; [ARR_3(_this select 0,'',west)] call FUNC(initRallypoint)); + }; + }; + + class ACE_Rallypoint_East { + class ADDON { + init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_CSAT_CO.paa'; [ARR_3(_this select 0,'',east)] call FUNC(initRallypoint)); + }; + }; + + class ACE_Rallypoint_Independent { + class ADDON { + init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_AAF_CO.paa'; [ARR_3(_this select 0,'',independent)] call FUNC(initRallypoint)); + }; + }; + + class ACE_Rallypoint_West_Base { + class ADDON { + init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_nato_CO.paa'; [ARR_3(_this select 0,'respawn_west',west)] call FUNC(initRallypoint)); + }; + }; + + class ACE_Rallypoint_East_Base { + class ADDON { + init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_CSAT_CO.paa'; [ARR_3(_this select 0,'respawn_east',east)] call FUNC(initRallypoint)); + }; + }; + + class ACE_Rallypoint_Independent_Base { + class ADDON { + init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_AAF_CO.paa'; [ARR_3(_this select 0,'respawn_guerrila',independent)] call FUNC(initRallypoint)); //respawn_civilian + }; + }; +}; + +class Extended_InitPost_EventHandlers { + // auto assign rallypoint leader + class CAManBase { + class ADDON { + serverInit = QUOTE(_this call FUNC(handleInitPostServer)); + }; + }; +}; diff --git a/addons/respawn/CfgVehicles.hpp b/addons/respawn/CfgVehicles.hpp index f6b8fc64c2..ddd8f28405 100644 --- a/addons/respawn/CfgVehicles.hpp +++ b/addons/respawn/CfgVehicles.hpp @@ -1,6 +1,6 @@ class CfgVehicles { class Module_F; - class ACE_ModuleRespawn : Module_F { + class ACE_ModuleRespawn: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; displayName = "Respawn System"; @@ -8,20 +8,24 @@ class CfgVehicles { scope = 2; isGlobal = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_Respawn_ca.paa)); + class Arguments { class SavePreDeathGear { displayName = "Save Gear?"; description = "Respawn with the gear a soldier had just before his death?"; typeName = "BOOL"; + class values { class Yes { name = "Yes"; value = 1; }; class No { default = 1; name = "No"; value = 0; }; }; }; + class RemoveDeadBodiesDisconnected { displayName = "Remove bodies?"; description = "Remove player bodies after disconnect?"; typeName = "BOOL"; + class values { class Yes { default = 1; name = "Yes"; value = 1; }; class No { name = "No"; value = 0; }; @@ -30,7 +34,7 @@ class CfgVehicles { }; }; - class ACE_ModuleFriendlyFire : Module_F { + class ACE_ModuleFriendlyFire: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; displayName = "Friendly Fire Messages"; @@ -38,11 +42,11 @@ class CfgVehicles { scope = 2; isGlobal = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_FriendlyFire_ca.paa)); - class Arguments { - }; + + class Arguments {}; }; - class ACE_ModuleRallypoint : Module_F { + class ACE_ModuleRallypoint: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; displayName = "Rallypoint System"; @@ -50,174 +54,8 @@ class CfgVehicles { scope = 2; isGlobal = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_Rallypoint_ca.paa)); - class Arguments { - }; - }; - // rallypoints - class FlagCarrier; - class Flag_NATO_F : FlagCarrier { - class ACE_Actions; - }; - - class Flag_CSAT_F : FlagCarrier { - class ACE_Actions; - }; - - class Flag_AAF_F : FlagCarrier { - class ACE_Actions; - }; - - // static - class ACE_Rallypoint_West : Flag_NATO_F { - author = "$STR_ACE_Common_ACETeam"; - displayName = "Rallypoint West Base"; - vehicleClass = QGVAR(Rallypoints); - - class EventHandlers { - init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_nato_CO.paa'; _this call FUNC(initRallypoint)); - }; - class ACE_Actions : ACE_Actions { - class ACE_MainActions { - distance = 5; - condition = "true"; - selection = ""; - class ACE_Teleport { - displayName = "Teleport to Rallypoint"; - distance = 4; - condition = QUOTE(side group _player == west); - statement = QUOTE([ARR_3(_player, side group _player, false)] call FUNC(teleportToRallypoint)); - showDisabled = 1; - priority = 1; - }; - }; - }; - }; - - class ACE_Rallypoint_East : Flag_CSAT_F { - author = "$STR_ACE_Common_ACETeam"; - displayName = "Rallypoint East Base"; - vehicleClass = QGVAR(Rallypoints); - - class EventHandlers { - init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_CSAT_CO.paa'; _this call FUNC(initRallypoint)); - }; - class ACE_Actions : ACE_Actions { - class ACE_MainActions { - distance = 5; - condition = "true"; - selection = ""; - class ACE_Teleport { - displayName = "Teleport to Rallypoint"; - distance = 4; - condition = QUOTE(side group _player == east); - statement = QUOTE([ARR_3(_player, side group _player, false)] call FUNC(teleportToRallypoint)); - showDisabled = 1; - priority = 1; - }; - }; - }; - }; - - class ACE_Rallypoint_Independent : Flag_AAF_F { - author = "$STR_ACE_Common_ACETeam"; - displayName = "Rallypoint Independent Base"; - vehicleClass = QGVAR(Rallypoints); - - class EventHandlers { - init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_AAF_CO.paa'; _this call FUNC(initRallypoint)); - }; - class ACE_Actions : ACE_Actions { - class ACE_MainActions { - distance = 5; - condition = "true"; - selection = ""; - class ACE_Teleport { - displayName = "Teleport to Rallypoint"; - distance = 4; - condition = QUOTE(side group _player == independent); - statement = QUOTE([ARR_3(_player, side group _player, false)] call FUNC(teleportToRallypoint)); - showDisabled = 1; - priority = 1; - }; - }; - }; - }; - - // moveable - class ACE_RallypointExit_West : Flag_NATO_F { - author = "$STR_ACE_Common_ACETeam"; - displayName = "Rallypoint West"; - vehicleClass = QGVAR(Rallypoints); - - class EventHandlers { - init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_nato_CO.paa'; _this call FUNC(initRallypoint)); - }; - class ACE_Actions : ACE_Actions { - class ACE_MainActions { - distance = 5; - condition = "true"; - selection = ""; - class ACE_Teleport { - displayName = "Teleport to Base"; - distance = 4; - condition = QUOTE(side group _player == west); - statement = QUOTE([ARR_3(_player, side group _player, true)] call FUNC(teleportToRallypoint)); - showDisabled = 1; - priority = 1; - }; - }; - }; - }; - - class ACE_RallypointExit_East : Flag_CSAT_F { - author = "$STR_ACE_Common_ACETeam"; - displayName = "Rallypoint East"; - vehicleClass = QGVAR(Rallypoints); - - class EventHandlers { - init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_CSAT_CO.paa'; _this call FUNC(initRallypoint)); - }; - class ACE_Actions : ACE_Actions { - class ACE_MainActions { - distance = 5; - condition = "true"; - selection = ""; - class ACE_Teleport { - displayName = "Teleport to Base"; - distance = 4; - condition = QUOTE(side group _player == east); - statement = QUOTE([ARR_3(_player, side group _player, true)] call FUNC(teleportToRallypoint)); - showDisabled = 1; - priority = 1; - }; - }; - }; - }; - - class ACE_RallypointExit_Independent : Flag_AAF_F { - author = "$STR_ACE_Common_ACETeam"; - displayName = "Rallypoint Independent"; - vehicleClass = QGVAR(Rallypoints); - - class EventHandlers { - init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_AAF_CO.paa'; _this call FUNC(initRallypoint)); - }; - class ACE_Actions : ACE_Actions { - class ACE_MainActions { - distance = 5; - condition = "true"; - selection = ""; - class ACE_Teleport { - displayName = "Teleport to Base"; - distance = 4; - condition = QUOTE(side group _player == independent); - statement = QUOTE([ARR_3(_player, side group _player, true)] call FUNC(teleportToRallypoint)); - showDisabled = 1; - priority = 1; - }; - }; - }; + class Arguments {}; }; // team leader @@ -233,4 +71,140 @@ class CfgVehicles { }; }; }; + + // rallypoints + class FlagCarrier; + class Flag_NATO_F: FlagCarrier { + class ACE_Actions; + }; + + class Flag_CSAT_F: FlagCarrier { + class ACE_Actions; + }; + + class Flag_AAF_F: FlagCarrier { + class ACE_Actions; + }; + + // static + class ACE_Rallypoint_West_Base: Flag_NATO_F { + XEH_ENABLED; + + author = "$STR_ACE_Common_ACETeam"; + displayName = "$STR_ACE_Respawn_RallypointWestBase"; + vehicleClass = QGVAR(Rallypoints); + + class ACE_Actions: ACE_Actions { + class ACE_Teleport { + displayName = "$STR_ACE_Respawn_TeleportToRallypoint"; + distance = 4; + condition = QUOTE(side group _player == west); + statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_West')] call FUNC(teleportToRallypoint)); + position = "[-0.05,-0.35,-2.6]"; + showDisabled = 1; + priority = 1; + }; + }; + }; + + class ACE_Rallypoint_East_Base: Flag_CSAT_F { + XEH_ENABLED; + + author = "$STR_ACE_Common_ACETeam"; + displayName = "$STR_ACE_Respawn_RallypointEastBase"; + vehicleClass = QGVAR(Rallypoints); + + class ACE_Actions: ACE_Actions { + class ACE_Teleport { + displayName = "$STR_ACE_Respawn_TeleportToRallypoint"; + distance = 4; + condition = QUOTE(side group _player == east); + statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_East')] call FUNC(teleportToRallypoint)); + position = "[-0.05,-0.35,-2.6]"; + showDisabled = 1; + priority = 1; + }; + }; + }; + + class ACE_Rallypoint_Independent_Base: Flag_AAF_F { + XEH_ENABLED; + + author = "$STR_ACE_Common_ACETeam"; + displayName = "$STR_ACE_Respawn_RallypointIndependentBase"; + vehicleClass = QGVAR(Rallypoints); + + class ACE_Actions: ACE_Actions { + class ACE_Teleport { + displayName = "$STR_ACE_Respawn_TeleportToRallypoint"; + distance = 4; + condition = QUOTE(side group _player == independent); + statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_Independent')] call FUNC(teleportToRallypoint)); + position = "[-0.05,-0.35,-2.6]"; + showDisabled = 1; + priority = 1; + }; + }; + }; + + // moveable + class ACE_Rallypoint_West: Flag_NATO_F { + XEH_ENABLED; + + author = "$STR_ACE_Common_ACETeam"; + displayName = "$STR_ACE_Respawn_RallypointWest"; + vehicleClass = QGVAR(Rallypoints); + + class ACE_Actions: ACE_Actions { + class ACE_Teleport { + displayName = "$STR_ACE_Respawn_TeleportToBase"; + distance = 4; + condition = QUOTE(side group _player == west); + statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_West_Base')] call FUNC(teleportToRallypoint)); + position = "[-0.05,-0.35,-2.6]"; + showDisabled = 1; + priority = 1; + }; + }; + }; + + class ACE_Rallypoint_East: Flag_CSAT_F { + XEH_ENABLED; + + author = "$STR_ACE_Common_ACETeam"; + displayName = "$STR_ACE_Respawn_RallypointEast"; + vehicleClass = QGVAR(Rallypoints); + + class ACE_Actions: ACE_Actions { + class ACE_Teleport { + displayName = "$STR_ACE_Respawn_TeleportToBase"; + distance = 4; + condition = QUOTE(side group _player == east); + statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_East_Base')] call FUNC(teleportToRallypoint)); + position = "[-0.05,-0.35,-2.6]"; + showDisabled = 1; + priority = 1; + }; + }; + }; + + class ACE_Rallypoint_Independent: Flag_AAF_F { + XEH_ENABLED; + + author = "$STR_ACE_Common_ACETeam"; + displayName = "$STR_ACE_Respawn_RallypointIndependent"; + vehicleClass = QGVAR(Rallypoints); + + class ACE_Actions: ACE_Actions { + class ACE_Teleport { + displayName = "$STR_ACE_Respawn_TeleportToBase"; + distance = 4; + condition = QUOTE(side group _player == independent); + statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_Independent_Base')] call FUNC(teleportToRallypoint)); + position = "[-0.05,-0.35,-2.6]"; + showDisabled = 1; + priority = 1; + }; + }; + }; }; diff --git a/addons/respawn/XEH_postInit.sqf b/addons/respawn/XEH_postInit.sqf new file mode 100644 index 0000000000..ada5765e86 --- /dev/null +++ b/addons/respawn/XEH_postInit.sqf @@ -0,0 +1,5 @@ +// by commy2 +#include "script_component.hpp" + +["rallypointMoved", {_this call FUNC(updateRallypoint)}] call EFUNC(common,addEventhandler); +["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); // hide enemy rallypoint markers diff --git a/addons/respawn/XEH_preInit.sqf b/addons/respawn/XEH_preInit.sqf index f57e1f3714..dd116f108c 100644 --- a/addons/respawn/XEH_preInit.sqf +++ b/addons/respawn/XEH_preInit.sqf @@ -4,7 +4,9 @@ ADDON = false; PREP(canMoveRallypoint); PREP(handleKilled); +PREP(handlePlayerChanged); PREP(handleRespawn); +PREP(handleInitPostServer); PREP(initRallypoint); PREP(module); PREP(moduleFriendlyFire); @@ -15,5 +17,6 @@ PREP(removeDisconnectedPlayer); PREP(restoreGear); PREP(showFriendlyFireMessage); PREP(teleportToRallypoint); +PREP(updateRallypoint); ADDON = true; diff --git a/addons/respawn/functions/fnc_handleInitPostServer.sqf b/addons/respawn/functions/fnc_handleInitPostServer.sqf new file mode 100644 index 0000000000..914334cc25 --- /dev/null +++ b/addons/respawn/functions/fnc_handleInitPostServer.sqf @@ -0,0 +1,52 @@ +// by commy2 +// execute on server only! +#include "script_component.hpp" + +PARAMS_1(_unit); + +private ["_group0", "_rallypoint"]; + +_group0 = group _unit; // _group-is a reserved veriable and shouldn't be used + +_rallypoint = [ + objNull, + missionNamespace getVariable ["ACE_Rallypoint_West", objNull], + missionNamespace getVariable ["ACE_Rallypoint_East", objNull], + missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull] +] select ([west, east, independent] find side _group0) + 1; + +// exit if no moveable rallypoint is placed for that side +if (isNull _rallypoint) exitWith {}; + +// find leader +private "_leaderVarName"; +_leaderVarName = _group0 getVariable [QGVAR(leaderVarName), ""]; + +// exit if group already has a playable slot assigned as rallypoint leader +if (_leaderVarName != "") exitWith { + // assign JIP unit as rallypoint leader + if (str _unit == _leaderVarName) then { + _unit setVariable ["ACE_canMoveRallypoint", true, true]; + }; +}; + +// treat group leader +_unit = leader _group0; + +_leaderVarName = vehicleVarName _unit; + +if (_leaderVarName == "") then { + private "_leaderID"; + _leaderID = GETGVAR(NextLeaderID,0); + + _leaderVarName = format [QUOTE(ACE_Rallypoint_Leader_%1), _leaderID]; + + _unit setVehicleVarName _leaderVarName; + + GVAR(NextLeaderID) = _leaderID + 1; +}; + +// prevent group from getting multiple leaders; use this to assign rallypoint moving ability on JIP +_group0 setVariable [QGVAR(leaderVarName), _leaderVarName]; + +_unit setVariable ["ACE_canMoveRallypoint", true, true]; diff --git a/addons/respawn/functions/fnc_handleKilled.sqf b/addons/respawn/functions/fnc_handleKilled.sqf index c3ab0aebf3..199495d75d 100644 --- a/addons/respawn/functions/fnc_handleKilled.sqf +++ b/addons/respawn/functions/fnc_handleKilled.sqf @@ -29,5 +29,5 @@ if (GVAR(SavePreDeathGear)) then { }; if (missionNamespace getVariable [QGVAR(showFriendlyFireMessage), false]) then { - [_this, FUNC(showFriendlyFireMessage), 2] call EFUNC(common,execRemoteFnc); + [_this, QUOTE(DFUNC(showFriendlyFireMessage)), 2] call EFUNC(common,execRemoteFnc); }; diff --git a/addons/respawn/functions/fnc_handlePlayerChanged.sqf b/addons/respawn/functions/fnc_handlePlayerChanged.sqf new file mode 100644 index 0000000000..db699066bc --- /dev/null +++ b/addons/respawn/functions/fnc_handlePlayerChanged.sqf @@ -0,0 +1,44 @@ +// by commy2 +#include "script_component.hpp" + +private "_newUnit"; + +_newUnit = _this select 0; + +switch (side group _newUnit) do { + case (west): { + ((missionNamespace getVariable ["ACE_Rallypoint_West", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; + ((missionNamespace getVariable ["ACE_Rallypoint_East", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + ((missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + ((missionNamespace getVariable ["ACE_Rallypoint_West_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; + ((missionNamespace getVariable ["ACE_Rallypoint_East_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + ((missionNamespace getVariable ["ACE_Rallypoint_Independent_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + }; + + case (east): { + ((missionNamespace getVariable ["ACE_Rallypoint_West", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + ((missionNamespace getVariable ["ACE_Rallypoint_East", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; + ((missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + ((missionNamespace getVariable ["ACE_Rallypoint_West_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + ((missionNamespace getVariable ["ACE_Rallypoint_East_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; + ((missionNamespace getVariable ["ACE_Rallypoint_Independent_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + }; + + case (independent): { + ((missionNamespace getVariable ["ACE_Rallypoint_West", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + ((missionNamespace getVariable ["ACE_Rallypoint_East", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + ((missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; + ((missionNamespace getVariable ["ACE_Rallypoint_West_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + ((missionNamespace getVariable ["ACE_Rallypoint_East_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + ((missionNamespace getVariable ["ACE_Rallypoint_Independent_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; + }; + + default { + ((missionNamespace getVariable ["ACE_Rallypoint_West", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + ((missionNamespace getVariable ["ACE_Rallypoint_East", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + ((missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + ((missionNamespace getVariable ["ACE_Rallypoint_West_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + ((missionNamespace getVariable ["ACE_Rallypoint_East_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + ((missionNamespace getVariable ["ACE_Rallypoint_Independent_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; + }; +}; diff --git a/addons/respawn/functions/fnc_handleRespawn.sqf b/addons/respawn/functions/fnc_handleRespawn.sqf index a9fe3293ac..33a0ec09e5 100644 --- a/addons/respawn/functions/fnc_handleRespawn.sqf +++ b/addons/respawn/functions/fnc_handleRespawn.sqf @@ -25,3 +25,8 @@ _respawnedUnit = _this select 0; if (GVAR(SavePreDeathGear)) then { [_respawnedUnit, GVAR(unitGear)] call FUNC(restoreGear); }; + +// fix for setVariable public being lost on respawn for machines that JIP after the command was broadcasted +if (_respawnedUnit getVariable ["ACE_canMoveRallypoint", false]) then { + _respawnedUnit setVariable ["ACE_canMoveRallypoint", true, true]; +}; diff --git a/addons/respawn/functions/fnc_initRallypoint.sqf b/addons/respawn/functions/fnc_initRallypoint.sqf index cb4d55146f..2ef158a419 100644 --- a/addons/respawn/functions/fnc_initRallypoint.sqf +++ b/addons/respawn/functions/fnc_initRallypoint.sqf @@ -16,17 +16,53 @@ #include "script_component.hpp" -private ["_rallypoint", "_name"]; - -_rallypoint = _this select 0; - -if (!local _rallypoint) exitWith {}; +PARAMS_3(_rallypoint,_respawnMarker,_side); +private "_name"; _name = typeOf _rallypoint; +// init visible marker +if (hasInterface) then { + // fix init having wrong position, vars etc. + [_rallypoint, _respawnMarker, _side, _name] spawn { + PARAMS_4(_rallypoint,_respawnMarker,_side,_name); + + private ["_marker", "_type"]; + + _marker = format ["ACE_Marker_%1", _name]; + + // exit if it already exist + if (_marker in allMapMarkers) exitWith {}; + + _marker = createMarkerLocal [_marker, getPosASL _rallypoint]; + _type = ["selector_selectedFriendly", "selector_selectedEnemy"] select (_respawnMarker == ""); + + _marker setMarkerTypeLocal _type; + _marker setMarkerAlphaLocal ([0,1] select (_side == playerSide)); // playerSide to guarantee init + + private "_markerDate"; + _markerDate = _rallypoint getVariable [QGVAR(markerDate), ""]; + + _marker setMarkerTextLocal _markerDate; + + _rallypoint setVariable [QGVAR(marker), _marker]; + }; +}; + +if (!isServer) exitWith {}; + if (isNil _name) then { missionNamespace setVariable [_name, _rallypoint]; publicVariable _name; + + _rallypoint setVariable [QGVAR(side), _side, true]; + + if (_respawnMarker != "" && {!(_respawnMarker in allMapMarkers)}) then { + createMarker [_respawnMarker, _rallypoint]; + }; + + ["rallypointMoved", [_rallypoint, _side]] call EFUNC(common,globalEvent); + } else { deleteVehicle _rallypoint; diag_log text "[ACE] Respawn: ERROR Multiple Rallypoints of same type."; diff --git a/addons/respawn/functions/fnc_module.sqf b/addons/respawn/functions/fnc_module.sqf index 6d03c1eda3..3f1ef89a1f 100644 --- a/addons/respawn/functions/fnc_module.sqf +++ b/addons/respawn/functions/fnc_module.sqf @@ -1,27 +1,26 @@ /* - Name: ACE_Respawn_fnc_module + Name: ACE_Respawn_fnc_module - Author(s): - KoffeinFlummi, bux578, esteldunedain, commy2 + Author(s): + KoffeinFlummi, bux578, esteldunedain, commy2 - Description: - initializes the respawn module + Description: + initializes the respawn module - Parameters: - 0: OBJECT - logic - 1: ARRAY - synced units - 2: BOOLEAN - activated + Parameters: + 0: OBJECT - logic + 1: ARRAY - synced units + 2: BOOLEAN - activated - Returns: - VOID + Returns: + VOID */ #include "script_component.hpp" -if !(isServer) exitWith {}; +PARAMS_3(_logic,_units,_activated); -_logic = _this select 0; -_activated = _this select 2; +if !(isServer) exitWith {}; if !(_activated) exitWith {}; @@ -32,20 +31,17 @@ GVAR(Module) = true; if (isServer) then { if (GVAR(RemoveDeadBodiesDisconnected)) then { - _fnc_deleteDisconnected = { - _this spawn { - _unit = _this select 0; - - sleep 4; + addMissionEventHandler ["HandleDisconnect", { + [{ + PARAMS_1(_unit); if (!alive _unit) then { deleteVehicle _unit; }; - }; + }, + _this, 4, 1] call EFUNC(common,waitAndExecute); false - }; - - addMissionEventHandler ["HandleDisconnect", _fnc_deleteDisconnected]; + }]; }; }; diff --git a/addons/respawn/functions/fnc_moduleFriendlyFire.sqf b/addons/respawn/functions/fnc_moduleFriendlyFire.sqf index 35857b43e4..7641db806d 100644 --- a/addons/respawn/functions/fnc_moduleFriendlyFire.sqf +++ b/addons/respawn/functions/fnc_moduleFriendlyFire.sqf @@ -19,17 +19,13 @@ #include "script_component.hpp" _this spawn { - _logic = _this select 0; - _units = _this select 1; - _activated = _this select 2; + PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; if (isServer) then { - _varName = QGVAR(showFriendlyFireMessage); - - missionNamespace setVariable [_varName, true]; - publicVariable _varName; + missionNamespace setVariable [QGVAR(showFriendlyFireMessage), true]; + publicVariable QGVAR(showFriendlyFireMessage); }; diag_log text "[ACE]: Friendly Fire Messages Module Initialized."; diff --git a/addons/respawn/functions/fnc_moduleRallypoint.sqf b/addons/respawn/functions/fnc_moduleRallypoint.sqf index 1646fa72da..15c415027d 100644 --- a/addons/respawn/functions/fnc_moduleRallypoint.sqf +++ b/addons/respawn/functions/fnc_moduleRallypoint.sqf @@ -16,11 +16,9 @@ VOID */ - #include "script_component.hpp" - -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +#include "script_component.hpp" + +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; diff --git a/addons/respawn/functions/fnc_moveRallypoint.sqf b/addons/respawn/functions/fnc_moveRallypoint.sqf index dcd4810844..da9054e6aa 100644 --- a/addons/respawn/functions/fnc_moveRallypoint.sqf +++ b/addons/respawn/functions/fnc_moveRallypoint.sqf @@ -1,54 +1,58 @@ /* - Name: ACE_Respawn_fnc_moveRallypoint - - Author(s): - commy2 - - Description: - Moves a rallypoint to the player's location - - Parameters: - 0: OBJECT - unit - 1: OBJECT - side - - Returns: - VOID + Name: ACE_Respawn_fnc_moveRallypoint + + Author(s): + commy2 + + Description: + Moves a rallypoint to the player's location + + Parameters: + 0: OBJECT - unit + 1: OBJECT - side + + Returns: + VOID */ #include "script_component.hpp" -_this spawn { - _unit = _this select 0; - _side = _this select 1; +PARAMS_2(_unit,_side); - // rallypoint names are defined in CfgVehicles.hpp +private ["_rallypoint", "_position"]; - _rallypoint = [ - objNull, - missionNamespace getVariable ["ACE_Rallypoint_West", objNull], - missionNamespace getVariable ["ACE_RallypointExit_East", objNull], - missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull] - ] select ([west, east, independent] find _side) + 1; +// rallypoint names are defined in CfgVehicles.hpp - if (isNull _rallypoint) exitWith {}; +_rallypoint = [ + objNull, + missionNamespace getVariable ["ACE_Rallypoint_West", objNull], + missionNamespace getVariable ["ACE_RallypointExit_East", objNull], + missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull] +] select ([west, east, independent] find _side) + 1; - _position = getPosATL _unit; - _position = _position findEmptyPosition [0, 2, typeOf _rallypoint]; - if (count _position == 0) then {_position = getPosATL _unit}; +if (isNull _rallypoint) exitWith {}; - _position set [2, 0]; +_position = getPosATL _unit; +_position = _position findEmptyPosition [0, 2, typeOf _rallypoint]; +if (count _position == 0) then {_position = getPosATL _unit}; - [localize "STR_ACE_Respawn_Deploy"] call EFUNC(common,displayTextStructured); +_position set [2, 0]; + +[localize "STR_ACE_Respawn_Deploy"] call EFUNC(common,displayTextStructured); + +[{ + _rallypoint = _this select 0; + _unit = _this select 1; + _position = _this select 2; + _rallypoint = _this select 3; - sleep 5; _rallypoint setPosATL _position; _unit reveal _rallypoint; - /* - _marker = format ["AGM_RallyPoint_%1", _side]; - _marker setMarkerPos _position; - _marker setMarkerTextLocal format ["%1:%2", [date select 3, 2, 0] call CBA_fnc_FORMATNumber, [date select 4, 2, 0] call CBA_fnc_FORMATNumber]; - */ + _rallypoint setVariable [QGVAR(markerDate), format ["%1:%2", date select 3, date select 4], true]; - [localize "STR_ACE_Respawn_Deploy"] call EFUNC(common,displayTextStructured); -}; + ["rallypointMoved", [_rallypoint, _side, _position]] call EFUNC(common,globalEvent); + + [localize "STR_ACE_Respawn_Deployed"] call EFUNC(common,displayTextStructured); +}, +[_rallypoint, _unit, _position, _rallypoint], 5, 1] call EFUNC(common,waitAndExecute); diff --git a/addons/respawn/functions/fnc_removeBody.sqf b/addons/respawn/functions/fnc_removeBody.sqf index 5c3ed14988..e00f633e6c 100644 --- a/addons/respawn/functions/fnc_removeBody.sqf +++ b/addons/respawn/functions/fnc_removeBody.sqf @@ -1,22 +1,22 @@ /* Name: ACE_Respawn_fnc_removeBody - + Author(s): bux578 - + Description: removes a given body - + Parameters: 0: OBJECT - body 1: BOOLEAN - forceRemove // not used atm - + Returns: VOID */ #include "script_component.hpp" - + private ["_body", "_forceRemove", "_bodyRemoveTimer"]; _body = _this select 0; @@ -29,9 +29,8 @@ if (_forceRemove) then { _bodyRemoveTimer = 2; }; -[_body, _bodyRemoveTimer] spawn { - sleep (_this select 1); +[{ // hideBody takes ~20s till body is fully underground // a better hideBody would make this more aesthetic - deleteVehicle (_this select 0); -}; + deleteVehicle _this; +}, _body, _bodyRemoveTimer, 1] call EFUNC(common,waitAndExecute); diff --git a/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf b/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf index 492cd990a4..7bd0a6707f 100644 --- a/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf +++ b/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_forceRemove", "_body"]; +private ["_forceRemove", "_body", "_uid"]; _forceRemove = _this select 0; diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index 18afba344b..85863bb6c2 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -17,11 +17,10 @@ #include "script_component.hpp" -private ["_unit", "_allGear", "_headgear", "_goggles", "_uniform", "_uniformitems", "_vest", "_vestitems", "_backpack", "_backpackitems", "_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine", "_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine", "_assigneditems", "_binocular"]; +PARAMS_2(_unit,_allGear); +private ["_unit", "_allGear", "_headgear", "_goggles", "_uniform", "_uniformitems", "_vest", "_vestitems", "_backpack", "_backpackitems", "_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine", "_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine", "_assigneditems", "_binocular", "_backpa", "_secondaryweapon", "_secondaryweaponitems", "_secondaryweaponmagazine"]; -_unit = _this select 0; -_allGear = _this select 1; // remove all starting gear of a player removeAllWeapons _unit; @@ -76,6 +75,8 @@ if (_goggles != "") then { _unit addItemToVest _x; }forEach _vestitems; +private "_flagRemoveDummyBag"; +_flagRemoveDummyBag = false; if(format["%1", _backpack] != "") then { _unit addBackpack _backpack; @@ -87,6 +88,12 @@ if(format["%1", _backpack] != "") then { { _unit addItemToBackpack _x; } forEach _backpackitems; + +} else { + // dummy backpack to ensure mags being loaded + _unit addBackpack "B_Kitbag_Base"; + + _flagRemoveDummyBag = true; }; @@ -138,6 +145,12 @@ if (_handgunweapon != "") then { }; +// remove dummy bagpack +if (_flagRemoveDummyBag) then { + removeBackpack _unit; +}; + + _assignedItems = _assignedItems - [_binocular]; // items diff --git a/addons/respawn/functions/fnc_teleportToRallypoint.sqf b/addons/respawn/functions/fnc_teleportToRallypoint.sqf index 8d898441ee..dc3cc16b92 100644 --- a/addons/respawn/functions/fnc_teleportToRallypoint.sqf +++ b/addons/respawn/functions/fnc_teleportToRallypoint.sqf @@ -1,47 +1,34 @@ /* - Name: ACE_Respawn_fnc_teleportToRallypoint - - Author(s): - commy2 - - Description: - teleports a unit to a rallypoint - - Parameters: - 0: OBJECT - unit - 1: OBJECT - side - 2: BOOLEAN - teleport to base - - Returns: - VOID -*/ - + * Author: commy2 + * teleports a unit to a rallypoint + * + * Arguments: + * 0: unit + * 1: side? + * 2: teleport to base + * + * Return Value: + * Nothing + * + * Example: + * [,,] call ACE_Respawn_fnc_teleportToRallypoint; + * + * Public: No + */ #include "script_component.hpp" -private ["_unit", "_side", "_toBase", "_rallypoint"]; +PARAMS_3(_unit,_side,_rallypoint); -_unit = _this select 0; -_side = _this select 1; -_toBase = _this select 2; +private ["_toBase"]; // rallypoint names are defined in CfgVehicles.hpp -_rallypoint = ([ - [ - objNull, - missionNamespace getVariable ["ACE_RallypointExit_West", objNull], - missionNamespace getVariable ["ACE_RallypointExit_East", objNull], - missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull] - ], - [ - objNull, - missionNamespace getVariable ["ACE_Rallypoint_West", objNull], - missionNamespace getVariable ["ACE_Rallypoint_East", objNull], - missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull] - ] -] select _toBase) select ([west, east, independent] find _side) + 1; +//IGNORE_PRIVATE_WARNING("_Base") +_toBase = _rallypoint find "_Base" != -1; + +_rallypoint = missionNamespace getVariable [_rallypoint, objNull], if (isNull _rallypoint) exitWith {}; -_unit setPosASL (getPosASL _rallypoint); +_unit setPosASL getPosASL _rallypoint; [[localize "STR_ACE_Respawn_TeleportedToRallypoint", localize "STR_ACE_Respawn_TeleportedToBase"] select _toBase] call EFUNC(common,displayTextStructured); diff --git a/addons/respawn/functions/fnc_updateRallypoint.sqf b/addons/respawn/functions/fnc_updateRallypoint.sqf new file mode 100644 index 0000000000..248955155a --- /dev/null +++ b/addons/respawn/functions/fnc_updateRallypoint.sqf @@ -0,0 +1,18 @@ +// by commy2 +#include "script_component.hpp" + +private ["_rallypoint", "_side", "_position"]; + +_rallypoint = _this select 0; +_side = _this select 1; +_position = _this select 2; + +if (!hasInterface) exitWith {}; + +private ["_marker", "_markerDate"]; + +_marker = _rallypoint getVariable [QGVAR(marker), ""]; +_markerDate = _rallypoint getVariable [QGVAR(markerDate), ""]; + +_marker setMarkerPosLocal _position; +_marker setMarkerTextLocal _markerDate; diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml index 2aa4360275..4106ad340c 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -1,23 +1,47 @@ - + Deploy in 5 seconds ... Déploiement dans 5 secondes ... Wird in 5 Sekunden errichtet ... - Desplegando en 5 segundos ... + Despliegue en 5 segundos ... Возрождение через 5 секунд ... Rozmieszczenie za 5 sekund ... Respawn za 5 sekund... + Kihelyezés 5 másodperc múlva ... + Dispiegamento in 5 secondi ... + Será posicionado em 5 segundos ... Rallypoint deployed Point de ralliement déployé - Rallypoint errichtet + Sammelpunkt errichtet Punto de reunión desplegado Точка сбора установлена Punkt zbiórki rozmieszczony Rallypoint umístěn + Gyülekezőpont elhelyezve + Rallypoint dispiegato + Rallypoints posicionado + + + Teleport to Base + Teleportovat na Základnu + Zur Basis teleportieren + Treletransportar a Base + Teleport do bazy + Телепортироваться на базу + Téléportation à la base + + + Teleport to Rallypoint + Teleport na Rallypoint + Teletransportar a Punto de reunión + Zum Sammelpunkt teleportieren + Teleport do punktu zbiórki + Телепортироваться на точку сбора + Téléporation au point de ralliement Teleported to Base @@ -26,16 +50,88 @@ Teletransportado a base Телепорт на базу Przeteleportowano do bazy - Odteleportován na základnu + Teleportován na základnu + Bázisra teleportálva + Teleportato alla base + Teletransportado para a Base Teleported to Rallypoint Téléporté au point de déploiement - Zum Rallypoint teleportiert + Zum Sammelpunkt teleportiert Teletransportado al punto de reunión Телепорт на точку сбора Przeteleportowano do punktu zbiórki - Odteleportován na rallypoint + Teleportován na rallypoint + Gyülekezőpontra teleportálva + Teleportato al rallypoint + Teletransportado para o Rallypoints + + + Rallypoint West (Base) + Sammelpunkt West (Basis) + Punto de reunión Oeste (Base) + Точка сбора Синих (База) + Punkt zbiórki Zachodu (Baza) + Point de ralliement OUEST (Base) + Rallypoint West (Base) + Gyülekezőpont, Nyugat (Bázis) + Rallypoint Západ (Základna) + + + Rallypoint East (Base) + Sammelpunkt Ost (Basis) + Punto de reunión Este (Base) + Точка сбора Красных (База) + Punkt zbiórki Wschodu (Baza) + Point de ralliement EST (Base) + Rallypoint East (Base) + Gyülekezőpont, Kelet (Bázis) + Ralllypoint Východ (Základna) + + + Rallypoint Independent (Base) + Sammelpunkt Widerstand (Basis) + Punto de reunión Independiente (Base) + Точка сбора Независимых (База) + Punkt zbiórki Ruchu oporu (Baza) + Point de ralliement Indépendant (Base) + Rallypoint Independent (Base) + Gyülekezőpont, Független (Bázis) + Rallypoint Nezávislý (Základna) + + + Rallypoint West + Sammelpunkt West + Punto de reunión Oeste + Точка сбора Синих + Punkt zbiórki Zachodu + Point de ralliement OUEST + Rallypoint West + Gyülekezőpont, Nyugat + Rallypoint Západ + + + Rallypoint East + Sammelpunkt Ost + Punto de reunión Este + Точка сбора Красных + Punkt zbiórki Wschodu + Point de ralliement EST + Rallypoint East + Gyülekezőpont, Kelet + Rallypoint Východ + + + Rallypoint Independent + Sammelpunkt Widerstand + Punto de reunión Independiente + Точка сбора Независимых + Punkt zbiórki Ruchu oporu + Point de ralliement Indépendant + Rallypoint Independent + Gyülekezőpont, Független + Rallypoint Nezávislý diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index aa13029547..9c3d989425 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -3,12 +3,13 @@ if (!hasInterface) exitWith {}; +// IGNORE_PRIVATE_WARNING(_player) //["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" // Add keybinds -["ACE3", QGVAR(safeMode), localize "STR_ACE_SafeMode_SafeMode", +["ACE3 Weapons", QGVAR(safeMode), localize "STR_ACE_SafeMode_SafeMode", { // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/safemode/stringtable.xml b/addons/safemode/stringtable.xml index 49cd237afd..f39ca84614 100644 --- a/addons/safemode/stringtable.xml +++ b/addons/safemode/stringtable.xml @@ -7,9 +7,11 @@ Seguro puesto Bezpiecznik Pojistka - Veszélytelenités + Biztonságos mód Предохранитель Sécurité + Sicura inserita + Modo de segurança Take off Safety @@ -17,19 +19,23 @@ Quitar seguro Zwolnij bezpiecznik Uvolnit pojistku - Veszélyesités + Biztonsági kapcsoló eltolása Снять с предохранителя Enlever sécurité + Togli la sicura + Tirar segurança Put on Safety Waffe gesichert Poner seguro - Zabezpiecz broń + Zabezpieczono broń Přepnout pojistku - Veszélytelenitve + Biztonsági kapcsoló helyretolása Поставить на предохранитель Sécurité mise + Inserisci la sicura + Colocar Segurança Took off Safety @@ -37,9 +43,11 @@ Seguro quitado Odbezpieczono broń Odstranit pojistku - veszélyes + Biztonságos mód megszüntetve Снят с предохранителя Sécurité enlevée + Togli la sicura + Tirou Segurança diff --git a/addons/scopes/CfgWeapons.hpp b/addons/scopes/CfgWeapons.hpp index 6ca522ced7..526282a1b6 100644 --- a/addons/scopes/CfgWeapons.hpp +++ b/addons/scopes/CfgWeapons.hpp @@ -71,4 +71,18 @@ class CfgWeapons { }; }; }; + + class optic_KHS_old : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class KHS { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; }; diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index ca4017222a..d7affc0534 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -33,20 +33,20 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", QGVAR(AdjustUpMinor), localize "STR_ACE_Scopes_AdjustUpMinor", +["ACE3 Scope Adjustment", QGVAR(AdjustUpMinor), localize "STR_ACE_Scopes_AdjustUpMinor", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific [ACE_player] call FUNC(inventoryCheck); - + // Statement [ACE_player, ELEVATION_UP, MINOR_INCREMENT] call FUNC(adjustScope); }, {false}, [201, [false, false, false]], true] call cba_fnc_addKeybind; -["ACE3", QGVAR(AdjustDownMinor), localize "STR_ACE_Scopes_AdjustDownMinor", +["ACE3 Scope Adjustment", QGVAR(AdjustDownMinor), localize "STR_ACE_Scopes_AdjustDownMinor", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -59,7 +59,7 @@ if !(hasInterface) exitWith {}; {false}, [209, [false, false, false]], true] call cba_fnc_addKeybind; -["ACE3", QGVAR(AdjustLeftMinor), localize "STR_ACE_Scopes_AdjustLeftMinor", +["ACE3 Scope Adjustment", QGVAR(AdjustLeftMinor), localize "STR_ACE_Scopes_AdjustLeftMinor", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -72,7 +72,7 @@ if !(hasInterface) exitWith {}; {false}, [209, [false, true, false]], true] call cba_fnc_addKeybind; -["ACE3", QGVAR(AdjustRightMinor), localize "STR_ACE_Scopes_AdjustRightMinor", +["ACE3 Scope Adjustment", QGVAR(AdjustRightMinor), localize "STR_ACE_Scopes_AdjustRightMinor", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -85,7 +85,7 @@ if !(hasInterface) exitWith {}; {false}, [201, [false, true, false]], true] call cba_fnc_addKeybind; -["ACE3", QGVAR(AdjustUpMajor), localize "STR_ACE_Scopes_AdjustUpMajor", +["ACE3 Scope Adjustment", QGVAR(AdjustUpMajor), localize "STR_ACE_Scopes_AdjustUpMajor", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -98,7 +98,7 @@ if !(hasInterface) exitWith {}; {false}, [201, [true, false, false]], true] call cba_fnc_addKeybind; -["ACE3", QGVAR(AdjustDownMajor), localize "STR_ACE_Scopes_AdjustDownMajor", +["ACE3 Scope Adjustment", QGVAR(AdjustDownMajor), localize "STR_ACE_Scopes_AdjustDownMajor", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -111,7 +111,7 @@ if !(hasInterface) exitWith {}; {false}, [209, [true, false, false]], true] call cba_fnc_addKeybind; -["ACE3", QGVAR(AdjustLeftMajor), localize "STR_ACE_Scopes_AdjustLeftMajor", +["ACE3 Scope Adjustment", QGVAR(AdjustLeftMajor), localize "STR_ACE_Scopes_AdjustLeftMajor", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -124,7 +124,7 @@ if !(hasInterface) exitWith {}; {false}, [209, [true, true, false]], true] call cba_fnc_addKeybind; -["ACE3", QGVAR(AdjustRightMajor), localize "STR_ACE_Scopes_AdjustRightMajor", +["ACE3 Scope Adjustment", QGVAR(AdjustRightMajor), localize "STR_ACE_Scopes_AdjustRightMajor", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/scopes/functions/fnc_adjustScope.sqf b/addons/scopes/functions/fnc_adjustScope.sqf index 76c62a4688..31b85f309e 100644 --- a/addons/scopes/functions/fnc_adjustScope.sqf +++ b/addons/scopes/functions/fnc_adjustScope.sqf @@ -14,11 +14,12 @@ */ #include "script_component.hpp" -if !(vehicle _unit == _unit) exitWith {false}; +PARAMS_3(_unit,_turretAndDirection,_majorStep); -private ["_unit", "_turretAndDirection", "_majorStep", "_weaponIndex", "_zeroing", "_optic", "_increment", "_maxVertical", "_maxHorizontal", "_elevation", "_windage", "_zero"]; +if (!(_unit isKindOf "Man")) exitWith {false}; +if (currentMuzzle _unit != currentWeapon _unit) exitWith {false}; -EXPLODE_3_PVT(_this,_unit,_turretAndDirection,_majorStep); +private ["_weaponIndex", "_zeroing", "_optic", "_increment", "_maxVertical", "_maxHorizontal", "_elevation", "_windage", "_zero", "_adjustment"]; _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; @@ -37,7 +38,7 @@ _increment = getNumber (configFile >> "CfgWeapons" >> _optic >> "ACE_ScopeAdjust _maxVertical = getArray (configFile >> "CfgWeapons" >> _optic >> "ACE_ScopeAdjust_Vertical"); _maxHorizontal = getArray (configFile >> "CfgWeapons" >> _optic >> "ACE_ScopeAdjust_Horizontal"); -if ((count _maxHorizontal < 2) or (count _maxVertical < 2)) exitWith {false}; +if ((_increment == 0) or (count _maxHorizontal < 2) or (count _maxVertical < 2)) exitWith {false}; _zeroing = _adjustment select _weaponIndex; _elevation = _zeroing select 0; diff --git a/addons/scopes/functions/fnc_adjustZero.sqf b/addons/scopes/functions/fnc_adjustZero.sqf index 4dbab48f49..12e911b537 100644 --- a/addons/scopes/functions/fnc_adjustZero.sqf +++ b/addons/scopes/functions/fnc_adjustZero.sqf @@ -12,10 +12,11 @@ */ #include "script_component.hpp" -if !(vehicle _unit == _unit) exitWith {false}; +PARAMS_1(_unit); -private ["_unit", "_adjustment", "_zeroing", "_elevation", "_windage", "_zero"]; -_unit = _this select 0; +if (vehicle _unit != _unit) exitWith {false}; + +private ["_weaponIndex", "_adjustment", "_zeroing", "_elevation", "_windage", "_zero"]; _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; diff --git a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf index 6bb72558b1..4950fe9ece 100644 --- a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf +++ b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf @@ -15,10 +15,10 @@ */ #include "script_component.hpp" -private ["_unit", "_elevation", "_windage", "_zero", "_adjustmentDifference", "_pitchbankyaw", "_pitch", "_bank", "_yaw"]; - EXPLODE_4_PVT(_this,_unit,_elevation,_windage,_zero); +private ["_adjustmentDifference", "_pitchbankyaw", "_pitch", "_bank", "_yaw", "_adjustment", "_weaponIndex"]; + _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); _adjustment = _unit getVariable QGVAR(Adjustment); diff --git a/addons/scopes/functions/fnc_canAdjustZero.sqf b/addons/scopes/functions/fnc_canAdjustZero.sqf index c9663ea711..619d82cf6e 100644 --- a/addons/scopes/functions/fnc_canAdjustZero.sqf +++ b/addons/scopes/functions/fnc_canAdjustZero.sqf @@ -12,13 +12,14 @@ */ #include "script_component.hpp" +PARAMS_1(_unit); + +private ["_weaponIndex", "_adjustment", "_elevation"]; + if (cameraView == "GUNNER") exitWith {false}; if !(vehicle _unit == _unit) exitWith {false}; if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {false}; -private ["_unit", "_adjustment", "_elevation"]; -_unit = _this select 0; - _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; diff --git a/addons/scopes/stringtable.xml b/addons/scopes/stringtable.xml index c04a4e79dc..257b78892b 100644 --- a/addons/scopes/stringtable.xml +++ b/addons/scopes/stringtable.xml @@ -1,42 +1,95 @@  - - "Minor adjustment up + Minor adjustment up Zerowanie powoli w górę + Малая корректировка ВВЕРХ + Ajuste menor arriba + Regola leggermente alzata in alto + Hausse + + Kleine Korrektur nach oben + Enyhe állítás fel - "Minor adjustment down + Minor adjustment down Zerowanie powoli w dół + Малая корректировка ВНИЗ + Ajuste menor abajo + Regola leggermente alzata in basso + Hausse - + Kleine Korrektur nach unten + Enyhe állítás le - "Minor adjustment right + Minor adjustment right Zerowanie powoli w prawo + Малая корректировка ВПРАВО + Ajuste menor derecha + Regola leggermente il tiro a destra + Dérive + + Kleine Korrektur nach rechts + Enyhe állítás jobbra - "Minor adjustment left + Minor adjustment left Zerowanie powoli w lewo + Малая корректировка ВЛЕВО + Ajuste menor izquierda + Regola leggermete il tiro a sinistra + Dérive - + Kleine Korrektur nach links + Enyhe állítás balra Major adjustment up Zerowanie w górę + Большая корректировка ВВЕРХ + Ajuste mayor arriba + Regola l'alzata in alto + Hausse +++ + Große Korrektur nach oben + Nagy állítás fel Major adjustment down Zerowanie w dół + Большая корректировка ВНИЗ + Ajuste mayor abajo + Regola l'alzata in basso + Hausse --- + Große Korrektur nach unten + Nagy állítás le Major adjustment right Zerowanie w prawo + Большая корректировка ВПРАВО + Ajuste mayor derecha + Regola il tiro a destra + Dérive +++ + Große Korrektur nach rechts + Nagy állítás jobbra Major adjustment left Zerowanie w lewo + Большая корректировка ВЛЕВО + Ajuste mayor izquierda + Regola il tiro a sinistra + Dérive --- + Große Korrektur nach links + Nagy állítás balra Set zero adjustment Zresetuj wyzerowanie + Сбросить корректировку + Establecer ajuste a cero + Resetta i valori del tiro + RAZ corrections + Auf 0 justieren + Állítások nullázása \ No newline at end of file diff --git a/addons/switchunits/functions/fnc_addMapFunction.sqf b/addons/switchunits/functions/fnc_addMapFunction.sqf index 62a7c42a22..7204e73d36 100644 --- a/addons/switchunits/functions/fnc_addMapFunction.sqf +++ b/addons/switchunits/functions/fnc_addMapFunction.sqf @@ -17,12 +17,10 @@ #include "script_component.hpp" -private ["_unit", "_sides"]; -_unit = _this select 0; -_sides = _this select 1; +PARAMS_2(_unit,_sides); ["theMapClick", "onMapSingleClick", { - + // IGNORE_PRIVATE_WARNING(_pos,_shift,_alt) if (alive ACE_player && {GVAR(OriginalUnit) getVariable ["ACE_CanSwitchUnits", false]}) then { [_this, _pos, _shift, _alt] call FUNC(handleMapClick); }; diff --git a/addons/switchunits/functions/fnc_handleMapClick.sqf b/addons/switchunits/functions/fnc_handleMapClick.sqf index 3033071984..bfe36f13ea 100644 --- a/addons/switchunits/functions/fnc_handleMapClick.sqf +++ b/addons/switchunits/functions/fnc_handleMapClick.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [_unit, _sides] call FUNC(handleMapClick) + * [unit, _sides] call FUNC(handleMapClick) * * Public: No */ diff --git a/addons/switchunits/functions/fnc_initPlayer.sqf b/addons/switchunits/functions/fnc_initPlayer.sqf index 9c71f8cefc..c2857f1091 100644 --- a/addons/switchunits/functions/fnc_initPlayer.sqf +++ b/addons/switchunits/functions/fnc_initPlayer.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [_player, _sides] call FUNC(initPlayer) + * [player, [west]] call FUNC(initPlayer) * * Public: No */ @@ -19,8 +19,7 @@ private ["_playerUnit", "_sides"]; -_playerUnit = _this select 0; -_sides = _this select 1; +PARAMS_2(_playerUnit,_sides); if (vehicle _playerUnit == _playerUnit) then { diff --git a/addons/switchunits/functions/fnc_nearestPlayers.sqf b/addons/switchunits/functions/fnc_nearestPlayers.sqf index b79c54054f..987c4e3528 100644 --- a/addons/switchunits/functions/fnc_nearestPlayers.sqf +++ b/addons/switchunits/functions/fnc_nearestPlayers.sqf @@ -10,14 +10,15 @@ * Player units > * * Example: - * [_pos, 100] call FUNC(nearestPlayers) + * [[300,300,0], 100] call FUNC(nearestPlayers) * * Public: Yes */ - #include "script_component.hpp" -private ["_position", "_radius", "_nearestPlayers"]; +private ["_nearestPlayers"]; + +PARAMS_2(_position,_radius); _position = _this select 0; _radius = _this select 1; @@ -25,9 +26,9 @@ _radius = _this select 1; _nearestPlayers = []; { - if ([_x] call EFUNC(common,isPlayer) && {alive _x}) then { - _nearestPlayers pushBack _x; - }; + if ([_x] call EFUNC(common,isPlayer) && {alive _x}) then { + _nearestPlayers pushBack _x; + }; } forEach (nearestObjects [_position, ["Man"], _radius]); - _nearestPlayers +_nearestPlayers diff --git a/addons/switchunits/functions/fnc_switchBack.sqf b/addons/switchunits/functions/fnc_switchBack.sqf index d54713bbe4..69be77dd8b 100644 --- a/addons/switchunits/functions/fnc_switchBack.sqf +++ b/addons/switchunits/functions/fnc_switchBack.sqf @@ -10,26 +10,20 @@ * None * * Example: - * [_origPlayer, _respPlayer] call FUNC(switchBack) + * [_originalPlayerUnit, _currentUnit] call FUNC(switchBack) * * Public: Yes */ #include "script_component.hpp" -private ["_origPlayerUnit"]; +PARAMS_1(_originalPlayerUnit); -_origPlayerUnit = _this select 0; -[_origPlayerUnit] joinSilent GVAR(OriginalGroup); +[_originalPlayerUnit] joinSilent GVAR(OriginalGroup); DFUNC(pfhSwitchBack) = { - - private ["_args", "_originalPlayerUnit", "_currentUnit"]; - - _args = _this select 0; - - _originalPlayerUnit = _args select 0; - _currentUnit = _args select 1; + PARAMS_2(_args,_pfID); + EXPLODE_2_PVT(_args,_originalPlayerUnit,_currentUnit); if (local _originalPlayerUnit) exitWith { selectPlayer _originalPlayerUnit; diff --git a/addons/switchunits/functions/fnc_switchUnit.sqf b/addons/switchunits/functions/fnc_switchUnit.sqf index abd053ffae..b1879b0999 100644 --- a/addons/switchunits/functions/fnc_switchUnit.sqf +++ b/addons/switchunits/functions/fnc_switchUnit.sqf @@ -18,9 +18,9 @@ #include "script_component.hpp" -private ["_unit", "_allNearestPlayers", "_oldUnit", "_leave"]; +private ["_nearestEnemyPlayers", "_allNearestPlayers", "_oldUnit", "_leave"]; -_unit = _this select 1; +PARAMS_1(_unit); // don't switch to original player units if (!([_unit] call FUNC(isValidAi))) exitWith {}; diff --git a/addons/switchunits/stringtable.xml b/addons/switchunits/stringtable.xml index 29501279a0..16ce6ae281 100644 --- a/addons/switchunits/stringtable.xml +++ b/addons/switchunits/stringtable.xml @@ -9,6 +9,9 @@ Przełącz jednostkę Cambiado de unidad Unité changée + Egység átváltva + Cambia unità + Trocado de unidade This unit is too close to the enemy. @@ -18,6 +21,9 @@ Ta jednostka jest zbyt blisko przeciwnika. Esta unidad está demasiado cerca del enemigo. Cette unité est trop proche des ennemis + Ez az egység túl közel van az ellenséghez. + Questa unità è troppo vicina al nemico. + Essa unidade está muito perta do inimigo. diff --git a/addons/vector/initKeybinds.sqf b/addons/vector/initKeybinds.sqf index 31fb3bbd1b..79df40b0a2 100644 --- a/addons/vector/initKeybinds.sqf +++ b/addons/vector/initKeybinds.sqf @@ -1,6 +1,6 @@ // by commy2 -["ACE3", QGVAR(AzimuthKey), localize "STR_ACE_Vector_AzimuthKey", +["ACE3 Equipment", QGVAR(AzimuthKey), localize "STR_ACE_Vector_AzimuthKey", { // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -29,7 +29,7 @@ [15, [false, false, false]], false, 0] call CBA_fnc_addKeybind; //Tab Key -["ACE3", QGVAR(DistanceKey), localize "STR_ACE_Vector_DistanceKey", +["ACE3 Equipment", QGVAR(DistanceKey), localize "STR_ACE_Vector_DistanceKey", { // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/vector/stringtable.xml b/addons/vector/stringtable.xml index 05289d189f..edef7a7bea 100644 --- a/addons/vector/stringtable.xml +++ b/addons/vector/stringtable.xml @@ -1,18 +1,17 @@  - - Vector IV - Vector IV - Vector IV - Vector IV - Vector IV - Vector IV - Vector IV - Vector IV - Vector IV - Vector IV + Vector 21 + Vector 21 + Vector 21 + Vector 21 + Vector 21 + Vector 21 + Vector 21 + Vector 21 + Vector 21 + Vector 21 Rangefinder diff --git a/addons/vehiclelock/CfgEventHandlers.hpp b/addons/vehiclelock/CfgEventHandlers.hpp index cf704d000c..6fbbd5c243 100644 --- a/addons/vehiclelock/CfgEventHandlers.hpp +++ b/addons/vehiclelock/CfgEventHandlers.hpp @@ -15,3 +15,20 @@ class Extended_InventoryOpened_EventHandlers { }; }; }; +class Extended_InitPost_EventHandlers { + class Car { + class ADDON { + serverInit = QUOTE(_this call FUNC(handleVehicleInitPost)); + }; + }; + class Tank { + class ADDON { + serverInit = QUOTE(_this call FUNC(handleVehicleInitPost)); + }; + }; + class Helicopter { + class ADDON { + serverInit = QUOTE(_this call FUNC(handleVehicleInitPost)); + }; + }; +}; diff --git a/addons/vehiclelock/CfgVehicles.hpp b/addons/vehiclelock/CfgVehicles.hpp index 65ad0568d6..94bcf34317 100644 --- a/addons/vehiclelock/CfgVehicles.hpp +++ b/addons/vehiclelock/CfgVehicles.hpp @@ -1,50 +1,65 @@ #define MACRO_LOCK_ACTIONS \ - class ACE_MainActions { \ + class ACE_SelfActions { \ class ACE_unlockVehicle { \ displayName = "$STR_ACE_Vehicle_Action_UnLock"; \ - distance = 4; \ condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(2,3)]}); \ statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [_target], [ARR_2(_target,false)])] call EFUNC(common,targetEvent)); \ - showDisabled = 0; \ priority = 0.3; \ icon = QUOTE(PATHTOF(UI\key_menuIcon_ca.paa)); \ }; \ class ACE_lockVehicle { \ displayName = "$STR_ACE_Vehicle_Action_Lock"; \ - distance = 4; \ condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(0,1)]}); \ statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [_target], [ARR_2(_target,true)])] call EFUNC(common,targetEvent)); \ - showDisabled = 0; \ priority = 0.2; \ icon = QUOTE(PATHTOF(UI\key_menuIcon_ca.paa)); \ }; \ class ACE_lockpickVehicle { \ displayName = "$STR_ACE_Vehicle_Action_Lockpick"; \ - distance = 4; \ condition = QUOTE([ARR_3(_player, _target, 'canLockpick')] call FUNC(lockpick)); \ statement = QUOTE([ARR_3(_player, _target, 'startLockpick')] call FUNC(lockpick)); \ - showDisabled = 0; \ priority = 0.1; \ }; \ + }; \ + class ACE_Actions { \ + class ACE_MainActions { \ + class ACE_unlockVehicle { \ + displayName = "$STR_ACE_Vehicle_Action_UnLock"; \ + distance = 4; \ + condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(2,3)]}); \ + statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [_target], [ARR_2(_target,false)])] call EFUNC(common,targetEvent)); \ + priority = 0.3; \ + icon = QUOTE(PATHTOF(UI\key_menuIcon_ca.paa)); \ + }; \ + class ACE_lockVehicle { \ + displayName = "$STR_ACE_Vehicle_Action_Lock"; \ + distance = 4; \ + condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(0,1)]}); \ + statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [_target], [ARR_2(_target,true)])] call EFUNC(common,targetEvent)); \ + priority = 0.2; \ + icon = QUOTE(PATHTOF(UI\key_menuIcon_ca.paa)); \ + }; \ + class ACE_lockpickVehicle { \ + displayName = "$STR_ACE_Vehicle_Action_Lockpick"; \ + distance = 4; \ + condition = QUOTE([ARR_3(_player, _target, 'canLockpick')] call FUNC(lockpick)); \ + statement = QUOTE([ARR_3(_player, _target, 'startLockpick')] call FUNC(lockpick)); \ + priority = 0.1; \ + }; \ + }; \ }; class CfgVehicles { class LandVehicle; class Car: LandVehicle { - class ACE_Actions { - MACRO_LOCK_ACTIONS - }; + MACRO_LOCK_ACTIONS }; class Tank: LandVehicle { - class ACE_Actions { - MACRO_LOCK_ACTIONS - }; + MACRO_LOCK_ACTIONS }; class Air; class Helicopter: Air { - class ACE_Actions { - MACRO_LOCK_ACTIONS - }; + MACRO_LOCK_ACTIONS }; class Logic; @@ -55,7 +70,7 @@ class CfgVehicles { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; displayName = "Vehicle Lock Setup"; - function = QUOTE(DFUNC(moduleInit)); + function = QFUNC(moduleInit); scope = 2; isGlobal = 0; icon = QUOTE(PATHTOF(UI\Icon_Module_VehicleLock_ca.paa)); @@ -67,9 +82,9 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 0; }; - class SetLockState { - displayName = "Set Lock State"; // Argument label - description = "Set lock state for all vehicles on map at start"; // Tooltip description + class VehicleStartingLockState { + displayName = "Vehicle Starting Lock State"; // Argument label + description = "Set lock state for all vehicles (removes ambiguous lock states)"; // Tooltip description typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" class values { class None {name = "As Is"; value = 0; default = 1;}; @@ -93,7 +108,7 @@ class CfgVehicles { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; displayName = "Vehicle Key Assign"; - function = QUOTE(DFUNC(moduleSync)); + function = QFUNC(moduleSync); scope = 2; isGlobal = 0; icon = QUOTE(PATHTOF(UI\Icon_Module_VehicleKey_ca.paa)); diff --git a/addons/vehiclelock/XEH_preInit.sqf b/addons/vehiclelock/XEH_preInit.sqf index bdab28fc75..18a7062c24 100644 --- a/addons/vehiclelock/XEH_preInit.sqf +++ b/addons/vehiclelock/XEH_preInit.sqf @@ -4,6 +4,7 @@ ADDON = false; PREP(addKeyForVehicle); PREP(getVehicleSideKey); +PREP(handleVehicleInitPost); PREP(hasKeyForVehicle); PREP(lockpick); PREP(moduleInit); diff --git a/addons/vehiclelock/config.cpp b/addons/vehiclelock/config.cpp index 248a1e7ca0..76d5817d8d 100644 --- a/addons/vehiclelock/config.cpp +++ b/addons/vehiclelock/config.cpp @@ -7,7 +7,7 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_interaction"}; author[] = {"PabstMirror"}; - authorUrl = "https://github.com/PabstMirror/"; + authorUrl = "https://github.com/acemod/ACE3"; VERSION_CONFIG; }; }; @@ -20,6 +20,10 @@ class ACE_Settings { class GVAR(LockVehicleInventory) { value = 0; typeName = "BOOL"; + }; + class GVAR(VehicleStartingLockState) { + value = -1; + typeName = "SCALAR"; }; }; diff --git a/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf b/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf new file mode 100644 index 0000000000..5a2bc3f7bd --- /dev/null +++ b/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf @@ -0,0 +1,41 @@ +/* + * Author: PabstMirror + * For every lockable vehicle, sets the starting lock state to a sane value. + * Only run if the InitModule is placed. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * None + * + * Example: + * [car] call ACE_VehicleLock_fnc_handleVehicleInitPost + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_1(_vehicle); + +if (!isServer) exitWith {}; + +[{ + //If the module wasn't placed, just exit (needs to be in wait because objectInitEH is before moduleInit) + if (GVAR(VehicleStartingLockState) == -1) exitWith {}; + private ["_lock"]; + PARAMS_1(_vehicle); + if ((_vehicle isKindOf "Car") || {_vehicle isKindOf "Tank"} || {_vehicle isKindOf "Helicopter"}) then { + //set lock state (eliminates the ambigious 1-"Default" and 3-"Locked for Player" states) + _lock = switch (GVAR(VehicleStartingLockState)) do { + case (0): {(locked _vehicle) in [2, 3]}; + case (1):{true}; + case (2):{false}; + }; + if (((_lock) && {(locked _vehicle) != 2}) || {(!_lock) && {(locked _vehicle) != 0}}) then { + TRACE_3("Setting Lock State",_lock,(typeOf _vehicle),_vehicle); + ["VehicleLock_SetVehicleLock", [_vehicle], [_vehicle, _lock]] call EFUNC(common,targetEvent); + }; + }; + //Delay call until mission start (so everyone has the eventHandler's installed) +}, [_vehicle], 0.25, 0.25] call EFUNC(common,waitAndExecute); diff --git a/addons/vehiclelock/functions/fnc_moduleInit.sqf b/addons/vehiclelock/functions/fnc_moduleInit.sqf index c26e8aacbd..510b8ec7be 100644 --- a/addons/vehiclelock/functions/fnc_moduleInit.sqf +++ b/addons/vehiclelock/functions/fnc_moduleInit.sqf @@ -17,8 +17,6 @@ */ #include "script_component.hpp" -private ["_sideKeysAssignment", "_setLockState", "_lock"]; - PARAMS_3(_logic,_syncedUnits,_activated); if (!_activated) exitWith {WARNING("Vehicle Lock Init Module - placed but not active");}; @@ -27,23 +25,4 @@ if (!isServer) exitWith {}; //Set the GVAR for default lockpick strength [_logic, QGVAR(DefaultLockpickStrength), "DefaultLockpickStrength"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(LockVehicleInventory), "LockVehicleInventory"] call EFUNC(common,readSettingFromModule); - -_setLockState = _logic getVariable["SetLockState", 0]; -[{ - PARAMS_1(_setLockState); - { - if ((_x isKindOf "Car") || {_x isKindOf "Tank"} || {_x isKindOf "Helicopter"}) then { - //set lock state (eliminates the ambigious 1-"Default" and 3-"Locked for Player" states) - _lock = switch (_setLockState) do { - case (0): {(locked _x) in [2, 3]}; - case (1):{true}; - case (2):{false}; - }; - if (((_lock) && {(locked _x) != 2}) || {(!_lock) && {(locked _x) != 0}}) then { - TRACE_3("Setting Lock State", _lock, (typeOf _x), _x); - ["VehicleLock_SetVehicleLock", [_x], [_x, _lock]] call EFUNC(common,targetEvent); - }; - }; - } forEach vehicles; - //Delay call until mission start (so everyone has the eventHandler's installed) -}, [_setLockState], 0.25, 0.25] call EFUNC(common,waitAndExecute); +[_logic, QGVAR(VehicleStartingLockState), "VehicleStartingLockState"] call EFUNC(common,readSettingFromModule); diff --git a/addons/vehiclelock/functions/fnc_moduleSync.sqf b/addons/vehiclelock/functions/fnc_moduleSync.sqf index feed42e3ab..ede20e3196 100644 --- a/addons/vehiclelock/functions/fnc_moduleSync.sqf +++ b/addons/vehiclelock/functions/fnc_moduleSync.sqf @@ -37,6 +37,7 @@ if (!isServer) exitWith {}; }; { + private "_unit"; _unit = _x; if (_unit isKindOf "CAManBase") then { { diff --git a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf index 55fee28cc6..8199f4b850 100644 --- a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf +++ b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf @@ -21,6 +21,7 @@ PARAMS_2(_unit,_container); //Only check for player: if (_unit != ace_player) exitWith {false}; +private "_handeled"; _handeled = false; if (GVAR(LockVehicleInventory) && //if setting not enabled @@ -33,7 +34,7 @@ if (GVAR(LockVehicleInventory) && //if setting not enabled playSound "ACE_Sound_Click"; //don't open the vehicles inventory _handeled = true; - //Just opens a dummy groundContainer + //Just opens a dummy groundContainer (so the player can still see their own inventory) ACE_player action ["Gear", objNull]; }; diff --git a/addons/vehiclelock/stringtable.xml b/addons/vehiclelock/stringtable.xml index e3216b3396..fc92b72dd2 100644 --- a/addons/vehiclelock/stringtable.xml +++ b/addons/vehiclelock/stringtable.xml @@ -4,22 +4,26 @@ Unlock Vehicle Fahrzeug aufschließen - Vehículo abierto + Abrir vehículo Déverrouiller le véhicule Odblokuj pojazd Odemknout vozidlo Jármű nyitása Открыть машину + Apri il veicolo + Destravar veículo Lock Vehicle Fahrzeug abschließen - Vehículo cerrado + Cerrar vehículo Verrouiller le véhicule Zablokuj pojazd Zamknout vozidlo Jármű zárása Закрыть машину + Chiudi il veicolo + Travar Veículo Lockpick Vehicle @@ -30,16 +34,20 @@ Vypáčit vozidlo Jármű feltörése Взломать замок + Scassina veicolo + Usar mixa no Veículo Picking Lock.... Schloss knacken... - Forzando cierre... + Forzando cerradura... Crochetage... Otwieranie zamka... Páčim vozidlo... - Feltörés... + Zár feltörése... Взламываем замок... + Scassino il veicolo.... + Usando Mixa... A custom key that will open a specific vehicle. @@ -48,8 +56,10 @@ Une clé propre à un seul véhicule. Unikatowy klucz, który otworzy konkretny pojazd. Vlastní klíč, který otevře konkrétní vozidlo. - Kulcs egy járműhez + Egy egyedi kulcs, ami egy meghatározott járművet nyit ki. Ключ от конкретной машины. + Una chiave personalizzata che apre determinati veicoli. + Uma chave específica que abre um veículo específico. A Master Key will open any lock, no matter what! @@ -58,58 +68,70 @@ Un passe-partout qui ouvrira n'importe quelle serrure. Uniwersalny klucz, który otworzy każdy zamek. Hlavní klíč otevře libovolný zámek, bez vyjímek! - Általános kulcs minden járműhez + Egy főkulcs, ami minden zárat kinyit, helyzettől függetlenül! Универсальный ключ, открывающий любой замок. + Una chiave principale che apre qualsiasi serratura! + Uma chave mestre irá abrir qualquer fechadura, não importa qual! A lockpick set that can pick the locks of most vehicles. Ein Dietrich der die meisten Fahrzeugschlösser knacken kann... - Un set de ganzúas puede abrir la mayoría de cerraduras de vehículos. + Un set de ganzúas que puede abrir las cerraduras de la mayoría vehículos. Un crochet qui ouvrira la plupart des véhicules. Zestaw wytrychów, dzięki któremu można otworzyć zamki w większości pojazdów. Sada paklíčů, která dokáže odemknout zámky u většiny vozidel. - Álkulcs melyik minden járműt nyitni tud + Egy tolvajkulcs-készlet, mely a legtöbb jármű zárjait fel tudja törni. Набор отмычек, которым можно взломать почти любую машину. + Un grimardello per forzare la maggior parte dei veicoli + Um set de chave mixas que pode abrir a maioria dos veículos. A key that should open most WEST vehicles. Ein Schlüssel der die meisten westlichen Fahrzeuge öffnen sollte... - Una llave que puede abrir la mayoría de vehículos occidentales. + Una llave que abrirá la mayoría de vehículos occidentales. Une clé qui ouvrira la plupart des véhicules OUEST. Klucz, który powinien otworzyć większość pojazdów ZACHODU. Klíč který by měl otevřít většinou Západních vozidel. - Általános kulcs WEST járművekhez - Ключ для открытия большинства машин Запада. + Egy kulcs, ami a NYUGAT egységeinek legtöbb járművét ki tudja nyitni. + Ключ для открытия большинства машин Красных. + Una chiave che apre la maggior parte dei veicoli WEST + Uma chave que abre a maioria dos veículos ocidentais A key that should open most EAST vehicle. Ein Schlüssel der die meisten östlichen Fahrzeuge öffnen sollte... - Una llave que puede abrir la mayoría de vehículos orientales. + Una llave que abrirá la mayoría de vehículos orientales. Une clé qui ouvrira la plupart des véhicules EST. Klucz, który powinien otworzyć większość pojazdów WSCHODU. - Általános kulcs EAST járművekhez + Egy kulcs, ami a KELET egységeinek legtöbb járművét ki tudja nyitni. Klíč který by měl otevřít vetšinu Východních vozidel. - Ключ для открытия большинства машин Востока. + Ключ для открытия большинства машин Синих. + Una chaive che apre la maggior parte dei veicoli EAST + Uma chave que abre a maioria dos veículos orientais A key that should open most INDEP vehicle. Ein Schlüssel der die meisten Fahrzeuge der Aufständischen öffnen sollte... - Una llave que puede abrir la mayoría de vehículos independientes. + Una llave que abrirá la mayoría de vehículos independientes. Une clé qui ouvrira la plupart des véhicules INDEP. Klucz, który powinien otworzyć większość pojazdów INDFOR. - Általános kulcs INDEPENDENT járművekhez + Egy kulcs, ami a FÜGGETLEN egységek legtöbb járművét ki tudja nyitni. Klíč který by měl otevřít většinu Nezávislých vozidel. Ключ для открытия большинства машин Независимых. + Una chaive che apr ela maggior parte dei veicoli INDEP + Uma chave que abre a maioria dos veículos independentes A key that should open most CIV vehicle. Ein Schlüssel der die meisten zivilen Fahrzeuge öffnen sollte... - Una llave que puede abrir la mayoría de vehículos civiles. + Una llave que abrirá la mayoría de vehículos civiles. Une clé qui ouvrira la plupart des véhicules CIV. Klucz, który powinien otworzyć większość pojazdów CYWILNYCH. Klíč který by měl otevřít většinu Civilních vozidel. - Általános kulcs CIVILIAN járművekhez + Egy kulcs, ami a CIVIL járművek többségét ki tudja nyitni. Ключ для открытия большинства машин Гражданских. + Una chaive che apr ela maggior parte dei veicoli CIV + Uma chave que abre a maioria dos veículos civis. - + \ No newline at end of file diff --git a/addons/vehicles/CfgEventHandlers.hpp b/addons/vehicles/CfgEventHandlers.hpp index 049b154088..2725e526bc 100644 --- a/addons/vehicles/CfgEventHandlers.hpp +++ b/addons/vehicles/CfgEventHandlers.hpp @@ -18,3 +18,12 @@ class Extended_Engine_EventHandlers { }; }; }; + +class Extended_Init_EventHandlers { + class StaticWeapon { + class ACE_FixMass { + init = QUOTE(if (local (_this select 0)) then {(_this select 0) setMass (getMass (_this select 0) max 250)};); + exclude[] = {"TargetSoldierBase","Static_Designator_01_base_F","Static_Designator_02_base_F","Pod_Heli_Transport_04_base_F"}; + }; + }; +}; diff --git a/addons/vehicles/XEH_postInit.sqf b/addons/vehicles/XEH_postInit.sqf index 8f714105b6..6ff723338b 100644 --- a/addons/vehicles/XEH_postInit.sqf +++ b/addons/vehicles/XEH_postInit.sqf @@ -4,10 +4,10 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", QGVAR(speedLimiter), localize "STR_ACE_SpeedLimiter", +["ACE3 Vehicles", QGVAR(speedLimiter), localize "STR_ACE_SpeedLimiter", { // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isnotinside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player == driver vehicle ACE_player && {vehicle ACE_player isKindOf 'Car' || diff --git a/addons/vehicles/functions/fnc_speedLimiter.sqf b/addons/vehicles/functions/fnc_speedLimiter.sqf index 2332336e0a..053d96d470 100644 --- a/addons/vehicles/functions/fnc_speedLimiter.sqf +++ b/addons/vehicles/functions/fnc_speedLimiter.sqf @@ -35,7 +35,7 @@ _maxSpeed = speed _vehicle max 10; _speed = speed _vehicle; if (_speed > _maxSpeed) then { - _vehicle setVelocity ((velocity _vehicle) vectorMultiply (_maxSpeed / _speed)); + _vehicle setVelocity ((velocity _vehicle) vectorMultiply ((_maxSpeed / _speed) - 0.00001)); // fix 1.42-hotfix PhysX libraries applying force in previous direction when turning }; } , 0, [_driver, _vehicle, _maxSpeed]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/vehicles/stringtable.xml b/addons/vehicles/stringtable.xml index 4fbb91ebcd..603f2563dc 100644 --- a/addons/vehicles/stringtable.xml +++ b/addons/vehicles/stringtable.xml @@ -1,43 +1,41 @@ - + - - - - Speed Limiter on - Begrenzer an - Limitador de velocidad activado - Ogranicznik prędkości włączony - Omezovač rychlosti zapnout - Limiteur de vitesse Activé - Ограничение скорости включено - Sebességkorlát bekapcsolva - Limitador de Velocidade Ativo - Limitatore Attivo - - - Speed Limiter off - Begrenzer aus - Limitador de velocidad desactivado - Ogranicznik prędkości wyłączony - Omezovač rychlosti vypnout - Limiteur de vitesse Désactivé - Ограничение скорости выключено - Sebességkorlát kikapcsolva - Limitador de Velocidade Desativado - Limitatore Non Attivo - - - - Speed Limiter - Begrenzer - Limitador de velocidad - Ogranicznik prędkości - Omezovač rychlosti - Limiteur de vitesse - Ограничение скорости - Sebességkorlát - Limitador de Velocidade - Limitatore di Velocità - - - + + + Speed Limiter on + Begrenzer an + Limitador de velocidad activado + Ogranicznik prędkości włączony + Omezovač rychlosti zapnout + Limiteur de vitesse Activé + Ограничение скорости включено + Sebességkorlátozó bekapcsolva + Limitador de Velocidade Ativo + Limitatore Attivo + + + Speed Limiter off + Begrenzer aus + Limitador de velocidad desactivado + Ogranicznik prędkości wyłączony + Omezovač rychlosti vypnout + Limiteur de vitesse Désactivé + Ограничение скорости выключено + Sebességkorlátozó kikapcsolva + Limitador de Velocidade Desativado + Limitatore Non Attivo + + + Speed Limiter + Begrenzer + Limitador de velocidad + Ogranicznik prędkości + Omezovač rychlosti + Limiteur de vitesse + Ограничение скорости + Sebességkorlátozó + Limitador de Velocidade + Limitatore di Velocità + + + \ No newline at end of file diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index 6dc648d54c..ab77f5d2ee 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -4,7 +4,7 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", QGVAR(SelectPistol), localize "STR_ACE_WeaponSelect_SelectPistol", +["ACE3 Weapons", QGVAR(SelectPistolNew), localize "STR_ACE_WeaponSelect_SelectPistol", { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -13,12 +13,12 @@ if !(hasInterface) exitWith {}; // Statement [ACE_player, handgunWeapon ACE_player] call FUNC(selectWeaponMode); - true + false }, {false}, -[2, [false, false, false]], false] call cba_fnc_addKeybind; //1 Key +[0, [false, false, false]], false] call cba_fnc_addKeybind; //1 Key -["ACE3", QGVAR(SelectRifle), localize "STR_ACE_WeaponSelect_SelectRifle", +["ACE3 Weapons", QGVAR(SelectRifleNew), localize "STR_ACE_WeaponSelect_SelectRifle", { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -27,12 +27,12 @@ if !(hasInterface) exitWith {}; // Statement [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMode); - true + false }, {false}, -[3, [false, false, false]], false] call cba_fnc_addKeybind; //2 Key +[0, [false, false, false]], false] call cba_fnc_addKeybind; //2 Key -["ACE3", QGVAR(SelectRifleMuzzle), localize "STR_ACE_WeaponSelect_SelectRifleMuzzle", +["ACE3 Weapons", QGVAR(SelectRifleMuzzleNew), localize "STR_ACE_WeaponSelect_SelectRifleMuzzle", { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -41,12 +41,12 @@ if !(hasInterface) exitWith {}; // Statement [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMuzzle); - true + false }, {false}, -[4, [false, false, false]], false] call cba_fnc_addKeybind; //3 Key +[0, [false, false, false]], false] call cba_fnc_addKeybind; //3 Key -["ACE3", QGVAR(SelectLauncher), localize "STR_ACE_WeaponSelect_SelectLauncher", +["ACE3 Weapons", QGVAR(SelectLauncherNew), localize "STR_ACE_WeaponSelect_SelectLauncher", { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -55,12 +55,12 @@ if !(hasInterface) exitWith {}; // Statement [ACE_player, secondaryWeapon ACE_player] call FUNC(selectWeaponMode); - true + false }, {false}, -[5, [false, false, false]], false] call cba_fnc_addKeybind; //4 Key +[0, [false, false, false]], false] call cba_fnc_addKeybind; //4 Key -["ACE3", QGVAR(SelectBinocular), localize "STR_ACE_WeaponSelect_SelectBinocular", +["ACE3 Weapons", QGVAR(SelectBinocularNew), localize "STR_ACE_WeaponSelect_SelectBinocular", { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -69,12 +69,12 @@ if !(hasInterface) exitWith {}; // Statement [ACE_player, binocular ACE_player] call FUNC(selectWeaponMode); - true + false }, {false}, -[6, [false, false, false]], false] call cba_fnc_addKeybind; //5 Key +[0, [false, false, false]], false] call cba_fnc_addKeybind; //5 Key -["ACE3", QGVAR(SelectGrenadeFrag), localize "STR_ACE_WeaponSelect_SelectGrenadeFrag", +["ACE3 Weapons", QGVAR(SelectGrenadeFrag), localize "STR_ACE_WeaponSelect_SelectGrenadeFrag", { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -88,7 +88,7 @@ if !(hasInterface) exitWith {}; {false}, [7, [false, false, false]], false] call cba_fnc_addKeybind; //6 Key -["ACE3", QGVAR(SelectGrenadeOther), localize "STR_ACE_WeaponSelect_SelectGrenadeOther", +["ACE3 Weapons", QGVAR(SelectGrenadeOther), localize "STR_ACE_WeaponSelect_SelectGrenadeOther", { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -102,7 +102,7 @@ if !(hasInterface) exitWith {}; {false}, [8, [false, false, false]], false] call cba_fnc_addKeybind; //7 Key -["ACE3", QGVAR(HolsterWeapon), localize "STR_ACE_WeaponSelect_HolsterWeapon", +["ACE3 Weapons", QGVAR(HolsterWeapon), localize "STR_ACE_WeaponSelect_HolsterWeapon", { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -116,7 +116,7 @@ if !(hasInterface) exitWith {}; {false}, [11, [false, false, false]], false] call cba_fnc_addKeybind; //0 Key -["ACE3", QGVAR(EngineOn), localize "STR_ACE_WeaponSelect_EngineOn", +["ACE3 Vehicles", QGVAR(EngineOn), localize "STR_ACE_WeaponSelect_EngineOn", { // Conditions: canInteract if !([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -130,7 +130,7 @@ if !(hasInterface) exitWith {}; {false}, [3, [false, false, false]], false] call cba_fnc_addKeybind; //2 Key -["ACE3", QGVAR(EngineOff), localize "STR_ACE_WeaponSelect_EngineOff", +["ACE3 Vehicles", QGVAR(EngineOff), localize "STR_ACE_WeaponSelect_EngineOff", { // Conditions: canInteract if !([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -144,7 +144,7 @@ if !(hasInterface) exitWith {}; {false}, [2, [false, false, false]], false] call cba_fnc_addKeybind; //1 Key -["ACE3", QGVAR(SelectMainGun), localize "STR_ACE_WeaponSelect_SelectMainGun", +["ACE3 Vehicles", QGVAR(SelectMainGunNew), localize "STR_ACE_WeaponSelect_SelectMainGun", { // Conditions: canInteract if !([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -153,12 +153,12 @@ if !(hasInterface) exitWith {}; // Statement [ACE_player, vehicle ACE_player, 0] call FUNC(selectWeaponVehicle); - true + false }, {false}, -[4, [false, false, false]], false] call cba_fnc_addKeybind; //3 Key +[0, [false, false, false]], false] call cba_fnc_addKeybind; //3 Key -["ACE3", QGVAR(SelectMachineGun), localize "STR_ACE_WeaponSelect_SelectMachineGun", +["ACE3 Vehicles", QGVAR(SelectMachineGunNew), localize "STR_ACE_WeaponSelect_SelectMachineGun", { // Conditions: canInteract if !([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -167,12 +167,12 @@ if !(hasInterface) exitWith {}; // Statement [ACE_player, vehicle ACE_player, 1] call FUNC(selectWeaponVehicle); - true + false }, {false}, -[5, [false, false, false]], false] call cba_fnc_addKeybind; //4 Key +[0, [false, false, false]], false] call cba_fnc_addKeybind; //4 Key -["ACE3", QGVAR(SelectMissiles), localize "STR_ACE_WeaponSelect_SelectMissiles", +["ACE3 Vehicles", QGVAR(SelectMissilesNew), localize "STR_ACE_WeaponSelect_SelectMissiles", { // Conditions: canInteract if !([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -181,12 +181,12 @@ if !(hasInterface) exitWith {}; // Statement [ACE_player, vehicle ACE_player, 2] call FUNC(selectWeaponVehicle); - true + false }, {false}, -[6, [false, false, false]], false] call cba_fnc_addKeybind; //5 Key +[0, [false, false, false]], false] call cba_fnc_addKeybind; //5 Key -["ACE3", QGVAR(FireSmokeLauncher), localize "STR_ACE_WeaponSelect_FireSmokeLauncher", +["ACE3 Vehicles", QGVAR(FireSmokeLauncher), localize "STR_ACE_WeaponSelect_FireSmokeLauncher", { // Conditions: canInteract if !([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/weaponselect/XEH_preInit.sqf b/addons/weaponselect/XEH_preInit.sqf index 790dfe7a99..4c5216c2f6 100644 --- a/addons/weaponselect/XEH_preInit.sqf +++ b/addons/weaponselect/XEH_preInit.sqf @@ -26,6 +26,7 @@ GVAR(CurrentGrenadeMuzzleOther) = ""; // Collect frag and other muzzles separately with uiNamespace do { + private ["_magazines", "_magazine", "_ammo", "_explosive"]; if (isNil QGVAR(FragMuzzles)) then { GVAR(FragMuzzles) = []; GVAR(NonFragMuzzles) = []; diff --git a/addons/weaponselect/config.cpp b/addons/weaponselect/config.cpp index 80be936e98..68d0fe842d 100644 --- a/addons/weaponselect/config.cpp +++ b/addons/weaponselect/config.cpp @@ -17,7 +17,7 @@ class CfgPatches { class ACE_Settings { class GVAR(DisplayText) { typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; value = 1; displayName = "$STR_ACE_Weaponselect_SettingDisplayTextName"; description = "$STR_ACE_Weaponselect_SettingDisplayTextDesc"; diff --git a/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf index f73f2444c4..f45ed0ea57 100644 --- a/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf @@ -12,18 +12,13 @@ */ #include "script_component.hpp" -private ["_unit", "_muzzle"]; +PARAMS_2(_unit,_muzzle); -_unit = _this select 0; -_muzzle = _this select 1; - -private ["_uniformMags", "_vestMags", "_backPackMags"]; +private ["_uniformMags", "_vestMags", "_backpackMags", "_numberOfMagazines", "_magazineClasses", "_firstMagazine"]; _uniformMags = getMagazineCargo uniformContainer _unit; _vestMags = getMagazineCargo vestContainer _unit; -_backPackMags = getMagazineCargo backpackContainer _unit; - -private ["_numberOfMagazines", "_magazineClasses", "_firstMagazine"]; +_backpackMags = getMagazineCargo backpackContainer _unit; _numberOfMagazines = 0; _magazineClasses = getArray (configFile >> "CfgWeapons" >> "Throw" >> _muzzle >> "magazines"); diff --git a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf index 1922ffdbb9..d7a68e7f50 100644 --- a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf +++ b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf @@ -21,10 +21,10 @@ _numberofMagazines = _this select 1; private ["_color", "_name", "_text", "_picture"]; -_color = [[1,0,0], [1,1,1]] select (_numberOfMagazines > 0); +_color = [[1,0,0], [1,1,1]] select (_numberofMagazines > 0); _name = getText (configFile >> "CfgMagazines" >> _magazine >> "displayNameShort"); -_text = [format["%1 x%2", _name, _numberOfMagazines], _color] call EFUNC(common,stringToColoredText); +_text = [format["%1 x%2", _name, _numberofMagazines], _color] call EFUNC(common,stringToColoredText); _picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture"); [_text, _picture] call EFUNC(common,displayTextPicture); diff --git a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf index 31999ad0b9..a75a11c202 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf @@ -11,41 +11,41 @@ */ #include "script_component.hpp" -private ["_unit", "_nextMuzzle"]; +private ["_text", "_nextMuzzle"]; -_unit = _this select 0; +PARAMS_1(_unit); _nextMuzzle = ["All"] call FUNC(findNextGrenadeMuzzle); if (_nextMuzzle != "") then { - private ["_magazines", "_magazine", "_count", "_return"]; - _magazines = GVAR(AllMagazines) select (GVAR(AllMuzzles) find _nextMuzzle); - reverse _magazines; + private ["_magazines", "_magazine", "_count", "_return"]; + _magazines = GVAR(AllMagazines) select (GVAR(AllMuzzles) find _nextMuzzle); + reverse _magazines; - _magazine = ""; - _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; + _magazine = ""; + _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; - // There is a muzzle with magazines --> cycle to it - [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); + // There is a muzzle with magazines --> cycle to it + [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); - [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); + [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); } else { - // There is a no muzzle with magazines --> select nothing - GVAR(CurrentGrenadeMuzzleFrag) = ""; GVAR(CurrentGrenadeMuzzleOther) = ""; + // There is a no muzzle with magazines --> select nothing + GVAR(CurrentGrenadeMuzzleFrag) = ""; GVAR(CurrentGrenadeMuzzleOther) = ""; - if (GVAR(DisplayText)) then { - _text = [localize "STR_ACE_WeaponSelect_NoGrenadesLeft", [1,0,0]] call EFUNC(common,stringToColoredText); - [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); - }; + if (GVAR(DisplayText)) then { + _text = [localize "STR_ACE_WeaponSelect_NoGrenadesLeft", [1,0,0]] call EFUNC(common,stringToColoredText); + [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); + }; }; if (_nextMuzzle in GVAR(FragMuzzles)) then { - GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle; - GVAR(CurrentGrenadeMuzzleIsFrag) = true; + GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle; + GVAR(CurrentGrenadeMuzzleIsFrag) = true; } else { - GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle; - GVAR(CurrentGrenadeMuzzleIsFrag) = false; + GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle; + GVAR(CurrentGrenadeMuzzleIsFrag) = false; }; diff --git a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf index 408cf0e608..0dee3e5c57 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf @@ -11,34 +11,34 @@ */ #include "script_component.hpp" -private ["_unit", "_nextMuzzle"]; +private ["_text", "_nextMuzzle"]; -_unit = _this select 0; +PARAMS_1(_unit); _nextMuzzle = ["Frag"] call FUNC(findNextGrenadeMuzzle); if (_nextMuzzle != "") then { - GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle; + GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle; - private ["_magazines", "_magazine", "_count", "_return"]; - _magazines = GVAR(FragMagazines) select (GVAR(FragMuzzles) find _nextMuzzle); - reverse _magazines; + private ["_magazines", "_magazine", "_count", "_return"]; + _magazines = GVAR(FragMagazines) select (GVAR(FragMuzzles) find _nextMuzzle); + reverse _magazines; - _magazine = ""; - _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; + _magazine = ""; + _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; - // There is a muzzle with magazines --> cycle to it - [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); + // There is a muzzle with magazines --> cycle to it + [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); - [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); + [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); } else { - // There is a no muzzle with magazines --> select nothing - GVAR(CurrentGrenadeMuzzleFrag) = ""; - if (GVAR(DisplayText)) then { - _text = [localize "STR_ACE_WeaponSelect_NoFragsLeft", [1,0,0]] call EFUNC(common,stringToColoredText); - [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); - }; + // There is a no muzzle with magazines --> select nothing + GVAR(CurrentGrenadeMuzzleFrag) = ""; + if (GVAR(DisplayText)) then { + _text = [localize "STR_ACE_WeaponSelect_NoFragsLeft", [1,0,0]] call EFUNC(common,stringToColoredText); + [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); + }; }; GVAR(CurrentGrenadeMuzzleIsFrag) = true; diff --git a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf index c732010a2b..4ab65e5bf3 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf @@ -11,34 +11,34 @@ */ #include "script_component.hpp" -private ["_unit", "_nextMuzzle"]; +private ["_nextMuzzle", "_text"]; -_unit = _this select 0; +PARAMS_1(_unit); _nextMuzzle = ["NonFrag"] call FUNC(findNextGrenadeMuzzle); if (_nextMuzzle != "") then { - GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle; + GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle; - private ["_magazines", "_magazine", "_count", "_return"]; - _magazines = GVAR(NonFragMagazines) select (GVAR(NonFragMuzzles) find _nextMuzzle); - reverse _magazines; + private ["_magazines", "_magazine", "_count", "_return"]; + _magazines = GVAR(NonFragMagazines) select (GVAR(NonFragMuzzles) find _nextMuzzle); + reverse _magazines; - _magazine = ""; - _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; + _magazine = ""; + _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; - // There is a muzzle with magazines --> cycle to it - [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); + // There is a muzzle with magazines --> cycle to it + [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); - [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); + [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); } else { - // There is a no muzzle with magazines --> select nothing - GVAR(CurrentGrenadeMuzzleOther) = ""; - if (GVAR(DisplayText)) then { - _text = [localize "STR_ACE_WeaponSelect_NoMiscGrenadeLeft", [1,0,0]] call EFUNC(common,stringToColoredText); - [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); - }; + // There is a no muzzle with magazines --> select nothing + GVAR(CurrentGrenadeMuzzleOther) = ""; + if (GVAR(DisplayText)) then { + _text = [localize "STR_ACE_WeaponSelect_NoMiscGrenadeLeft", [1,0,0]] call EFUNC(common,stringToColoredText); + [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); + }; }; GVAR(CurrentGrenadeMuzzleIsFrag) = false; diff --git a/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf index ced1fa87b3..81d1a59ed1 100644 --- a/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf @@ -17,19 +17,15 @@ private ["_unit", "_muzzle"]; _unit = _this select 0; _muzzle = _this select 1; -private ["_uniformMags", "_vestMags", "_backPackMags"]; +private ["_uniformMags", "_vestMags", "_backpackMags", "_i", "_uniformMagsToRemove", "_vestMagsToRemove", "_backpackMagsToRemove", "_firstMagazine", "_throwMuzzleNames"]; _uniformMags = getMagazineCargo uniformContainer _unit; _vestMags = getMagazineCargo vestContainer _unit; -_backPackMags = getMagazineCargo backpackContainer _unit; - -private ["_uniformMagsToRemove", "_vestMagsToRemove", "_backPackMagsToRemove"]; +_backpackMags = getMagazineCargo backpackContainer _unit; _uniformMagsToRemove = []; _vestMagsToRemove = []; -_backPackMagsToRemove = []; - -private ["_firstMagazine", "_throwMuzzleNames"]; +_backpackMagsToRemove = []; _firstMagazine = ""; _throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles"); @@ -99,7 +95,7 @@ _throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles" for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { _unit removeItem (_x select 0); }; -} forEach _backPackMagsToRemove; +} forEach _backpackMagsToRemove; // Readd magazines { @@ -118,4 +114,4 @@ _throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles" for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { _unit addItemToBackpack (_x select 0); }; -} forEach _backPackMagsToRemove; +} forEach _backpackMagsToRemove; diff --git a/addons/weaponselect/stringtable.xml b/addons/weaponselect/stringtable.xml index c1b9039553..93193b520f 100644 --- a/addons/weaponselect/stringtable.xml +++ b/addons/weaponselect/stringtable.xml @@ -4,20 +4,26 @@ Display text on grenade throw Zeige Text beim Granatwurf - Mostrar texto al lanzar granada + Mostrar texto al lanzar una granada Показывать текст при броске Zobrazí text při hodu granátem Wyświetl tekst przy rzucie granatem Afficher texte lors d'un lancé de grenade + Szöveg mutatása gránát eldobásakor + Mostra indicazioni nel lancio granate + Mostrat texto ao lançar granada Display a hint or text on grenade throw. Zeige Hinweis oder Text beim Granatwurf - Muestra una notificación o texto al lanzar granada + Muestra una notificación o texto al lanzar una granada Показывать текст или подсказку при броске гранаты. Zobrazí upozornění nebo text při hodu granátem. Wyświetla powiadomienie lub tekst przy rzucie granatem. Afficher texte/info au lancé de grenade + Jelez egy súgót vagy szöveget a gránát eldobásakor. + Mostra un suggerimento quando si lanciano granate + Mostra um hint ou texto ao lançar uma granada Select Pistol @@ -37,7 +43,7 @@ Seleccionar fusil Wybierz karabin Zvolit hlavní zbraň - Выбрать автомат + Выбрать винтовку Sélectionner Fusil Puska Kiválasztása Selecionar Rifle @@ -49,19 +55,19 @@ Seleccionar lanzador Wybierz wyrzutnię Zvolit Raketomet - Выбрать гранатомет + Выбрать гранатомёт Sélectionner Lanceur Rakétavető Kiválasztása Selecionar Lançador - Seleziona il Lanciatore + Seleziona il Lanciamissili Select Grenade Launcher Granatwerfer auswählen - Seleccionar lanzador de granadas + Seleccionar lanzagranadas Wybierz granatnik Zvolit Granátomet - Выбрать подствольный гранатомет + Выбрать подствольный гранатомёт Sélectionner Lance-grenades Gránátvető Kiválasztása Selecionar Lança-Granadas @@ -157,9 +163,10 @@ Granada %1 Granat %1 Granát %1 - Gránát Kiválasztása + Gránát: %1 Граната %1 Grenade %1 + Granata %1 Ready Grenade @@ -167,9 +174,10 @@ Granada lista Przygotuj granat Odjistit granát - Kész Gránát + Gránát előkészítése Подготовить гранату Grenade prête + Granata pronta Select Frag Grenade @@ -189,16 +197,16 @@ Seleccionar granada de no fragmentación Wybierz granat nieodłamkowy Sélectionner grenade non-léthale - Nem Robbanó Gránát Kiválasztása + Nem-robbanó Gránát Kiválasztása Zvolit Ne-Výbušný Granát Selecionar Granada - Seleziona Altre Granate + Seleziona granate non a frammentazione Выбрать гранату Throw Selected Grenade Gewählte Granate werfen - Arrojar granada seleccionada + Lanzar granada seleccionada Rzuć wybrany granat Lancer la grenade sélectionnée Kiválasztott Gránát Eldobása @@ -216,30 +224,31 @@ Žádné granáty Nincs több gránát Гранат не осталось + Granate esaurite No frags left Keine explosiven Granaten übrig - Sin granadas de fragmentación + No quedan granadas de fragmentación Brak granatów odłamkowych Plus de grenades à fragmentation Nincs több repeszgránát Už nejsou granáty Não há granadas de fragmentação restantes Nessuna granata a frammentazione rimanente - Осколочныких гранат нет + Осколочных гранат нет No misc. grenades left Keine nichtexplosiven Granaten übrig - Sin granadas de varias + Sin granadas misc. Brak granatów nieodłamkowych Plus de grenades non-léthales Nincs több egyéb gránát Už nejsou žádné ostatní granáty Não há outras granadas restantes Nessun'altra granata rimanente. - Летальные гранаты закончились + Нелетальные гранаты закончились No grenade selected @@ -247,7 +256,7 @@ Granada no seleccionada Nie wybrano żadnego granatu Aucune grenade sélectionnée - Nincs kiválasztva gránát + Nincs semmilyen gránát kiválasztva Není zvolen žádný granát Nenhuma granada selecionada Nessuna granata selezionata @@ -260,8 +269,9 @@ Kouřový odpalovač Tirer le lance-pots fumigènes Wystrzel granat dymny - Füst kilövése - Запустить дымовую завесу + Füstvető eltüzelése + Пустить дымовую завесу + Lancia fumogeno diff --git a/addons/weather/ACE_Settings.hpp b/addons/weather/ACE_Settings.hpp new file mode 100644 index 0000000000..d4b5a716cf --- /dev/null +++ b/addons/weather/ACE_Settings.hpp @@ -0,0 +1,38 @@ +class ACE_Settings { + class GVAR(enableServerController) { + displayName = "Weather propagation"; + description = "Enables sever side weather propagation"; + typeName = "BOOL"; + value = 1; + }; + class GVAR(useACEWeather) { + displayName = "ACE Weather"; + description = "Overrides the default weather (editor, mission settings) with ACE weather (map based)"; + typeName = "BOOL"; + value = 1; + }; + class GVAR(syncRain) { + displayName = "Sync Rain"; + description = "Synchronizes rain"; + typeName = "BOOL"; + value = 1; + }; + class GVAR(syncWind) { + displayName = "Sync Wind"; + description = "Synchronizes wind"; + typeName = "BOOL"; + value = 1; + }; + class GVAR(syncMisc) { + displayName = "Sync Misc"; + description = "Synchronizes lightnings, rainbow, fog, ..."; + typeName = "BOOL"; + value = 1; + }; + class GVAR(serverUpdateInterval) { + displayName = "Update Interval"; + description = "Defines the interval (seconds) between weather updates"; + typeName = "SCALAR"; + value = 60; + }; +}; diff --git a/addons/weather/CfgEventhandlers.hpp b/addons/weather/CfgEventhandlers.hpp index c3f1f2ba0b..842ad8e7bf 100644 --- a/addons/weather/CfgEventhandlers.hpp +++ b/addons/weather/CfgEventhandlers.hpp @@ -1,6 +1,5 @@ class Extended_PreInit_EventHandlers { class ADDON { - clientInit = QUOTE(call COMPILE_FILE(XEH_preClientInit)); init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; diff --git a/addons/weather/CfgVehicles.hpp b/addons/weather/CfgVehicles.hpp new file mode 100644 index 0000000000..3de925e446 --- /dev/null +++ b/addons/weather/CfgVehicles.hpp @@ -0,0 +1,52 @@ +class CfgVehicles { + class ACE_Module; + class GVAR(ModuleSettings): ACE_Module { + scope = 2; + displayName = "Weather"; + icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa)); + category = "ACE"; + function = QUOTE(DFUNC(initModuleSettings)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "$STR_ACE_Common_ACETeam"; + class Arguments { + class enableServerController { + displayName = "Weather propagation"; + description = "Enables sever side weather propagation"; + typeName = "BOOL"; + defaultValue = 1; + }; + class useACEWeather { + displayName = "ACE Weather"; + description = "Overrides the default weather (editor, mission settings) with ACE weather (map based)"; + typeName = "BOOL"; + defaultValue = 1; + }; + class syncRain { + displayName = "Sync Rain"; + description = "Synchronizes rain"; + typeName = "BOOL"; + defaultValue = 1; + }; + class syncWind { + displayName = "Sync Wind"; + description = "Synchronizes wind"; + typeName = "BOOL"; + defaultValue = 1; + }; + class syncMisc { + displayName = "Sync Misc"; + description = "Synchronizes lightnings, rainbow, fog, ..."; + typeName = "BOOL"; + defaultValue = 1; + }; + class serverUpdateInterval { + displayName = "Update Interval"; + description = "Defines the interval (seconds) between weather updates"; + typeName = "NUMBER"; + defaultValue = 60; + }; + }; + }; +}; diff --git a/addons/weather/CfgWorlds.hpp b/addons/weather/CfgWorlds.hpp index ed932654f7..1391468fd9 100644 --- a/addons/weather/CfgWorlds.hpp +++ b/addons/weather/CfgWorlds.hpp @@ -7,6 +7,22 @@ class CfgWorlds { ACE_TempNight[] = {4, 4, 6, 8, 13, 17, 20, 20, 16, 12, 8, 6}; // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Limnos,Greece ACE_Humidity[] = {78, 77, 78, 74, 71, 60, 59, 61, 65, 72, 79, 80}; + // Source: https://weatherspark.com/averages/32194/Lemnos-Limnos-North-Aegean-Islands-Greece + ACE_WindSpeedMax[] = {{8.8, 5.5}, {8.8, 5}, {8.6, 4.8}, {7.6, 3.4}, {7.0, 3.0}, {7.1, 3.0}, {7.5, 3.1}, {8.0, 3.2}, {7.6, 3.5}, {7.8, 4.6}, {7.9, 5.0}, {8.2, 5.5}}; + ACE_WindSpeedMean[] = {4.8, 4.9, 4.6, 4.1, 3.5, 3.5, 4.3, 4.4, 4.1, 4.5, 4.5, 5.0}; + ACE_WindSpeedMin[] = {{0.2, 5.0}, {0.1, 5.0}, {0.2, 4.3}, {0.0, 3.0}, {0.0, 2.1}, {0.0, 2.0}, {0.1, 3.1}, {0.3, 3.1}, {0.0, 3.6}, {0.0, 4.2}, {0.1, 5.0}, {0.2, 5.5}}; + ACE_WindDirectionProbabilities[] = {{0.06, 0.32, 0.05, 0.04, 0.15, 0.06, 0.02, 0.02}, // January + {0.08, 0.32, 0.04, 0.04, 0.18, 0.06, 0.02, 0.02}, // February + {0.09, 0.30, 0.04, 0.04, 0.20, 0.06, 0.02, 0.03}, // March + {0.10, 0.25, 0.03, 0.04, 0.22, 0.06, 0.02, 0.04}, // April + {0.18, 0.25, 0.03, 0.04, 0.18, 0.04, 0.01, 0.05}, // May + {0.25, 0.25, 0.03, 0.03, 0.15, 0.03, 0.00, 0.08}, // June + {0.32, 0.30, 0.02, 0.02, 0.10, 0.01, 0.00, 0.09}, // July + {0.28, 0.35, 0.02, 0.01, 0.08, 0.01, 0.00, 0.08}, // August + {0.20, 0.37, 0.03, 0.01, 0.11, 0.01, 0.01, 0.05}, // September + {0.10, 0.39, 0.04, 0.02, 0.15, 0.02, 0.01, 0.03}, // October + {0.08, 0.38, 0.06, 0.04, 0.19, 0.03, 0.02, 0.02}, // November + {0.06, 0.37, 0.05, 0.03, 0.18, 0.04, 0.02, 0.02}};// December }; class Altis: CAWorld { @@ -15,5 +31,21 @@ class CfgWorlds { ACE_TempNight[] = {4, 4, 6, 8, 13, 17, 20, 20, 16, 12, 8, 6}; // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Limnos,Greece ACE_Humidity[] = {78, 77, 78, 74, 71, 60, 59, 61, 65, 72, 79, 80}; + // Source: https://weatherspark.com/averages/32194/Lemnos-Limnos-North-Aegean-Islands-Greece + ACE_WindSpeedMax[] = {{8.8, 5.5}, {8.8, 5}, {8.6, 4.8}, {7.6, 3.4}, {7.0, 3.0}, {7.1, 3.0}, {7.5, 3.1}, {8.0, 3.2}, {7.6, 3.5}, {7.8, 4.6}, {7.9, 5.0}, {8.2, 5.5}}; + ACE_WindSpeedMean[] = {4.8, 4.9, 4.6, 4.1, 3.5, 3.5, 4.3, 4.4, 4.1, 4.5, 4.5, 5.0}; + ACE_WindSpeedMin[] = {{0.2, 5.0}, {0.1, 5.0}, {0.2, 4.3}, {0.0, 3.0}, {0.0, 2.1}, {0.0, 2.0}, {0.1, 3.1}, {0.3, 3.1}, {0.0, 3.6}, {0.0, 4.2}, {0.1, 5.0}, {0.2, 5.5}}; + ACE_WindDirectionProbabilities[] = {{0.06, 0.32, 0.05, 0.04, 0.15, 0.06, 0.02, 0.02}, // January + {0.08, 0.32, 0.04, 0.04, 0.18, 0.06, 0.02, 0.02}, // February + {0.09, 0.30, 0.04, 0.04, 0.20, 0.06, 0.02, 0.03}, // March + {0.10, 0.25, 0.03, 0.04, 0.22, 0.06, 0.02, 0.04}, // April + {0.18, 0.25, 0.03, 0.04, 0.18, 0.04, 0.01, 0.05}, // May + {0.25, 0.25, 0.03, 0.03, 0.15, 0.03, 0.00, 0.08}, // June + {0.32, 0.30, 0.02, 0.02, 0.10, 0.01, 0.00, 0.09}, // July + {0.28, 0.35, 0.02, 0.01, 0.08, 0.01, 0.00, 0.08}, // August + {0.20, 0.37, 0.03, 0.01, 0.11, 0.01, 0.01, 0.05}, // September + {0.10, 0.39, 0.04, 0.02, 0.15, 0.02, 0.01, 0.03}, // October + {0.08, 0.38, 0.06, 0.04, 0.19, 0.03, 0.02, 0.02}, // November + {0.06, 0.37, 0.05, 0.03, 0.18, 0.04, 0.02, 0.02}};// December }; -}; +}; \ No newline at end of file diff --git a/addons/weather/UI/Icon_Module_Wind_ca.paa b/addons/weather/UI/Icon_Module_Wind_ca.paa new file mode 100644 index 0000000000..176fe700a7 Binary files /dev/null and b/addons/weather/UI/Icon_Module_Wind_ca.paa differ diff --git a/addons/weather/XEH_postInit.sqf b/addons/weather/XEH_postInit.sqf index ff78eeb727..455c336d96 100644 --- a/addons/weather/XEH_postInit.sqf +++ b/addons/weather/XEH_postInit.sqf @@ -1,86 +1,44 @@ -//XEH_postInit.sqf -//#define DEBUG_MODE_FULL #include "script_component.hpp" + +// Randomization +GVAR(temperatureShift) = 3 - random 6; +GVAR(badWeatherShift) = (random 1) ^ 2 * 10; +GVAR(humidityShift) = (5 - random 10) / 100; + +GVAR(wind_period_start_time) = time; +GVAR(rain_period_start_time) = time; + "ACE_WIND_PARAMS" addPublicVariableEventHandler { GVAR(wind_period_start_time) = time; }; "ACE_RAIN_PARAMS" addPublicVariableEventHandler { GVAR(rain_period_start_time) = time; }; "ACE_MISC_PARAMS" addPublicVariableEventHandler { - if !(isServer) then { - 30 setLightnings (ACE_MISC_PARAMS select 0); - 30 setRainbow (ACE_MISC_PARAMS select 1); - 30 setFog (ACE_MISC_PARAMS select 2); + if (!isServer) then { + if (GVAR(syncMisc)) then { + 30 setLightnings (ACE_MISC_PARAMS select 0); + 30 setRainbow (ACE_MISC_PARAMS select 1); + 30 setFog (ACE_MISC_PARAMS select 2); + }; + GVAR(temperatureShift) = (ACE_MISC_PARAMS select 3); + GVAR(badWeatherShift) = (ACE_MISC_PARAMS select 4); + GVAR(humidityShift) = (ACE_MISC_PARAMS select 5); + call FUNC(updateTemperature); + call FUNC(updateHumidity); }; }; -["ACE3", QGVAR(WindInfoKey), localize "STR_ACE_Weather_WindInfoKey", +["ACE3 Common", QGVAR(WindInfoKey), localize "STR_ACE_Weather_WindInfoKey", { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Statement [] call FUNC(displayWindInfo); - false }, {false}, [37, [true, false, false]], false, 0] call CBA_fnc_addKeybind; // (SHIFT + K) -// Update Wind simulWeatherSync; -_fnc_updateWind = { - ACE_wind = [] call FUNC(getWind); - setWind [ACE_wind select 0, ACE_wind select 1, true]; - 2 setGusts 0; - // Set waves: 0 when no wind, 1 when wind >= 16 m/s - 1 setWaves (((vectorMagnitude ACE_wind) / 16.0) min 1.0); - - //systemChat format ["w:%1 %2,ACE_w:%1 %2, w", [wind select 0, wind select 1, ACE_wind select 0, ACE_wind select 1]]; -}; -[_fnc_updateWind, 1, []] call CBA_fnc_addPerFrameHandler; - - -// Update Rain -_fnc_updateRain = { - if(GVAR(enableRain)) then { - if(!isNil "ACE_RAIN_PARAMS" && {!isNil QGVAR(rain_period_start_time)}) then { - _oldStrength = ACE_RAIN_PARAMS select 0; - _rainStrength = ACE_RAIN_PARAMS select 1; - _transitionTime = ACE_RAIN_PARAMS select 2; - _periodPosition = (time - GVAR(rain_period_start_time)) min _transitionTime; - _periodPercent = (_periodPosition/_transitionTime) min 1; - - 0 setRain ((_periodPercent*(_rainStrength-_oldStrength))+_oldStrength); - }; - }; -}; -[_fnc_updateRain, 2, []] call CBA_fnc_addPerFrameHandler; - - -// Update Temperature -_fnc_updateTemperature = { - _time = daytime; - _month = date select 1; - - // Temperature - _hourlyCoef = -0.5 * sin(360 * ((3 + (date select 3))/24 + (date select 4)/1440)); - - GVAR(currentTemperature) = (GVAR(TempDay) select (_month - 1)) * (1 - _hourlyCoef) + (GVAR(TempNight) select (_month - 1)) * _hourlyCoef; - GVAR(currentTemperature) = GVAR(currentTemperature) - 2 * humidity - 4 * overcast; - GVAR(currentTemperature) = round(GVAR(currentTemperature) * 10) / 10; - - // Humidity - GVAR(currentHumidity) = (GVAR(Humidity) select _month) / 100; - - if (rain > 0 && overcast > 0.7) then { - GVAR(currentHumidity) = 1; - } else { - _avgTemperature = ((GVAR(TempDay) select (_month - 1)) + (GVAR(TempNight) select (_month - 1))) / 2; - _pS1 = 6.112 * exp((17.62 * _avgTemperature) / (243.12 + _avgTemperature)); - _PS2 = 6.112 * exp((17.62 * GVAR(currentTemperature)) / (243.12 + GVAR(currentTemperature))); - GVAR(currentHumidity) = GVAR(currentHumidity) * _PS1 / _PS2; - }; - GVAR(currentHumidity) = 0 max GVAR(currentHumidity) min 1; - - // @todo: take altitude and humidity into account - GVAR(currentRelativeDensity) = (273.15 + 20) / (273.15 + GVAR(currentTemperature)); -}; -[_fnc_updateTemperature, 20, []] call CBA_fnc_addPerFrameHandler; +[FUNC(updateTemperature), 20, []] call CBA_fnc_addPerFrameHandler; +[FUNC(updateHumidity), 20, []] call CBA_fnc_addPerFrameHandler; +[FUNC(updateWind), 1, []] call CBA_fnc_addPerFrameHandler; +[FUNC(updateRain), 2, []] call CBA_fnc_addPerFrameHandler; \ No newline at end of file diff --git a/addons/weather/XEH_postServerInit.sqf b/addons/weather/XEH_postServerInit.sqf index cfe35e6009..5704212b79 100644 --- a/addons/weather/XEH_postServerInit.sqf +++ b/addons/weather/XEH_postServerInit.sqf @@ -1,3 +1,12 @@ #include "script_component.hpp" -[FUNC(serverController), 60] call cba_fnc_addPerFrameHandler; +// Rain +GVAR(rain_next_period) = -1; +GVAR(rain_period_count) = 0; +GVAR(current_rain) = 0; +GVAR(rain_current_range) = -1+(random 2); + +// Wind +call FUNC(initWind); + +[FUNC(serverController), GVAR(serverUpdateInterval)] call cba_fnc_addPerFrameHandler; diff --git a/addons/weather/XEH_preClientInit.sqf b/addons/weather/XEH_preClientInit.sqf deleted file mode 100644 index b979521cdd..0000000000 --- a/addons/weather/XEH_preClientInit.sqf +++ /dev/null @@ -1,17 +0,0 @@ -#include "script_component.hpp" - - -FUNC(KEEPTIME) = { - if((count GVAR(WINDSPEED)) > 0) then { - private ["_wind", "_p", "_str"]; - _wind = ACE_wind; - - _p = _wind call CBA_fnc_vect2polar; - _str = format["Wind: %1 at %2m/s (%3MPH)\n%4", floor(_p select 1), floor(_p select 0), floor((_p select 0)*2.23693629), GVAR(WINDSPEED)]; - TRACE_2("Wind",_wind,_str); - }; -}; - -#ifdef DEBUG_MODE_FULL - [FUNC(KEEPTIME), 0.0, []] call CBA_fnc_addPerFrameHandler; -#endif diff --git a/addons/weather/XEH_preInit.sqf b/addons/weather/XEH_preInit.sqf index 2751e77226..0f49226432 100644 --- a/addons/weather/XEH_preInit.sqf +++ b/addons/weather/XEH_preInit.sqf @@ -2,44 +2,22 @@ #include "script_component.hpp" ADDON = false; -LOG(MSG_INIT); +PREP(calculateAirDensity); +PREP(calculateBarometricPressure); PREP(displayWindInfo); PREP(getMapData); PREP(getWind); +PREP(initModuleSettings); +PREP(initWind); PREP(serverController); +PREP(updateAceWeather); +PREP(updateHumidity); +PREP(updateRain); +PREP(updateTemperature); +PREP(updateWind); - -// Rain variables -GVAR(enableRain) = true; -GVAR(rain_next_period) = -1; -GVAR(rain_period_count) = 0; -GVAR(rain_initial_rain) = 0; -if(overcast >= 0.7) then { - GVAR(rain_initial_rain) = (random ((overcast-0.7)/0.3)); -}; -GVAR(current_rain) = GVAR(rain_initial_rain); -GVAR(rain_current_range) = -1+(random 2); -GVAR(overcast_multiplier) = 1; - -// Wind Variables -ACE_wind = [0, 0, 0]; -GVAR(wind_initial_dir) = (random 360); -GVAR(wind_initial_speed) = (overcast*5)+(random (overcast*5)) max 1; -GVAR(wind_mean_speed) = GVAR(wind_initial_speed); -GVAR(wind_mean_dir) = GVAR(wind_initial_dir); -GVAR(wind_current_speed) = GVAR(wind_initial_speed); -GVAR(wind_current_dir) = GVAR(wind_initial_dir); -GVAR(wind_current_range_speed) = -1+(random 2); -GVAR(wind_current_range_dir) = -1+(random 2); -GVAR(wind_next_period) = -1; //ceil((2+random(5))/(GVAR(overcast_multiplier)/10)); -GVAR(wind_next_major_period) = -1; -GVAR(wind_period_count) = 0; -GVAR(wind_major_period_count) = 0; -GVAR(wind_total_time) = 0; -GVAR(wind_period_start_time) = time; - -// Init weather variables, in case they are needed before postInit +// Make sure this data is read before client/server postInit call FUNC(getMapData); ADDON = true; diff --git a/addons/weather/config.cpp b/addons/weather/config.cpp index 13e5a0cab2..39cf223518 100644 --- a/addons/weather/config.cpp +++ b/addons/weather/config.cpp @@ -3,7 +3,7 @@ class CfgPatches { class ADDON { units[] = {}; - weapons[] = {};// "ACE_Kestrel4500" }; + weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author[] = {"q1184", "Rocko", "esteldunedain","Ruthberg"}; @@ -14,3 +14,5 @@ class CfgPatches { #include "CfgEventhandlers.hpp" #include "CfgWorlds.hpp" #include "RscTitles.hpp" +#include "CfgVehicles.hpp" +#include "ACE_Settings.hpp" \ No newline at end of file diff --git a/addons/advanced_ballistics/functions/fnc_calculateAirDensity.sqf b/addons/weather/functions/fnc_calculateAirDensity.sqf similarity index 93% rename from addons/advanced_ballistics/functions/fnc_calculateAirDensity.sqf rename to addons/weather/functions/fnc_calculateAirDensity.sqf index ea7a77e837..298049e51d 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAirDensity.sqf +++ b/addons/weather/functions/fnc_calculateAirDensity.sqf @@ -1,7 +1,7 @@ /* * Author: Ruthberg * - * Displays a wind info (colored arrow) in the top left corner of the screen + * Calculates the air density * * Arguments: * 0: temperature - degrees celcius diff --git a/addons/weather/functions/fnc_calculateBarometricPressure.sqf b/addons/weather/functions/fnc_calculateBarometricPressure.sqf new file mode 100644 index 0000000000..c65d343c93 --- /dev/null +++ b/addons/weather/functions/fnc_calculateBarometricPressure.sqf @@ -0,0 +1,20 @@ +/* + * Author: Ruthberg + * + * Calculates the barometric pressure based on altitude and weather + * + * Arguments: + * 0: altitude - meters + * + * Return Value: + * 0: barometric pressure - hPA + * + * Return value: + * None + */ +#include "script_component.hpp" + +private ["_altitude"]; +_altitude = _this; + +(1013.25 * exp(-(GVAR(Altitude) + _altitude) / 7990) - 10 * overcast) diff --git a/addons/weather/functions/fnc_displayWindInfo.sqf b/addons/weather/functions/fnc_displayWindInfo.sqf index da1b8be267..7996503719 100644 --- a/addons/weather/functions/fnc_displayWindInfo.sqf +++ b/addons/weather/functions/fnc_displayWindInfo.sqf @@ -19,8 +19,8 @@ if (GVAR(WindInfo)) exitWith { 0 cutText ["", "PLAIN"]; true }; -if (underwater ACE_player) exitWith { true }; -if (vehicle ACE_player != ACE_player) exitWith { true }; +if (underwater ACE_player) exitWith { false }; +if (vehicle ACE_player != ACE_player) exitWith { false }; 2 cutText ["", "PLAIN"]; EGVAR(advanced_ballistics,Protractor) = false; @@ -28,14 +28,14 @@ EGVAR(advanced_ballistics,Protractor) = false; GVAR(WindInfo) = true; [{ - private ["_windSpeed", "_windDir", "_playerDir", "_windIndex", "_windColor", "_newWindSpeed", "_windSource", "_height"]; - + private ["_windSpeed", "_windDir", "_playerDir", "_windIndex", "_windColor"]; + if !(GVAR(WindInfo) && !(underwater ACE_player) && vehicle ACE_player == ACE_player) exitWith { GVAR(WindInfo) = false; 0 cutText ["", "PLAIN"]; [_this select 1] call cba_fnc_removePerFrameHandler; }; - + _windIndex = 12; _windColor = [1, 1, 1, 1]; @@ -46,7 +46,7 @@ GVAR(WindInfo) = true; } else { vectorMagnitude ACE_wind; }; - + if (_windSpeed > 0.2) then { _playerDir = getDir ACE_player; _windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); diff --git a/addons/weather/functions/fnc_getMapData.sqf b/addons/weather/functions/fnc_getMapData.sqf index 86a05fb225..f2527d1157 100644 --- a/addons/weather/functions/fnc_getMapData.sqf +++ b/addons/weather/functions/fnc_getMapData.sqf @@ -35,6 +35,32 @@ if (worldName in ["Thirsk"]) then { GVAR(Latitude) = 65; GVAR(Altitude) = 0; }; if (worldName in ["lingor"]) then { GVAR(Latitude) = -4; GVAR(Altitude) = 0; }; if (worldName in ["Panthera3"]) then { GVAR(Latitude) = 46; GVAR(Altitude) = 0; }; +// Assume default wind values +// Source: https://weatherspark.com/averages/32194/Lemnos-Limnos-North-Aegean-Islands-Greece +GVAR(WindSpeedMax) = [[8.8, 5.5], [8.8, 5], [8.6, 4.8], [7.6, 3.4], [7.0, 3.0], [7.1, 3.0], [7.5, 3.1], [8.0, 3.2], [7.6, 3.5], [7.8, 4.6], [7.9, 5.0], [8.2, 5.5]]; +GVAR(WindSpeedMean) = [4.8, 4.9, 4.6, 4.1, 3.5, 3.5, 4.3, 4.4, 4.1, 4.5, 4.5, 5.0]; +GVAR(WindSpeedMin) = [[0.2, 5.0], [0.1, 5.0], [0.2, 4.3], [0.0, 3.0], [0.0, 2.1], [0.0, 2.0], [0.1, 3.1], [0.3, 3.1], [0.0, 3.6], [0.0, 4.2], [0.1, 5.0], [0.2, 5.5]]; +GVAR(WindDirectionProbabilities) = [[0.06, 0.32, 0.05, 0.04, 0.15, 0.06, 0.02, 0.02], // January + [0.08, 0.32, 0.04, 0.04, 0.18, 0.06, 0.02, 0.02], // February + [0.09, 0.30, 0.04, 0.04, 0.20, 0.06, 0.02, 0.03], // March + [0.10, 0.25, 0.03, 0.04, 0.22, 0.06, 0.02, 0.04], // April + [0.18, 0.25, 0.03, 0.04, 0.18, 0.04, 0.01, 0.05], // May + [0.25, 0.25, 0.03, 0.03, 0.15, 0.03, 0.00, 0.08], // June + [0.32, 0.30, 0.02, 0.02, 0.10, 0.01, 0.00, 0.09], // July + [0.28, 0.35, 0.02, 0.01, 0.08, 0.01, 0.00, 0.08], // August + [0.20, 0.37, 0.03, 0.01, 0.11, 0.01, 0.01, 0.05], // September + [0.10, 0.39, 0.04, 0.02, 0.15, 0.02, 0.01, 0.03], // October + [0.08, 0.38, 0.06, 0.04, 0.19, 0.03, 0.02, 0.02], // November + [0.06, 0.37, 0.05, 0.03, 0.18, 0.04, 0.02, 0.02]];// December + +// Check if the wind data is defined in the map config +if (isArray (configFile >> "CfgWorlds" >> worldName >> "ACE_WindSpeedMean")) then { + GVAR(WindSpeedMin) = getArray (configFile >> "CfgWorlds" >> worldName >> "ACE_WindSpeedMin"); + GVAR(WindSpeedMean) = getArray (configFile >> "CfgWorlds" >> worldName >> "ACE_WindSpeedMean"); + GVAR(WindSpeedMax) = getArray (configFile >> "CfgWorlds" >> worldName >> "ACE_WindSpeedMax"); + GVAR(WindDirectionProbabilities) = getArray (configFile >> "CfgWorlds" >> worldName >> "ACE_WindDirectionProbabilities"); +}; + // Check if the weather data is defined in the map config if (isArray (configFile >> "CfgWorlds" >> worldName >> "ACE_TempDay")) exitWith { GVAR(TempDay) = getArray (configFile >> "CfgWorlds" >> worldName >> "ACE_TempDay"); @@ -110,3 +136,6 @@ if (worldName in ["Imrali"]) exitWith { GVAR(TempDay) = [1, 3, 9, 14, 19, 23, 25, 24, 21, 13, 7, 2]; GVAR(TempNight) = [-4, -3, 0, 4, 9, 12, 14, 14, 10, 6, 2, -2]; GVAR(Humidity) = [82, 80, 78, 70, 71, 72, 70, 73, 78, 80, 83, 82]; + +GVAR(currentTemperature) = 20; +GVAR(currentHumidity) = 0.5; \ No newline at end of file diff --git a/addons/weather/functions/fnc_getWind.sqf b/addons/weather/functions/fnc_getWind.sqf index e25d53309d..a23394e992 100644 --- a/addons/weather/functions/fnc_getWind.sqf +++ b/addons/weather/functions/fnc_getWind.sqf @@ -1,22 +1,34 @@ +/* + * Author: ACE2 Team, Ruthberg + * + * Calculate current wind locally from the data broadcasted by the server + * + * Argument: + * None + * + * Return value: + * Wind + */ #include "script_component.hpp" -_return = [0,0,0]; -if(!isNil "ACE_WIND_PARAMS") then { - _dir = ACE_WIND_PARAMS select 0; - _dirRange = (ACE_WIND_PARAMS select 1) - (ACE_WIND_PARAMS select 0); - _spd = ACE_WIND_PARAMS select 2; - _spdRange = (ACE_WIND_PARAMS select 3) - (ACE_WIND_PARAMS select 2); - _period = ACE_WIND_PARAMS select 4; +if (isNil "ACE_WIND_PARAMS") exitWith { [0, 0, 0] }; - _periodPosition = (time - GVAR(wind_period_start_time)) min _period; - _periodPercent = _periodPosition/_period; - _spdInc = _spdRange * _periodPercent; - _dirInc = _dirRange * _periodPercent; - _spd = (_spd + _spdInc); - _dir = _dir + _dirInc; - if (_dir > 360) then {_dir = _dir - 360}; - if (_dir < 0) then {_dir = _dir + 360}; +EXPLODE_5_PVT(ACE_WIND_PARAMS,_dir,_dirChange,_spd,_spdChange,_period); - _return = [_spd * sin _dir, _spd * cos _dir, 0]; -}; -_return; \ No newline at end of file +private ["_periodPercent", "_periodPosition"]; +_periodPosition = (time - GVAR(wind_period_start_time)) min _period; +_periodPercent = _periodPosition / _period; + +_spd = _spd + _spdChange * _periodPercent; +_dir = _dir + _dirChange * _periodPercent; + +_dir = (360 + _dir) % 360; + +TRACE_1("PeriodStartTime",Round(GVAR(wind_period_start_time))); +TRACE_2("Dir: Current/Change",Round(_dir),Round(_dirChange)); +TRACE_2("Spd: Current/Change",Round(_spd * 10) / 10,Round(_spdChange * 10) / 10); +TRACE_3("Period/Position/Percent",Round(_period),Round(_periodPosition),Round(_periodPercent * 100) / 100); + +// TODO: Add some deterministic noise + +[-_spd * sin(_dir), -_spd * cos(_dir), 0] diff --git a/addons/weather/functions/fnc_initModuleSettings.sqf b/addons/weather/functions/fnc_initModuleSettings.sqf new file mode 100644 index 0000000000..eb0eaafc31 --- /dev/null +++ b/addons/weather/functions/fnc_initModuleSettings.sqf @@ -0,0 +1,39 @@ +/* + * Author: Glowbal, Ruthberg + * Module for adjusting the wind deflection settings + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_logic", "_units", "_activated"]; +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; + +if !(_activated) exitWith {}; + +// Control server side weather propagation +[_logic, QGVAR(enableServerController), "enableServerController"] call EFUNC(common,readSettingFromModule); + +// Overrides the default weather (editor, mission settings) with ACE weather (map based) +[_logic, QGVAR(useACEWeather), "useACEWeather"] call EFUNC(common,readSettingFromModule); + +// Control client side weather effects +[_logic, QGVAR(syncRain), "syncRain"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(syncWind), "syncWind"] call EFUNC(common,readSettingFromModule); // Wind, Gusts, Waves +[_logic, QGVAR(syncMisc), "syncMisc"] call EFUNC(common,readSettingFromModule); // Lightnings, Rainbow, Fog + +// Server weather update interval +[_logic, QGVAR(serverUpdateInterval), "serverUpdateInterval"] call EFUNC(common,readSettingFromModule); + +GVAR(serverUpdateInterval) = 1 max GVAR(serverUpdateInterval) min 600; \ No newline at end of file diff --git a/addons/weather/functions/fnc_initWind.sqf b/addons/weather/functions/fnc_initWind.sqf new file mode 100644 index 0000000000..10b22efa2a --- /dev/null +++ b/addons/weather/functions/fnc_initWind.sqf @@ -0,0 +1,58 @@ +/* + * Author: Ruthberg + * + * Inits the wind variables on mission start + * + * Argument: + * None + * + * Return value: + * None + */ +#include "script_component.hpp" + +private ["_sum", "_rand", "_csum", "_index", "_month", "_windDirectionProbabilities"]; +_month = date select 1; +_windDirectionProbabilities = GVAR(WindDirectionProbabilities) select (_month - 1); + +ACE_wind = [0, 0, 0]; + +GVAR(wind_direction_reference) = random 360; +_sum = 0; +for "_i" from 0 to 7 do { + _sum = _sum + (_windDirectionProbabilities select _i); +}; +_rand = random _sum; +_csum = [0, 0, 0, 0, 0, 0, 0, 0]; +for "_i" from 0 to 7 do { + for "_j" from 0 to _i do { + _csum set [_i, (_csum select _i) + (_windDirectionProbabilities select _j)]; + }; +}; +_index = 0; +for "_i" from 0 to 7 do { + if (_rand > (_csum select _i)) then { + _index = _index + 1; + }; +}; +GVAR(wind_direction_reference) = 45 * _index; + +GVAR(wind_mean_dir) = GVAR(wind_direction_reference); +GVAR(wind_direction_reference) = GVAR(wind_direction_reference) + (random 22.5) - (random 22.5); +GVAR(wind_direction_reference) = (360 + GVAR(wind_direction_reference)) % 360; + +GVAR(min_wind_speed) = GVAR(WindSpeedMin) select (_month - 1); +GVAR(min_wind_speed) = (GVAR(min_wind_speed) select 0) + (random (GVAR(min_wind_speed) select 1)) - (random (GVAR(min_wind_speed) select 1)); +GVAR(min_wind_speed) = 0 max GVAR(min_wind_speed); +GVAR(mean_wind_speed) = GVAR(WindSpeedMean) select (_month - 1); +GVAR(max_wind_speed) = GVAR(WindSpeedMax) select (_month - 1); +GVAR(max_wind_speed) = (GVAR(max_wind_speed) select 0) + (random (GVAR(max_wind_speed) select 1)) - (random (GVAR(max_wind_speed) select 1)); +GVAR(max_wind_speed) = 0 max GVAR(max_wind_speed); + +GVAR(current_wind_direction) = GVAR(wind_direction_reference); +GVAR(current_wind_speed) = GVAR(min_wind_speed) + (GVAR(max_wind_speed) - GVAR(min_wind_speed)) * (random 1); + +GVAR(wind_period_count) = 0; +GVAR(wind_next_period) = -1; + +GVAR(wind_speed_debug_output) = []; diff --git a/addons/weather/functions/fnc_serverController.sqf b/addons/weather/functions/fnc_serverController.sqf index 7646475e81..2cbdeb581e 100644 --- a/addons/weather/functions/fnc_serverController.sqf +++ b/addons/weather/functions/fnc_serverController.sqf @@ -1,87 +1,33 @@ +/* + * Author: Ruthberg + * + * Gather weather parameters and broadcast them to the clients + * + * Argument: + * None + * + * Return value: + * None + */ #include "script_component.hpp" -// Rain simulation -if(GVAR(rain_period_count) > GVAR(rain_next_period)) then { +if (!GVAR(enableServerController)) exitWith {}; - if(overcast >= 0.7) then { - _lastRain = GVAR(current_rain); - _rainOverCast = ((overcast-0.7)/0.3); - GVAR(rain_next_period) = ceil((1+random(10))/GVAR(overcast_multiplier)); - - GVAR(current_rain) = (GVAR(current_rain)+(((GVAR(current_rain)))*((_rainOverCast*(GVAR(overcast_multiplier)))/8)*GVAR(rain_current_range))); - GVAR(current_rain) = (GVAR(current_rain) max 0.01) min 1; - - _transitionTime = (_rainOverCast*5)+(random (_rainOverCast*20))+1; - GVAR(rain_current_range) = -1+(random 2); - - ACE_RAIN_PARAMS = [_lastRain, GVAR(current_rain), _transitionTime]; - TRACE_4("",_lastRain,_rainOverCast,_transitionTime, overcast); - } else { - GVAR(current_rain) = 0; - _lastRain = GVAR(current_rain); - _rainOverCast = 1; - _transitionTime = (_rainOverCast*5)+(random (_rainOverCast*20))+1; - - ACE_RAIN_PARAMS = [_lastRain, GVAR(current_rain), _transitionTime]; - TRACE_4("",_lastRain,_rainOverCast,_transitionTime, overcast); +if (GVAR(useACEWeather)) then { + // Use location based real world weather data + [] call FUNC(updateAceWeather); +} else { + // Simply replicate the server weather on the clients + if (GVAR(syncRain)) then { + ACE_RAIN_PARAMS = [rain, rain, GVAR(serverUpdateInterval)]; + publicVariable "ACE_RAIN_PARAMS"; + }; + if (GVAR(syncWind)) then { + ACE_WIND_PARAMS = [wind call CBA_fnc_vectDir, 0, vectorMagnitude wind, 0, GVAR(serverUpdateInterval)]; + publicVariable "ACE_WIND_PARAMS"; + }; + if (GVAR(syncMisc)) then { + ACE_MISC_PARAMS = [lightnings, rainbow, fogParams, GVAR(temperatureShift), GVAR(badWeatherShift), GVAR(humidityShift)]; + publicVariable "ACE_MISC_PARAMS"; }; - - GVAR(rain_period_start_time) = time; - publicVariable "ACE_RAIN_PARAMS"; }; - -// Wind simulation -if(GVAR(wind_period_count) > GVAR(wind_next_period)) then { - _startDir = GVAR(wind_current_dir); - _startSpeed = GVAR(wind_current_speed); - GVAR(wind_current_dir) = (GVAR(wind_current_dir)+(((GVAR(wind_current_dir)))*((overcast*(GVAR(overcast_multiplier)))/8)*GVAR(wind_current_range_dir))); - - GVAR(wind_current_speed) = (GVAR(wind_current_speed)+(((GVAR(wind_current_speed)))*(overcast*(GVAR(overcast_multiplier))/12)*GVAR(wind_current_range_speed))); - GVAR(wind_current_speed) = GVAR(wind_current_speed) max 0.01; - - if(GVAR(wind_current_dir) < 0) then { - GVAR(wind_current_dir) = GVAR(wind_current_dir)+360; - }; - GVAR(wind_current_dir) = GVAR(wind_current_dir) % 360; - - GVAR(wind_current_range_speed) = (-1)+(random 2); - - GVAR(wind_current_range_dir) = (-1)+(random 2); - - GVAR(wind_next_period) = ceil((2+random(5))/(GVAR(overcast_multiplier))); - GVAR(wind_period_count) = 0; - - _gustCount = floor(random(GVAR(wind_next_period)*(overcast*((GVAR(overcast_multiplier)^3))))); - - _time = GVAR(wind_next_period)*60; - _gusts = []; - if(_gustCount > 0) then { - _maxInterval = _time/_gustCount; - for "_i" from 0 to _gustCount-1 do { - _gustTime = (random (3 min _maxInterval)); - _timeTillGust = (_maxInterval*_i)+(random (_maxInterval - _gustTime)); - _gustSpeed = (random 1); - _gustDir = (GVAR(wind_current_dir)+(GVAR(wind_current_dir)*(-1+(random 2))))*(overcast*(GVAR(overcast_multiplier))); - _gusts set[(count _gusts), [_timeTillGust, _gustTime, _gustSpeed, _gustDir]]; - }; - }; - - GVAR(wind_total_time) = GVAR(wind_total_time) + GVAR(wind_next_period); - - ACE_WIND_PARAMS = [_startDir, - GVAR(wind_current_dir), - _startSpeed, - GVAR(wind_current_speed), - _time, - _gusts]; - - GVAR(wind_period_start_time) = time; - publicVariable "ACE_WIND_PARAMS"; -}; - -// Sync misc. parameters -ACE_MISC_PARAMS = [lightnings, rainbow, fogParams]; -publicVariable "ACE_MISC_PARAMS"; - -GVAR(rain_period_count) = GVAR(rain_period_count) + 1; -GVAR(wind_period_count) = GVAR(wind_period_count) + 1; \ No newline at end of file diff --git a/addons/weather/functions/fnc_updateAceWeather.sqf b/addons/weather/functions/fnc_updateAceWeather.sqf new file mode 100644 index 0000000000..8ed0bb0d10 --- /dev/null +++ b/addons/weather/functions/fnc_updateAceWeather.sqf @@ -0,0 +1,105 @@ +/* + * Author: ACE2 Team, esteldunedain, ruthberg + * + * Updates the wind and rain evolution on the server. Broadcasts the current and next values to the clients + * + * Argument: + * None + * + * Return value: + * None + */ +#include "script_component.hpp" + +private ["_overcastMultiplier", "_lastRain", "_rainOverCast", "_transitionTime", "_windDirectionVariance", "_windSpeed", "_windSpeedChange", "_windMaxDiff", "_windMinDiff", "_windDirection", "_windDirectionChange", "_ratioMin", "_ratioMax"]; + +_overcastMultiplier = 1 max (2* overcast) min 2; // 0 (@ overcast 0), 2 (@ overcast 1) + +// Rain simulation +if (GVAR(syncRain) && GVAR(rain_period_count) > GVAR(rain_next_period)) then { + + GVAR(rain_next_period) = ceil((1 + (random 10)) / _overcastMultiplier); + GVAR(rain_period_count) = 0; + + _lastRain = GVAR(current_rain); + + if (overcast >= 0.7) then { + _rainOverCast = (overcast - 0.7) / 0.3; + if (GVAR(current_rain) == 0) then { + // Initialize rain with a random strength depending on the current overcast value + GVAR(current_rain) = 0.25 + (random 0.25) + (random 0.5) * _rainOverCast; + }; + + GVAR(current_rain) = GVAR(current_rain) + GVAR(current_rain) * ((_rainOverCast * _overcastMultiplier) / 8) * GVAR(rain_current_range); + GVAR(current_rain) = 0.01 max GVAR(current_rain) min 1; + + GVAR(rain_current_range) = -1 + (random 2); + } else { + _rainOverCast = 1; + + GVAR(current_rain) = 0; + }; + + _transitionTime = 1 + (_rainOverCast * 5) + (random (_rainOverCast * 20)); + + ACE_RAIN_PARAMS = [_lastRain, GVAR(current_rain), _transitionTime]; + TRACE_4("",_lastRain,_rainOverCast,_transitionTime,overcast); + + GVAR(rain_period_start_time) = time; + publicVariable "ACE_RAIN_PARAMS"; +}; + +// Wind simulation +if (GVAR(syncWind) && GVAR(wind_period_count) > GVAR(wind_next_period)) then { + + GVAR(wind_next_period) = ceil((2 + (random 5)) / _overcastMultiplier); + GVAR(wind_period_count) = 0; + + _windDirectionVariance = (90 - (random 180)) * (overcast ^ 2); + _windDirection = (360 + GVAR(wind_direction_reference) + _windDirectionVariance) % 360; + _windDirectionChange = _windDirection - GVAR(current_wind_direction); + if (_windDirectionChange > 180) then { + _windDirectionChange = _windDirectionChange - 360; + }; + if (_windDirectionChange < -180) then { + _windDirectionChange = 360 + _windDirectionChange; + }; + + _windMaxDiff = GVAR(mean_wind_speed) - GVAR(max_wind_speed); + _windMinDiff = GVAR(min_wind_speed) - GVAR(mean_wind_speed); + + _ratioMax = (random 1) ^ 2; + _ratioMin = (random 1) ^ 2; + + _windSpeed = GVAR(current_wind_speed); + _windSpeedChange = 0; + if ((random 1) < (0.3 max overcast)) then { + _windSpeed = GVAR(mean_wind_speed) + _windMaxDiff * _ratioMax + _windMinDiff * _ratioMin; + _windSpeedChange = _windSpeed - GVAR(current_wind_speed); + }; + + _transitionTime = GVAR(wind_next_period) * GVAR(serverUpdateInterval); + + TRACE_5("dirCur/dirNew/spdCur/spdNew/period",GVAR(current_wind_direction),_windDirection,GVAR(current_wind_speed),_windSpeed,_transitionTime); + + ACE_WIND_PARAMS = [GVAR(current_wind_direction), + _windDirectionChange, + GVAR(current_wind_speed), + _windSpeedChange, + _transitionTime]; + + GVAR(current_wind_direction) = _windDirection; + GVAR(current_wind_speed) = _windSpeed; + + GVAR(wind_period_start_time) = time; + publicVariable "ACE_WIND_PARAMS"; +}; + + +if (GVAR(syncMisc)) then { + ACE_MISC_PARAMS = [lightnings, rainbow, fogParams, GVAR(temperatureShift), GVAR(badWeatherShift), GVAR(humidityShift)]; + publicVariable "ACE_MISC_PARAMS"; +}; + +GVAR(rain_period_count) = GVAR(rain_period_count) + 1; +GVAR(wind_period_count) = GVAR(wind_period_count) + 1; \ No newline at end of file diff --git a/addons/weather/functions/fnc_updateHumidity.sqf b/addons/weather/functions/fnc_updateHumidity.sqf new file mode 100644 index 0000000000..dce031b3f3 --- /dev/null +++ b/addons/weather/functions/fnc_updateHumidity.sqf @@ -0,0 +1,31 @@ +/* + * Author: ACE2 Team + * + * Updates GVAR(currentHumidity) based on + * + * Argument: + * Nothing + * + * Return value: + * Nothing + */ +#include "script_component.hpp" + +private ["_month", "_avgTemperature", "_pS1", "_pS2"]; +_month = date select 1; + +GVAR(currentHumidity) = (GVAR(Humidity) select _month) / 100; + +if (rain > 0 && overcast > 0.7) then { + GVAR(currentHumidity) = 1; +} else { + _avgTemperature = ((GVAR(TempDay) select (_month - 1)) + (GVAR(TempNight) select (_month - 1))) / 2; + _pS1 = 6.112 * exp((17.62 * _avgTemperature) / (243.12 + _avgTemperature)); + _PS2 = 6.112 * exp((17.62 * GVAR(currentTemperature)) / (243.12 + GVAR(currentTemperature))); + GVAR(currentHumidity) = GVAR(currentHumidity) * _PS1 / _PS2; + GVAR(currentHumidity) = GVAR(currentHumidity) + GVAR(humidityShift); + + TRACE_1("humidityShift",GVAR(humidityShift)); +}; + +GVAR(currentHumidity) = 0 max GVAR(currentHumidity) min 1; diff --git a/addons/weather/functions/fnc_updateRain.sqf b/addons/weather/functions/fnc_updateRain.sqf new file mode 100644 index 0000000000..d240093443 --- /dev/null +++ b/addons/weather/functions/fnc_updateRain.sqf @@ -0,0 +1,25 @@ +/* + * Author: ACE2 Team, Ruthberg + * + * Updates rain based on ACE_RAIN_PARAMS + * + * Argument: + * Nothing + * + * Return value: + * Nothing + */ +#include "script_component.hpp" + +if (!GVAR(syncRain)) exitWith {}; + +if (!isNil "ACE_RAIN_PARAMS") then { + + EXPLODE_3_PVT(ACE_RAIN_PARAMS,_oldRain,_newRain,_period); + + private ["_periodPosition", "_periodPercent"]; + _periodPosition = (time - GVAR(rain_period_start_time)) min _period; + _periodPercent = (_periodPosition / _period) min 1; + + 0 setRain (_oldRain + (_newRain - _oldRain) * _periodPercent); +}; diff --git a/addons/weather/functions/fnc_updateTemperature.sqf b/addons/weather/functions/fnc_updateTemperature.sqf new file mode 100644 index 0000000000..870d00333c --- /dev/null +++ b/addons/weather/functions/fnc_updateTemperature.sqf @@ -0,0 +1,24 @@ +/* + * Author: ACE2 Team + * + * Updates GVAR(currentTemperature) based on the map data + * + * Argument: + * Nothing + * + * Return value: + * Nothing + */ +#include "script_component.hpp" + +private ["_time", "_month", "_hourlyCoef"]; +_time = daytime; +_month = date select 1; + +_hourlyCoef = -0.5 * sin(360 * ((3 + (date select 3))/24 + (date select 4)/1440)); + +GVAR(currentTemperature) = (GVAR(TempDay) select (_month - 1)) * (1 - _hourlyCoef) + (GVAR(TempNight) select (_month - 1)) * _hourlyCoef; +GVAR(currentTemperature) = GVAR(currentTemperature) + GVAR(temperatureShift) - GVAR(badWeatherShift) * overcast; +GVAR(currentTemperature) = round(GVAR(currentTemperature) * 10) / 10; + +TRACE_2("temperatureShift/badWeatherShift",GVAR(temperatureShift),GVAR(badWeatherShift)); diff --git a/addons/weather/functions/fnc_updateWind.sqf b/addons/weather/functions/fnc_updateWind.sqf new file mode 100644 index 0000000000..06bb57d093 --- /dev/null +++ b/addons/weather/functions/fnc_updateWind.sqf @@ -0,0 +1,23 @@ +/* + * Author: ACE2 Team, Ruthberg + * + * Updates wind, gusts and waves based on ACE_wind + * + * Argument: + * Nothing + * + * Return value: + * Nothing + */ +#include "script_component.hpp" + +if (!GVAR(syncWind)) exitWith { ACE_wind = wind }; + +ACE_wind = [] call FUNC(getWind); +setWind [ACE_wind select 0, ACE_wind select 1, true]; +2 setGusts 0; + +// Set waves: 0 when no wind, 1 when wind >= 16 m/s +1 setWaves (((vectorMagnitude ACE_wind) / 16.0) min 1.0); + +TRACE_3("Wind/ACE_wind/Deviation(m/s)",wind,ACE_wind,Round((vectorMagnitude (ACE_wind vectorDiff wind)) * 1000) / 1000); diff --git a/addons/weather/script_component.hpp b/addons/weather/script_component.hpp index a21d8245fd..edc1ac64d0 100644 --- a/addons/weather/script_component.hpp +++ b/addons/weather/script_component.hpp @@ -10,3 +10,11 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + +#define ABSOLUTE_ZERO_IN_CELSIUS -273.15 +#define KELVIN(t) (t - ABSOLUTE_ZERO_IN_CELSIUS) +#define CELSIUS(t) (t + ABSOLUTE_ZERO_IN_CELSIUS) +#define UNIVERSAL_GAS_CONSTANT 8.314 +#define WATER_VAPOR_MOLAR_MASS 0.018016 +#define DRY_AIR_MOLAR_MASS 0.028964 +#define SPECIFIC_GAS_CONSTANT_DRY_AIR 287.058 diff --git a/addons/weather/stringtable.xml b/addons/weather/stringtable.xml index 4827751c6b..32362825ee 100644 --- a/addons/weather/stringtable.xml +++ b/addons/weather/stringtable.xml @@ -1,10 +1,16 @@  - Show Wind Info Pokaż inf. o wietrze + Показать информацию о ветре + Afficher information sur le vent + Mostrar información del viento + Mostra informazioni sul vento + Zeige Windinformationen + Széladatok mutatása + Zobrazit informace o větru - \ No newline at end of file + diff --git a/addons/winddeflection/ACE_Settings.hpp b/addons/winddeflection/ACE_Settings.hpp index 89235fe5af..0a0cac6b34 100644 --- a/addons/winddeflection/ACE_Settings.hpp +++ b/addons/winddeflection/ACE_Settings.hpp @@ -1,4 +1,16 @@ class ACE_Settings { + class GVAR(enabled) { + displayName = "Wind Deflection"; + description = "Enables wind deflection"; + typeName = "BOOL"; + value = 1; + }; + class GVAR(vehicleEnabled) { + displayName = "Vehicle Enabled"; + description = "Enables wind deflection for static/vehicle gunners"; + typeName = "BOOL"; + value = 1; + }; class GVAR(simulationInterval) { displayName = "Simulation Interval"; description = "Defines the interval between every calculation step"; @@ -7,7 +19,7 @@ class ACE_Settings { }; class GVAR(simulationRadius) { displayName = "Simulation Radius"; - description = "Defines the radius (in meters) in which advanced ballistics are applied"; + description = "Defines the radius around the player (in meters) at which projectiles are wind deflected"; typeName = "SCALAR"; value = 3000; }; diff --git a/addons/winddeflection/CfgEventHandlers.hpp b/addons/winddeflection/CfgEventHandlers.hpp index 4f54a73c84..d856993322 100644 --- a/addons/winddeflection/CfgEventHandlers.hpp +++ b/addons/winddeflection/CfgEventHandlers.hpp @@ -5,7 +5,7 @@ class Extended_PreInit_EventHandlers { }; class Extended_FiredBIS_EventHandlers { - class CAManBase { + class AllVehicles { class ADDON { firedBIS = QUOTE(_this call FUNC(handleFired)); }; diff --git a/addons/winddeflection/CfgVehicles.hpp b/addons/winddeflection/CfgVehicles.hpp index f9362a2711..1c24c0a386 100644 --- a/addons/winddeflection/CfgVehicles.hpp +++ b/addons/winddeflection/CfgVehicles.hpp @@ -11,6 +11,18 @@ class CfgVehicles { isTriggerActivated = 0; author = "$STR_ACE_Common_ACETeam"; class Arguments { + class enabled { + displayName = "Wind Deflection"; + description = "Enables wind deflection"; + typeName = "BOOL"; + defaultValue = 1; + }; + class vehicleEnabled { + displayName = "Vehicle Enabled"; + description = "Enables wind deflection for static/vehicle gunners"; + typeName = "BOOL"; + defaultValue = 1; + }; class simulationInterval { displayName = "Simulation Interval"; description = "Defines the interval between every calculation step"; @@ -19,7 +31,7 @@ class CfgVehicles { }; class simulationRadius { displayName = "Simulation Radius"; - description = "Defines the radius (in meters) in which advanced ballistics are applied"; + description = "Defines the radius around the player (in meters) at which projectiles are wind deflected"; typeName = "NUMBER"; defaultValue = 3000; }; diff --git a/addons/winddeflection/functions/fnc_handleFired.sqf b/addons/winddeflection/functions/fnc_handleFired.sqf index 5ee22ecf4f..f7090cfc2a 100644 --- a/addons/winddeflection/functions/fnc_handleFired.sqf +++ b/addons/winddeflection/functions/fnc_handleFired.sqf @@ -21,14 +21,16 @@ */ #include "script_component.hpp" -if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {false}; - private ["_unit", "_bullet"]; _unit = _this select 0; _bullet = _this select 6; +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && (_bullet isKindOf "BulletBase") && (_unit isKindOf "Man")) exitWith {false}; + if (!hasInterface) exitWith {false}; -if (!(_bullet isKindOf "BulletBase")) exitWith {false}; +if (!(GVAR(enabled))) exitWith {false}; +if (!(GVAR(vehicleEnabled)) && !(_unit isKindOf "Man")) exitWith {false}; +if (!((_bullet isKindOf "BulletBase") || (_bullet isKindOf "GrenadeBase"))) exitWith {false}; if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {false}; if (!([_unit] call EFUNC(common,isPlayer))) exitWith {false}; diff --git a/addons/winddeflection/functions/fnc_initModuleSettings.sqf b/addons/winddeflection/functions/fnc_initModuleSettings.sqf index 4cf75c885a..40be14a2b2 100644 --- a/addons/winddeflection/functions/fnc_initModuleSettings.sqf +++ b/addons/winddeflection/functions/fnc_initModuleSettings.sqf @@ -22,6 +22,8 @@ _activated = _this select 2; if !(_activated) exitWith {}; +[_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleEnabled), "vehicleEnabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(simulationInterval), "simulationInterval"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(simulationRadius), "simulationRadius"] call EFUNC(common,readSettingFromModule); diff --git a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf index 9859f330dd..4c2859f9b6 100644 --- a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf +++ b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf @@ -16,23 +16,23 @@ #include "script_component.hpp" [{ - private ["_bullet", "_airFriction", "_args", "_deltaT", "_bulletVelocity", "_bulletSpeed", "_trueVelocity", "_trueVelocity", "_dragRef", "_drag", "_accelRef", "_accel"]; + private ["_args", "_bullet", "_airFriction", "_time", "_deltaT", "_bulletVelocity", "_bulletSpeed", "_trueVelocity", "_trueSpeed", "_dragRef", "_drag", "_accelRef", "_accel"]; _args = _this select 0; _bullet = _args select 0; _airFriction = _args select 1; _time = _args select 2; - - if (!alive _bullet) exitwith { - [_this select 1] call cba_fnc_removePerFrameHandler; - }; - - _deltaT = time - _time; - _args set[2, time]; - + _bulletVelocity = velocity _bullet; _bulletSpeed = vectorMagnitude _bulletVelocity; - + + if (!alive _bullet || ((_bullet isKindOf "BulletBase") && _bulletSpeed < 100)) exitwith { + [_this select 1] call cba_fnc_removePerFrameHandler; + }; + + _deltaT = time - _time; + _args set[2, time]; + if (vectorMagnitude ACE_wind > 0) then { _trueVelocity = _bulletVelocity vectorDiff ACE_wind; _trueSpeed = vectorMagnitude _trueVelocity; diff --git a/addons/winddeflection/stringtable.xml b/addons/winddeflection/stringtable.xml index 985f23a467..af6f05a912 100644 --- a/addons/winddeflection/stringtable.xml +++ b/addons/winddeflection/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -6,19 +6,25 @@ Wind Information Informacje o wietrze Información del viento - Ветер + Информация о ветре Informace o větru Vent Windinformationen + Szélinformáció + Informazioni sul vento + Informação do vento Direction: %1 Kierunek: %1 Dirección: %1 - Направление: %1 + Направление: %1° Směr: %1 Direction %1 Windrichtung: %1 + Irány: %1 + Direzione: %1 + Direção: %1 Speed: %1 m/s @@ -27,16 +33,22 @@ Скорость: %1 м/с Rychlost: %1 m/s Vitesse %1 m/s - Geschwindigkeit: %1m/s + Geschwindigkeit: %1 m/s + Sebesség: %1 m/s + Velocità: %1 m/s + Velocidade: %1 m/s Weather Information Informacje o pogodzie Información Meteorológica - Погода + Информация о погоде Informace o počasí Météo Wetterinformationen + Időjárás-Információ + Meteo + Informação Meteorológica Humidity: %1% @@ -46,6 +58,9 @@ Vlhkost: %1% Humidité: %1% Luftfeuchtigkeit: %1 + Páratartalom: %1% + Umidità: %1% + Humidade: %1% diff --git a/documentation/README_DE.md b/documentation/README_DE.md new file mode 100644 index 0000000000..0b5ca4d0ef --- /dev/null +++ b/documentation/README_DE.md @@ -0,0 +1,48 @@ +

+ +

+

+ + ACE version + + + ACE download + + + ACE issues + + + ACE license + +

+

Benötigt eine Aktuelle Version von CBA A3 | BIF thread

+ +**ACE3** ist ein Gemeinschaftsprojekt der sich zusammengeschlossenen Moddinggruppen von **ACE2**, **AGM** und **CSE** mit dem Ziel den Realismus und die Spieltiefe von Arma 3 zu steigern. + +Da die MOD vollkommen als **open-source** Projekt gestaltet ist, steht es jedem frei Änderungen vorzuschlagen, oder seine eigene, modifizierte Version zu erstellen, solange diese ebenfalls der Öffentlichkeit zugänglich ist und mit GNU General Public License übereinstimmt. (Weitere Informationen ist der Lizenzdatei in diesem Projekt entnehmbar) + +Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sodass jede Gemeinschaft ihre eigene Version der Mod unterhalten kann. Dies kann zum Beispiel einige Funktionalitäten ausschließen, da das Feature nicht gewünscht ist, oder es mit einer anderen MOD in Konflikt gerät etc. .Ebenfalls können viele Einstellungen vom Missionsersteller vorgenommen werden (u.a. am medizinischem System), sodass eine individuelle Erfahrung gewährleistet wird. + +### Features +* Verbessertes medizinisches System +* Logistik System: U.a. Transport und Fahrzeugreparatur +* Sprengstoffsystem mit unterschiedlichen Zündern +* Gefangenensystem +* Reale Namen für Arma 3 Fahrzeuge und Waffen +* Realistisches, ballistisches Verhalten (Wind und Luftfeuchtigkeit) +* Simulation der Rückstrahlzone +* Ein Feuerleitsystem für gepanzerte Fahrzeuge und Hubschrauber + ***und noch viel mehr...*** + +#### Anleitungen +Du hast ACE3 installiert, hast aber keine Ahnung was und wie alles funktioniert und wo sich was befindet? [Erste Schritte](https://github.com/acemod/ACE3/blob/master/documentation/user/getting-started.md). + +#### Mitwirken +Wenn du bei der Entwicklung der MOD mithelfen möchtest, so kannst du dies tun, indem du nach Fehlern Ausschau hältst, oder neue Funktionen vorschlägst. Um etwas beizutragen, "Forke" einfach dieses Archiv (bzw. repository) und erstelle deine "Pull-Request", welche von anderen Entwicklern und Beiträgern überprüft wird. Bitte trage dich dabei in "AUTHORS.txt" mit deinem Nutzernamen und einer gütligen Email-Adresse ein. + +Um einen Fehler oder ein Feature zu melden bzw. ein bereits Bestehendes zu ändern - nutze unseren [Issue Tracker](https://github.com/acemod/ACE3/issues). + +#### Testen & MOD erstellen +Wenn du die neusten Entwicklungen erleben und uns dabei helfen möchtest bestehende Fehler zu entdecken, lade dir einfach die "Master Branch" herunter. Entweder nutzt du Git - wenn die Schritte bekannt sind - oder du lädst es dir direkt über [diesen Link] (https://github.com/acemod/ACE3/archive/master.zip) herunter. + +Wie du deine eigene Entwicklungsumgebung und eine Testversion von ACE erstellst folge [dieser Anleitung](https://github.com/acemod/ACE3/blob/master/documentation/development/setting-up-the-development-environment.md). diff --git a/documentation/README_PL.md b/documentation/README_PL.md new file mode 100644 index 0000000000..d156185908 --- /dev/null +++ b/documentation/README_PL.md @@ -0,0 +1,84 @@ +

+ +

+

+ + ACE version + + + ACE download + + + ACE issues + + + BIF thread + + + ACE license + +

+

Wymaga najnowszej wersji CBA A3. Odwiedź nas na Facebook | YouTube | Twitter | Reddit

+ + +**ACE3** to efekt wspólnego wysiłku grup moderów odpowiedzialnych za **ACE2**, **AGM** oraz **CSE** w celu zwiększenia realizmu i autentyczności Arma 3. + +Projekt ten jest całkowicie **otwarty źródłowo** i wszelki wkład w rozwój jest mile widziany. Możesz bez przeszkód prowadzić swoją własną dostosowaną wersję, o ile zmiany jakie wprowadzisz będą otwarte dla publiki zgodnie z GNU General Public License ([GPLv2](https://github.com/acemod/ACE3/blob/master/LICENSE)). + +Modyfikacja ta jest **budowana modułowo**, dzięki temu prawie każdy dostarczony plik PBO może zostać łatwo usunięty z konfiguracji. Dzięki temu, grupa może prowadzić własną, dostosowaną do siebie, wersję ACE wyłączając elementy, których nie potrzebują, lub które po prostu nie działają z innymi addonami. Moduły same w sobie np. system medyczny, posiadają wiele możliwości konfiguracji, pozwalając mission designerom dostosować ogólne doświadczenie z gry. + +### Główne cechy +* Całkowicie nowy system akcji/interakcji 3D +* Wydajna i niezawodna struktura +* Skupienie na modułowości i customizacji +* Elastyczny system ustawień i konfiguracji opcji u klienta i serwera +* Ulepszony system medyczny z różnymi stopniami zaawansowania (podstawowy/rozszerzony) skupiony na grywalności i realizmowi +* Prawidłowa i spójna synchronizowana pogoda +* Balistyka oparta na warunkach pogodowych i wietrze +* Możliwość brania jeńców +* Rozszerzony system ładunków wybuchowych, włączając w to użycie różnego rodzaju zapalników +* Ulepszenia mapy - stawianie markerów i przybory mapy +* Zaawansowane naprowadzanie rakiet i wskazywanie laserem + +#### Dodatkowe cechy +* Przeciąganie i przenoszenie +* Realistyczne nazwy pojazdów i broni +* System kontroli ognia (SKO) dla pojazdów opancerzonych oraz śmigłowców +* Realistyczna balistyka/SKO obliczana w rozszerzeniach C/C++ +* Symulacja strefy backblastu i podciśnienia +* Jednorazowe wyrzutnie +* Realistyczne siły G +* Zamykanie pojazdów na kluczyk +* Realistyczne tryby termowizji oraz noktowizji +* Przepakowywanie magazynków +* Realistyczna mechanika przegrzewania broni +* Symulacja głuchoty bitewnej (tymczasowej utraty słuchu) +* Ulepszona fizyka ragdoll +* Ulepszona interakcja dla asystentów i amunicyjnych +* Regulowane celowniki snajperskie +* Usunięte animacje bezczynności z opuszczoną bronią +* Usunięte głosy awatara gracza +* Skakanie przez przeszkody, wspinanie się na ściany i przecinanie płotów +* Urządzenia Vector, MicroDAGR, Kestrel
+***i wiele wiele więcej...*** + +### Poradniki i instrukcje +Jeżeli zainstalowałeś ACE3 lecz masz problem ze zrozumieniem jak to wszystko działa, lub gdzie zacząć, zacznij od przeczytania tego: +* [Wprowadzenie](http://ace3mod.com/wiki/user/getting-started.html) + +#### Współpraca +Możesz pomóc w rozwoju addonu szukając potencjalnych bugów w naszym kodzie, lub zgłaszając nowe funkcje. Aby wnieść swój wkład do ACE, po prostu zforkuj to repozytorium na swoje konto GitHub i zgłoś swoje pull requesty do przeglądu przez innych współpracowników. Pamiętaj, aby dodać siebie do listy autorów każdego PBO jakie edytujesz oraz do pliku ['AUTHORS.txt'](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) dodając także swój adres e-mail. + +Używaj naszego [Issue Tracker-a](https://github.com/acemod/ACE3/issues) aby zgłaszać bugi, proponować nowe funkcje lub sugerować zmiany do aktualnie istniejących. Zobacz także: +* [Jak zgłosić bug-a](http://ace3mod.com/wiki/user/how-to-report-an-issue.html) +* [Jak zgłosić feature request-a](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html) + +#### Testowanie i budowanie +Aby pomóc nam w testowaniu najnowszych zmian rozwojowych, pobierz nasz master branch ([bezpośrednio](https://github.com/acemod/ACE3/archive/master.zip), lub [korzystając z git](https://help.github.com/articles/fetching-a-remote/)), a następnie złóż testowego build-a: +* [Konfiguracja środowiska do testów](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html) – intrukcja krok-po-kroku jak poprawnie ustawić i zbudować wersję ACE do celów testowych. \ No newline at end of file diff --git a/documentation/development/ace3-config-entries.md b/documentation/development/ace3-config-entries.md index cc0104a8b1..1033172469 100644 --- a/documentation/development/ace3-config-entries.md +++ b/documentation/development/ace3-config-entries.md @@ -46,17 +46,23 @@ ace_gforcecoef ace_protection ace_scopeadjust_horizontal ace_scopeadjust_vertical +ace_scopeadjust_increment ace_isusedlauncher ace_attachable ace_range ace_detonator +ace_barrelTwist +ace_twistDirection +ace_barrelLength +ace_laserpointer +ace_nextmodeclass +ace_modedescription ``` ### CfgAmmo ```c++ -ace_bulletmass ace_recoil_shakemultiplier ace_frag_skip ace_frag_force @@ -68,6 +74,17 @@ ace_frag_gurney_k ace_explodeondefuse ace_explosive ace_fcs_airburst +ace_caliber +ace_bulletlength +ace_bulletmass +ace_transonicstabilitycoef +ace_ammotempmuzzlevelocityshifts +ace_ballisticcoefficients +ace_velocityboundaries +ace_standardatmosphere +ace_dragmodel +ace_muzzlevelocities +ace_barrellengths ``` diff --git a/documentation/development/ace3-events-system.md b/documentation/development/ace3-events-system.md index d7c99e558e..33412aa8fa 100644 --- a/documentation/development/ace3-events-system.md +++ b/documentation/development/ace3-events-system.md @@ -23,6 +23,11 @@ Events can be removed or cleared with the following commands. * `[eventName, eventHandlerId] call ace_common_fnc_removeEventHandler`
will remove a specific event handler of the event name, using the ID returned from `ace_common_fnc_addEventHandler`. * `[eventName] call ace_common_fnc_removeAllEventHandlers`
will remove all event handlers for that type of event. +### Synchronized Events +* `[eventName, eventCodeBlock, ttlNumberOrCodeBlock] call ace_common_fnc_addSyncedEventHandler`
adds a globally synchronized event handler which will expire events after the provided TTL, or the code returns true. +* `[eventName] call ace_common_fnc_removeSyncedEventHandler`
will remove a specific event handler of the event name, using the ID returned from `ace_common_fnc_addSyncedEventHandler`. +* * `[eventName, args, ttlNumberOrCodeBlock] call ace_common_fnc_syncedEvent`
calls a global synchronized event, which will also be run on JIP players unless it has expired; event will expire after the provided TTL, or the code returns true. + ### Pattern: ```c++ // tapper machine @@ -52,6 +57,13 @@ PREP(onTapShoulder); [_newPlayer, _oldPlayer] local + + "PlayerJIP" + Player was a JIP player, and `player` object is now created. + common + [_player] + local + "playerInventoryChanged" diff --git a/documentation/development/coding-guidelines.md b/documentation/development/coding-guidelines.md index f72263eeaa..e39581a9d4 100644 --- a/documentation/development/coding-guidelines.md +++ b/documentation/development/coding-guidelines.md @@ -35,8 +35,8 @@ Tabs can be tricky sometimes, especially when it comes to sharing code with othe ## Braces -- opening bracket on the same line as keyword -- closing bracket in own line, same level of indentation as keyword +- opening brace on the same line as keyword +- closing brace in own line, same level of indentation as keyword **Yes:** @@ -70,7 +70,7 @@ class Something : Or { }; ``` -When using `if`/`else`, it is encouraged to put `else` on the same line as the closing bracket to save space: +When using `if`/`else`, it is encouraged to put `else` on the same line as the closing brace to save space: ```c++ if (alive player) then { @@ -90,7 +90,7 @@ class Three {foo = 3;}; #### Reasoning -Putting the opening bracket in it's own line wastes a lot of space, and keeping the closing bracket on the same level as the keyword makes it easier to recognize what exactly the bracket closes. +Putting the opening brace in it's own line wastes a lot of space, and keeping the closing brace on the same level as the keyword makes it easier to recognize what exactly the brace closes. ## How to create a new module diff --git a/documentation/development/extension-guidelines.md b/documentation/development/extension-guidelines.md index 0558d49d5e..b5e7e98586 100644 --- a/documentation/development/extension-guidelines.md +++ b/documentation/development/extension-guidelines.md @@ -11,7 +11,7 @@ order: 9 ### Requirements - A compiler (VS/GCC/Clang) - - If starting with visual studio, you need to make sure to use the Visual studio command prompt + - If starting with Visual Studio, you need to make sure to use the Visual studio command prompt - cmake 3.0 or later in your path ### Cross-Platform Guidelines diff --git a/documentation/development/how-to-translate-ace3.md b/documentation/development/how-to-translate-ace3.md index b7e23fa575..576cd3a98b 100644 --- a/documentation/development/how-to-translate-ace3.md +++ b/documentation/development/how-to-translate-ace3.md @@ -24,3 +24,7 @@ This page describes in short how you can help translating ACE3 into your languag (The last three steps require some git knowledge, but there are a lot of tutorials out there) [GitHub for Windows help](https://windows.github.com/help.html) + + +#### Community Translation Guides +**Spanish:** [https://gist.github.com/Legolasindar/bf8a3b09cb835f72501f](https://gist.github.com/Legolasindar/bf8a3b09cb835f72501f) diff --git a/documentation/development/modularity-and-pbo-structure.md b/documentation/development/modularity-and-pbo-structure.md index ad1194e39c..036ebb35d4 100644 --- a/documentation/development/modularity-and-pbo-structure.md +++ b/documentation/development/modularity-and-pbo-structure.md @@ -10,23 +10,21 @@ order: 4 Main principles: - As much stuff as possible should be modular -- Strive to make as much stuff as possible run-time toogable. Adding/removing PBOS would still be requiring to toogle any feature relying on config changes. +- Strive to make as much stuff as possible run-time togglable. Adding/removing PBOS would still be requiring to toggle any feature relying on config changes. ### PBO Structure Main principles: - Try to keep single module dependencies as much as possible -- InteractionMenu would be the requirement for most modules. -- Anything that is 100% config should require common and not interaction. +- Interaction would be the requirement for most modules. +- Anything that is 100% config should require Common and not Interaction. ``` -Main -> Common -> OptionsMenu -> InteractionMenu -> Most things +Main -> Common -> OptionsMenu -> Interaction -> Most things Main -> Common -> Config things -Main -> Common -> 3D Models | - InteractionMenu | -> Feature +Main -> Common -> 3D Models | + Interaction | -> Feature ``` - - diff --git a/documentation/development/setting-up-the-development-environment.md b/documentation/development/setting-up-the-development-environment.md index 0fbc0793f2..fe76ca6a20 100644 --- a/documentation/development/setting-up-the-development-environment.md +++ b/documentation/development/setting-up-the-development-environment.md @@ -70,12 +70,12 @@ mklink /D "[Arma 3 installation folder]\z\ace" "[location of the ACE3 project]" mklink /D "P:\z\ace" "[location of the ACE3 project]" ``` -Then, copy the `cba` folder from the `tools` folder to `P:\x\cba`. Create the `x` folder if needed. That folder contains the part of the CBA source code that are required for the macros to work. +Then, copy the `cba` folder from the `tools` folder to `P:\x\cba`. Create the `x` folder if needed. That folder contains the parts of the CBA source code that are required for the macros to work. ## Creating a Test Build -To create a development build of ACE to test changes or to debug something, run the `build.bat` file in the `tools` folder. This will populate the `addons` folder with binarized PBOs. These PBOs still point to the source files in their respective folders however, which allows you to use [file patching](#file-patching). +To create a development build of ACE to test changes or to debug something, run the `build.py` file in the `tools` folder. This will populate the `addons` folder with binarized PBOs. These PBOs still point to the source files in their respective folders however, which allows you to use [file patching](#file-patching). This also means that you cannot distribute this build to others. diff --git a/documentation/feature/javelin.md b/documentation/feature/javelin.md new file mode 100644 index 0000000000..b253a25fc9 --- /dev/null +++ b/documentation/feature/javelin.md @@ -0,0 +1,21 @@ +--- +layout: wiki +title: Javelin/Titan Locking and Firing +group: feature +order: 5 +parent: wiki +--- + +## 1. Overview +Blah blah blah + +Steps to lock titan/Javelin: + +1. You must be zoomed ALL THE WAY IN +2. You must be in thermal view +3. You must have a missile loaded +4. Hold TAB over a target, it will start beeping and the constraint boxes will appear +5. Once the beeping changes to LOCK tone, and the lock crosshairs appear, click fire without releasing tab + + +CTRL+TAB is default key to change firemode (configurable as a key) diff --git a/documentation/feature/medical-system.md b/documentation/feature/medical-system.md new file mode 100644 index 0000000000..3d756b70c8 --- /dev/null +++ b/documentation/feature/medical-system.md @@ -0,0 +1,70 @@ +--- +layout: wiki +title: Medical System +group: feature +order: 4 +parent: wiki +--- + +## 1. Overview +ACE provide users with a more realistic medical system and comes in both a basic and advanced version. This page will detail the differences between both systems and what they do. It is split into two parts; basic and advanced. Both versions have overlap but each have their own unique characteristics. + + +## 2. Basic Medical +ACE's basic medical system is quite a bit more complex than Arma's default system, but not really difficult to grasp. ACE basic medical is a mixture between the ACE2 and AGM medical systems. + +The four main elements that basic medical introduces are: + +* damage divided into different zones (head, body, left & right arm, left & right leg) +* bleeding +* unconsciousness +* pain + +All interactions in the medical system are done with the interaction menu. Non-medics can - by default - not perform all actions, and their actions take more time as when performed by trained medics. These actions are using epinephrine and blood IVs. + + +### How it works + +When hit, units start to lose blood depending on the severity of their wounds. Once the level of blood falls below a certain threshold, the unit will fall unconscious and eventually die. Units will also fall unconscious when sustaining large amounts of damage at once. + +To stop the bleeding, the combat life saver needs to bandage every wounded limb. Unconscious units can be "woken up" with Epipens. Should a unit have lost a lot of blood, it might be necessary to replace the lost blood with a blood bag before being able to wake unconscious units up. + +Should a unit be in pain, materializing itself with a chromatic aberration screen effect, he can be given morphine. + +## 3. Advanced Medical +The advanced medical system provides a more complex and detailed medical simulation and is based off the CSE/CMS medical system. It focuses on a more realistic model for injuries and treatment, thus resulting in a more important and prominent role for combat medics, and a bigger incentive to not get shot. + +The system behind advanced medical is designed to attempt to mimic important parts of the human body, as well as react to any injuries sustained and treatments applied in a realistic manner. The available treatments and supplies in advanced medical are based off the Tactical Combat Casualty Care (TCCC) guidelines, which are the same guidelines used by real-life combat medics around the world. + +Besides the 4 elements introduced by basic medical, advanced introduces the following: + +* More detailed wound system +* Accurate blood loss based upon sustained injuries +* Vitals, including heart rate and blood pressure +* Cardiac Arrest +* Various treatment methods such as CPR, different kinds of IVs and tourniquets +* A basic medication simulation + +### How it works + +Same as with basic, when hit an injury is sustained. Different though is that the type of injury and the severity of it are based upon how the damage was done and what caused it. This affects both blood loss and immediate consequences, such as being knocked out or being killed right away. When a player has sustained an injury, this will be indicated by flashing red of the screen; this means the player is bleeding. + +##### Stopping bleeding +In order to stop the bleeding, all injuries on every bodypart requires treatment. This is done by either applying a tourniquet to legs or arms as a temporarly solution, or by using bandages to stop the bleeding as a more permament fix. + +##### Vitals +While a unit is bleeding however, the blood volume decreases which will result in a change of vitals. Depending on the factors such as current blood volume, the blood loss rate, medication used, the blood pressure will start to drop. To counter this drop, also based upon the previously mentioned factors and others, the heart rate will adjust accordingly to attempt to keep blood pressure at safe levels. This means that for any patient it is required to keep an eye on the vitals. This is done through the interaction system by selecting check pulse or blood pressure on either the arms or head. + +##### Medication +To stabalize the vitals and to counter for example pain, a player/medic can use medication. Advanced medical has 3 different medications available: +* Atropine +* Morphine +* Epinephrine + +Atropine is a vagolytic and anticholinergic drug which in low dosages reduces heart rate but in high dosages increases it, countering effects of organophosphate poisoning (in NBC scenarios; anticholinesterase poisoning) and symptomatic bradycardia (in post-ROSC care and resuscitative medicine). + +Morphine is used to alleviate large amounts of pain. Has an effect similar to Heroin due to its opiate properties. Must only ever be given once, and only when bleeding has been reduced to a minimum. Morphine must never be given to a casualty with a low heart rate, as it can stop the heart. + +Epinephrine is used to increase heart rate and blood pressure and alleviate unconsciousness. Epinephrine is a synthetic form of Adrenaline, which is naturally produced in the body. It can also be applied to counter-act the effects of Atropine. Be careful though, as it may only be given once. + +_Epinephrine must never be given to a casualty with a high heart rate or blood pressure._ diff --git a/documentation/framework/advanced-missile-guidance.md b/documentation/framework/advanced-missile-guidance.md new file mode 100644 index 0000000000..3029b7b3bd --- /dev/null +++ b/documentation/framework/advanced-missile-guidance.md @@ -0,0 +1,107 @@ +--- +layout: wiki +title: Advanced Missile Guidance +group: framework +order: 5 +parent: wiki +--- + +# 1. Overview + +The ACE Advanced Missile Guidance Framework provides a setup of configuration settings, functions and a execution framework for addon makers to integrate with the missile guidance and targeting mechanisms of ACE. It also provides for mod makers to create their own custom guidance methods within the framework. + +The framework provides all the functionality needed for guidance; from laser locking, target specification and selection, to handling the fired events and tracking and steering the vehicle based on provided parameters. This way, all that needs to be defined in addons is the appropriate CfgAmmo entries for the missile. + +The framework also provides addon makers and scripters with the ability to configure custom seeker types and attack profiles, which are defined below. This allows for complete control of the guidance, locking and flight of a missile at the discretion of the addon maker. + +ACE3 provides a full suite of base concepts and guidance for the majority of modern missile weaponry avialable today; these includes all basic types of seekers (SALH/SACLOS/Optic/Thermal/etc) - as well as the different common attack profiles utilized with guided munitions (such as top-down attacks). + +Finally, flight profiles and mechanics for realistic missile simulations are also implemented; allowing for lock-steering bump guidance flight such as with the M47 Dragon or GBU steering fins, or finely tuned direct flight guidance which is currently avialable with other missile types. + +# 2. Details + +The framework is broken up into 3 major components: Locking Types, Seeker Types and Attack Profiles. In combination, these components build out the entire process of launching, locking and going terminal flight against targets. + +### Components + +##### 1. Locking Types +Locking types provide the basic functionality of targeting which will be based to a seeker type, providing target aquisition for seekers. This provides the basic functionality for providing pre-determined targets for a seeker, or allowing the seeker to perform its own target aquisition and locking. Additionally, the seeker may reference back into the locking type in order to re-perform target aquisition. + +##### 2. Seeker Types +Each seeker is generally assumed to be the logic for the seeker head unit within any given munition. Seekers within this framework provide the basic targeting functionality for the entire framework. The locking type will provide a generic target to the seeker, or the seeker may aquire a target on its own. The seeker then provides a target, either an object or a ASL position, which is then passed further into the framework. This target (or position) should be the actual current target position for the missiles flight. Seekers are required to perform all limitations and checks within their systems, although various limitations have been provided in this framework such as LOS FOV, laser guidance, etc. + +##### 3. Attack Profiles + +An attack profile adjusts the current target flight location to create the actual flight path of the missile. The attack profile is provided with all parameters of the system, including the returned target of the seeker. Using this information, the attack profile then will adjust the *direct flight target position* to specifically direct where and how the missile shall flight. + +## How it all ties together + +The system is executed in a linear series of calls to each step of the process, and feeding back the return from that step to the next step. Execution is conducted using Locking->Seeker->Profile, iteratively every frame of execution. Flight times are adjusted to accTime values and FPS lag, giving consistent flight. + +On each step of execution, a target specification array [targetObj, targetPos] is passed to the locking type, which then will return a possible modified target array. Next, this modified data is passed to the seeker type - which then, in turn, returns a position vector to the current "seeked" target position (ASL). Last, this target position is passed to the attack profile, who then returns an "adjusted attack position (ASL)", which is the location the missile should *currently* be homing on for flight. + +In the simplest sense, the entire system provides the flight trajectory of the missile homing directly on the "adjusted attack position"; thus, an attack profile would ajust this position to direct the missile. For example, Top down attacks return the adjusted attack position high above the target, until entering their terminal stages, which then changes the position to be directly ontop of the target - thus "walking the missile" along its flight path and to the kill. + +# 2. Adding AMG to a missile + +## Enabling guidance on Ammo Types +``` +class CfgAmmo { + class MissileBase; + class MyMissileType : MissileBase { + // Turn off arma crosshair-guidance + manualControl = 0; + + // Begin ACE guidance Configs + class ace_missileguidance { + enabled = 1; + + minDeflection = 0.00025; // Minium flap deflection for guidance + maxDeflection = 0.001; // Maximum flap deflection for guidance + incDeflection = 0.0005; // The incrmeent in which deflection adjusts. + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet modes. All 'recruit' games use vanilla locking + + // Seeker type and settings for munitions + defaultSeekerType = "SALH"; + seekerTypes[] = { "SALH", "LIDAR", "SARH", "Optic", "Thermal", "GPS", "SACLOS", "MCLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + seekerAngle = 90; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 1; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "LIN"; + attackProfiles[] = { "LIN", "DIR", "MID", "HI" }; + }; +``` + +# 2. Creating your own custom seekers and attack profiles + +## Adding seeker types and attack profiles + +``` +class ace_missileguidance_attackProfiles{ + class MyAttackProfile { + name = ""; + visualName = ""; + description = ""; + + functionName = "my_fnc_doAttackProfile"; + }; +}; +class ace_missileguidance_seekerTypes { + class MySeekerType { + name = ""; + visualName = ""; + description = ""; + + functionName = "my_fnc_doSeekerType"; + }; +}; +``` \ No newline at end of file diff --git a/documentation/framework/carry-drag.md b/documentation/framework/carry-drag.md new file mode 100644 index 0000000000..daaa9fb95a --- /dev/null +++ b/documentation/framework/carry-drag.md @@ -0,0 +1,27 @@ +--- +layout: wiki +title: Carry and Drag System +group: framework +order: 5 +parent: wiki +--- + +# 1. Config Values + +``` +class CfgVehicles { + class MyVehicle { + + + ace_dragging_canDrag = 1; // can this object be dragged?; 1 yes, 0 no (0 default) + ace_dragging_dragPosition[] = {0,1.2,0} // Offset of the model from the body while dragging, comparable to the offset in attachTo (It's the same actually) + ace_dragging_dragDirection = 0; // how much degrees is the model rotatated after dragging it (a global setDir after attachTo) + + ace_dragging_canCarry = 1; // can this object be carried?; 1 yes, 0 no (0 default) + ace_dragging_carryPosition[] = {0,1.2,0}; // Same as drag, but for carrying objects + ace_dragging_carryDirection = 0; // Same as drag, but for carrying objects + + }; +}; +``` + diff --git a/documentation/development/fragmentation-configuration.md b/documentation/framework/fragmentation-configuration.md similarity index 83% rename from documentation/development/fragmentation-configuration.md rename to documentation/framework/fragmentation-configuration.md index 17ff36fa13..c8a64b2db4 100644 --- a/documentation/development/fragmentation-configuration.md +++ b/documentation/framework/fragmentation-configuration.md @@ -1,7 +1,7 @@ --- layout: wiki title: Fragmentation Configuration -group: development +group: framework parent: wiki order: 7 --- @@ -15,15 +15,15 @@ The system for the end-developer is easy to use, and only requires minimal resea Below is an example set of explosives configuration properties for sys_frag (in this case an M67 hand grenade): ```c++ -ACE_FRAG_METAL = 210; // metal in grams -ACE_FRAG_CHARGE = 185; // explosive in grams -ACE_FRAG_GURNEY_C = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations -ACE_FRAG_GURNEY_K = 3/5; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations +ace_frag_metal = 210; // metal in grams +ace_frag_charge = 185; // explosive in grams +ace_frag_gurney_c = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations +ace_frag_gurney_k = 3/5; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations ``` -`ACE_FRAG_METAL` is the amount of metal being fragmented (generally taken as the entire weight of the warhead, though in some cases you might want to only include the fragmentation jacket or body. `ACE_FRAG_CHARGE` is the amount of explosive filler in the warhead. `ACE_FRAG_METAL` and `ACE_FRAG_CHARGE` are dimensionless values, as long as they are both in the same unit (for example kg/kg g/g lbs/lbs). +`ace_frag_metal` is the amount of metal being fragmented (generally taken as the entire weight of the warhead, though in some cases you might want to only include the fragmentation jacket or body. `ace_frag_charge` is the amount of explosive filler in the warhead. `ace_frag_metal` and `ace_frag_charge` are dimensionless values, as long as they are both in the same unit (for example kg/kg g/g lbs/lbs). -`ACE_FRAG_GURNEY_C` is the Gurney constant for explosive force. You can find a list of common explosive types below. If you can not find it here, or want more accurate numbers, just google the type of explosive and Gurney constant and you can find substantial information. This is *NOT* the detonation velocity of the explosive, do not confuse them! +`ace_frag_gurney_c` is the Gurney constant for explosive force. You can find a list of common explosive types below. If you can not find it here, or want more accurate numbers, just google the type of explosive and Gurney constant and you can find substantial information. This is *NOT* the detonation velocity of the explosive, do not confuse them! | Type | Speed | |------------------|----------| @@ -42,7 +42,7 @@ ACE_FRAG_GURNEY_K = 3/5; // Gurney shape factor, in this case a sphere. See: ht |Tritonal | 2320 m/s | -`ACE_FRAG_GURNEY_K` is the shape factor for the explosive configuration. You should choose it based on the general configuration of explosives/metal in the warhead. Most grenades for example are a sphere. Artillery and aircraft bombs are a cylinder. Mines generally a flat plate. Below is a list of the three common shapes and their factors. +`ace_frag_gurney_k` is the shape factor for the explosive configuration. You should choose it based on the general configuration of explosives/metal in the warhead. Most grenades for example are a sphere. Artillery and aircraft bombs are a cylinder. Mines generally a flat plate. Below is a list of the three common shapes and their factors. ``` Sphere = 3/5 @@ -52,7 +52,7 @@ Plate = 3/5 There are other configurations but these are the most common. If you are interested in others check out the wikipedia link given above. Most of these will not correctly function in sys_frag though due to additional variables for the equation. -In addition to these variables there are different types of fragmentation fragments to choose from, and they can be defined in the config value `ACE_FRAG_CLASSES[]`. Below are a list of the types. +In addition to these variables there are different types of fragmentation fragments to choose from, and they can be defined in the config value `ace_frag_classes[]`. Below are a list of the types. ``` ACE_frag_tiny @@ -71,6 +71,6 @@ The tinier the piece of fragmentation the shorter the distance of travel. The `_ The final information needed is a couple of entries for forcing or ignoring fragmentation for this ammo. -If you set `ACE_FRAG_SKIP` to 1 then you will skip fragmentation for ammo of this type. This is useful for things that might cause high network load, such as FFAR rockets, or possibly even 40mm grenades from AGLs. Experimentation under network conditions is required. +If you set `ace_frag_skip` to 1 then you will skip fragmentation for ammo of this type. This is useful for things that might cause high network load, such as FFAR rockets, or possibly even 40mm grenades from AGLs. Experimentation under network conditions is required. -If you set `ACE_FRAG_FORCE` to 1 it will force the fragmentation system to use frag on this ammo, ignoring sys_frags internal qualifications based on hit values. +If you set `ace_frag_force` to 1 it will force the fragmentation system to use frag on this ammo, ignoring sys_frags internal qualifications based on hit values. diff --git a/documentation/missionmaker/modules.md b/documentation/missionmaker/modules.md index 0b0f13f8d6..186e99ece4 100644 --- a/documentation/missionmaker/modules.md +++ b/documentation/missionmaker/modules.md @@ -11,8 +11,42 @@ parent: wiki ## 1. Modules -### 1.1 BlueForceTracking -*Part of: ACE_Map* +### 1.1 Advanced Ballistics +*Part of: ace_advanced_ballistics* + +This module allows to enable advanced external- and internal ballistics. + +**Settings:** + +1. **Advanced Ballistics (Boolean)
** +Enables advanced ballistics.
+`Default value: No` +2. **Always Enabled For Snipers (Boolean)
** +Always enables advanced ballistics when high power optics are used.
+`Default value: Yes` +3. **Disabled In FullAuto Mode (Boolean)
** +Disables the advanced ballistics during full auto fire.
+`Default value: No` +4. **Disabled For Non Local Players (Boolean)
** +Disables the advanced ballistics for bullets coming from other players (enable this if you encounter frame drops during heavy firefights in multiplayer).
+`Default value: Yes` +5. **Enable Ammo Temperature Simulation (Boolean)
** +Muzzle velocity varies with ammo temperature.
+`Default value: Yes` +6. **Enable Barrel Length Simulation (Boolean)
** +Muzzle velocity varies with barrel length.
+`Default value: Yes` +7. **Enable Bullet Trace Effect (Boolean)
** +Enables a bullet trace effect to high caliber bullets (only visible when looking through high power optics).
+8. **Simulation Interval (Number)
** +Defines the interval between every calculation step.
+`Default value: 0.05` +9. **Simulation Radius (Number)
** +Defines the radius around the player (in meters) at which advanced ballistics are applied to projectiles.
+`Default value: 3000` + +### 1.2 BlueForceTracking +*Part of: ace_map* When adding the "BlueForceTracking" module to your mission it adds map markers to every group on the players side and refreshes them in certain configurable interval (in seconds). The module takes the group type into account and uses the proper NATO icon for each marker. @@ -25,8 +59,8 @@ How often the markers should be refreshed (in seconds).
Hide markers for "AI only" groups.
`Default value: No` -### 1.2 Check PBOs -*Part of: ACE_Core* +### 1.3 Check PBOs +*Part of: ace_core* If you are worried that players haven't updated ACE or other mods to the version you're using on the server, you can place the "Check PBOs" module on your map. You can choose one of three posible actions that are being executed when a player joins that has a wrong version of ACE or an other mod: @@ -61,8 +95,8 @@ Example 3: @JSRS + @Blastcore-A3:
[TBD, "warfxpe","blastcore_vep"] ``` -### 1.3 Explosive System -*Part of: ACE_Explosive* +### 1.4 Explosive System +*Part of: ace_explosive* The "Explosive System" module lets you tweak the settings for the new explosive system that ACE introduces. @@ -75,17 +109,17 @@ Require explosive specialists to disable explosives.
Increase the time it takes to complete actions for non-specialists.
`Default value: Yes` -### 1.4 Fatigue System (deprecated) +### 1.5 Fatigue System (deprecated) **Warning:** *This module is deprecated and only in there not to break older missions that have used this module. It will be removed in a future update. It serves no purpose.* -### 1.5 Friendly Fire Messages -*Part of: ACE_Respawn* +### 1.6 Friendly Fire Messages +*Part of: ace_respawn* The "Friendly Fire Messages" module triggers a message when a player kills a friendly or civilian unit. This module isn't needed on servers with a low difficulty setting. -### 1.6 Interaction -*Part of: ACE_Interaction* +### 1.7 Interaction +*Part of: ace_interaction* This module allows you to tweak the settings for player names tags. @@ -95,8 +129,8 @@ This module allows you to tweak the settings for player names tags. Sets the distance (in meters) at which player name tags become visible.
`Default value: 5` -### 1.7 Medical System -*Part of: ACE_Medical* +### 1.8 Medical System +*Part of: ace_medical* When using the medical system ACE offers you probably want to fine tune some aspects of the wounding, healing or gameplay mechanics and fit them to your needs. The "Medical System" module offers a lot of settings to do just that. @@ -133,16 +167,16 @@ Use one bandage to heal the entire body.
Allow all players to use chat while unconcious? Admin can always use the chat regardless.
`Default value: No` -### 1.8 Rallypoint System -*Part of: ACE_Respawn* +### 1.9 Rallypoint System +*Part of: ace_respawn* This module was introduced with 0.94 and enables Mission Makers to specificly enable units to move a rallypoint. Every unit that is synced with that module is able to move a rallypoint. **Note:** It's important to mention that this doesn't work for player who join during a mission (JIP = Join in progress). That's something we can't change because that's the way Bohemia has implemented their module framework. To enable JIP players to move rally points have a look at [3.1 ACE Rallypoints](#31-ace-rallypoints). -### 1.9 Repair System -*Part of: ACE_Logistics* +### 1.10 Repair System +*Part of: ace_logistics* Placing the "Repair System" module makes it possible to define the time it takes for certain repair actions. @@ -161,8 +195,8 @@ Time to replace a track (in seconds).
Limits the amount of damage that can be repaired. 0 = Repair all damage, 1 = Cannot repair any damage.
`Default value: 0` -### 1.10 Respawn System -*Part of: ACE_Respawn* +### 1.11 Respawn System +*Part of: ace_respawn* The "Respawn System" module enables players to respawn with the gear they had before dying and to remove bodies of players after a configurable interval (in seconds). @@ -172,8 +206,8 @@ The "Respawn System" module enables players to respawn with the gear they had be Respawn with the gear a player had just before his death.
`Default value: No` -### 1.11 SwitchUnits System -*Part of: ACE_SwitchUnits* +### 1.12 SwitchUnits System +*Part of: ace_switchunits* The [SwitchUnits System](#32-ace-switchunits) enables players to control certain AI units on the map. @@ -199,8 +233,54 @@ The safe zone around players from a different team (in meters)
`Default value: 200` -### 1.12 LSD Vehicles -*Part of: ACE_Core* +### 1.13 LSD Vehicles +*Part of: ace_core* + +### 1.14 Weather +*Part of: ace_weather* + +This module allows you to customize the weather settings. + +**Settings:** + +1. **Weather propagation (Boolean)
** +Enables sever side weather propagation.
+`Default value: Yes` +2. **ACE Weather (Boolean)
** +Overrides the default weather (editor, mission settings) with ACE weather (map based).
+`Default value: Yes` +3. **Sync Rain (Boolean)
** +Synchronizes rain.
+`Default value: Yes` +3. **Sync Wind (Boolean)
** +Synchronizes wind.
+`Default value: Yes` +3. **Sync Misc (Boolean)
** +Synchronizes lightnings, rainbow, fog, ...
+`Default value: Yes` +4. **Update Interval (Number)
** +Defines the interval (seconds) between weather updates.
+`Default value: 60` + +### 1.15 Wind Deflection +*Part of: ace_winddeflection* + +This module allows you to define when wind deflection is active. + +**Settings:** + +1. **Wind Deflection (Boolean)
** +Enables wind deflection.
+`Default value: Yes` +2. **Vehicle Enabled (Boolean)
** +Enables wind deflection for static/vehicle gunners.
+`Default value: Yes` +3. **Simulation Interval (Number)
** +Defines the interval between every calculation step.
+`Default value: 0.05` +4. **Simulation Radius (Number)
** +Defines the radius around the player (in meters) at which projectiles are wind deflected.
+`Default value: 3000` And then there's the "LSD Vehicles" module … it does 'something' to all vehicles synced to that module. http://youtu.be/X3e0LTexEok diff --git a/documentation/user/getting-started.md b/documentation/user/getting-started.md index 5a9c3f6917..012f307445 100644 --- a/documentation/user/getting-started.md +++ b/documentation/user/getting-started.md @@ -1,20 +1,90 @@ --- layout: wiki -title: Getting Started +title: Getting started group: user order: 0 parent: wiki --- +
+
Note:
+

This page is currently under construction.

+
-**This page will get updated soon.** +Downloaded ACE3 and have no idea where to start? This page serves as a document to help new players get started with things like the medical system, or how to adjust your scope. +### Table of contents +1. [Vector 21](#vector-21) -## Table of Contents +### Vector 21 +*Part of: ace_vector* - 1. [xx](#xx) - 2. [yy](#yy) - 3. [zz](#zz) +ACE3 adds a realistic depiction of the Vector 21 rangefinder to the game. Unlike other rangefinders, it doesn't just magically show you the range to your target, but in exchange allows you to do alot of things with it that the other choices in Arma do not offer. The Vector's functions include, but are not limited to: +- Distance to a target +- Azimuth to a target +- Horizontal and vertical distance to a target +- Distance between 2 targets +- Angle between 2 targets +- Switching between feet and meters +- Switching between degrees and mils +... -## What ACE3 has to offer +The Vector is controlled with 2 keys: the azimuth key and the range key; Tab and R by default. First you bring it up like every other binocular in the game and then, while looking through it you can access all the different functions. + +The Vector 21 rangefinder has the following usage modes: + +1. Slope distance +2. Azimuth +3. Slope distance & Azimuth +4. Horizontal distance and height difference +5. Azimuth & Inclination +6. Distance between two points +7. Horizontal & vertical distance between two points +8. Horizontal distance & azimuth between two points +9. Fall of shot + +#### 1. Slope distance +Measuring Slope distance + +Press and hold the "Distance" key until the red pointing circle appears. Sight the circle on the object and release the key. + +#### 2. Azimuth +Measuring Azimuth + +Press and hold the "Azimuth" key until the red pointing circle appears. Sight the circle on the object and release the key. + +#### 3. Slope distance and Azimuth +Measuring Slope distance and Azimuth + +Press and hold both the "Distance" and "Azimuth" key until the red pointing circle appears. Sight the circle on the object and release both keys. + +#### 4. Horizontal distance and height difference +Measuring Horizontal distance and height difference + +Tap the "Distance" key once then press and hold it until the red pointing circle appears. Sight the circle on the object and release the key. + +#### 5. Azimuth and Inclination +Measuring Azimuth and Inclination + +Tap the "Azimuth" key once then press and hold it until the red pointing circle appears. Sight the circle on the object and release the key. + +#### 6. Distance between two points +Measuring Distance between two points + +Press and hold the "Distance" key until the red pointing circle appears. Sight the circle on the first object and tap the "Azimuth" key while further holding the "Distance" key. The first measurement is confirmed ("1-P" = first point). Sight the second object and release the "Distance" key. + +#### 7. Horizontal and vertical distance between two points +Measuring Horizontal and vertical distance between two points + +Tap the "Distance" key once then press and hold it until the red pointing circle appears. Sight the circle on the object and tap the "Azimuth" key once. The first measurement is confirmed ("1-P" = first point). Sight the second object and release the "Distance" key. + +#### 8. Horizontal distance and azimuth between two points +Measuring Horizontal distance and azimuth between two points + +Press and hold the "Azimuth" key until the red pointing circle appears. Sight the circle on the first object and tap the "Distance" key while further holding the "Azimuth" key. The first measurement is confirmed ("1-P" = first point). Sight the second object and release the "Azimuth" key. + +#### 9. Fall of shot +Measuring Fall of shot + +Tap the "Azimuth" key once then press and hold it until the red pointing circle appears. Sight the circle on the object and tap the "Distance" key while further holding the "Azimuth" key. The first measurement is confirmed ("1-P" = first point). Sight the Fall of shot and release the "Azimuth" key. The left digits display the left (`L`)/right (`r`) correction value in meter and the right digits display the longer (`A` = add)/shorter (`d` = drop) correction value in meter. If the "Distance" key is tapped the height correction values will be displayed (`UP` and `dn`). diff --git a/documentation/user/how-to-make-a-feature-request.md b/documentation/user/how-to-make-a-feature-request.md index 7a317a2c5f..7b0c52478d 100644 --- a/documentation/user/how-to-make-a-feature-request.md +++ b/documentation/user/how-to-make-a-feature-request.md @@ -6,19 +6,17 @@ order: 11 parent: wiki --- -### Before requesting +### Background +ACE2, AGM and CSE had a lot of features implemented or planned. All of them are or have been evaluated for inclusion in ACE3 itself, and we'd like to port the majority of them eventually. However, due to time constraints, we have managed to finish only a fraction of the job so far. -ACE 2, AGM and CSE had a lot of features implemented or planned. All of them are or have been evaluated for inclusion in ACE3 itself, and we'd like to port the mayority of them eventually. However, due to time constraints, we have only managed to do a fraction of the job so far. - -There's really no point on making feature requests for anything included or planned for inclusion in ACE2, AGM or CSE. The majority of those things are been considered for porting or rewritting already. +Please refrain from making requests for any planned or existing features from either ACE2, AGM or CSE. Most of them are already being or have been considered for porting or a rewrite.
-
Please note:
-

Due to the pace at which development is taking place, we are establishing a feature request embargo during the first week weeks prior and posterior to the first release. Feel free to add feature requests as described below, but don't expect them to be evaluated or discussed yet. Any dev activity on the feature request thread is highly unlikely during that period.

+
Note:
+

Due to our current work load, in the period of weeks prior and posterior to the first release, new feature requests are under embargo. Feel free to submit yours now, but don't expect them to be considered just yet. Any treatment or attention by developers towards the feature request thread is highly unlikely during this time.

### Requesting a feature +In order to avoid duplicates and keep the issue tracker organized, we have created a common issue for ACE 3 Feature requests. Any and all relevant requests should be submitted there, where they will also get discussed and evaluated. Before adding a new one, make sure to check the previous entries from the thread and do a quick search for similar suggestions; please don't reiterate requests for features that had already been accepted for inclusion, or those which were disregarded earlier. -In order not to spam the issue tracker with duplicated requests, we have have created a single Issue for feature request. Any and all requests should be done there, where they will get discussed and evaluated. Before posting a new one, please make sure to check the previous entries on the thread and make a quick search; please don't reiterate requests that had already been either accepted for inclusion or disregarded. - -Accepted feature requests may be moved to a sepparate issue by moderators for further discussion. +Following their approval, feature requests may be moved by moderators to a separate issue for further discussion. diff --git a/documentation/user/shortcuts.md b/documentation/user/shortcuts.md new file mode 100644 index 0000000000..66e12ae76f --- /dev/null +++ b/documentation/user/shortcuts.md @@ -0,0 +1,214 @@ +--- +layout: wiki +title: Shortcuts +group: user +order: 5 +parent: wiki +--- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ShortcutActionPBO
Ctrl+⇧ Shift+KShow ProtractorACE_Advanced_Ballistics
⊞ WinInteraction menuACE_Interaction
Ctrl+⊞ WinSelf-interaction menuACE_Interaction
Ctrl+SpaceOpen/close doorACE_Interaction
Ctrl+TTap on the shoulderACE_Interaction
CtrlModifier keyACE_Logistics
Ctrl+⇧ Shift+TWipe off gogglesACE_Goggles
8Switch grenade modeACE_Grenades
CtrlShow namesACE_NameTags
Alt+Page UpNVG: Increase brightnessACE_NightVision
Alt+Page DownNVG: Decrease brightnessACE_NightVision
⇧ Shift+RClear firearm malfunctionACE_Overheating
OAltimeterACE_Parachute
Ctrl+RCheck ammunitionACE_Reload
`Safety toggleACE_SafeMode
Page UpScope: Elevation upACE_Scopes
Page DownScope: Elevation downACE_Scopes
Ctrl+Page UpScope: Windage leftACE_Scopes
Ctrl+Page DownScope: Windage rightACE_Scopes
Tab ↹Vector: Azimuth keyACE_Vector
RVector: Distance keyACE_Vector
DelSpeed limiterACE_Vehicles
1PistolACE_WeaponSelect
2RifleACE_WeaponSelect
3Grenade launcherACE_WeaponSelect
5BinocularsACE_WeaponSelect
6Frag grenadeACE_WeaponSelect
7Non-frag grenadeACE_WeaponSelect
0Holster weaponACE_WeaponSelect
2Engine onACE_WeaponSelect
1Engine offACE_WeaponSelect
3Primary weaponACE_WeaponSelect
4Machine gunACE_WeaponSelect
5MissilesACE_WeaponSelect
9Fire smoke launcherACE_WeaponSelect
Tab ↹FCS: Lase target (measure distance)ACE_FireControlSsystem
Page UpFCS: Range upACE_FireControlSsystem
Page DownFCS: Range downACE_FireControlSsystem
⇧ Shift+KShow Wind InfoACE_Weather
diff --git a/documentation/user/shourtcuts.md b/documentation/user/shourtcuts.md deleted file mode 100644 index d44dc54886..0000000000 --- a/documentation/user/shourtcuts.md +++ /dev/null @@ -1,204 +0,0 @@ ---- -layout: wiki -title: Shortcuts -group: user -order: 5 -parent: wiki ---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PBOCommandShortcut
ACE_InteractionInteraction MenuWin_Left
ACE_InteractionInteraction Menu (Self)Ctrl Win_Left
ACE_InteractionOpen / Close DoorCtrl Space
ACE_InteractionTap ShoulderCtrl T
ACE_LogisticsModifier KeyCtrl_Left
ACE_GogglesWipe GogglesCtrl Shift T
ACE_GrenadesSwitch Grenade Mode8
ACE_NameTagsShow NamesCtrl_Left
ACE_NightVisionIncrease NVG BrightnessAlt Page Up
ACE_NightVisionDecrease NVG BrightnessAlt Page Down
ACE_OverheatingClear jamShift R
ACE_ParachuteShow AltimeterO
ACE_ReloadCheck AmmoCtrl R
ACE_SafeModeSafe Mode`(en) | ^(de)
ACE_ScopesAdjust Elevation UpPage Up
ACE_ScopesAdjust Elevation DownPage Down
ACE_ScopesAdjust Windage LeftCtrl Page Up
ACE_ScopesAdjust Windage RightCtrl Page Down
ACE_VectorVector - Azimuth KeyTab
ACE_VectorVector - Distance KeyR
ACE_VehiclesSpeed LimiterDel
ACE_WeaponSelectSelect Pistol1
ACE_WeaponSelectSelect Rifle2
ACE_WeaponSelectSelect Grenade Launcher3
ACE_WeaponSelectSelect Binoculars5
ACE_WeaponSelectSelect Frag Grenade6
ACE_WeaponSelectSelect Non-Frag Grenade7
ACE_WeaponSelectHolster Weapon0
ACE_WeaponSelectEngine on2
ACE_WeaponSelectEngine off1
ACE_WeaponSelectSelect Main Gun3
ACE_WeaponSelectSelect Machine Gun4
ACE_WeaponSelectSelect Missiles5
ACE_WeaponSelectFire Smoke Launcher9
ACE_FireControlSsystemLase Target / Measure DistanceTab
ACE_FireControlSsystemAdjust FCS Range (Up)Page Up
ACE_FireControlSsystemAdjust FCS Range (Down)Page Down
\ No newline at end of file diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt index c50501c770..835cd30fd6 100644 --- a/extensions/CMakeLists.txt +++ b/extensions/CMakeLists.txt @@ -25,8 +25,37 @@ file(GLOB ACE_COMMON_SOURCES common/*.h common/*.hpp common/*.c common/*.cpp) add_library(ace_common STATIC ${ACE_COMMON_SOURCES}) include_directories(AFTER "common") +string(TIMESTAMP ACE_BUILDSTAMP "%Y-%m-%dT%H:%M:%SZ") +set(ACE_VERSION_MAJOR 3) +set(ACE_VERSION_MINOR 0) +set(ACE_VERSION_REVISION 1) +EXECUTE_PROCESS(COMMAND git rev-parse --verify HEAD + OUTPUT_VARIABLE T_ACE_VERSION_BUILD + OUTPUT_STRIP_TRAILING_WHITESPACE +) +string(SUBSTRING ${T_ACE_VERSION_BUILD} 0 7 ACE_VERSION_BUILD ) + +message("Building for: " ${ACE_VERSION_MAJOR}.${ACE_VERSION_MINOR}.${ACE_VERSION_REVISION}-${ACE_VERSION_BUILD}) + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/common/ace_version.hpp.in" + "${CMAKE_CURRENT_BINARY_DIR}/common/ace_version.hpp" + @ONLY) + +if(MSVC) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/common/ace_version_win32.rc.in" + "${CMAKE_CURRENT_BINARY_DIR}/common/ace_version_win32.rc" + @ONLY) + set(GLOBAL_RC ${CMAKE_CURRENT_BINARY_DIR}/common/ace_version_win32.rc) +endif() + +include_directories(AFTER ${CMAKE_CURRENT_BINARY_DIR}/common) +set(GLOBAL_SOURCES ${GLOBAL_RC}) + # Add extensions to build here add_subdirectory(fcs) +add_subdirectory(break_line) add_subdirectory(advanced_ballistics) message("Build Type: ${CMAKE_BUILD_TYPE}") \ No newline at end of file diff --git a/extensions/advanced_ballistics/AdvancedBallistics.cpp b/extensions/advanced_ballistics/AdvancedBallistics.cpp index 2851d6576b..e62a564dca 100644 --- a/extensions/advanced_ballistics/AdvancedBallistics.cpp +++ b/extensions/advanced_ballistics/AdvancedBallistics.cpp @@ -19,8 +19,6 @@ #define STD_AIR_DENSITY_ICAO 1.22498 #define STD_AIR_DENSITY_ASM 1.20885 -static char version[] = "1.0"; - struct Bullet { double airFriction; double caliber; @@ -242,7 +240,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) { if (!strcmp(function, "version")) { - int n = sprintf_s(output, outputSize, "%s", version); + int n = sprintf_s(output, outputSize, "%s", ACE_FULL_VERSION_STR); return; } @@ -463,7 +461,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) if (gridHeight > position[2]) { double angle = atan((gridHeight - position[2]) / 100); - windAttenuation *= pow(cos(angle), 2); + windAttenuation *= pow(abs(cos(angle)), 2); } } } @@ -478,7 +476,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) if (heightAGL > 0 && heightAGL < 20) { double roughnessLength = calculateRoughnessLength(windSourceObstacles[0], windSourceObstacles[1]); - windAttenuation *= (log(heightAGL / roughnessLength) / log(20 / roughnessLength)); + windAttenuation *= abs(log(heightAGL / roughnessLength) / log(20 / roughnessLength)); } } diff --git a/extensions/advanced_ballistics/CMakeLists.txt b/extensions/advanced_ballistics/CMakeLists.txt index f579339a04..19b9fc41d9 100644 --- a/extensions/advanced_ballistics/CMakeLists.txt +++ b/extensions/advanced_ballistics/CMakeLists.txt @@ -1,7 +1,7 @@ set(ACE_EXTENSION_NAME "ace_advanced_ballistics") file(GLOB SOURCES *.h *.hpp *.c *.cpp) -add_library( ${ACE_EXTENSION_NAME} SHARED ${SOURCES}) +add_library( ${ACE_EXTENSION_NAME} SHARED ${GLOBAL_SOURCES} ${SOURCES}) add_dependencies(${ACE_EXTENSION_NAME} ace_common) SET_TARGET_PROPERTIES(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") diff --git a/extensions/break_line/CMakeLists.txt b/extensions/break_line/CMakeLists.txt new file mode 100644 index 0000000000..00a74d4c3a --- /dev/null +++ b/extensions/break_line/CMakeLists.txt @@ -0,0 +1,11 @@ +set(ACE_EXTENSION_NAME "ace_break_line") + +file(GLOB SOURCES *.h *.hpp *.c *.cpp) +add_library( ${ACE_EXTENSION_NAME} SHARED ${GLOBAL_SOURCES} ${SOURCES}) +add_dependencies(${ACE_EXTENSION_NAME} ace_common) +SET_TARGET_PROPERTIES(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") + +if(CMAKE_COMPILER_IS_GNUCXX) + set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1) + set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_END_STATIC 1) +endif() \ No newline at end of file diff --git a/extensions/break_line/ace_break_line.cpp b/extensions/break_line/ace_break_line.cpp new file mode 100644 index 0000000000..2b253c05bc --- /dev/null +++ b/extensions/break_line/ace_break_line.cpp @@ -0,0 +1,76 @@ +/* + * ace_break_line.cpp + * + * Takes a string and insert as many line breaks as needed so it fits a given width + * + * Takes: + * Localized string as string + * Example: "Check weapon temperature" + * + * Returns: + * String with line breaks + */ + +#include "ace_common.h" + +#include +#include +#include + +#define MAXCHARACTERS 14 + +extern "C" { + __declspec (dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function); +}; + +std::vector splitString(const std::string & input) { + std::istringstream ss(input); + std::string token; + + std::vector output; + while (std::getline(ss, token, ' ')) { + output.push_back(token); + } + + return output; +} + +std::string addLineBreaks(const std::vector &words) { + std::stringstream sstream; + size_t numChar = 0; + size_t i = 0; + + while (i < words.size()) { + if (numChar == 0) { + sstream << words[i]; + numChar += words[i].size(); + i++; + } else { + if (numChar + 1 + words[i].size() > MAXCHARACTERS) { + sstream << "
"; + numChar = 0; + } else { + sstream << " " << words[i]; + numChar += 1 + words[i].size(); + i++; + } + } + } + + return sstream.str(); +} + +// i like to live dangerously. jk, fix strncpy sometime pls. +#pragma warning( push ) +#pragma warning( disable : 4996 ) + +void __stdcall RVExtension(char *output, int outputSize, const char *function) { + if (!strcmp(function, "version")) { + strncpy(output, ACE_FULL_VERSION_STR, outputSize); + } else { + strncpy(output, addLineBreaks(splitString(function)).c_str(), outputSize); + output[outputSize - 1] = '\0'; + } +} + +#pragma warning( pop ) diff --git a/extensions/common/ace_common.h b/extensions/common/ace_common.h index 4a8847b209..93f7b9af8a 100644 --- a/extensions/common/ace_common.h +++ b/extensions/common/ace_common.h @@ -1,4 +1,4 @@ #pragma once #include "targetver.h" - +#include "ace_version.hpp" diff --git a/extensions/common/ace_version.hpp.in b/extensions/common/ace_version.hpp.in new file mode 100644 index 0000000000..853648497d --- /dev/null +++ b/extensions/common/ace_version.hpp.in @@ -0,0 +1,4 @@ +#pragma once + +#define ACE_VERSION_STR "@ACE_VERSION_MAJOR@.@ACE_VERSION_MINOR@.@ACE_VERSION_REVISION@" +#define ACE_FULL_VERSION_STR "@ACE_VERSION_MAJOR@.@ACE_VERSION_MINOR@.@ACE_VERSION_REVISION@-@ACE_VERSION_BUILD@" \ No newline at end of file diff --git a/extensions/common/ace_version_win32.rc.in b/extensions/common/ace_version_win32.rc.in new file mode 100644 index 0000000000..112f404649 --- /dev/null +++ b/extensions/common/ace_version_win32.rc.in @@ -0,0 +1,47 @@ +#ifdef _WIN32 + + #include + + #ifndef DEBUG + #define VER_DEBUG 0 + #else + #define VER_DEBUG VS_FF_DEBUG + #endif + + VS_VERSION_INFO VERSIONINFO + FILEVERSION @ACE_VERSION_MAJOR@, @ACE_VERSION_MINOR@, @ACE_VERSION_REVISION@ + PRODUCTVERSION @ACE_VERSION_MAJOR@, @ACE_VERSION_MINOR@, @ACE_VERSION_REVISION@ + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS (VS_FF_PRIVATEBUILD|VS_FF_PRERELEASE|VER_DEBUG) + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "ACE3 Team" + VALUE "FileDescription", "@ACE_VERSION_MAJOR@.@ACE_VERSION_MINOR@.@ACE_VERSION_REVISION@-@ACE_VERSION_BUILD@" + VALUE "FileVersion", "@ACE_VERSION_MAJOR@.@ACE_VERSION_MINOR@.@ACE_VERSION_REVISION@-@ACE_VERSION_BUILD@" + VALUE "ProductName", "ACE3" + VALUE "ProductVersion", "@ACE_VERSION_MAJOR@.@ACE_VERSION_MINOR@.@ACE_VERSION_REVISION@-@ACE_VERSION_BUILD@" + VALUE "Build Date", "@ACE_BUILDSTAMP@" + END + END + + BLOCK "VarFileInfo" + BEGIN + /* The following line should only be modified for localized versions. */ + /* It consists of any number of WORD,WORD pairs, with each pair */ + /* describing a language,codepage combination supported by the file. */ + /* */ + /* For example, a file might have values "0x409,1252" indicating that it */ + /* supports English language (0x409) in the Windows ANSI codepage (1252). */ + + VALUE "Translation", 0x409, 1252 + + END + END + +#endif \ No newline at end of file diff --git a/extensions/fcs/CMakeLists.txt b/extensions/fcs/CMakeLists.txt index 2b24542566..0a4ba1b064 100644 --- a/extensions/fcs/CMakeLists.txt +++ b/extensions/fcs/CMakeLists.txt @@ -1,7 +1,7 @@ set(ACE_EXTENSION_NAME "ace_fcs") file(GLOB SOURCES *.h *.hpp *.c *.cpp) -add_library( ${ACE_EXTENSION_NAME} SHARED ${SOURCES}) +add_library( ${ACE_EXTENSION_NAME} SHARED ${GLOBAL_SOURCES} ${SOURCES}) add_dependencies(${ACE_EXTENSION_NAME} ace_common) SET_TARGET_PROPERTIES(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") diff --git a/extensions/fcs/ace_fcs.cpp b/extensions/fcs/ace_fcs.cpp index a1a3b64ba7..4aada29aff 100644 --- a/extensions/fcs/ace_fcs.cpp +++ b/extensions/fcs/ace_fcs.cpp @@ -12,7 +12,7 @@ */ #include "ace_common.h" - + #define _USE_MATH_DEFINES #include @@ -25,8 +25,6 @@ #define PRECISION 0.1 #define RADIANS(X) (X / (180 / M_PI)) -static char version[] = "1.0"; - extern "C" { __declspec (dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function); }; @@ -104,7 +102,7 @@ double getSolution(double initSpeed, double airFriction, double angleTarget, dou void __stdcall RVExtension(char *output, int outputSize, const char *function) { if (!strcmp(function, "version")) { - strncpy(output, version, outputSize); + strncpy(output, ACE_FULL_VERSION_STR, outputSize); } else { std::vector argStrings = splitString(function); double initSpeed = std::stod(argStrings[0]); @@ -113,9 +111,11 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) { double distance = std::stod(argStrings[3]); double result = getSolution(initSpeed, airFriction, angleTarget, distance); - std::string resultString = std::to_string(result); - strcpy(output, resultString.c_str()); + std::stringstream sstream; + sstream << result; + + strcpy(output, sstream.str().c_str()); output[outputSize - 1] = '\0'; } } diff --git a/extras/CfgAmmoReference.hpp b/extras/CfgAmmoReference.hpp new file mode 100644 index 0000000000..85201b92cc --- /dev/null +++ b/extras/CfgAmmoReference.hpp @@ -0,0 +1,2801 @@ +class CfgAmmo +{ + class BulletBase; + class B_556x45_Ball : BulletBase { + airFriction=-0.001265; + hit=8; + typicalSpeed=750; + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-27.20, -26.44, -23.76, -21.00, -17.54, -13.10, -7.95, -1.62, 6.24, 15.48, 27.75}; + ACE_ballisticCoefficients[]={0.151}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={723, 764, 796, 825, 843, 866, 878, 892, 906, 915, 922, 900}; + ACE_barrelLengths[]={8.3, 9.4, 10.6, 11.8, 13.0, 14.2, 15.4, 16.5, 17.7, 18.9, 20.0, 24.0}; + }; + class ACE_556x45_Ball_Mk262 : B_556x45_Ball { + airFriction=-0.001125; + caliber=0.6; + deflecting=18; + hit=11; + typicalSpeed=836; + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=77; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.361}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={624, 816, 832, 838}; + ACE_barrelLengths[]={7.5, 14.5, 18, 20}; + }; + class ACE_556x45_Ball_Mk318 : B_556x45_Ball { + airFriction=-0.001120; + caliber=0.6; + deflecting=18; + hit=9; + typicalSpeed=886; + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.307}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={780, 886, 950}; + ACE_barrelLengths[]={10, 15.5, 20}; + }; + class B_556x45_Ball_Tracer_Red; + class ACE_B_556x45_Ball_Tracer_Dim: B_556x45_Ball_Tracer_Red { + nvgOnly = 1; + }; + class ACE_545x39_Ball_7N6M : B_556x45_Ball { + airFriction=-0.001162; + caliber=0.5; + deflecting=18; + hit=7; + typicalSpeed=880; + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=52.9; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={780, 880, 920}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class B_556x45_Ball_Tracer_Yellow; + class ACE_545x39_Ball_7T3M : B_556x45_Ball_Tracer_Yellow { + airFriction=-0.001162; + caliber=0.5; + deflecting=18; + hit=7; + typicalSpeed=883; + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=49.8; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={785, 883, 925}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class B_65x39_Caseless : BulletBase { + airFriction=-0.000785; + typicalSpeed=800; + ACE_caliber=0.264; + ACE_bulletLength=1.295; + ACE_bulletMass=123; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.263}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={730, 760, 788, 800, 810, 830}; + ACE_barrelLengths[]={10, 16, 20, 24, 26, 30}; + }; + class B_65x39_Case_yellow; + class ACE_65x39_Caseless_Tracer_Dim : B_65x39_Case_yellow { + nvgOnly = 1; + }; + class B_65x39_Caseless_green; + class ACE_65x39_Caseless_green_Tracer_Dim : B_65x39_Caseless_green { + nvgOnly = 1; + }; + class ACE_65x47_Ball_Scenar: B_65x39_Caseless + { + airFriction=-0.00078; + typicalSpeed=820 ; + ACE_caliber=0.264; + ACE_bulletLength=1.364; + ACE_bulletMass=139; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.290}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={730, 760, 790, 820, 830}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class B_762x51_Ball : BulletBase { + airFriction=-0.001035; + typicalSpeed=833; + hit=9; + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class B_762x51_Tracer_Yellow; + class ACE_B_762x51_Tracer_Dim: B_762x51_Tracer_Yellow { + nvgOnly = 1; + }; + class ACE_762x51_Ball_M118LR : B_762x51_Ball { + airFriction=-0.0008525; + caliber=1.05; + hit=16; + typicalSpeed=790; + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=175; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.243}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={750, 780, 790, 794}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class ACE_762x51_Ball_Mk319_Mod_0 : B_762x51_Ball { + airFriction=-0.00103; + caliber=0.85; + hit=14; + typicalSpeed=890; + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=130; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.377}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={838, 892, 910}; + ACE_barrelLengths[]={13, 16, 20}; + }; + class ACE_762x51_Ball_Subsonic : B_762x51_Ball { + airFriction=-0.000535; + caliber=0.5; + hit=6; + typicalSpeed=790; + ACE_caliber=0.308; + ACE_bulletLength=1.340; + ACE_bulletMass=200; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.235}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={305, 325, 335, 340}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class ACE_762x67_Ball_Mk248_Mod_0 : B_762x51_Ball { + airFriction=-0.000830; + caliber=1.08; + hit=17; + typicalSpeed=900; + ACE_caliber=0.308; + ACE_bulletLength=1.353; + ACE_bulletMass=190; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.268}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={865, 900, 924}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class ACE_762x67_Ball_Mk248_Mod_1 : B_762x51_Ball { + airFriction=-0.000815; + caliber=1.12; + hit=18; + typicalSpeed=867; + ACE_caliber=0.308; + ACE_bulletLength=1.489; + ACE_bulletMass=220; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.310}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={847, 867, 877}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class ACE_762x67_Ball_Berger_Hybrid_OTM : B_762x51_Ball { + airFriction=-0.00076; + caliber=1.15; + hit=19; + typicalSpeed=853; + ACE_caliber=0.308; + ACE_bulletLength=1.602; + ACE_bulletMass=230; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.368}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={800, 853, 884}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class B_762x54_Ball: B_762x51_Ball { + airFriction=-0.001023; + typicalSpeed=820; + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=152; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.4}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={700, 800, 820, 833}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class ACE_762x54_Ball_7N14 : B_762x51_Ball { + airFriction=-0.001023; + caliber=0.95; + hit=15; + typicalSpeed=820; + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=152; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.4}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={700, 800, 820, 833}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class B_762x54_Tracer_Green; + class ACE_762x54_Ball_7T2 : B_762x54_Tracer_Green { + airFriction=-0.001023; + caliber=0.9; + hit=15; + typicalSpeed=800; + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=149; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.395}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={680, 750, 798, 800}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class ACE_762x35_Ball : B_762x51_Ball { + airFriction=-0.000821; + caliber=0.9; + hit=11; + typicalSpeed=790; + ACE_caliber=0.308; + ACE_bulletLength=1.153; + ACE_bulletMass=125; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.349, 0.338, 0.330, 0.310}; + ACE_velocityBoundaries[]={792, 610, 488}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={620, 655, 675}; + ACE_barrelLengths[]={9, 16, 20}; + }; + class ACE_762x39_Ball : B_762x51_Ball { + airFriction=-0.0015168; + hit=12; + typicalSpeed=716; + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=123; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class ACE_762x39_Ball_57N231P : B_762x51_Tracer_Yellow { + airFriction=-0.0015168; + hit=12; + typicalSpeed=716; + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=117; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class B_9x21_Ball : BulletBase { + airFriction=-0.00125; + typicalSpeed=390; + hit=6; + ACE_caliber=0.356; + ACE_bulletLength=0.610; + ACE_bulletMass=115; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.17}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={440, 460, 480}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class ACE_9x18_Ball_57N181S : B_9x21_Ball { + hit=5; + airFriction=-0.001234; + typicalSpeed=298; + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class ACE_9x19_Ball : B_9x21_Ball { + airFriction=-0.001234; + typicalSpeed=370; + hit=6; + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class ACE_10x25_Ball : B_9x21_Ball { + airFriction=-0.00168; + typicalSpeed=425; + hit=7; + ACE_caliber=0.5; + ACE_bulletLength=0.764; + ACE_bulletMass=165; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.189}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={360, 400, 430}; + ACE_barrelLengths[]={4, 4.61, 9}; + }; + class ACE_765x17_Ball: B_9x21_Ball { + airFriction=-0.001213; + typicalSpeed=282; + hit=7; + ACE_caliber=0.3125; + ACE_bulletLength=0.610; + ACE_bulletMass=65; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.118}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={282, 300, 320}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class ACE_303_Ball : ACE_762x51_Ball_M118LR { + airFriction=-0.00083; + typicalSpeed=761; + ACE_caliber=0.311; + ACE_bulletLength=1.227; + ACE_bulletMass=174; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.499, 0.493, 0.48}; + ACE_velocityBoundaries[]={671, 549}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={748, 761, 765}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class B_93x64_Ball : BulletBase { + airFriction=-0.00106; + typicalSpeed=880; + ACE_caliber=0.366; + ACE_bulletLength=1.350; + ACE_bulletMass=230; + ACE_transonicStabilityCoef=1; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.368}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={850, 870, 880}; + ACE_barrelLengths[]={20, 24.41, 26}; + }; + class B_408_Ball : BulletBase { + timeToLive=10; + airFriction=-0.000395; + typicalSpeed=910; + ACE_caliber=0.408; + ACE_bulletLength=2.126; + ACE_bulletMass=410; + ACE_transonicStabilityCoef=1; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.97}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={910}; + ACE_barrelLengths[]={29}; + }; + class ACE_106x83mm_Ball : B_408_Ball { + timeToLive=10; + ACE_caliber=0.416; + ACE_bulletLength=2.089; + ACE_bulletMass=398; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.72}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={960}; + ACE_barrelLengths[]={29}; + }; + class B_338_Ball : BulletBase { + timeToLive=10; + airFriction=-0.000606; + typicalSpeed=915; + ACE_caliber=0.338; + ACE_bulletLength=1.558; + ACE_bulletMass=250; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.322}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={880, 915, 925}; + ACE_barrelLengths[]={20, 26, 28}; + }; + class B_338_NM_Ball : BulletBase { + airFriction=-0.000537; + typicalSpeed=820; + ACE_caliber=0.338; + ACE_bulletLength=1.70; + ACE_bulletMass=300; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.381}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={790, 807, 820}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class ACE_338_Ball : B_338_Ball { + timeToLive=10; + airFriction=-0.000535; + caliber=1.55; + typicalSpeed=826; + ACE_caliber=0.338; + ACE_bulletLength=1.70; + ACE_bulletMass=300; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.381}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={800, 820, 826, 830}; + ACE_barrelLengths[]={20, 24, 26.5, 28}; + }; + class ACE_338_Ball_API526 : B_338_Ball { + timeToLive=10; + airFriction=-0.000673; + caliber=2.4; + typicalSpeed=826; + ACE_caliber=0.338; + ACE_bulletLength=1.535; + ACE_bulletMass=253; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.290}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={880, 915, 925}; + ACE_barrelLengths[]={20, 26, 28}; + }; + class B_127x54_Ball : BulletBase { + airFriction=-0.00014; + typicalSpeed=300; + ACE_caliber=0.510; + ACE_bulletLength=2.540; + ACE_bulletMass=750; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={1.050}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={300}; + ACE_barrelLengths[]={17.2}; + }; + class B_127x99_Ball : BulletBase { + timeToLive=10; + airFriction=-0.0006; + typicalSpeed=853; + ACE_caliber=0.510; + ACE_bulletLength=2.310; + ACE_bulletMass=647; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.670}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={853}; + ACE_barrelLengths[]={29}; + }; + class ACE_127x99_Ball_AMAX : B_127x99_Ball { + timeToLive=10; + airFriction=-0.000374; + typicalSpeed=860; + ACE_caliber=0.510; + ACE_bulletLength=2.540; + ACE_bulletMass=750; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={1.050}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={860}; + ACE_barrelLengths[]={29}; + }; + class B_127x108_Ball : BulletBase { + timeToLive=10; + airFriction=-0.00064; + typicalSpeed=820; + ACE_caliber=0.511; + ACE_bulletLength=2.520; + ACE_bulletMass=745; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.63}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={820}; + ACE_barrelLengths[]={28.7}; + }; + class B_45ACP_Ball : BulletBase { + airFriction=-0.0007182; + typicalSpeed=250; + ACE_caliber=0.452; + ACE_bulletLength=0.68; + ACE_bulletMass=230; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.195}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={230, 250, 285}; + ACE_barrelLengths[]={4, 5, 9}; + }; + + class TMR_B_762x51_M118LR : B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=175; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.505, 0.496, 0.485, 0.485, 0.485}; + ACE_velocityBoundaries[]={853, 549, 549, 549}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={750, 780, 790, 794}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + + class RH_50_AE_Ball: BulletBase + { + ACE_caliber=0.5; + ACE_bulletLength=1.110; + ACE_bulletMass=325; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.228}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={360, 398, 420}; + ACE_barrelLengths[]={4, 6, 9}; + }; + class RH_454_Casull: BulletBase + { + ACE_caliber=0.452; + ACE_bulletLength=0.895; + ACE_bulletMass=325; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.171}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={450, 490, 500}; + ACE_barrelLengths[]={4, 7.5, 9}; + }; + class RH_32ACP: BulletBase + { + ACE_caliber=0.3125; + ACE_bulletLength=0.610; + ACE_bulletMass=65; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.118}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={282, 300, 320}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class RH_45ACP: BulletBase + { + ACE_caliber=0.452; + ACE_bulletLength=0.68; + ACE_bulletMass=230; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.195}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={230, 250, 285}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class RH_B_40SW: BulletBase + { + ACE_caliber=0.4; + ACE_bulletLength=0.447; + ACE_bulletMass=135; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.105, 0.115, 0.120, 0.105}; + ACE_velocityBoundaries[]={365, 305, 259}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={360, 380, 400}; + ACE_barrelLengths[]={4, 6, 9}; + }; + class RH_44mag_ball: BulletBase + { + ACE_caliber=0.429; + ACE_bulletLength=0.804; + ACE_bulletMass=200; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.172}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={360, 390, 420}; + ACE_barrelLengths[]={4, 7.5, 9}; + }; + class RH_357mag_ball: BulletBase + { + ACE_caliber=0.357; + ACE_bulletLength=0.541; + ACE_bulletMass=125; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.148}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={490, 510, 535}; + ACE_barrelLengths[]={4, 6, 9}; + }; + class RH_762x25: BulletBase + { + ACE_caliber=0.310; + ACE_bulletLength=0.5455; + ACE_bulletMass=86; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.17}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={360, 380, 400}; + ACE_barrelLengths[]={4, 6, 9}; + }; + class RH_9x18_Ball: BulletBase + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class RH_B_9x19_Ball: BulletBase + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class RH_B_22LR_SD: BulletBase + { + ACE_caliber=0.223; + ACE_bulletLength=0.45; + ACE_bulletMass=38; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.111}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={330, 340, 360}; + ACE_barrelLengths[]={4, 6, 9}; + }; + class RH_57x28mm: BulletBase + { + ACE_caliber=0.224; + ACE_bulletLength=0.495; + ACE_bulletMass=28; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.144}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={550, 625, 720}; + ACE_barrelLengths[]={4, 6, 10.35}; + }; + + class RH_9x19_B_M822: BulletBase + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class RH_9x19_B_HP: BulletBase + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class RH_9x19_B_HPSB: BulletBase + { + ACE_caliber=0.355; + ACE_bulletLength=0.603; + ACE_bulletMass=147; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.212}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={295, 310, 330}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class RH_B_6x35: BulletBase + { + ACE_caliber=0.224; + ACE_bulletLength=0.445; + ACE_bulletMass=65; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.26}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={730, 750, 760}; + ACE_barrelLengths[]={8, 10, 12}; + }; + class RH_556x45_B_M855A1 : B_556x45_Ball + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-27.20, -26.44, -23.76, -21.00, -17.54, -13.10, -7.95, -1.62, 6.24, 15.48, 27.75}; + ACE_ballisticCoefficients[]={0.152}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={723, 764, 796, 825, 843, 866, 878, 892, 906, 915, 922, 900}; + ACE_barrelLengths[]={8.3, 9.4, 10.6, 11.8, 13.0, 14.2, 15.4, 16.5, 17.7, 18.9, 20.0, 24.0}; + }; + class RH_556x45_B_Mk262 : B_556x45_Ball + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=77; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.361}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={624, 816, 832, 838}; + ACE_barrelLengths[]={7.5, 14.5, 18, 20}; + }; + class RH_556x45_B_Mk318 : B_556x45_Ball + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.307}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={780, 886, 950}; + ACE_barrelLengths[]={10, 15.5, 20}; + }; + class RH_68x43_B_FMJ: B_65x39_Caseless + { + ACE_caliber=0.277; + ACE_bulletLength=0.959; + ACE_bulletMass=115; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.162}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={713, 785, 810, 850}; + ACE_barrelLengths[]={12, 16, 20, 24}; + }; + class RH_68x43_B_Match: B_65x39_Caseless + { + ACE_caliber=0.277; + ACE_bulletLength=1.250; + ACE_bulletMass=135; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.253}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 732, 750, 780}; + ACE_barrelLengths[]={12, 16, 20, 24}; + }; + class RH_762x35_B_FMJ: B_65x39_Caseless + { + ACE_caliber=0.308; + ACE_bulletLength=1.118; + ACE_bulletMass=147; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.398}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={559, 609, 625}; + ACE_barrelLengths[]={6, 16, 20}; + }; + class RH_762x35_B_Match: B_65x39_Caseless + { + ACE_caliber=0.308; + ACE_bulletLength=1.153; + ACE_bulletMass=125; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.349, 0.338, 0.330, 0.310}; + ACE_velocityBoundaries[]={792, 610, 488}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={590, 650, 665}; + ACE_barrelLengths[]={6, 16, 20}; + }; + class RH_762x35_B_MSB: B_65x39_Caseless + { + ACE_caliber=0.308; + ACE_bulletLength=1.489; + ACE_bulletMass=220; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.608}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={300, 320, 340}; + ACE_barrelLengths[]={9, 16, 20}; + }; + class RH_762x51_B_M80A1 : B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class RH_762x51_B_Mk316LR : B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=175; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.243}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={750, 780, 790, 794}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class RH_762x51_B_Mk319 : B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.074; + ACE_bulletMass=130; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.277}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={838, 892, 920}; + ACE_barrelLengths[]={13, 16, 20}; + }; + class RH_762x51_B_LFMJSB: B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.340; + ACE_bulletMass=200; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.252}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={305, 325, 335, 340}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + + class HLC_556NATO_SOST: BulletBase + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.307}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={780, 886, 950}; + ACE_barrelLengths[]={10, 15.5, 20}; + }; + class HLC_556NATO_SPR: BulletBase + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=77; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.361}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={624, 816, 832, 838}; + ACE_barrelLengths[]={7.5, 14.5, 18, 20}; + }; + class HLC_556NATO_EPR: BulletBase + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-27.20, -26.44, -23.76, -21.00, -17.54, -13.10, -7.95, -1.62, 6.24, 15.48, 27.75}; + ACE_ballisticCoefficients[]={0.152}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={723, 764, 796, 825, 843, 866, 878, 892, 906, 915, 922, 900}; + ACE_barrelLengths[]={8.3, 9.4, 10.6, 11.8, 13.0, 14.2, 15.4, 16.5, 17.7, 18.9, 20.0, 24.0}; + }; + class HLC_300Blackout_Ball: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.118; + ACE_bulletMass=147; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.398}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={559, 609, 625}; + ACE_barrelLengths[]={6, 16, 20}; + }; + class HLC_300Blackout_SMK: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.489; + ACE_bulletMass=220; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.608}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={300, 320, 340}; + ACE_barrelLengths[]={9, 16, 20}; + }; + class HLC_762x51_BTSub: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.340; + ACE_bulletMass=200; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.235}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={305, 325, 335, 340}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class HLC_762x54_ball: BulletBase + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=152; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.4}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={700, 800, 820, 833}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class HLC_762x54_tracer: BulletBase + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=149; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.395}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={680, 750, 798, 800}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class HLC_303Brit_B: BulletBase + { + ACE_caliber=0.311; + ACE_bulletLength=1.227; + ACE_bulletMass=174; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.499, 0.493, 0.48}; + ACE_velocityBoundaries[]={671, 549}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={748, 761, 765}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class HLC_792x57_Ball: BulletBase + { + ACE_caliber=0.318; + ACE_bulletLength=1.128; + ACE_bulletMass=196; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.315}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={785, 800, 815}; + ACE_barrelLengths[]={20, 23.62, 26}; + }; + class FH_545x39_Ball: BulletBase + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=52.9; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={780, 880, 920}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class FH_545x39_7u1: FH_545x39_Ball + { + ACE_bulletMass=80; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_muzzleVelocities[]={260, 303, 320}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class HLC_9x19_Ball: BulletBase + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class HLC_9x19_GoldDot: HLC_9x19_Ball + { + ACE_muzzleVelocities[]={350, 380, 420}; + }; + class HLC_9x19_Subsonic: HLC_9x19_Ball + { + ACE_muzzleVelocities[]={300, 320, 340}; + }; + class HLC_10mm_FMJ: HLC_9x19_Ball + { + ACE_caliber=0.5; + ACE_bulletLength=0.764; + ACE_bulletMass=165; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.189}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={360, 400, 430}; + ACE_barrelLengths[]={4, 4.61, 9}; + }; + class HLC_9x19_M882_SMG: HLC_9x19_Ball + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + + class M_mas_545x39_Ball_7N6M : BulletBase + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=52.9; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={780, 880, 920}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class M_mas_545x39_Ball_7T3M : BulletBase + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=49.8; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={785, 883, 925}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class B_mas_556x45_Ball_Mk262 : B_556x45_Ball + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=77; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.361}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={624, 816, 832, 838}; + ACE_barrelLengths[]={7.5, 14.5, 18, 20}; + }; + class B_mas_9x18_Ball_57N181S : BulletBase + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class B_mas_9x21p_Ball: BulletBase + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class B_mas_9x21_Ball: BulletBase + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class B_mas_9x21d_Ball: BulletBase + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={210, 250, 285}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class B_mas_765x17_Ball: BulletBase + { + ACE_caliber=0.3125; + ACE_bulletLength=0.610; + ACE_bulletMass=65; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.118}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={282, 300, 320}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class B_mas_762x39_Ball: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=123; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class B_mas_762x39_Ball_T: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=117; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class B_mas_762x51_Ball_M118LR : B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=175; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.505, 0.496, 0.485, 0.485, 0.485}; + ACE_velocityBoundaries[]={853, 549, 549, 549}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={750, 780, 790, 794}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class B_mas_762x67_Ball_Mk248_Mod_0 : B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.353; + ACE_bulletMass=190; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.268}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={865, 900, 924}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class B_mas_762x67_Ball_Mk248_Mod_1 : B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.489; + ACE_bulletMass=220; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.310}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={820, 867, 900}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class B_mas_762x67_Ball_Berger_Hybrid_OTM : B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.602; + ACE_bulletMass=230; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.368}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={800, 853, 884}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class B_mas_762x54_Ball : BulletBase + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=152; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.4}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={700, 800, 820, 833}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class B_mas_762x54_Ball_T : BulletBase + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=149; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.395}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={680, 750, 798, 800}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class BWA3_B_762x51_Ball_LR : BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=175; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.505, 0.496, 0.485, 0.485, 0.485}; + ACE_velocityBoundaries[]={853, 549, 549, 549}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={750, 780, 790, 794}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class BWA3_B_762x51_Ball_SD : BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=175; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={300, 340}; + ACE_barrelLengths[]={16, 24}; + }; + + class BWA3_B_46x30_Ball : BulletBase + { + ACE_caliber=0.193; + ACE_bulletLength=0.512; + ACE_bulletMass=31; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.1455}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={680, 720, 730, 740}; + ACE_barrelLengths[]={4, 7, 9, 12}; + }; + + class Trixie_338_Ball : BulletBase + { + ACE_caliber=0.338; + ACE_bulletLength=1.70; + ACE_bulletMass=300; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.381}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={820, 826, 830}; + ACE_barrelLengths[]={24, 26.5, 28}; + }; + class Trixie_303_Ball : BulletBase + { + ACE_caliber=0.311; + ACE_bulletLength=1.227; + ACE_bulletMass=174; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.499, 0.493, 0.48}; + ACE_velocityBoundaries[]={671, 549}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={748, 761, 765}; + ACE_barrelLengths[]={20, 24, 26}; + }; + + class rhs_ammo_556x45_Mk318_Ball : BulletBase + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.307}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={780, 886, 950}; + ACE_barrelLengths[]={10, 15.5, 20}; + }; + class rhs_ammo_556x45_Mk262_Ball : BulletBase + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=77; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.361}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={624, 816, 832, 838}; + ACE_barrelLengths[]={7.5, 14.5, 18, 20}; + }; + class rhsammo_762x51_Ball : BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class rhs_B_545x39_Ball : BulletBase + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=52.9; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={780, 880, 920}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class rhs_B_545x39_Ball_Tracer_Green : BulletBase + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=49.8; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={785, 883, 925}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class rhs_ammo_762x51_M118_Special_Ball : BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=175; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.243}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={750, 780, 790, 794}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class rhs_B_762x54_Ball : BulletBase + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=152; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.4}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={700, 800, 820, 833}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class rhs_B_762x54_Ball_Tracer_Green : BulletBase + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=149; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.395}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={680, 750, 798, 800}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class rhs_B_762x39_Ball : BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=123; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class rhs_B_762x39_Tracer : BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=117; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class rhs_ammo_762x51_M80_Ball : BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class rhsusf_B_300winmag : BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.489; + ACE_bulletMass=220; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.310}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={847, 867, 877}; + ACE_barrelLengths[]={20, 24, 26}; + }; + + class R3F_9x19_Ball: BulletBase + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class R3F_556x45_Ball: BulletBase + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-27.20, -26.44, -23.76, -21.00, -17.54, -13.10, -7.95, -1.62, 6.24, 15.48, 27.75}; + ACE_ballisticCoefficients[]={0.151}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={723, 764, 796, 825, 843, 866, 878, 892, 906, 915, 922, 900}; + ACE_barrelLengths[]={8.3, 9.4, 10.6, 11.8, 13.0, 14.2, 15.4, 16.5, 17.7, 18.9, 20.0, 24.0}; + }; + class R3F_762x51_Ball: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class R3F_762x51_Ball2: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=175; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.505, 0.496, 0.485, 0.485, 0.485}; + ACE_velocityBoundaries[]={853, 549, 549, 549}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={750, 780, 790, 794}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class R3F_127x99_Ball: BulletBase + { + ACE_caliber=0.510; + ACE_bulletLength=2.310; + ACE_bulletMass=647; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.670}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={853}; + ACE_barrelLengths[]={29}; + }; + class R3F_127x99_Ball2: BulletBase + { + ACE_caliber=0.510; + ACE_bulletLength=2.310; + ACE_bulletMass=647; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.670}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={853}; + ACE_barrelLengths[]={29}; + }; + + class CUP_B_545x39_Ball: BulletBase + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=52.9; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={780, 880, 920}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_545x39_Ball_Tracer_Green: BulletBase + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=49.8; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={785, 883, 925}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_545x39_Ball_Tracer_Red: BulletBase + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=49.8; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={785, 883, 925}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_545x39_Ball_Tracer_White: BulletBase + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=49.8; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={785, 883, 925}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_545x39_Ball_Tracer_Yellow: BulletBase + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=49.8; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={785, 883, 925}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_762x39_Ball: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=123; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_762x39_Ball_Tracer_Green: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=117; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class B_762x39mm_KLT: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=123; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_9x18_Ball: BulletBase + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_9x18_Ball_Tracer_Green: BulletBase + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_9x18_Ball_Tracer_Red: BulletBase + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_9x18_Ball_Tracer_Yellow: BulletBase + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_9x18_Ball_White_Tracer: BulletBase + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_9x19_Ball: BulletBase + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class CUP_B_762x51_noTracer: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class CUP_B_762x51_Red_Tracer_3RndBurst: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class CUP_B_762x51_White_Tracer_3RndBurst: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class CUP_B_303_Ball: BulletBase + { + ACE_caliber=0.311; + ACE_bulletLength=1.227; + ACE_bulletMass=174; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.499, 0.493, 0.48}; + ACE_velocityBoundaries[]={671, 549}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={748, 761, 765}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class CUP_B_127x107_Ball_Green_Tracer: BulletBase + { + ACE_caliber=0.511; + ACE_bulletLength=2.520; + ACE_bulletMass=745; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.63}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={820}; + ACE_barrelLengths[]={28.7}; + }; + class CUP_B_127x108_Ball_Green_Tracer: BulletBase + { + ACE_caliber=0.511; + ACE_bulletLength=2.520; + ACE_bulletMass=745; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.63}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={820}; + ACE_barrelLengths[]={28.7}; + }; + class CUP_B_762x54_Ball_White_Tracer: BulletBase + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=149; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.395}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={680, 750, 798, 800}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class CUP_B_762x54_Ball_Red_Tracer: BulletBase + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=149; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.395}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={680, 750, 798, 800}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class CUP_B_762x54_Ball_Green_Tracer: BulletBase + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=149; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.395}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={680, 750, 798, 800}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class CUP_B_762x54_Ball_Yellow_Tracer: BulletBase + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=149; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.395}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={680, 750, 798, 800}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class CUP_B_9x39_SP5: BulletBase + { + ACE_caliber=0.364; + ACE_bulletLength=1.24; + ACE_bulletMass=250; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={280, 300, 320}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_762x51_Tracer_Green: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class CUP_B_762x51_Tracer_Red: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class CUP_B_762x51_Tracer_Yellow: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class CUP_B_762x51_Tracer_White: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class B_127x107_Ball: BulletBase + { + ACE_caliber=0.511; + ACE_bulletLength=2.520; + ACE_bulletMass=745; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.63}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={820}; + ACE_barrelLengths[]={28.7}; + }; + class CUP_B_9x18_SD: BulletBase + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 340}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_765x17_Ball: BulletBase + { + ACE_caliber=0.3125; + ACE_bulletLength=0.610; + ACE_bulletMass=65; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.118}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={282, 300, 320}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class CUP_B_145x115_AP_Green_Tracer: BulletBase + { + ACE_caliber=0.586; + ACE_bulletLength=2.00; + ACE_bulletMass=1010; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.620}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={1000}; + ACE_barrelLengths[]={53}; + }; + class CUP_B_127x99_Ball_White_Tracer: BulletBase + { + ACE_caliber=0.510; + ACE_bulletLength=2.310; + ACE_bulletMass=647; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.670}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={853}; + ACE_barrelLengths[]={29}; + }; + class CUP_B_86x70_Ball_noTracer: BulletBase + { + ACE_caliber=0.338; + ACE_bulletLength=1.70; + ACE_bulletMass=300; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.381}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={820, 826, 830}; + ACE_barrelLengths[]={24, 26.5, 28}; + }; + + class VTN_9x18_Ball_FMJ: B_9x21_Ball + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class VTN_9x18_Ball_SC: VTN_9x18_Ball_FMJ + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class VTN_9x18_Ball_TRC: VTN_9x18_Ball_FMJ + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class VTN_9x18_Ball_AP1: VTN_9x18_Ball_FMJ + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class VTN_9x18_Ball_AP2: VTN_9x18_Ball_FMJ + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class VTN_9x18_Ball_PRS: VTN_9x18_Ball_FMJ + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class VTN_9x19_Ball_SC: VTN_9x18_Ball_FMJ + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class VTN_9x19_Ball_TRC: VTN_9x19_Ball_SC + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class VTN_9x19_Ball_AP: VTN_9x19_Ball_SC + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class VTN_9x19_Ball_PRS: VTN_9x19_Ball_SC + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class VTN_9x39_Ball_SC: B_9x21_Ball + { + ACE_caliber=0.364; + ACE_bulletLength=1.24; + ACE_bulletMass=250; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={280, 300, 320}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class VTN_9x39_Ball_AP: VTN_9x39_Ball_SC + { + ACE_caliber=0.364; + ACE_bulletLength=1.24; + ACE_bulletMass=250; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={280, 300, 320}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class VTN_545x39_Ball_SC: B_556x45_Ball + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=52.9; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={780, 880, 920}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class VTN_545x39_Ball_TRC: VTN_545x39_Ball_SC + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=49.8; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={785, 883, 925}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class VTN_545x39_Ball_AP: VTN_545x39_Ball_TRC + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=52.9; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={780, 880, 920}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class VTN_545x39_Ball_AP2: VTN_545x39_Ball_AP + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=52.9; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={780, 880, 920}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class VTN_545x39_Ball_SS: VTN_545x39_Ball_SC + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=52.9; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={300, 320, 340}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class VTN_762x39_Ball_SC: B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=123; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class VTN_762x39_Ball_TRC: VTN_762x39_Ball_SC + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=117; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class VTN_762x39_Ball_AP: VTN_762x39_Ball_TRC + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=123; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class VTN_762x39_Ball_INC: VTN_762x39_Ball_AP + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=123; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class VTN_762x39_Ball_API: VTN_762x39_Ball_INC + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=123; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class VTN_762x39_Ball_SS: VTN_762x39_Ball_SC + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=123; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={300, 320, 340}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class VTN_762x41_Ball_SS: B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=0.53; + ACE_bulletMass=143; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={200, 210, 220}; + ACE_barrelLengths[]={4, 6, 8}; + }; + class VTN_762x54_Ball_SC: VTN_762x39_Ball_SC + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=152; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.4}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={700, 800, 820, 833}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class VTN_762x54_Ball_TRC: VTN_762x54_Ball_SC + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=149; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.395}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={680, 750, 798, 800}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class VTN_762x54_Ball_AP: VTN_762x54_Ball_TRC + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=152; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.4}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={700, 800, 820, 833}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class VTN_762x54_Ball_INC: VTN_762x54_Ball_AP + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=152; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.4}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={700, 800, 820, 833}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class VTN_762x54_Ball_API: VTN_762x54_Ball_INC + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=152; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.4}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={700, 800, 820, 833}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class VTN_145x114_Ball_APT: B_127x108_Ball + { + ACE_caliber=0.586; + ACE_bulletLength=2.00; + ACE_bulletMass=1010; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.620}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={1000}; + ACE_barrelLengths[]={53}; + }; + class VTN_6mm_BB: B_65x39_Caseless + { + ACE_caliber=0.24; + ACE_bulletLength=0.24; + ACE_bulletMass=6; + ACE_ammoTempMuzzleVelocityShifts[]={}; + ACE_ballisticCoefficients[]={}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={100}; + ACE_barrelLengths[]={15}; + }; + class VTN_9x19_Ball_FMJ: B_9x21_Ball + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class VTN_556x45_Ball_FMJ: B_556x45_Ball + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-27.20, -26.44, -23.76, -21.00, -17.54, -13.10, -7.95, -1.62, 6.24, 15.48, 27.75}; + ACE_ballisticCoefficients[]={0.151}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={723, 764, 796, 825, 843, 866, 878, 892, 906, 915, 922, 900}; + ACE_barrelLengths[]={8.3, 9.4, 10.6, 11.8, 13.0, 14.2, 15.4, 16.5, 17.7, 18.9, 20.0, 24.0}; + }; + class VTN_556x45_Ball_TRC: VTN_556x45_Ball_FMJ + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-27.20, -26.44, -23.76, -21.00, -17.54, -13.10, -7.95, -1.62, 6.24, 15.48, 27.75}; + ACE_ballisticCoefficients[]={0.151}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={723, 764, 796, 825, 843, 866, 878, 892, 906, 915, 922, 900}; + ACE_barrelLengths[]={8.3, 9.4, 10.6, 11.8, 13.0, 14.2, 15.4, 16.5, 17.7, 18.9, 20.0, 24.0}; + }; + class VTN_556x45_Ball_TRCN: VTN_556x45_Ball_TRC + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-27.20, -26.44, -23.76, -21.00, -17.54, -13.10, -7.95, -1.62, 6.24, 15.48, 27.75}; + ACE_ballisticCoefficients[]={0.151}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={723, 764, 796, 825, 843, 866, 878, 892, 906, 915, 922, 900}; + ACE_barrelLengths[]={8.3, 9.4, 10.6, 11.8, 13.0, 14.2, 15.4, 16.5, 17.7, 18.9, 20.0, 24.0}; + }; + class VTN_556x45_Ball_SC: VTN_556x45_Ball_FMJ + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-27.20, -26.44, -23.76, -21.00, -17.54, -13.10, -7.95, -1.62, 6.24, 15.48, 27.75}; + ACE_ballisticCoefficients[]={0.151}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={723, 764, 796, 825, 843, 866, 878, 892, 906, 915, 922, 900}; + ACE_barrelLengths[]={8.3, 9.4, 10.6, 11.8, 13.0, 14.2, 15.4, 16.5, 17.7, 18.9, 20.0, 24.0}; + }; + class VTN_556x45_Ball_AP: VTN_556x45_Ball_TRC + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-27.20, -26.44, -23.76, -21.00, -17.54, -13.10, -7.95, -1.62, 6.24, 15.48, 27.75}; + ACE_ballisticCoefficients[]={0.151}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={723, 764, 796, 825, 843, 866, 878, 892, 906, 915, 922, 900}; + ACE_barrelLengths[]={8.3, 9.4, 10.6, 11.8, 13.0, 14.2, 15.4, 16.5, 17.7, 18.9, 20.0, 24.0}; + }; + class VTN_556x45_Ball_INC: VTN_556x45_Ball_AP + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-27.20, -26.44, -23.76, -21.00, -17.54, -13.10, -7.95, -1.62, 6.24, 15.48, 27.75}; + ACE_ballisticCoefficients[]={0.151}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={723, 764, 796, 825, 843, 866, 878, 892, 906, 915, 922, 900}; + ACE_barrelLengths[]={8.3, 9.4, 10.6, 11.8, 13.0, 14.2, 15.4, 16.5, 17.7, 18.9, 20.0, 24.0}; + }; + class VTN_556x45_Ball_LR: VTN_556x45_Ball_FMJ + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=77; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.361}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={624, 816, 832, 838}; + ACE_barrelLengths[]={7.5, 14.5, 18, 20}; + }; + class VTN_556x45_Ball_SS: B_556x45_Ball + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.151}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={300, 320, 340}; + ACE_barrelLengths[]={10, 20.0, 24.0}; + }; + class VTN_762x51_Ball_SC: B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class VTN_762x51_Ball_TRC: VTN_762x51_Ball_SC + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class VTN_762x51_Ball_TRCN: VTN_762x51_Ball_TRC + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class VTN_762x51_Ball_AP: VTN_762x51_Ball_TRC + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class VTN_762x51_Ball_LR: VTN_762x51_Ball_SC + { + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=175; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.243}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={750, 780, 790, 794}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class VTN_1143x23_Ball_FMJ: B_408_Ball + { + ACE_caliber=0.452; + ACE_bulletLength=0.68; + ACE_bulletMass=230; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.195}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={230, 250, 285}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class VTN_1143x23_Ball_HP: VTN_1143x23_Ball_FMJ + { + ACE_caliber=0.452; + ACE_bulletLength=0.68; + ACE_bulletMass=230; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.195}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={230, 250, 285}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class VTN_1143x23_Ball_JHP: VTN_1143x23_Ball_FMJ + { + ACE_caliber=0.452; + ACE_bulletLength=0.68; + ACE_bulletMass=230; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.195}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={230, 250, 285}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class VTN_762x39_Ball_FMJ: B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=123; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class VTN_45_Pellet: B_762x51_Ball + { + ACE_caliber=0.22; + ACE_bulletLength=0.23; + ACE_bulletMass=3; + ACE_ammoTempMuzzleVelocityShifts[]={}; + ACE_ballisticCoefficients[]={}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={100, 138, 150}; + ACE_barrelLengths[]={5, 10, 16}; + }; +}; \ No newline at end of file diff --git a/extras/CfgWeaponsReference.hpp b/extras/CfgWeaponsReference.hpp new file mode 100644 index 0000000000..4821d53813 --- /dev/null +++ b/extras/CfgWeaponsReference.hpp @@ -0,0 +1,1894 @@ +class CfgWeapons +{ + class MGun; + class MGunCore; + class Pistol_Base_F; + class Rifle_Base_F; + class Rifle_Long_Base_F; + class arifle_MX_Base_F; + class PDW2000_Base_F; + class arifle_Katiba_Base_F; + class SDAR_base_F; + class SMG_02_Base_F; + class Tavor_base_F; + class SMG_01_Base; + class DMR_01_base_F; + class Mk20_Base_F; + class EBR_base_F; + class HMG_127; + class LRR_base_F; + class GM6_base_F; + class DMR_02_base_F; + class DMR_03_base_F; + class DMR_04_base_F; + class DMR_05_base_F; + class DMR_06_base_F; + class MMG_01_base_F; + class MMG_02_base_F; + class hgun_P07_F : Pistol_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=4; + }; + class hgun_Rook40_F : Pistol_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=4.4; + }; + class hgun_Pistol_heavy_01_F : Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=4.5; + }; + class hgun_Pistol_heavy_02_F : Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=3; + }; + class hgun_ACPC2_F : Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=5; + }; + class hgun_PDW2000_F : PDW2000_Base_F + { + ACE_barrelTwist=9; + ACE_barrelLength=7; + }; + class arifle_Katiba_F : arifle_Katiba_Base_F + { + ACE_barrelTwist=8; + ACE_barrelLength=28.7; + }; + class arifle_Katiba_C_F : arifle_Katiba_Base_F + { + ACE_barrelTwist=8; + ACE_barrelLength=26.8; + }; + class arifle_Katiba_GL_F : arifle_Katiba_Base_F + { + ACE_barrelTwist=8; + ACE_barrelLength=28.7; + }; + class arifle_MX_F: arifle_MX_Base_F + { + ACE_barrelTwist=9; + ACE_barrelLength=14.5; + }; + class arifle_MX_GL_F: arifle_MX_Base_F + { + ACE_barrelTwist=9; + ACE_barrelLength=14.5; + }; + class arifle_MX_SW_F: arifle_MX_Base_F + { + ACE_barrelTwist=9; + ACE_barrelLength=16.0; + }; + class arifle_MXC_F: arifle_MX_Base_F + { + ACE_barrelTwist=8; + ACE_barrelLength=10.5; + }; + class arifle_MXM_F: arifle_MX_Base_F + { + ACE_barrelTwist=9; + ACE_barrelLength=18; + }; + class arifle_SDAR_F : SDAR_base_F + { + ACE_barrelTwist=11.25; + ACE_barrelLength=18; + }; + class SMG_02_F : SMG_02_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=7.7; + }; + class arifle_TRG20_F : Tavor_base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=15; + }; + class arifle_TRG21_F : Tavor_base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=18.1; + }; + class LMG_Zafir_F : Rifle_Long_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=18.1; + }; + class arifle_Mk20_F : Mk20_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=17.4; + }; + class arifle_Mk20C_F : Mk20_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=16; + }; + class arifle_Mk20_GL_F : Mk20_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=16; + }; + class SMG_01_F : SMG_01_Base + { + ACE_barrelTwist=16; + ACE_barrelLength=5.5; + }; + class srifle_DMR_01_F : DMR_01_base_F + { + ACE_barrelTwist=9.5; + ACE_barrelLength=24; + }; + class srifle_EBR_F : EBR_base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=24; + }; + class LMG_Mk200_F : Rifle_Long_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=12.5; + }; + class srifle_LRR_F : LRR_base_F + { + ACE_barrelTwist=13; + ACE_barrelLength=29; + }; + class srifle_GM6_F : GM6_base_F + { + ACE_barrelTwist=15; + ACE_barrelLength=43.3; + }; + class srifle_DMR_02_F: DMR_02_base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=26; + }; + class srifle_DMR_03_F: DMR_03_base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=20; + }; + class srifle_DMR_04_F: DMR_04_base_F + { + ACE_barrelTwist=8; + ACE_barrelLength=17.72; + }; + class srifle_DMR_05_blk_F: DMR_05_base_F + { + ACE_barrelTwist=14.17; + ACE_barrelLength=24.41; + }; + class srifle_DMR_06_camo_F: DMR_06_base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=22; + }; + class MMG_01_hex_F: MMG_01_base_F + { + ACE_barrelTwist=14.17; + ACE_barrelLength=21.65; + }; + class MMG_02_camo_F: MMG_02_base_F + { + ACE_barrelTwist=9.25; + ACE_barrelLength=24; + }; + class HMG_M2 : HMG_127 + { + ACE_barrelTwist=12; + ACE_barrelLength=45; + }; + + class RH_deagle : Pistol_Base_F + { + ACE_barrelTwist=19; + ACE_barrelLength=6; + }; + class RH_sw659 : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=7.44; + }; + class RH_usp : Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=4.41; + }; + class RH_uspm : Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=6; + }; + class RH_mak : Pistol_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=3.68; + }; + class RH_m1911 : Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=5; + }; + class RH_kimber : Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=5; + }; + class RH_m9 : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.9; + }; + class RH_vz61 : Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=4.5; + }; + class RH_tec9 : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=5; + }; + class RH_muzi : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=5; + }; + class RH_g18 : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.49; + }; + class RH_g17 : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.49; + }; + class RH_tt33 : Pistol_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=4.6; + }; + class RH_mk2 : Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=4; + }; + class RH_p226 : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.4; + }; + class RH_g19 : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4; + }; + class RH_gsh18 : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.1; + }; + class RH_mateba : Pistol_Base_F + { + ACE_barrelTwist=14; + ACE_barrelLength=6; + }; + class RH_python : Pistol_Base_F + { + ACE_barrelTwist=14; + ACE_barrelLength=6; + }; + class RH_bull : Pistol_Base_F + { + ACE_barrelTwist=24; + ACE_barrelLength=6.5; + }; + class RH_ttracker : Pistol_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=4; + }; + class RH_mp412 : Pistol_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=6; + }; + class RH_fnp45 : Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=4.5; + }; + class RH_fn57 : Pistol_Base_F + { + ACE_barrelTwist=9.1; + ACE_barrelLength=4.8; + }; + class RH_vp70 : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.6; + }; + class RH_cz75 : Pistol_Base_F + { + ACE_barrelTwist=9.7; + ACE_barrelLength=4.7; + }; + + class RH_PDW : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=10; + }; + + class RH_hb : Rifle_Base_F + { + ACE_barrelTwist=8; + ACE_barrelLength=6; + }; + class RH_sbr9 : Rifle_Base_F + { + ACE_barrelTwist=9.7; + ACE_barrelLength=9; + }; + class RH_ar10 : Rifle_Base_F + { + ACE_barrelTwist=11.25; + ACE_barrelLength=20.8; + }; + class RH_m4 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class RH_M4m : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=10.5; + }; + class RH_M4sbr : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=10.5; + }; + class RH_M16a1 : Rifle_Base_F + { + ACE_barrelTwist=14; + ACE_barrelLength=20; + }; + class RH_M16A2 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class RH_M16A3 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class RH_M16A4 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class RH_M16A6 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class RH_hk416 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class RH_hk416c : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=9; + }; + class RH_hk416s : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=10.4; + }; + class RH_m27iar : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=16.5; + }; + class RH_Mk12mod1 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=18; + }; + class RH_SAMR : Rifle_Base_F + { + ACE_barrelTwist=7.7; + ACE_barrelLength=20; + }; + class RH_m110 : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=20; + }; + class RH_mk11 : Rifle_Base_F + { + ACE_barrelTwist=11.25; + ACE_barrelLength=24; + }; + class RH_sr25ec : Rifle_Base_F + { + ACE_barrelTwist=11.25; + ACE_barrelLength=20; + }; + + class hlc_rifle_ak74 : Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class hlc_rifle_aks74u : Rifle_Base_F + { + ACE_barrelTwist=6.3; + ACE_barrelLength=8.3; + }; + class hlc_rifle_ak47 : Rifle_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=16.3; + }; + class hlc_rifle_akm : Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class hlc_rifle_rpk : Rifle_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=23.2; + }; + class hlc_rifle_aek971 : Rifle_Base_F + { + ACE_barrelTwist=9.5; + ACE_barrelLength=17; + }; + class hlc_rifle_saiga12k : Rifle_Base_F + { + ACE_barrelTwist=0; + ACE_twistDirection=0; + ACE_barrelLength=16.9; + }; + class hlc_ar15_base : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=11.5; + }; + class hlc_rifle_bcmjack : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class hlc_rifle_Bushmaster300 : Rifle_Base_F + { + ACE_barrelTwist=8; + ACE_barrelLength=16; + }; + class hlc_rifle_SAMR : Rifle_Base_F + { + ACE_barrelTwist=9; + ACE_barrelLength=16; + }; + class hlc_rifle_honeybase : Rifle_Base_F + { + ACE_barrelTwist=8; + ACE_barrelLength=6; + }; + class hlc_rifle_SLRchopmod : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=21; + }; + class hlc_rifle_LAR : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=21; + }; + class hlc_rifle_c1A1 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=21.7; + }; + class hlc_rifle_FAL5061 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=18; + }; + class hlc_rifle_STG58F : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=21; + }; + class hlc_rifle_SLR : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=21.7; + }; + class hlc_rifle_falosw : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=13; + }; + class hlc_rifle_psg1 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=25.6; + }; + class hlc_rifle_g3sg1 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=17.7; + }; + class hlc_rifle_hk51 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=8.31; + }; + class hlc_rifle_hk53 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=8.31; + }; + class hlc_rifle_g3a3 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=17.7; + }; + class hlc_M14_base : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=22; + }; + class hlc_rifle_m14sopmod : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=18; + }; + class hlc_lmg_M60E4 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=17; + }; + class hlc_lmg_m60 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=22; + }; + + class hlc_smg_mp5k_PDW : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=4.5; + }; + class hlc_smg_mp5a2 : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=8.9; + }; + class hlc_smg_mp5a4 : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=8.9; + }; + class hlc_smg_mp5n : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=8.9; + }; + class hlc_smg_mp5sd5 : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=5.7; + }; + class hlc_smg_mp5sd6 : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=5.7; + }; + class hlc_smg_9mmar : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=8.9; + }; + class hlc_smg_mp510 : Rifle_Base_F + { + ACE_barrelTwist=15; + ACE_barrelLength=8.9; + }; + class hlc_smg_mp5a3 : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=8.9; + }; + + class hgun_mas_usp_F: Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=4.41; + }; + class hgun_mas_m23_F: Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=5.87; + }; + class hgun_mas_acp_F: Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=5.03; + }; + class hgun_mas_m9_F: Pistol_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=4.9; + }; + class hgun_mas_bhp_F: Pistol_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=4.7; + }; + class hgun_mas_glock_F: Pistol_Base_F + { + ACE_barrelTwist=9.84; + ACE_barrelLength=4.48; + }; + class hgun_mas_glocksf_F: Pistol_Base_F + { + ACE_barrelTwist=15.75; + ACE_barrelLength=4.60; + }; + class hgun_mas_grach_F: Pistol_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=4.4; + }; + class hgun_mas_mak_F: Pistol_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=3.68; + }; + class hgun_mas_sa61_F: Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=4.5; + }; + class hgun_mas_uzi_F: Pistol_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=5.28; + }; + class arifle_mas_mk16 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=13.8; + }; + class arifle_mas_mk16_l : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=18; + }; + class arifle_mas_mk17 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=16; + }; + class srifle_mas_m110 : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=20; + }; + class arifle_mas_ak_74m : Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.34; + }; + class arifle_mas_ak_74m_gl : Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.34; + }; + class srifle_mas_svd : Rifle_Base_F + { + ACE_barrelTwist=9.4; + ACE_barrelLength=24.4; + }; + class srifle_mas_m91 : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=29; + }; + class srifle_mas_ksvk : Rifle_Base_F + { + ACE_barrelTwist=18; + ACE_barrelLength=39.37; + }; + class LMG_mas_rpk_F : Rifle_Base_F + { + ACE_barrelTwist=7.68; + ACE_barrelLength=23.2; + }; + class LMG_mas_pkm_F : Rifle_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=25.4; + }; + class arifle_mas_aks74u : Rifle_Base_F + { + ACE_barrelTwist=6.3; + ACE_barrelLength=8.3; + }; + class arifle_mas_bizon : Rifle_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=9.1; + }; + class arifle_mas_saiga : Rifle_Base_F + { + ACE_barrelTwist=0; + ACE_twistDirection=0; + ACE_barrelLength=16.93; + }; + class arifle_mas_hk416 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class arifle_mas_hk416_gl : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class arifle_mas_hk416c : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=9.0; + }; + class arifle_mas_hk416_m203c : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=9.0; + }; + class arifle_mas_hk417c : Rifle_Base_F + { + ACE_barrelTwist=11; + ACE_barrelLength=13; + }; + class arifle_mas_m4 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class arifle_mas_m4c : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=10.3; + }; + class arifle_mas_l119 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=16; + }; + class arifle_mas_l119_gl : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=16; + }; + class arifle_mas_l119_m203 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=16; + }; + class arifle_mas_m16 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class arifle_mas_m16_gl : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class srifle_mas_hk417 : Rifle_Base_F + { + ACE_barrelTwist=11; + ACE_barrelLength=16.5; + }; + class srifle_mas_sr25 : Rifle_Base_F + { + ACE_barrelTwist=11.25; + ACE_barrelLength=24; + }; + class srifle_mas_ebr : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=18; + }; + class srifle_mas_m24 : Rifle_Base_F + { + ACE_barrelTwist=11.25; + ACE_barrelLength=24; + }; + class arifle_mas_mp5 : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=8.9; + }; + class arifle_mas_mp5sd : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=5.7; + }; + class srifle_mas_m107 : Rifle_Base_F + { + ACE_barrelTwist=15; + ACE_barrelLength=29; + }; + class LMG_mas_M249_F : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=16.3; + }; + class LMG_mas_M249a_F : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=18; + }; + class LMG_mas_mk48_F : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=19.75; + }; + class LMG_mas_m240_F : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=24.8; + }; + class LMG_mas_mg3_F : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=22.2; + }; + class arifle_mas_g3 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=17.7; + }; + class arifle_mas_g3_m203 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=17.7; + }; + class arifle_mas_fal : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=21; + }; + class arifle_mas_fal_m203 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=21; + }; + class arifle_mas_m1014 : Rifle_Base_F + { + ACE_barrelTwist=0; + ACE_twistDirection=0; + ACE_barrelLength=18.5; + }; + + class BWA3_P8 : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.25; + }; + class BWA3_MP7 : Pistol_Base_F + { + ACE_barrelTwist=6.3; + ACE_barrelLength=7.1; + }; + class BWA3_G36 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=18.9; + }; + class BWA3_G36K : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=12.5; + }; + class BWA3_G28_Standard : Rifle_Long_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=16.5; + }; + class BWA3_G27 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=16; + }; + class BWA3_MG4 : Rifle_Long_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=18.9; + }; + class BWA3_MG5 : Rifle_Long_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=21.6; + }; + class BWA3_G82 : Rifle_Long_Base_F + { + ACE_barrelTwist=15; + ACE_barrelLength=29; + }; + + class Trixie_L131A1 : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.5; + }; + class Trixie_XM8_Carbine : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=12.5; + }; + class Trixie_XM8_Compact : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=9; + }; + class Trixie_XM8_SAW : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class Trixie_XM8_SAW_NB : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class Trixie_XM8_DMR : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class Trixie_XM8_DMR_NB : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class L129A1_base : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=16; + }; + class Trixie_Enfield : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=25.2; + }; + class Trixie_CZ550_Rail : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=23.622; + }; + class Trixie_FNFAL_Rail : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=21; + }; + + class Trixie_M110 : Rifle_Base_F + { + ACE_barrelTwist=11; + ACE_barrelLength=20; + }; + class Trixie_MK12 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=18; + }; + class Trixie_LM308MWS : Rifle_Base_F + { + ACE_barrelTwist=11.25; + ACE_barrelLength=16; + }; + class Trixie_M14DMR : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=22; + }; + class Trixie_M14DMR_NG_Black_Short : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=18; + }; + class Trixie_M14DMR_NG_Short : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=18; + }; + class Trixie_M14 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=22; + }; + class Trixie_M40A3 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=24; + }; + class Trixie_CZ750 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=26; + }; + class Trixie_M24 : Rifle_Base_F + { + ACE_barrelTwist=11.25; + ACE_barrelLength=24; + }; + class Trixie_AWM338 : Rifle_Base_F + { + ACE_barrelTwist=11; + ACE_barrelLength=27; + }; + class Trixie_M107 : Rifle_Base_F + { + ACE_barrelTwist=15; + ACE_barrelLength=29; + }; + class Trixie_AS50 : Rifle_Base_F + { + ACE_barrelTwist=15; + ACE_barrelLength=29; + }; + class L110A1_base : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=13.7; + }; + class Trixie_L86A2_base : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=25.4; + }; + class Trixie_l85a2_base : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20.4; + }; + class L7A2_base : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=24.8; + }; + + class rhs_weap_pya : Pistol_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=4.4; + }; + class rhs_weap_pkp : Rifle_Long_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=25.9; + }; + class rhs_weap_pkm : Rifle_Long_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=25.4; + }; + class rhs_weap_rpk74m : Rifle_Long_Base_F + { + ACE_barrelTwist=7.68; + ACE_barrelLength=23.2; + }; + class rhs_weap_rpk74 : Rifle_Long_Base_F + { + ACE_barrelTwist=7.68; + ACE_barrelLength=23.2; + }; + class rhs_weap_ak74m : Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class rhs_weap_aks74u : Rifle_Base_F + { + ACE_barrelTwist=6.3; + ACE_barrelLength=8.3; + }; + class rhs_weap_akm : Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class rhs_weap_svd : Rifle_Base_F + { + ACE_barrelTwist=9.4; + ACE_barrelLength=24.4; + }; + class rhs_weap_svds : Rifle_Base_F + { + ACE_barrelTwist=9.4; + ACE_barrelLength=22.2; + }; + class rhs_weap_m4_Base : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class rhs_weap_m16a4 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class rhs_weap_m16a4_carryhandle : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class rhs_weap_m16a4_grip : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class rhs_weap_m240B : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=24.8; + }; + class rhs_weap_m249_pip : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=16.3; + }; + class rhs_weap_mk18 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=10.3; + }; + class rhs_weap_M590_5RD : Rifle_Base_F + { + ACE_barrelTwist=0; + ACE_twistDirection=0; + ACE_barrelLength=18.5; + }; + class rhs_weap_M590_8RD : Rifle_Base_F + { + ACE_barrelTwist=0; + ACE_twistDirection=0; + ACE_barrelLength=20; + }; + class rhs_weap_sr25 : Rifle_Base_F + { + ACE_barrelTwist=11.25; + ACE_barrelLength=24; + }; + class rhs_weap_sr25_ec : Rifle_Base_F + { + ACE_barrelTwist=11.25; + ACE_barrelLength=20; + }; + class rhs_weap_XM2010_Base_F: Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=24; + }; + + class R3F_PAMAS : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.9; + }; + class R3F_Famas_F1: Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=19.2; + }; + class R3F_Famas_surb: Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=15.9; + }; + class R3F_Minimi: Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=13.7; + }; + class R3F_Minimi_762: Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=19.8; + }; + class R3F_FRF2: Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=25.59; + }; + class R3F_PGM_Hecate_II: Rifle_Base_F + { + ACE_barrelTwist=15; + ACE_barrelLength=27.6; + }; + class R3F_HK417S_HG : Rifle_Base_F + { + ACE_barrelTwist=11; + ACE_barrelLength=12; + }; + class R3F_HK417M : Rifle_Base_F + { + ACE_barrelTwist=11; + ACE_barrelLength=16; + }; + class R3F_HK417L : Rifle_Base_F + { + ACE_barrelTwist=11; + ACE_barrelLength=20; + }; + class R3F_M107 : Rifle_Base_F + { + ACE_barrelTwist=15; + ACE_barrelLength=29; + }; + class R3F_HK416M : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=14; + }; + class R3F_MP5SD : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=5.7; + }; + + class CUP_hgun_Colt1911 : Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=5; + }; + class CUP_sgun_AA12 : Rifle_Base_F + { + ACE_barrelTwist=0; + ACE_twistDirection=0; + ACE_barrelLength=18; + }; + class CUP_arifle_AK_Base : Rifle_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=16.3; + }; + class CUP_arifle_AK107_Base : Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class CUP_arifle_AKS_Base : Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class CUP_arifle_AKS74U : Rifle_Base_F + { + ACE_barrelTwist=6.3; + ACE_barrelLength=8.3; + }; + class CUP_arifle_RPK74 : Rifle_Long_Base_F + { + ACE_barrelTwist=7.68; + ACE_barrelLength=23.2; + }; + class CUP_srifle_AS50 : Rifle_Long_Base_F + { + ACE_barrelTwist=15; + ACE_barrelLength=29; + }; + class CUP_srifle_AWM_Base : Rifle_Long_Base_F + { + ACE_barrelTwist=11; + ACE_barrelLength=27; + }; + class CUP_smg_bizon : Rifle_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=9.1; + }; + class CUP_hgun_Compact : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=3.74; + }; + class CUP_srifle_CZ750 : Rifle_Long_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=26; + }; + class CUP_arifle_CZ805_Base : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=14; + }; + class CUP_arifle_CZ805_A1 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=14; + }; + class CUP_arifle_CZ805_A2 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=10.9; + }; + class CUP_srifle_DMR : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=22; + }; + class CUP_hgun_Duty : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=3.74; + }; + class CUP_arifle_FNFAL : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=21; + }; + class CUP_arifle_G36A : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=18.9; + }; + class CUP_arifle_G36K : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=12.5; + }; + class CUP_arifle_G36C : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=9; + }; + class CUP_arifle_MG36 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=18.9; + }; + class CUP_hgun_Glock17 : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.49; + }; + class CUP_srifle_CZ550 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=23.622; + }; + class CUP_srifle_ksvk : Rifle_Long_Base_F + { + ACE_barrelTwist=18; + ACE_barrelLength=39.37; + }; + class CUP_lmg_L7A2 : Rifle_Long_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=24.8; + }; + class CUP_arifle_L85A2_Base : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20.4; + }; + class CUP_lmg_L110A1 : Rifle_Long_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=13.7; + }; + class CUP_srifle_LeeEnfield : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=25.2; + }; + class CUP_hgun_M9 : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.9; + }; + class CUP_srifle_M14 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=22; + }; + class CUP_arifle_M16_Base : Rifle_Base_F + { + ACE_barrelTwist=14; + ACE_barrelLength=20; + }; + class CUP_arifle_M4_Base : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class CUP_srifle_Mk12SPR : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=18; + }; + class CUP_srifle_M24_des : Rifle_Base_F + { + ACE_barrelTwist=11.25; + ACE_barrelLength=24; + }; + class CUP_lmg_M60A4 : Rifle_Long_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=17; + }; + class CUP_srifle_M107_Base : Rifle_Long_Base_F + { + ACE_barrelTwist=15; + ACE_barrelLength=29; + }; + class CUP_srifle_M110 : Rifle_Base_F + { + ACE_barrelTwist=11; + ACE_barrelLength=20; + }; + class CUP_lmg_M240 : Rifle_Long_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=24.8; + }; + class CUP_lmg_M249_para : Rifle_Long_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=16.3; + }; + class CUP_lmg_M249 : Rifle_Long_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=18; + }; + class CUP_sgun_M1014 : Rifle_Base_F + { + ACE_twistDirection=0; + ACE_barrelTwist=0; + ACE_barrelLength=18.5; + }; + class CUP_hgun_Makarov : Pistol_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=3.68; + }; + class CUP_hgun_MicroUzi : Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=5; + }; + class CUP_lmg_Mk48_Base : Rifle_Long_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=19.75; + }; + class CUP_smg_MP5SD6 : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=5.7; + }; + class CUP_smg_MP5A5 : Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=8.9; + }; + class CUP_hgun_PB6P9 : Rifle_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=4.1; + }; + class CUP_hgun_Phantom : Rifle_Base_F + { + ACE_barrelTwist=9.7; + ACE_barrelLength=4.7; + }; + class CUP_lmg_PKM : Rifle_Long_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=25.4; + }; + class CUP_lmg_Pecheneg : Rifle_Long_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=25.9; + }; + class CUP_hgun_TaurusTracker455 : Pistol_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=4; + }; + class CUP_arifle_Sa58P : Rifle_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=15.4; + }; + class CUP_arifle_Sa58V : Rifle_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=15.4; + }; + class CUP_hgun_SA61 : Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=4.5; + }; + class CUP_sgun_Saiga12K: Rifle_Base_F + { + ACE_barrelTwist=0; + ACE_twistDirection=0; + ACE_barrelLength=16.9; + } + class CUP_arifle_Mk16_CQC : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=10; + }; + class CUP_arifle_Mk16_STD : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=14; + }; + class CUP_arifle_Mk16_SV : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=18; + }; + class CUP_arifle_Mk17_CQC : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=13; + }; + class CUP_arifle_Mk17_STD : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=16; + }; + class CUP_arifle_Mk20 : Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=20; + }; + class CUP_srifle_SVD : Rifle_Base_F + { + ACE_barrelTwist=9.4; + ACE_barrelLength=24.4; + }; + class CUP_lmg_UK59 : Rifle_Long_Base_F + { + ACE_barrelTwist=15; + ACE_barrelLength=21.7; + }; + class CUP_DSHKM_W : MGun + { + ACE_barrelTwist=15; + ACE_barrelLength=42.1; + }; + class CUP_KPVT_W : MGun + { + ACE_barrelTwist=17.91; + ACE_barrelLength=53; + }; + class CUP_KPVB_W : MGun + { + ACE_barrelTwist=17.91; + ACE_barrelLength=53; + }; + class CUP_M134 : MGunCore + { + ACE_barrelTwist=12; + ACE_barrelLength=22; + }; + class CUP_M240_veh_W : Rifle_Long_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=24.8; + }; + class CUP_PKT_W : MGun + { + ACE_barrelTwist=9.45; + ACE_barrelLength=28.43; + }; + class CUP_srifle_VSSVintorez : Rifle_Base_F + { + ACE_barrelTwist=8.3; + ACE_barrelLength=7.9; + }; + class CUP_arifle_XM8_Base : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=12.5; + }; + class CUP_arifle_XM8_Carbine : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=12.5; + }; + class CUP_arifle_xm8_sharpshooter : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class CUP_arifle_xm8_SAW : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class CUP_arifle_XM8_Compact : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=9; + }; + class CUP_arifle_XM8_Railed_Base : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=12.5; + }; + class CUP_arifle_XM8_Carbine_FG : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=12.5; + }; + + class VTN_AK_BASE: Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class VTN_AK74M: Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class VTN_AK74M_GP25: Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class VTN_AK74M_GP30M: Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class VTN_AKS74: Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class VTN_AKS74N: Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class VTN_AKS74N_76: Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class VTN_AK74_76: Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class VTN_AKMS_aa: Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=10.3; + }; + class VTN_AKS74U_BASE: Rifle_Base_F + { + ACE_barrelTwist=6.3; + ACE_barrelLength=8.3; + }; + class VTN_AKM_BASE: Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class VTN_AKMS: Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class VTN_AKMS_T_P: Rifle_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class VTN_AK103_BASE: Rifle_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=16.3; + }; + class VTN_AK104_BASE: Rifle_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=12.4; + }; + class VTN_AK105_BASE: Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=12.4; + }; + class VTN_AK105_P_BASE: Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=12.4; + }; + class VTN_SVD_BASE: Rifle_Base_F + { + ACE_barrelTwist=9.4; + ACE_barrelLength=24.4; + }; + class VTN_SVD_63: Rifle_Base_F + { + ACE_barrelTwist=9.4; + ACE_barrelLength=24.4; + }; + class VTN_SVD_86: Rifle_Base_F + { + ACE_barrelTwist=9.4; + ACE_barrelLength=24.4; + }; + class VTN_SV98_BASE: Rifle_Base_F + { + ACE_barrelTwist=12.6; + ACE_barrelLength=25.59; + }; + class VTN_PKM_BAS: Rifle_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=25.4; + }; + class VTN_PKP: Rifle_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=25.9; + }; + class VTN_PYA: Pistol_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=4.4; + }; + class VTN_PM: Pistol_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=3.68; + }; + class VTN_PB: Pistol_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=4.1; + }; + class VTN_GSH18: Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.1; + }; + class VTN_PSS: Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=1.4; + }; + class VTN_PKT: Rifle_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=28.43; + }; + class VTN_KORD: Rifle_Base_F + { + ACE_barrelTwist=17.91; + ACE_barrelLength=53; + }; + class VTN_KPVT: Rifle_Base_F + { + ACE_barrelTwist=17.91; + ACE_barrelLength=53; + }; + class VTN_C_M4A1 : Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class VTN_MK18MOD0: Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=10.3; + }; + class VTN_M16_BASE: Rifle_Base_F + { + ACE_barrelTwist=14; + ACE_barrelLength=20; + }; + class VTN_FN_SAMR_BASE: Rifle_Base_F + { + ACE_barrelTwist=7.7; + ACE_barrelLength=20; + }; + class VTN_M249_SAW_BASE: Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=18; + }; + class VTN_M249_PARA: Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=16.3; + }; + class VTN_M240G_BASE: Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=24.8; + }; + class VTN_M9: Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.9; + }; + class VTN_M45A1: Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=5; + }; + class VTN_M24: Rifle_Base_F + { + ACE_barrelTwist=11.25; + ACE_barrelLength=24; + }; + class VTN_M240: Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=24.8; + }; + class VTN_KO44: Rifle_Base_F + { + ACE_barrelTwist=9.5; + ACE_barrelLength=20.2; + }; + class VTN_SAIGA_MK03: Rifle_Base_F + { + ACE_twistDirection=9.45; + ACE_barrelLength=16.3; + }; +}; \ No newline at end of file diff --git a/extras/assets/icons/Icons_Modules.psd b/extras/assets/icons/Icons_Modules.psd index 9dcfa6a38b..9686644521 100644 Binary files a/extras/assets/icons/Icons_Modules.psd and b/extras/assets/icons/Icons_Modules.psd differ diff --git a/extras/assets/icons/png/Icon_Module/Icon_Module_Repair_ca.png b/extras/assets/icons/png/Icon_Module/Icon_Module_Repair_ca.png new file mode 100644 index 0000000000..381c3d1c41 Binary files /dev/null and b/extras/assets/icons/png/Icon_Module/Icon_Module_Repair_ca.png differ diff --git a/extras/assets/icons/png/Icon_Module_mk6_ca.png b/extras/assets/icons/png/Icon_Module_mk6_ca.png new file mode 100644 index 0000000000..26c2966551 Binary files /dev/null and b/extras/assets/icons/png/Icon_Module_mk6_ca.png differ diff --git a/mod.cpp b/mod.cpp index f1cef6b6a2..b878c76a6d 100644 --- a/mod.cpp +++ b/mod.cpp @@ -1,4 +1,4 @@ -name = "ACE3"; +name = "Advanced Combat Environment 3.0.0"; picture = "logo_ace3_ca.paa"; actionName = "GitHub"; action = "https://github.com/acemod/ACE3"; @@ -7,6 +7,6 @@ logo = "logo_ace3_ca.paa"; logoOver = "logo_ace3_ca.paa"; tooltip = "ACE3"; tooltipOwned = "ACE3 Owned"; -overview = "ACE3 is a joint effort by the teams behind ACE2, AGM and CSE to improve the realism and authenticity of Arma 3."; +overview = "Advanced Combat Environment 3, also known as ACE3, is a joint effort by the teams behind ACE2, AGM and CSE to improve the realism and authenticity of Arma 3."; author = "ACE3 Team"; overviewPicture = "logo_ace3_ca.paa"; diff --git a/optionals/compat_asdg/config.cpp b/optionals/compat_asdg/config.cpp new file mode 100644 index 0000000000..c7e7903ce2 --- /dev/null +++ b/optionals/compat_asdg/config.cpp @@ -0,0 +1,37 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"asdg_jointrails","ace_laserpointer","ace_optics"}; + author[]={"OnkelDisMaster"}; + authorUrl = "http://2.xn--gebirgsjgerkompanie-nwb.de/"; + VERSION_CONFIG; + }; +}; + +class asdg_SlotInfo; +class asdg_FrontSideRail: asdg_SlotInfo { + class compatibleItems { + ACE_acc_pointer_red = 1; + ACE_acc_pointer_green = 1; + }; +}; + +class asdg_OpticRail; +class asdg_OpticRail1913: asdg_OpticRail { + class compatibleItems { + ACE_optic_Hamr_2D = 1; + ACE_optic_Hamr_PIP = 1; + ACE_optic_Arco_2D = 1; + ACE_optic_Arco_PIP = 1; + ACE_optic_MRCO_2D = 1; + ACE_optic_MRCO_PIP = 1; + ACE_optic_SOS_2D = 1; + ACE_optic_SOS_PIP = 1; + ACE_optic_LRPS_2D = 1; + ACE_optic_LRPS_PIP = 1; + }; +}; diff --git a/optionals/compat_asdg/script_component.hpp b/optionals/compat_asdg/script_component.hpp new file mode 100644 index 0000000000..e67bf3b9e4 --- /dev/null +++ b/optionals/compat_asdg/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT asdg_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_cup/CfgAmmo.hpp b/optionals/compat_cup/CfgAmmo.hpp new file mode 100644 index 0000000000..1dcd91bc23 --- /dev/null +++ b/optionals/compat_cup/CfgAmmo.hpp @@ -0,0 +1,422 @@ +class CfgAmmo +{ + class BulletBase; + class B_762x51_Ball; + class B_127x99_Ball; + class CUP_B_545x39_Ball: BulletBase + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=52.9; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={780, 880, 920}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_545x39_Ball_Tracer_Green: CUP_B_545x39_Ball + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=49.8; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={785, 883, 925}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_545x39_Ball_Tracer_Red: BulletBase + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=49.8; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={785, 883, 925}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_545x39_Ball_Tracer_White: BulletBase + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=49.8; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={785, 883, 925}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_545x39_Ball_Tracer_Yellow: BulletBase + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=49.8; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={785, 883, 925}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_762x39_Ball: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=123; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_762x39_Ball_Tracer_Green: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=117; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_9x18_Ball: BulletBase + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_9x18_Ball_Tracer_Green: BulletBase + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_9x18_Ball_Tracer_Red: BulletBase + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_9x18_Ball_Tracer_Yellow: BulletBase + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_9x18_Ball_White_Tracer: BulletBase + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_9x19_Ball: BulletBase + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class CUP_B_762x51_noTracer: B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class CUP_B_303_Ball: BulletBase + { + ACE_caliber=0.311; + ACE_bulletLength=1.227; + ACE_bulletMass=174; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.499, 0.493, 0.48}; + ACE_velocityBoundaries[]={671, 549}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={748, 761, 765}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class CUP_B_127x107_Ball_Green_Tracer: BulletBase + { + ACE_caliber=0.511; + ACE_bulletLength=2.520; + ACE_bulletMass=745; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.63}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={820}; + ACE_barrelLengths[]={28.7}; + }; + class CUP_B_127x108_Ball_Green_Tracer: BulletBase + { + ACE_caliber=0.511; + ACE_bulletLength=2.520; + ACE_bulletMass=745; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.63}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={820}; + ACE_barrelLengths[]={28.7}; + }; + class CUP_B_762x54_Ball_White_Tracer: BulletBase + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=149; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.395}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={680, 750, 798, 800}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class CUP_B_762x54_Ball_Red_Tracer: BulletBase + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=149; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.395}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={680, 750, 798, 800}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class CUP_B_762x54_Ball_Green_Tracer: BulletBase + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=149; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.395}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={680, 750, 798, 800}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class CUP_B_762x54_Ball_Yellow_Tracer: BulletBase + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=149; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.395}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={680, 750, 798, 800}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class CUP_B_9x39_SP5: BulletBase + { + ACE_caliber=0.364; + ACE_bulletLength=1.24; + ACE_bulletMass=250; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={280, 300, 320}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_762x51_Tracer_Green: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class CUP_B_762x51_Tracer_Red: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class CUP_B_762x51_Tracer_Yellow: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class CUP_B_762x51_Tracer_White: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class B_127x107_Ball: BulletBase + { + ACE_caliber=0.511; + ACE_bulletLength=2.520; + ACE_bulletMass=745; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.63}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={820}; + ACE_barrelLengths[]={28.7}; + }; + class CUP_B_9x18_SD: BulletBase + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 340}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_765x17_Ball: BulletBase + { + ACE_caliber=0.3125; + ACE_bulletLength=0.610; + ACE_bulletMass=65; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.118}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={282, 300, 320}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class CUP_B_145x115_AP_Green_Tracer: BulletBase + { + ACE_caliber=0.586; + ACE_bulletLength=2.00; + ACE_bulletMass=1010; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.620}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={1000}; + ACE_barrelLengths[]={53}; + }; + class CUP_B_127x99_Ball_White_Tracer: B_127x99_Ball + { + ACE_caliber=0.510; + ACE_bulletLength=2.310; + ACE_bulletMass=647; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.670}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={853}; + ACE_barrelLengths[]={29}; + }; + class CUP_B_86x70_Ball_noTracer: BulletBase + { + ACE_caliber=0.338; + ACE_bulletLength=1.70; + ACE_bulletMass=300; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.381}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={820, 826, 830}; + ACE_barrelLengths[]={24, 26.5, 28}; + }; +}; \ No newline at end of file diff --git a/optionals/compat_cup/config.cpp b/optionals/compat_cup/config.cpp new file mode 100644 index 0000000000..e4f26f8051 --- /dev/null +++ b/optionals/compat_cup/config.cpp @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"CUP_Weapons_Ammunition"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgAmmo.hpp" diff --git a/optionals/compat_cup/script_component.hpp b/optionals/compat_cup/script_component.hpp new file mode 100644 index 0000000000..3d77fcb370 --- /dev/null +++ b/optionals/compat_cup/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT CUP_Weapons_Ammunition_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_hlc_ar15/CfgWeapons.hpp b/optionals/compat_hlc_ar15/CfgWeapons.hpp new file mode 100644 index 0000000000..d57de932e6 --- /dev/null +++ b/optionals/compat_hlc_ar15/CfgWeapons.hpp @@ -0,0 +1,65 @@ +class CfgWeapons +{ + class Rifle; + class Rifle_Base_F; + class hlc_ar15_base: Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=11.5; + }; + class hlc_rifle_RU556: hlc_ar15_base + { + ACE_barrelTwist=7; + ACE_barrelLength=10.3; + }; + class hlc_rifle_RU5562: hlc_rifle_RU556 + { + ACE_barrelTwist=7; + ACE_barrelLength=10.3; + }; + class hlc_rifle_CQBR: hlc_rifle_RU556 + { + ACE_barrelTwist=7; + ACE_barrelLength=10; + }; + class hlc_rifle_M4: hlc_rifle_RU556 + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class hlc_rifle_bcmjack: hlc_ar15_base + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class hlc_rifle_Colt727: hlc_ar15_base + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class hlc_rifle_Colt727_GL: hlc_rifle_Colt727 + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class hlc_rifle_Bushmaster300: hlc_rifle_Colt727 + { + ACE_barrelTwist=8; + ACE_barrelLength=14.5; + }; + class hlc_rifle_vendimus: hlc_rifle_Bushmaster300 + { + ACE_barrelTwist=8; + ACE_barrelLength=16; + }; + class hlc_rifle_SAMR: hlc_rifle_RU556 + { + ACE_barrelTwist=9; + ACE_barrelLength=16; + }; + class hlc_rifle_honeybase: hlc_rifle_RU556 + { + ACE_barrelTwist=8; + ACE_barrelLength=6; + }; +}; \ No newline at end of file diff --git a/optionals/compat_hlc_ar15/config.cpp b/optionals/compat_hlc_ar15/config.cpp new file mode 100644 index 0000000000..51e42dc040 --- /dev/null +++ b/optionals/compat_hlc_ar15/config.cpp @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"hlcweapons_ar15"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/optionals/compat_hlc_ar15/script_component.hpp b/optionals/compat_hlc_ar15/script_component.hpp new file mode 100644 index 0000000000..3fb38b0477 --- /dev/null +++ b/optionals/compat_hlc_ar15/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT hlcweapons_ar15_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_hlc_wp_mp5/CfgWeapons.hpp b/optionals/compat_hlc_wp_mp5/CfgWeapons.hpp new file mode 100644 index 0000000000..bb2762d1bc --- /dev/null +++ b/optionals/compat_hlc_wp_mp5/CfgWeapons.hpp @@ -0,0 +1,60 @@ + +class CfgWeapons +{ + class Rifle_Base_F; + class hlc_MP5_base: Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=9; + }; + class hlc_smg_mp5k_PDW: hlc_MP5_base + { + ACE_barrelTwist=10; + ACE_barrelLength=4.5; + }; + class hlc_smg_mp5k: hlc_smg_mp5k_PDW + { + ACE_barrelTwist=10; + ACE_barrelLength=4.5; + }; + class hlc_smg_mp5a2: hlc_MP5_base + { + ACE_barrelTwist=10; + ACE_barrelLength=9; + }; + class hlc_smg_MP5N: hlc_MP5_base + { + ACE_barrelTwist=10; + ACE_barrelLength=9; + }; + class hlc_smg_9mmar: hlc_smg_MP5N + { + ACE_barrelTwist=10; + ACE_barrelLength=9; + }; + class hlc_smg_mp5a4: hlc_MP5_base + { + ACE_barrelTwist=10; + ACE_barrelLength=9; + }; + class hlc_smg_mp510: hlc_smg_MP5N + { + ACE_barrelTwist=15; + ACE_barrelLength=9; + }; + class hlc_smg_mp5sd5: hlc_MP5_base + { + ACE_barrelTwist=10; + ACE_barrelLength=9; + }; + class hlc_smg_mp5a3: hlc_smg_mp5a2 + { + ACE_barrelTwist=10; + ACE_barrelLength=9; + }; + class hlc_smg_mp5sd6: hlc_smg_mp5sd5 + { + ACE_barrelTwist=10; + ACE_barrelLength=9; + }; +}; diff --git a/optionals/compat_hlc_wp_mp5/config.cpp b/optionals/compat_hlc_wp_mp5/config.cpp new file mode 100644 index 0000000000..1f4fe78db4 --- /dev/null +++ b/optionals/compat_hlc_wp_mp5/config.cpp @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"hlcweapons_mp5"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/optionals/compat_hlc_wp_mp5/script_component.hpp b/optionals/compat_hlc_wp_mp5/script_component.hpp new file mode 100644 index 0000000000..6b19e4912b --- /dev/null +++ b/optionals/compat_hlc_wp_mp5/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT hlcweapons_mp5_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_hlcmods_ak/CfgWeapons.hpp b/optionals/compat_hlcmods_ak/CfgWeapons.hpp new file mode 100644 index 0000000000..390d3e6177 --- /dev/null +++ b/optionals/compat_hlcmods_ak/CfgWeapons.hpp @@ -0,0 +1,76 @@ +class CfgWeapons +{ + class optic_dms; + class hlc_ak_base; + class hlc_rifle_ak12; + class InventoryOpticsItem_Base_F; + class hlc_rifle_ak74: hlc_ak_base + { + ACE_barrelTwist=7.8699999; + ACE_barrelLength=16.299999; + }; + class hlc_rifle_aku12: hlc_rifle_ak12 + { + ACE_barrelTwist=6.3000002; + ACE_barrelLength=8.3000002; + }; + class hlc_rifle_RPK12: hlc_rifle_ak12 + { + ACE_barrelLength=23.200001; + }; + class hlc_rifle_aks74u: hlc_rifle_ak74 + { + ACE_barrelTwist=6.3000002; + ACE_barrelLength=8.3000002; + }; + class hlc_rifle_ak47: hlc_rifle_ak74 + { + ACE_barrelTwist=9.4499998; + ACE_barrelLength=16.299999; + }; + class hlc_rifle_akm: hlc_rifle_ak47 + { + ACE_barrelTwist=7.8699999; + ACE_barrelLength=16.299999; + }; + class hlc_rifle_rpk: hlc_rifle_ak47 + { + ACE_barrelTwist=9.4499998; + ACE_barrelLength=23.200001; + }; + class hlc_rifle_rpk74n: hlc_rifle_rpk + { + ACE_barrelTwist=9.4499998; + ACE_barrelLength=23.200001; + }; + class hlc_rifle_aek971: hlc_rifle_ak74 + { + ACE_barrelTwist=9.5; + ACE_barrelLength=17; + }; + class hlc_rifle_saiga12k: hlc_rifle_ak47 + { + ACE_barrelTwist=0; + ACE_twistDirection=0; + ACE_barrelLength=16.9; + }; + + class HLC_Optic_PSO1 : optic_dms { + ACE_ScopeAdjust_Vertical[] = { 0, 0 }; + ACE_ScopeAdjust_Horizontal[] = { -10, 10 }; + ACE_ScopeAdjust_Increment = 0.5; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class Snip { + discreteDistance[]={100, 200, 300, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; + discreteDistanceInitIndex=3; + }; + }; + }; + }; + class HLC_Optic_1p29 : HLC_Optic_PSO1 { + ACE_ScopeAdjust_Vertical[] = {}; + ACE_ScopeAdjust_Horizontal[] = {}; + ACE_ScopeAdjust_Increment = 0; + }; +}; \ No newline at end of file diff --git a/optionals/compat_hlcmods_ak/config.cpp b/optionals/compat_hlcmods_ak/config.cpp new file mode 100644 index 0000000000..7c8cdba2ba --- /dev/null +++ b/optionals/compat_hlcmods_ak/config.cpp @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"hlcweapons_aks"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/optionals/compat_hlcmods_ak/script_component.hpp b/optionals/compat_hlcmods_ak/script_component.hpp new file mode 100644 index 0000000000..a970229846 --- /dev/null +++ b/optionals/compat_hlcmods_ak/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT hlcweapons_aks_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_hlcmods_aug/CfgWeapons.hpp b/optionals/compat_hlcmods_aug/CfgWeapons.hpp new file mode 100644 index 0000000000..b46cf485e1 --- /dev/null +++ b/optionals/compat_hlcmods_aug/CfgWeapons.hpp @@ -0,0 +1,51 @@ + +class CfgWeapons +{ + class Rifle_Base_F; + class hlc_aug_base; + class hlc_rifle_aug: hlc_aug_base + { + ACE_barrelTwist=9; + ACE_barrelLength=20; + }; + class hlc_rifle_auga1carb: hlc_rifle_aug + { + ACE_barrelTwist=9; + ACE_barrelLength=16; + }; + class hlc_rifle_aughbar: hlc_rifle_aug + { + ACE_barrelTwist=9; + ACE_barrelLength=24; + }; + class hlc_rifle_augpara: hlc_rifle_aug + { + ACE_barrelTwist=9; + ACE_barrelLength=16.5; + }; + class hlc_rifle_auga2: hlc_rifle_aug + { + ACE_barrelTwist=9; + ACE_barrelLength=20; + }; + class hlc_rifle_auga2para: hlc_rifle_auga2 + { + ACE_barrelTwist=9; + ACE_barrelLength=16.5; + }; + class hlc_rifle_auga2carb: hlc_rifle_auga2 + { + ACE_barrelTwist=9; + ACE_barrelLength=18; + }; + class hlc_rifle_auga2lsw: hlc_rifle_aughbar + { + ACE_barrelTwist=9; + ACE_barrelLength=24; + }; + class hlc_rifle_auga3: hlc_rifle_aug + { + ACE_barrelTwist=9; + ACE_barrelLength=18; + }; +}; \ No newline at end of file diff --git a/optionals/compat_hlcmods_aug/config.cpp b/optionals/compat_hlcmods_aug/config.cpp new file mode 100644 index 0000000000..06192a6ffd --- /dev/null +++ b/optionals/compat_hlcmods_aug/config.cpp @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"hlcweapons_AUG"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/optionals/compat_hlcmods_aug/script_component.hpp b/optionals/compat_hlcmods_aug/script_component.hpp new file mode 100644 index 0000000000..d5a6712b6b --- /dev/null +++ b/optionals/compat_hlcmods_aug/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT hlcweapons_AUG_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_hlcmods_core/CfgAmmo.hpp b/optionals/compat_hlcmods_core/CfgAmmo.hpp new file mode 100644 index 0000000000..7259d2da3d --- /dev/null +++ b/optionals/compat_hlcmods_core/CfgAmmo.hpp @@ -0,0 +1,316 @@ +class CfgAmmo +{ + class B_762x51_Ball; + class B_556x45_Ball; + class B_127x99_Ball; + class B_127x99_Ball_Tracer_Red; + class HLC_762x51_tracer; + class HLC_762x51_ball; + class HLC_556NATO_EPR: B_556x45_Ball + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-27.20, -26.44, -23.76, -21.00, -17.54, -13.10, -7.95, -1.62, 6.24, 15.48, 27.75}; + ACE_ballisticCoefficients[]={0.151}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={723, 764, 796, 825, 843, 866, 878, 892, 906, 915, 922, 900}; + ACE_barrelLengths[]={8.3, 9.4, 10.6, 11.8, 13.0, 14.2, 15.4, 16.5, 17.7, 18.9, 20.0, 24.0}; + }; + class HLC_556NATO_SOST: B_556x45_Ball + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.307}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={780, 886, 950}; + ACE_barrelLengths[]={10, 15.5, 20}; + }; + class HLC_556NATO_SPR: B_556x45_Ball + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=77; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.361}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={624, 816, 832, 838}; + ACE_barrelLengths[]={7.5, 14.5, 18, 20}; + }; + class HLC_300Blackout_Ball: B_556x45_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.118; + ACE_bulletMass=147; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.398}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={559, 609, 625}; + ACE_barrelLengths[]={6, 16, 20}; + }; + class HLC_300Blackout_SMK: HLC_300Blackout_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.489; + ACE_bulletMass=220; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.608}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={300, 320, 340}; + ACE_barrelLengths[]={9, 16, 20}; + }; + class HLC_762x39_Ball: HLC_300Blackout_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=123; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class HLC_762x39_Tracer: HLC_762x39_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=117; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class HLC_762x51_MK316_20in: B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=175; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.243}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={750, 780, 790, 794}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class HLC_762x51_BTSub: B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.340; + ACE_bulletMass=200; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.235}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={305, 325, 335, 340}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class HLC_762x54_ball: HLC_762x51_ball + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=152; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.4}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={700, 800, 820, 833}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class HLC_762x54_tracer: HLC_762x51_tracer + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=149; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.395}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={680, 750, 798, 800}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class HLC_303Brit_B: B_556x45_Ball + { + ACE_caliber=0.311; + ACE_bulletLength=1.227; + ACE_bulletMass=174; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.499, 0.493, 0.48}; + ACE_velocityBoundaries[]={671, 549}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={748, 761, 765}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class HLC_792x57_Ball: HLC_303Brit_B + { + ACE_caliber=0.318; + ACE_bulletLength=1.128; + ACE_bulletMass=196; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.315}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={785, 800, 815}; + ACE_barrelLengths[]={20, 23.62, 26}; + }; + class HLC_542x42_ball: HLC_303Brit_B + { + }; + class HLC_542x42_Tracer: HLC_303Brit_B + { + }; + class FH_545x39_Ball: B_556x45_Ball + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=52.9; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={780, 880, 920}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class FH_545x39_7u1: FH_545x39_Ball + { + ACE_bulletMass=80; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_muzzleVelocities[]={260, 303, 320}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class HLC_57x28mm_JHP: FH_545x39_Ball + { + ACE_caliber=0.224; + ACE_bulletLength=0.495; + ACE_bulletMass=28; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.144}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={550, 625, 720}; + ACE_barrelLengths[]={4, 6, 10.35}; + }; + class HLC_9x19_Ball: B_556x45_Ball + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class HLC_9x19_M882_SMG: B_556x45_Ball + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class HLC_9x19_GoldDot: HLC_9x19_Ball + { + ACE_muzzleVelocities[]={350, 380, 420}; + }; + class HLC_9x19_Subsonic: HLC_9x19_Ball + { + ACE_muzzleVelocities[]={300, 320, 340}; + }; + class HLC_10mm_FMJ: HLC_9x19_Ball + { + ACE_caliber=0.5; + ACE_bulletLength=0.764; + ACE_bulletMass=165; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.189}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={360, 400, 430}; + ACE_barrelLengths[]={4, 4.61, 9}; + }; + class HLC_45ACP_Ball: B_556x45_Ball + { + ACE_caliber=0.452; + ACE_bulletLength=0.68; + ACE_bulletMass=230; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.195}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={230, 250, 285}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class FH_44Mag: HLC_45ACP_Ball + { + ACE_caliber=0.429; + ACE_bulletLength=0.804; + ACE_bulletMass=200; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.172}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={360, 390, 420}; + ACE_barrelLengths[]={4, 7.5, 9}; + }; + class FH_50BMG_SLAP: B_127x99_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.25; + ACE_bulletMass=350; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={1.056}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={1204}; + ACE_barrelLengths[]={29}; + }; + class FH_50BMG_Raufoss: B_127x99_Ball + { + ACE_caliber=0.510; + ACE_bulletLength=2.380; + ACE_bulletMass=660; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.670}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={817}; + ACE_barrelLengths[]={29}; + }; +}; diff --git a/optionals/compat_hlcmods_core/config.cpp b/optionals/compat_hlcmods_core/config.cpp new file mode 100644 index 0000000000..ecd780908f --- /dev/null +++ b/optionals/compat_hlcmods_core/config.cpp @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"hlcweapons_core"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgAmmo.hpp" diff --git a/optionals/compat_hlcmods_core/script_component.hpp b/optionals/compat_hlcmods_core/script_component.hpp new file mode 100644 index 0000000000..444799ed4a --- /dev/null +++ b/optionals/compat_hlcmods_core/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT hlcweapons_core_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_hlcmods_fal/CfgWeapons.hpp b/optionals/compat_hlcmods_fal/CfgWeapons.hpp new file mode 100644 index 0000000000..05a17d8eb4 --- /dev/null +++ b/optionals/compat_hlcmods_fal/CfgWeapons.hpp @@ -0,0 +1,50 @@ + +class CfgWeapons +{ + class hlc_fal_base; + class hlc_rifle_falosw: hlc_fal_base + { + ACE_barrelTwist=12; + ACE_barrelLength=13; + }; + class hlc_rifle_osw_GL: hlc_rifle_falosw + { + ACE_barrelTwist=12; + ACE_barrelLength=13; + }; + class hlc_rifle_SLR: hlc_fal_base + { + ACE_barrelTwist=12; + ACE_barrelLength=21.700001; + }; + class hlc_rifle_STG58F: hlc_fal_base + { + ACE_barrelTwist=12; + ACE_barrelLength=21; + }; + class hlc_rifle_FAL5061: hlc_fal_base + { + ACE_barrelTwist=12; + ACE_barrelLength=18; + }; + class hlc_rifle_L1A1SLR: hlc_rifle_SLR + { + ACE_barrelTwist=12; + ACE_barrelLength=21.700001; + }; + class hlc_rifle_c1A1: hlc_rifle_SLR + { + ACE_barrelTwist=12; + ACE_barrelLength=21.700001; + }; + class hlc_rifle_LAR: hlc_rifle_FAL5061 + { + ACE_barrelTwist=12; + ACE_barrelLength=21; + }; + class hlc_rifle_SLRchopmod: hlc_rifle_FAL5061 + { + ACE_barrelTwist=12; + ACE_barrelLength=18; + }; +}; \ No newline at end of file diff --git a/optionals/compat_hlcmods_fal/config.cpp b/optionals/compat_hlcmods_fal/config.cpp new file mode 100644 index 0000000000..5428e9871c --- /dev/null +++ b/optionals/compat_hlcmods_fal/config.cpp @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"hlcweapons_falpocalypse"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/optionals/compat_hlcmods_fal/script_component.hpp b/optionals/compat_hlcmods_fal/script_component.hpp new file mode 100644 index 0000000000..828722a5a4 --- /dev/null +++ b/optionals/compat_hlcmods_fal/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT hlcweapons_falpocalypse_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_hlcmods_g3/CfgWeapons.hpp b/optionals/compat_hlcmods_g3/CfgWeapons.hpp new file mode 100644 index 0000000000..e45fe34048 --- /dev/null +++ b/optionals/compat_hlcmods_g3/CfgWeapons.hpp @@ -0,0 +1,45 @@ + +class CfgWeapons +{ + class hlc_g3_base; + class hlc_rifle_g3sg1: hlc_g3_base + { + ACE_barrelTwist=12; + ACE_barrelLength=17.700001; + }; + class hlc_rifle_psg1: hlc_rifle_g3sg1 + { + ACE_barrelTwist=12; + ACE_barrelLength=25.6; + }; + class hlc_rifle_g3a3: hlc_rifle_g3sg1 + { + ACE_barrelTwist=12; + ACE_barrelLength=17.700001; + }; + class hlc_rifle_g3a3ris: hlc_rifle_g3a3 + { + ACE_barrelTwist=12; + ACE_barrelLength=17.700001; + }; + class hlc_rifle_g3ka4: hlc_rifle_g3a3 + { + ACE_barrelTwist=12; + ACE_barrelLength=12.4; + }; + class HLC_Rifle_g3ka4_GL: hlc_rifle_g3ka4 + { + ACE_barrelTwist=12; + ACE_barrelLength=12.4; + }; + class hlc_rifle_hk51: hlc_rifle_g3sg1 + { + ACE_barrelTwist=12; + ACE_barrelLength=8.3100004; + }; + class hlc_rifle_hk53: hlc_rifle_g3sg1 + { + ACE_barrelTwist=7; + ACE_barrelLength=8.3100004; + }; +}; \ No newline at end of file diff --git a/optionals/compat_hlcmods_g3/config.cpp b/optionals/compat_hlcmods_g3/config.cpp new file mode 100644 index 0000000000..6b79486364 --- /dev/null +++ b/optionals/compat_hlcmods_g3/config.cpp @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"hlcweapons_g3"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/optionals/compat_hlcmods_g3/script_component.hpp b/optionals/compat_hlcmods_g3/script_component.hpp new file mode 100644 index 0000000000..642977f87b --- /dev/null +++ b/optionals/compat_hlcmods_g3/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT hlcweapons_g3_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_hlcmods_m14/CfgWeapons.hpp b/optionals/compat_hlcmods_m14/CfgWeapons.hpp new file mode 100644 index 0000000000..01a67ff063 --- /dev/null +++ b/optionals/compat_hlcmods_m14/CfgWeapons.hpp @@ -0,0 +1,16 @@ + +class CfgWeapons +{ + class Rifle_Base_F; + class hlc_rifle_M14; + class hlc_M14_base: Rifle_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=22; + }; + class hlc_rifle_m14sopmod: hlc_rifle_M14 + { + ACE_barrelTwist=12; + ACE_barrelLength=18; + }; +}; diff --git a/optionals/compat_hlcmods_m14/config.cpp b/optionals/compat_hlcmods_m14/config.cpp new file mode 100644 index 0000000000..cdf11a7db1 --- /dev/null +++ b/optionals/compat_hlcmods_m14/config.cpp @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"hlcweapons_m14"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/optionals/compat_hlcmods_m14/script_component.hpp b/optionals/compat_hlcmods_m14/script_component.hpp new file mode 100644 index 0000000000..a29b751195 --- /dev/null +++ b/optionals/compat_hlcmods_m14/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT hlcweapons_m14_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_hlcmods_m60e4/CfgWeapons.hpp b/optionals/compat_hlcmods_m60e4/CfgWeapons.hpp new file mode 100644 index 0000000000..9532c1968d --- /dev/null +++ b/optionals/compat_hlcmods_m60e4/CfgWeapons.hpp @@ -0,0 +1,15 @@ + +class CfgWeapons +{ + class hlc_M60e4_base; + class hlc_lmg_M60E4: hlc_M60e4_base + { + ACE_barrelTwist=12; + ACE_barrelLength=17; + }; + class hlc_lmg_m60: hlc_M60e4_base + { + ACE_barrelTwist=12; + ACE_barrelLength=22; + }; +}; diff --git a/optionals/compat_hlcmods_m60e4/config.cpp b/optionals/compat_hlcmods_m60e4/config.cpp new file mode 100644 index 0000000000..1df3a97a20 --- /dev/null +++ b/optionals/compat_hlcmods_m60e4/config.cpp @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"hlcweapons_m60e4"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/optionals/compat_hlcmods_m60e4/script_component.hpp b/optionals/compat_hlcmods_m60e4/script_component.hpp new file mode 100644 index 0000000000..4a5a9c03b0 --- /dev/null +++ b/optionals/compat_hlcmods_m60e4/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT hlc_m60e4_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_rh_acc/CfgWeapons.hpp b/optionals/compat_rh_acc/CfgWeapons.hpp new file mode 100644 index 0000000000..4dda8ffbe0 --- /dev/null +++ b/optionals/compat_rh_acc/CfgWeapons.hpp @@ -0,0 +1,131 @@ + +class CfgWeapons { + class ItemCore; + class InventoryOpticsItem_Base_F; + + class RH_accupoint : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class Accupoint { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RH_m3lr : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class m3lr { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RH_leu_mk4 : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class mk4 { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RH_c79 : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class c79scope { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RH_c79_2d : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class c79scope { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RH_anpvs10 : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class pvs10 { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RH_pas13cm : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class MTWS { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RH_pas13cmg : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class MTWSmg { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RH_pas13ch : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class HTWS { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; +}; diff --git a/optionals/compat_rh_acc/config.cpp b/optionals/compat_rh_acc/config.cpp new file mode 100644 index 0000000000..9f563bd157 --- /dev/null +++ b/optionals/compat_rh_acc/config.cpp @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"RH_acc"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/optionals/compat_rh_acc/script_component.hpp b/optionals/compat_rh_acc/script_component.hpp new file mode 100644 index 0000000000..4b36a38ce0 --- /dev/null +++ b/optionals/compat_rh_acc/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT RH_acc_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_rh_de/CfgAmmo.hpp b/optionals/compat_rh_de/CfgAmmo.hpp new file mode 100644 index 0000000000..b66b55f530 --- /dev/null +++ b/optionals/compat_rh_de/CfgAmmo.hpp @@ -0,0 +1,161 @@ + +class CfgAmmo +{ + class BulletBase; + class RH_50_AE_Ball: BulletBase + { + ACE_caliber=0.5; + ACE_bulletLength=1.110; + ACE_bulletMass=325; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.228}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={360, 398, 420}; + ACE_barrelLengths[]={4, 6, 9}; + }; + class RH_454_Casull: BulletBase + { + ACE_caliber=0.452; + ACE_bulletLength=0.895; + ACE_bulletMass=325; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.171}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={450, 490, 500}; + ACE_barrelLengths[]={4, 7.5, 9}; + }; + class RH_32ACP: BulletBase + { + ACE_caliber=0.3125; + ACE_bulletLength=0.610; + ACE_bulletMass=65; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.118}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={282, 300, 320}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class RH_45ACP: BulletBase + { + ACE_caliber=0.452; + ACE_bulletLength=0.68; + ACE_bulletMass=230; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.195}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={230, 250, 285}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class RH_B_40SW: BulletBase + { + ACE_caliber=0.4; + ACE_bulletLength=0.447; + ACE_bulletMass=135; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.105, 0.115, 0.120, 0.105}; + ACE_velocityBoundaries[]={365, 305, 259}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={360, 380, 400}; + ACE_barrelLengths[]={4, 6, 9}; + }; + class RH_44mag_ball: BulletBase + { + ACE_caliber=0.429; + ACE_bulletLength=0.804; + ACE_bulletMass=200; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.172}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={360, 390, 420}; + ACE_barrelLengths[]={4, 7.5, 9}; + }; + class RH_357mag_ball: BulletBase + { + ACE_caliber=0.357; + ACE_bulletLength=0.541; + ACE_bulletMass=125; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.148}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={490, 510, 535}; + ACE_barrelLengths[]={4, 6, 9}; + }; + class RH_762x25: BulletBase + { + ACE_caliber=0.310; + ACE_bulletLength=0.5455; + ACE_bulletMass=86; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.17}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={360, 380, 400}; + ACE_barrelLengths[]={4, 6, 9}; + }; + class RH_9x18_Ball: BulletBase + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; + class RH_B_9x19_Ball: BulletBase + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class RH_B_22LR_SD: BulletBase + { + ACE_caliber=0.223; + ACE_bulletLength=0.45; + ACE_bulletMass=38; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.111}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={330, 340, 360}; + ACE_barrelLengths[]={4, 6, 9}; + }; + class RH_57x28mm: BulletBase + { + ACE_caliber=0.224; + ACE_bulletLength=0.495; + ACE_bulletMass=28; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.144}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={550, 625, 720}; + ACE_barrelLengths[]={4, 6, 10.35}; + }; +}; \ No newline at end of file diff --git a/optionals/compat_rh_de/CfgWeapons.hpp b/optionals/compat_rh_de/CfgWeapons.hpp new file mode 100644 index 0000000000..8fdff293c9 --- /dev/null +++ b/optionals/compat_rh_de/CfgWeapons.hpp @@ -0,0 +1,140 @@ +class CfgWeapons +{ + class Pistol_Base_F; + class RH_Pistol_Base_F; + class RH_deagle: RH_Pistol_Base_F + { + ACE_barrelTwist=19; + ACE_barrelLength=6; + }; + class RH_mateba: Pistol_Base_F + { + ACE_barrelTwist=14; + ACE_barrelLength=6; + }; + class RH_mp412: Pistol_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=6; + }; + class RH_python: Pistol_Base_F + { + ACE_barrelTwist=14; + ACE_barrelLength=6; + }; + class RH_bull: RH_python + { + ACE_barrelTwist=24; + ACE_barrelLength=6.5; + }; + class RH_ttracker: Pistol_Base_F + { + ACE_barrelTwist=12; + ACE_barrelLength=4; + }; + class RH_cz75: RH_Pistol_Base_F + { + ACE_barrelTwist=9.7; + ACE_barrelLength=4.7; + }; + class RH_p226: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.4; + }; + class RH_sw659: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=7.44; + }; + class RH_usp: RH_Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=4.41; + }; + class RH_uspm: RH_Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=6; + }; + class RH_kimber: RH_Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=5; + }; + class RH_m1911: RH_Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=5; + }; + class RH_tt33: RH_Pistol_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=4.6; + }; + class RH_mak: RH_Pistol_Base_F + { + ACE_barrelTwist=9.45; + ACE_barrelLength=3.68; + }; + class RH_mk2: RH_Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=4; + }; + class RH_m9: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.9; + }; + class RH_g18: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.49; + }; + class RH_g17: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.49; + }; + class RH_g19: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4; + }; + class RH_gsh18: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.1; + }; + class RH_fnp45: RH_Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=4.5; + }; + class RH_fn57: RH_fnp45 + { + ACE_barrelTwist=9.1; + ACE_barrelLength=4.8; + }; + class RH_vp70: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=4.6; + }; + class RH_vz61: RH_Pistol_Base_F + { + ACE_barrelTwist=16; + ACE_barrelLength=4.5; + }; + class RH_tec9: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=5; + }; + class RH_muzi: RH_Pistol_Base_F + { + ACE_barrelTwist=9.8; + ACE_barrelLength=5; + }; +}; \ No newline at end of file diff --git a/optionals/compat_rh_de/config.cpp b/optionals/compat_rh_de/config.cpp new file mode 100644 index 0000000000..3d82eab05a --- /dev/null +++ b/optionals/compat_rh_de/config.cpp @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"RH_de_cfg"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgAmmo.hpp" +#include "CfgWeapons.hpp" diff --git a/optionals/compat_rh_de/script_component.hpp b/optionals/compat_rh_de/script_component.hpp new file mode 100644 index 0000000000..07ed06ae3f --- /dev/null +++ b/optionals/compat_rh_de/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT RH_de_cfg_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_rh_m4/CfgAmmo.hpp b/optionals/compat_rh_m4/CfgAmmo.hpp new file mode 100644 index 0000000000..c15e0e503a --- /dev/null +++ b/optionals/compat_rh_m4/CfgAmmo.hpp @@ -0,0 +1,206 @@ +class CfgAmmo { + + class Default; + class BulletCore; + class BulletBase; + class B_9x21_Ball; + class B_556x45_Ball; + class B_65x39_Caseless; + class B_762x51_Ball; + + class RH_9x19_B_M822: BulletBase + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class RH_9x19_B_HP: BulletBase + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=124; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.165}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={340, 370, 400}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class RH_9x19_B_HPSB: BulletBase + { + ACE_caliber=0.355; + ACE_bulletLength=0.603; + ACE_bulletMass=147; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.212}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={295, 310, 330}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class RH_556x45_B_M855A1: B_556x45_Ball + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-27.20, -26.44, -23.76, -21.00, -17.54, -13.10, -7.95, -1.62, 6.24, 15.48, 27.75}; + ACE_ballisticCoefficients[]={0.151}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={723, 764, 796, 825, 843, 866, 878, 892, 906, 915, 922, 900}; + ACE_barrelLengths[]={8.3, 9.4, 10.6, 11.8, 13.0, 14.2, 15.4, 16.5, 17.7, 18.9, 20.0, 24.0}; + }; + class RH_556x45_B_Mk318: B_556x45_Ball + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.307}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={780, 886, 950}; + ACE_barrelLengths[]={10, 15.5, 20}; + }; + class RH_556x45_B_Mk262: B_556x45_Ball + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=77; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.361}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={624, 816, 832, 838}; + ACE_barrelLengths[]={7.5, 14.5, 18, 20}; + }; + class RH_68x43_B_FMJ: B_65x39_Caseless + { + ACE_caliber=0.277; + ACE_bulletLength=0.959; + ACE_bulletMass=115; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.162}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={713, 785, 810, 850}; + ACE_barrelLengths[]={12, 16, 20, 24}; + }; + class RH_68x43_B_Match: B_65x39_Caseless + { + ACE_caliber=0.277; + ACE_bulletLength=1.250; + ACE_bulletMass=135; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.253}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 732, 750, 780}; + ACE_barrelLengths[]={12, 16, 20, 24}; + }; + class RH_762x35_B_FMJ: B_65x39_Caseless + { + ACE_caliber=0.308; + ACE_bulletLength=1.118; + ACE_bulletMass=147; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.398}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={559, 609, 625}; + ACE_barrelLengths[]={6, 16, 20}; + }; + class RH_762x35_B_Match: B_65x39_Caseless + { + ACE_caliber=0.308; + ACE_bulletLength=1.153; + ACE_bulletMass=125; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.349, 0.338, 0.330, 0.310}; + ACE_velocityBoundaries[]={792, 610, 488}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={572, 676, 700}; + ACE_barrelLengths[]={6, 16, 20}; + }; + class RH_762x35_B_MSB: B_65x39_Caseless + { + ACE_caliber=0.308; + ACE_bulletLength=1.489; + ACE_bulletMass=220; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.608}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={300, 320, 340}; + ACE_barrelLengths[]={9, 16, 20}; + }; + class RH_762x51_B_M80A1: B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class RH_762x51_B_Mk316LR: B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=175; + ACE_ammoTempMuzzleVelocityShifts[]={-5.3, -5.1, -4.6, -4.2, -3.4, -2.6, -1.4, -0.3, 1.4, 3.0, 5.2}; + ACE_ballisticCoefficients[]={0.243}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={775, 790, 805, 810}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class RH_762x51_B_Mk319: B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=130; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.377}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={838, 892, 910}; + ACE_barrelLengths[]={13, 16, 20}; + }; + class RH_762x51_B_LFMJSB: B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.340; + ACE_bulletMass=200; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.235}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={305, 325, 335, 340}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; +}; diff --git a/optionals/compat_rh_m4/CfgWeapons.hpp b/optionals/compat_rh_m4/CfgWeapons.hpp new file mode 100644 index 0000000000..69536e9302 --- /dev/null +++ b/optionals/compat_rh_m4/CfgWeapons.hpp @@ -0,0 +1,130 @@ + +class CfgWeapons +{ + class Rifle_Base_F; + class RH_ar10: Rifle_Base_F + { + ACE_barrelTwist=11.25; + ACE_barrelLength=20.8; + }; + class RH_m110: Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=20; + }; + class RH_Mk11: RH_m110 + { + ACE_barrelTwist=11.25; + ACE_barrelLength=24; + }; + class RH_SR25EC: RH_m110 + { + ACE_barrelTwist=11.25; + ACE_barrelLength=20; + }; + class RH_m4: Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class RH_M4_ris: RH_m4 + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class RH_M4A1_ris: RH_M4_ris + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class RH_M4m: RH_M4A1_ris + { + ACE_barrelTwist=7; + ACE_barrelLength=10.5; + }; + class RH_M4sbr: RH_M4A1_ris + { + ACE_barrelTwist=7; + ACE_barrelLength=10.5; + }; + class RH_hb: Rifle_Base_F + { + ACE_barrelTwist=8; + ACE_barrelLength=6; + }; + class RH_hb_b: RH_hb + { + ACE_barrelTwist=8; + ACE_barrelLength=6; + }; + class RH_sbr9: Rifle_Base_F + { + ACE_barrelTwist=9.7; + ACE_barrelLength=9; + }; + class RH_M4A6: RH_M4A1_ris + { + ACE_barrelTwist=10; + ACE_barrelLength=14.5; + }; + class RH_M16a1: RH_m4 + { + ACE_barrelTwist=14; + ACE_barrelLength=20; + }; + class RH_M16A2: RH_m4 + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class RH_M16A4 : RH_M4_ris + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class RH_M16A3: RH_M16A4 + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class RH_M16A4_m: RH_M16A4 + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class RH_M16A6: RH_M16A4 + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class RH_Mk12mod1: RH_M16A4 + { + ACE_barrelTwist=7; + ACE_barrelLength=18; + }; + class RH_SAMR: RH_Mk12mod1 + { + ACE_barrelTwist=7.7; + ACE_barrelLength=20; + }; + class RH_Hk416: RH_M4A1_ris + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class RH_Hk416s: RH_M4sbr + { + ACE_barrelTwist=7; + ACE_barrelLength=10.4; + }; + class RH_Hk416c: RH_M4sbr + { + ACE_barrelTwist=7; + ACE_barrelLength=9; + }; + class RH_M27IAR: RH_Mk12mod1 + { + ACE_barrelTwist=7; + ACE_barrelLength=16.5; + }; +}; \ No newline at end of file diff --git a/optionals/compat_rh_m4/config.cpp b/optionals/compat_rh_m4/config.cpp new file mode 100644 index 0000000000..9c28be4f89 --- /dev/null +++ b/optionals/compat_rh_m4/config.cpp @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"RH_m4_cfg"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgAmmo.hpp" +#include "CfgWeapons.hpp" diff --git a/optionals/compat_rh_m4/script_component.hpp b/optionals/compat_rh_m4/script_component.hpp new file mode 100644 index 0000000000..167c926dd7 --- /dev/null +++ b/optionals/compat_rh_m4/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT RH_m4_cfg_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_rh_pdw/CfgAmmo.hpp b/optionals/compat_rh_pdw/CfgAmmo.hpp new file mode 100644 index 0000000000..706344ff8c --- /dev/null +++ b/optionals/compat_rh_pdw/CfgAmmo.hpp @@ -0,0 +1,15 @@ + +class BulletBase; +class RH_B_6x35: BulletBase +{ + ACE_caliber=0.224; + ACE_bulletLength=0.445; + ACE_bulletMass=65; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.26}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={730, 750, 760}; + ACE_barrelLengths[]={8, 10, 12}; +}; \ No newline at end of file diff --git a/optionals/compat_rh_pdw/CfgWeapons.hpp b/optionals/compat_rh_pdw/CfgWeapons.hpp new file mode 100644 index 0000000000..b009a202ce --- /dev/null +++ b/optionals/compat_rh_pdw/CfgWeapons.hpp @@ -0,0 +1,10 @@ + +class CfgWeapons +{ + class Rifle_Base_F; + class RH_PDW: Rifle_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=10; + }; +}; diff --git a/optionals/compat_rh_pdw/config.cpp b/optionals/compat_rh_pdw/config.cpp new file mode 100644 index 0000000000..4aed0e6241 --- /dev/null +++ b/optionals/compat_rh_pdw/config.cpp @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"RH_PDW"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgAmmo.hpp" +#include "CfgWeapons.hpp" diff --git a/optionals/compat_rh_pdw/script_component.hpp b/optionals/compat_rh_pdw/script_component.hpp new file mode 100644 index 0000000000..67c4617e06 --- /dev/null +++ b/optionals/compat_rh_pdw/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT RH_PDW_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_rhs_afrf3/CfgAmmo.hpp b/optionals/compat_rhs_afrf3/CfgAmmo.hpp new file mode 100644 index 0000000000..323634f02c --- /dev/null +++ b/optionals/compat_rhs_afrf3/CfgAmmo.hpp @@ -0,0 +1,125 @@ + +class CfgAmmo +{ + class BulletBase; + class B_556x45_Ball; + class rhs_B_545x39_Ball: B_556x45_Ball + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=52.9; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={780, 880, 920}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class rhs_B_545x39_Ball_Tracer_Green: rhs_B_545x39_Ball + { + ACE_caliber=0.220; + ACE_bulletLength=0.85; + ACE_bulletMass=49.8; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.168}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={785, 883, 925}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class B_762x51_Ball; + class rhs_B_762x54_Ball: B_762x51_Ball + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=152; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.4}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={700, 800, 820, 833}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class rhs_B_762x54_Ball_Tracer_Green: B_762x51_Ball + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=149; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.395}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={680, 750, 798, 800}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class rhs_B_762x54_7N1_Ball: rhs_B_762x54_Ball + { + ACE_caliber=0.312; + ACE_bulletLength=1.14; + ACE_bulletMass=152; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.4}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={700, 800, 820, 833}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class rhs_B_762x39_Ball: B_762x51_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=123; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class rhs_B_762x39_Tracer: rhs_B_762x39_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=117; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.275}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={650, 716, 750}; + ACE_barrelLengths[]={10, 16.3, 20}; + }; + class B_9x21_Ball; + class rhs_B_9x19_7N21: B_9x21_Ball + { + ACE_caliber=0.355; + ACE_bulletLength=0.610; + ACE_bulletMass=80.2; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.14}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={445, 460, 480}; + ACE_barrelLengths[]={4, 5, 9}; + }; + class rhs_B_9x18_57N181S: B_9x21_Ball + { + ACE_caliber=0.365; + ACE_bulletLength=0.610; + ACE_bulletMass=92.6; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.125}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={298, 330, 350}; + ACE_barrelLengths[]={3.8, 5, 9}; + }; +}; \ No newline at end of file diff --git a/optionals/compat_rhs_afrf3/CfgWeapons.hpp b/optionals/compat_rhs_afrf3/CfgWeapons.hpp new file mode 100644 index 0000000000..49573b164a --- /dev/null +++ b/optionals/compat_rhs_afrf3/CfgWeapons.hpp @@ -0,0 +1,67 @@ + +class CfgWeapons +{ + class hgun_Rook40_F; + class rhs_weap_pya: hgun_Rook40_F + { + ACE_barrelTwist=10; + ACE_barrelLength=4.4; + }; + class Pistol_Base_F; + class rhs_weap_makarov_pmm: rhs_weap_pya + { + ACE_barrelTwist=9.45; + ACE_barrelLength=3.68; + }; + class rhs_weap_ak74m_Base_F; + class rhs_weap_ak74m: rhs_weap_ak74m_Base_F + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class rhs_weap_akm: rhs_weap_ak74m + { + ACE_barrelTwist=7.87; + ACE_barrelLength=16.3; + }; + class rhs_weap_aks74; + class rhs_weap_aks74u: rhs_weap_aks74 + { + ACE_barrelTwist=6.3; + ACE_barrelLength=8.3; + }; + class rhs_weap_svd: rhs_weap_ak74m + { + ACE_barrelTwist=9.4; + ACE_barrelLength=24.4; + }; + class rhs_weap_svdp; + class rhs_weap_svds: rhs_weap_svdp + { + ACE_barrelTwist=9.4; + ACE_barrelLength=22.2; + }; + class rhs_pkp_base; + class rhs_weap_pkp: rhs_pkp_base + { + ACE_barrelTwist=9.45; + ACE_barrelLength=25.9; + }; + class rhs_weap_pkm: rhs_weap_pkp + { + ACE_barrelTwist=9.45; + ACE_barrelLength=25.4; + }; + class rhs_weap_rpk74m: rhs_weap_pkp + { + ACE_barrelTwist=7.68; + ACE_barrelLength=23.2; + }; + + class rhs_acc_sniper_base; + class rhs_acc_pso1m2: rhs_acc_sniper_base { + ACE_ScopeAdjust_Vertical[] = { 0, 0 }; + ACE_ScopeAdjust_Horizontal[] = { -10, 10 }; + ACE_ScopeAdjust_Increment = 0.5; + }; +}; \ No newline at end of file diff --git a/optionals/compat_rhs_afrf3/config.cpp b/optionals/compat_rhs_afrf3/config.cpp new file mode 100644 index 0000000000..8b7f9d5ca4 --- /dev/null +++ b/optionals/compat_rhs_afrf3/config.cpp @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"rhs_c_weapons"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgAmmo.hpp" +#include "CfgWeapons.hpp" diff --git a/optionals/compat_rhs_afrf3/script_component.hpp b/optionals/compat_rhs_afrf3/script_component.hpp new file mode 100644 index 0000000000..edf3963b1f --- /dev/null +++ b/optionals/compat_rhs_afrf3/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT rhs_c_weapons_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_rhs_usf3/CfgAmmo.hpp b/optionals/compat_rhs_usf3/CfgAmmo.hpp new file mode 100644 index 0000000000..68a8c8f7fd --- /dev/null +++ b/optionals/compat_rhs_usf3/CfgAmmo.hpp @@ -0,0 +1,97 @@ + +class CfgAmmo +{ + class BulletBase; + class rhsusf_B_300winmag: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.489; + ACE_bulletMass=220; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.310}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={847, 867, 877}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class B_556x45_Ball; + class rhs_ammo_556x45_Mk318_Ball: B_556x45_Ball + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=62; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.307}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={780, 886, 950}; + ACE_barrelLengths[]={10, 15.5, 20}; + }; + class rhs_ammo_556x45_Mk262_Ball: B_556x45_Ball + { + ACE_caliber=0.224; + ACE_bulletLength=0.906; + ACE_bulletMass=77; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.361}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={624, 816, 832, 838}; + ACE_barrelLengths[]={7.5, 14.5, 18, 20}; + }; + class rhs_ammo_762x51_M80_Ball: BulletBase + { + ACE_caliber=0.308; + ACE_bulletLength=1.14; + ACE_bulletMass=146; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.2}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; + ACE_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class rhs_ammo_762x51_M118_Special_Ball: rhs_ammo_762x51_M80_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=175; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.243}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={750, 780, 790, 794}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; + class rhs_ammo_762x51_M993_Ball: rhs_ammo_762x51_M80_Ball + { + ACE_caliber=0.308; + ACE_bulletLength=1.24; + ACE_bulletMass=127; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.377}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={875, 910, 930}; + ACE_barrelLengths[]={13, 16, 20}; + }; + class rhs_ammo_45ACP_MHP: BulletBase + { + ACE_caliber=0.452; + ACE_bulletLength=0.68; + ACE_bulletMass=230; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.195}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={230, 250, 285}; + ACE_barrelLengths[]={4, 5, 9}; + }; +}; \ No newline at end of file diff --git a/optionals/compat_rhs_usf3/CfgWeapons.hpp b/optionals/compat_rhs_usf3/CfgWeapons.hpp new file mode 100644 index 0000000000..a9791cd6b8 --- /dev/null +++ b/optionals/compat_rhs_usf3/CfgWeapons.hpp @@ -0,0 +1,86 @@ + +class CfgWeapons +{ + class Pistol_Base_F; + class Rifle_Base_F; + class srifle_EBR_F; + class rhs_weap_XM2010_Base_F: Rifle_Base_F + { + ACE_barrelTwist=10; + ACE_barrelLength=24; + }; + class arifle_MX_Base_F; + class rhs_weap_m4_Base: arifle_MX_Base_F + { + ACE_barrelTwist=7; + ACE_barrelLength=14.5; + }; + class rhs_weap_m4a1; + class rhs_weap_mk18: rhs_weap_m4a1 + { + ACE_barrelTwist=7; + ACE_barrelLength=10.3; + }; + class rhs_weap_m16a4: rhs_weap_m4_Base + { + ACE_barrelTwist=7; + ACE_barrelLength=20; + }; + class rhs_M249_base; + class rhs_weap_m249_pip: rhs_M249_base + { + ACE_barrelTwist=7; + ACE_barrelLength=16.3; + }; + class weap_m240_base; + class rhs_weap_m240B: weap_m240_base + { + ACE_barrelTwist=12; + ACE_barrelLength=24.8; + }; + class rhs_weap_m14ebrri: srifle_EBR_F + { + ACE_barrelTwist=12; + ACE_barrelLength=22; + }; + class rhs_weap_sr25: rhs_weap_m14ebrri + { + ACE_barrelTwist=11.25; + ACE_barrelLength=24; + }; + class rhs_weap_sr25_ec: rhs_weap_sr25 + { + ACE_barrelTwist=11.25; + ACE_barrelLength=20; + }; + class rhs_weap_M590_5RD: Rifle_Base_F + { + ACE_barrelTwist=0; + ACE_twistDirection=0; + ACE_barrelLength=18.5; + }; + class rhs_weap_M590_8RD: rhs_weap_M590_5RD + { + ACE_barrelTwist=0; + ACE_twistDirection=0; + ACE_barrelLength=20; + }; + class hgun_ACPC2_F; + class rhsusf_weap_m1911a1: hgun_ACPC2_F + { + ACE_barrelTwist=16; + ACE_barrelLength=5; + }; + + class rhsusf_acc_sniper_base; + class rhsusf_acc_LEUPOLDMK4: rhsusf_acc_sniper_base { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + }; + class rhsusf_acc_LEUPOLDMK4_2: rhsusf_acc_sniper_base { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + }; +}; \ No newline at end of file diff --git a/optionals/compat_rhs_usf3/config.cpp b/optionals/compat_rhs_usf3/config.cpp new file mode 100644 index 0000000000..bc4d264697 --- /dev/null +++ b/optionals/compat_rhs_usf3/config.cpp @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"rhsusf_c_weapons"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgAmmo.hpp" +#include "CfgWeapons.hpp" diff --git a/optionals/compat_rhs_usf3/script_component.hpp b/optionals/compat_rhs_usf3/script_component.hpp new file mode 100644 index 0000000000..c0a5bbf1f4 --- /dev/null +++ b/optionals/compat_rhs_usf3/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT rhsusf_c_weapons_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_rksl_pm_ii/CfgWeapons.hpp b/optionals/compat_rksl_pm_ii/CfgWeapons.hpp new file mode 100644 index 0000000000..621dd98b71 --- /dev/null +++ b/optionals/compat_rksl_pm_ii/CfgWeapons.hpp @@ -0,0 +1,33 @@ + +class CfgWeapons { + class ItemCore; + class InventoryOpticsItem_Base_F; + + class RKSL_optic_PMII_312 : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class Snip { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class RKSL_optic_PMII_312_sunshade : ItemCore { + ACE_ScopeAdjust_Vertical[] = { -4, 30 }; + ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; + ACE_ScopeAdjust_Increment = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class Snip { + discreteDistance[] = { 100 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; +}; diff --git a/optionals/compat_rksl_pm_ii/config.cpp b/optionals/compat_rksl_pm_ii/config.cpp new file mode 100644 index 0000000000..c3ed720f8b --- /dev/null +++ b/optionals/compat_rksl_pm_ii/config.cpp @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"RKSL_PMII"}; + author[]={"Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/optionals/compat_rksl_pm_ii/script_component.hpp b/optionals/compat_rksl_pm_ii/script_component.hpp new file mode 100644 index 0000000000..a98639b0e8 --- /dev/null +++ b/optionals/compat_rksl_pm_ii/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT RKSL_PMII_comp + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/tools/github_privates_bot.py b/tools/github_privates_bot.py new file mode 100644 index 0000000000..4ef04eb33c --- /dev/null +++ b/tools/github_privates_bot.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 + +import os +import argparse + +from pygithub3 import Github + +def main(): + gh = Github(user='acemod', repo='ACE3') + + pull_requests = gh.pull_requests.list().all() + + for request in pull_requests: + files = gh.pull_requests.list_files(request.number).all() + + for file in files: + # print file.filename + if '.sqf' in file.filename: + print file + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tools/make.cfg b/tools/make.cfg index 1eb02b826f..5e2d9d78da 100644 --- a/tools/make.cfg +++ b/tools/make.cfg @@ -17,6 +17,11 @@ project = @ace # Default: None # key = D:\Program Files (x86)\Bohemia Interactive\Tools\DSSignFile Tools\keys\ace_preAlpha.biprivatekey +# Path to where private keys are automatically created if the command-line parameter "key" is used +# Make sure this isn't in your public repository! +# Default: \private_keys +# private_key_path = P:\private_keys + # If set to True, the make system will attempt to autodetect addons in the # current folder by looking for directories with 'config.cpp' in them. # Default: True @@ -39,6 +44,11 @@ prefix = z\ace\addons # Default: \\addons module_root = P:\z\ace\addons +# Set the location where the optional addon source folders (i.e. P:\z\ace\optionals) +# Default: \\optionals +optionals_root = P:\z\ace\optionals + + # Directory where the built addon will be saved. # Default: release release_dir = P:\z\ace\release diff --git a/tools/make.py b/tools/make.py index bd27f893f5..462d44b536 100644 --- a/tools/make.py +++ b/tools/make.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # vim: set fileencoding=utf-8 : # make.py @@ -30,13 +30,13 @@ ############################################################################### -__version__ = "0.3dev" +__version__ = "0.4" import sys if sys.version_info[0] == 2: - print("Python 3 is required.") - sys.exit(1) + print("Python 3 is required.") + sys.exit(1) import os import os.path @@ -52,7 +52,17 @@ import time import re if sys.platform == "win32": - import winreg + import winreg + +######## GLOBALS ######### +work_drive = "" +module_root = "" +release_dir = "" +module_root_parent = "" +optionals_root = "" +key_name = "ace_3.0.0" +key = "" +dssignfile = "" ############################################################################### # http://akiscode.com/articles/sha-1directoryhash.shtml @@ -63,255 +73,437 @@ if sys.platform == "win32": # -1 -> Directory does not exist # -2 -> General error (see stack traceback) def get_directory_hash(directory): - directory_hash = hashlib.sha1() - if not os.path.exists (directory): - return -1 + directory_hash = hashlib.sha1() + if not os.path.exists (directory): + return -1 - try: - for root, dirs, files in os.walk(directory): - for names in files: - path = os.path.join(root, names) - try: - f = open(path, 'rb') - except: - # You can't open the file for some reason - f.close() - continue + try: + for root, dirs, files in os.walk(directory): + for names in files: + path = os.path.join(root, names) + try: + f = open(path, 'rb') + except: + # You can't open the file for some reason + f.close() + continue - while 1: - # Read file in as little chunks - buf = f.read(4096) - if not buf: break - new = hashlib.sha1(buf) - directory_hash.update(new.digest()) - f.close() + while 1: + # Read file in as little chunks + buf = f.read(4096) + if not buf: break + new = hashlib.sha1(buf) + directory_hash.update(new.digest()) + f.close() - except: - # Print the stack traceback - traceback.print_exc() - return -2 + except: + # Print the stack traceback + traceback.print_exc() + return -2 - return directory_hash.hexdigest() + return directory_hash.hexdigest() # Copyright (c) André Burgaud # http://www.burgaud.com/bring-colors-to-the-windows-console-with-python/ if sys.platform == "win32": - from ctypes import windll, Structure, c_short, c_ushort, byref + from ctypes import windll, Structure, c_short, c_ushort, byref - SHORT = c_short - WORD = c_ushort + SHORT = c_short + WORD = c_ushort - class COORD(Structure): - """struct in wincon.h.""" - _fields_ = [ - ("X", SHORT), - ("Y", SHORT)] + class COORD(Structure): + """struct in wincon.h.""" + _fields_ = [ + ("X", SHORT), + ("Y", SHORT)] - class SMALL_RECT(Structure): - """struct in wincon.h.""" - _fields_ = [ - ("Left", SHORT), - ("Top", SHORT), - ("Right", SHORT), - ("Bottom", SHORT)] + class SMALL_RECT(Structure): + """struct in wincon.h.""" + _fields_ = [ + ("Left", SHORT), + ("Top", SHORT), + ("Right", SHORT), + ("Bottom", SHORT)] - class CONSOLE_SCREEN_BUFFER_INFO(Structure): - """struct in wincon.h.""" - _fields_ = [ - ("dwSize", COORD), - ("dwCursorPosition", COORD), - ("wAttributes", WORD), - ("srWindow", SMALL_RECT), - ("dwMaximumWindowSize", COORD)] + class CONSOLE_SCREEN_BUFFER_INFO(Structure): + """struct in wincon.h.""" + _fields_ = [ + ("dwSize", COORD), + ("dwCursorPosition", COORD), + ("wAttributes", WORD), + ("srWindow", SMALL_RECT), + ("dwMaximumWindowSize", COORD)] - # winbase.h - STD_INPUT_HANDLE = -10 - STD_OUTPUT_HANDLE = -11 - STD_ERROR_HANDLE = -12 + # winbase.h + STD_INPUT_HANDLE = -10 + STD_OUTPUT_HANDLE = -11 + STD_ERROR_HANDLE = -12 - # wincon.h - FOREGROUND_BLACK = 0x0000 - FOREGROUND_BLUE = 0x0001 - FOREGROUND_GREEN = 0x0002 - FOREGROUND_CYAN = 0x0003 - FOREGROUND_RED = 0x0004 - FOREGROUND_MAGENTA = 0x0005 - FOREGROUND_YELLOW = 0x0006 - FOREGROUND_GREY = 0x0007 - FOREGROUND_INTENSITY = 0x0008 # foreground color is intensified. + # wincon.h + FOREGROUND_BLACK = 0x0000 + FOREGROUND_BLUE = 0x0001 + FOREGROUND_GREEN = 0x0002 + FOREGROUND_CYAN = 0x0003 + FOREGROUND_RED = 0x0004 + FOREGROUND_MAGENTA = 0x0005 + FOREGROUND_YELLOW = 0x0006 + FOREGROUND_GREY = 0x0007 + FOREGROUND_INTENSITY = 0x0008 # foreground color is intensified. - BACKGROUND_BLACK = 0x0000 - BACKGROUND_BLUE = 0x0010 - BACKGROUND_GREEN = 0x0020 - BACKGROUND_CYAN = 0x0030 - BACKGROUND_RED = 0x0040 - BACKGROUND_MAGENTA = 0x0050 - BACKGROUND_YELLOW = 0x0060 - BACKGROUND_GREY = 0x0070 - BACKGROUND_INTENSITY = 0x0080 # background color is intensified. + BACKGROUND_BLACK = 0x0000 + BACKGROUND_BLUE = 0x0010 + BACKGROUND_GREEN = 0x0020 + BACKGROUND_CYAN = 0x0030 + BACKGROUND_RED = 0x0040 + BACKGROUND_MAGENTA = 0x0050 + BACKGROUND_YELLOW = 0x0060 + BACKGROUND_GREY = 0x0070 + BACKGROUND_INTENSITY = 0x0080 # background color is intensified. - stdout_handle = windll.kernel32.GetStdHandle(STD_OUTPUT_HANDLE) - SetConsoleTextAttribute = windll.kernel32.SetConsoleTextAttribute - GetConsoleScreenBufferInfo = windll.kernel32.GetConsoleScreenBufferInfo + stdout_handle = windll.kernel32.GetStdHandle(STD_OUTPUT_HANDLE) + SetConsoleTextAttribute = windll.kernel32.SetConsoleTextAttribute + GetConsoleScreenBufferInfo = windll.kernel32.GetConsoleScreenBufferInfo - def get_text_attr(): - """Returns the character attributes (colors) of the console screen - buffer.""" - csbi = CONSOLE_SCREEN_BUFFER_INFO() - GetConsoleScreenBufferInfo(stdout_handle, byref(csbi)) - return csbi.wAttributes + def get_text_attr(): + """Returns the character attributes (colors) of the console screen + buffer.""" + csbi = CONSOLE_SCREEN_BUFFER_INFO() + GetConsoleScreenBufferInfo(stdout_handle, byref(csbi)) + return csbi.wAttributes - def set_text_attr(color): - """Sets the character attributes (colors) of the console screen - buffer. Color is a combination of foreground and background color, - foreground and background intensity.""" - SetConsoleTextAttribute(stdout_handle, color) + def set_text_attr(color): + """Sets the character attributes (colors) of the console screen + buffer. Color is a combination of foreground and background color, + foreground and background intensity.""" + SetConsoleTextAttribute(stdout_handle, color) ############################################################################### def find_bi_tools(work_drive): - """Find BI tools.""" + """Find BI tools.""" - reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) - try: - k = winreg.OpenKey(reg, r"Software\bohemia interactive\arma 3 tools") - arma3tools_path = winreg.QueryValueEx(k, "path")[0] - winreg.CloseKey(k) - except: - raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") + reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) + try: + k = winreg.OpenKey(reg, r"Software\bohemia interactive\arma 3 tools") + arma3tools_path = winreg.QueryValueEx(k, "path")[0] + winreg.CloseKey(k) + except: + raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") - addonbuilder_path = os.path.join(arma3tools_path, "AddonBuilder", "AddonBuilder.exe") - dssignfile_path = os.path.join(arma3tools_path, "DSSignFile", "DSSignFile.exe") - dscreatekey_path = os.path.join(arma3tools_path, "DSSignFile", "DSCreateKey.exe") - cfgconvert_path = os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe") + addonbuilder_path = os.path.join(arma3tools_path, "AddonBuilder", "AddonBuilder.exe") + dssignfile_path = os.path.join(arma3tools_path, "DSSignFile", "DSSignFile.exe") + dscreatekey_path = os.path.join(arma3tools_path, "DSSignFile", "DSCreateKey.exe") + cfgconvert_path = os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe") + + if os.path.isfile(addonbuilder_path) and os.path.isfile(dssignfile_path) and os.path.isfile(dscreatekey_path) and os.path.isfile(cfgconvert_path): + return [addonbuilder_path, dssignfile_path, dscreatekey_path, cfgconvert_path] + else: + raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") - if os.path.isfile(addonbuilder_path) and os.path.isfile(dssignfile_path) and os.path.isfile(dscreatekey_path) and os.path.isfile(cfgconvert_path): - return [addonbuilder_path, dssignfile_path, dscreatekey_path, cfgconvert_path] - else: - raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") def find_depbo_tools(regKey): - """Use registry entries to find DePBO-based tools.""" - stop = False + """Use registry entries to find DePBO-based tools.""" + stop = False - if regKey == "HKCU": - reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) - stop = True - else: - reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) + if regKey == "HKCU": + reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) + stop = True + else: + reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) - try: - k = winreg.OpenKey(reg, r"Software\Mikero\pboProject") - try: - pboproject_path = winreg.QueryValueEx(k, "exe")[0] - winreg.CloseKey(k) - print("Found pboproject.") - except: - print_error("ERROR: Could not find pboProject.") + try: + try: + k = winreg.OpenKey(reg, r"Software\Wow6432Node\Mikero\pboProject") + except FileNotFoundError: + k = winreg.OpenKey(reg, r"Software\Mikero\pboProject") + try: + pboproject_path = winreg.QueryValueEx(k, "exe")[0] + winreg.CloseKey(k) + print("Found pboproject.") + except: + print_error("ERROR: Could not find pboProject.") - k = winreg.OpenKey(reg, r"Software\Mikero\rapify") - try: - rapify_path = winreg.QueryValueEx(k, "exe")[0] - winreg.CloseKey(k) - print("Found rapify.") - except: - print_error("Could not find rapify.") + try: + k = winreg.OpenKey(reg, r"Software\Wow6432Node\Mikero\rapify") + except FileNotFoundError: + k = winreg.OpenKey(reg, r"Software\Mikero\rapify") + try: + rapify_path = winreg.QueryValueEx(k, "exe")[0] + winreg.CloseKey(k) + print("Found rapify.") + except: + print_error("Could not find rapify.") - k = winreg.OpenKey(reg, r"Software\Mikero\MakePbo") - try: - makepbo_path = winreg.QueryValueEx(k, "exe")[0] - winreg.CloseKey(k) - print("Found makepbo.") - except: - print_error("Could not find makepbo.") - except: - if stop == True: - raise Exception("BadDePBO", "DePBO tools not installed correctly") - return -1 + try: + k = winreg.OpenKey(reg, r"Software\Wow6432Node\Mikero\MakePbo") + except FileNotFoundError: + k = winreg.OpenKey(reg, r"Software\Mikero\MakePbo") + try: + makepbo_path = winreg.QueryValueEx(k, "exe")[0] + winreg.CloseKey(k) + print("Found makepbo.") + except: + print_error("Could not find makepbo.") + except: + if stop == True: + raise Exception("BadDePBO", "DePBO tools not installed correctly") + return -1 - #Strip any quotations from the path due to a MikeRo tool bug which leaves a trailing space in some of its registry paths. - return [pboproject_path.strip('"'),rapify_path.strip('"'),makepbo_path.strip('"')] + #Strip any quotations from the path due to a MikeRo tool bug which leaves a trailing space in some of its registry paths. + return [pboproject_path.strip('"'),rapify_path.strip('"'),makepbo_path.strip('"')] + def color(color): - """Set the color. Works on Win32 and normal terminals.""" - if sys.platform == "win32": - if color == "green": - set_text_attr(FOREGROUND_GREEN | get_text_attr() & 0x0070 | FOREGROUND_INTENSITY) - elif color == "red": - set_text_attr(FOREGROUND_RED | get_text_attr() & 0x0070 | FOREGROUND_INTENSITY) - elif color == "blue": - set_text_attr(FOREGROUND_BLUE | get_text_attr() & 0x0070 | FOREGROUND_INTENSITY) - elif color == "reset": - set_text_attr(FOREGROUND_GREY | get_text_attr() & 0x0070) - elif color == "grey": - set_text_attr(FOREGROUND_GREY | get_text_attr() & 0x0070) - else : - if color == "green": - sys.stdout.write('\033[92m') - elif color == "red": - sys.stdout.write('\033[91m') - elif color == "blue": - sys.stdout.write('\033[94m') - elif color == "reset": - sys.stdout.write('\033[0m') + """Set the color. Works on Win32 and normal terminals.""" + if sys.platform == "win32": + if color == "green": + set_text_attr(FOREGROUND_GREEN | get_text_attr() & 0x0070 | FOREGROUND_INTENSITY) + elif color == "yellow": + set_text_attr(FOREGROUND_YELLOW | get_text_attr() & 0x0070 | FOREGROUND_INTENSITY) + elif color == "red": + set_text_attr(FOREGROUND_RED | get_text_attr() & 0x0070 | FOREGROUND_INTENSITY) + elif color == "blue": + set_text_attr(FOREGROUND_BLUE | get_text_attr() & 0x0070 | FOREGROUND_INTENSITY) + elif color == "reset": + set_text_attr(FOREGROUND_GREY | get_text_attr() & 0x0070) + elif color == "grey": + set_text_attr(FOREGROUND_GREY | get_text_attr() & 0x0070) + else : + if color == "green": + sys.stdout.write('\033[92m') + elif color == "red": + sys.stdout.write('\033[91m') + elif color == "blue": + sys.stdout.write('\033[94m') + elif color == "reset": + sys.stdout.write('\033[0m') def print_error(msg): - color("red") - print ("ERROR: " + msg) - color("reset") + color("red") + print ("ERROR: " + msg) + color("reset") def print_green(msg): - color("green") - print(msg) - color("reset") + color("green") + print(msg) + color("reset") def print_blue(msg): - color("blue") - print(msg) - color("reset") + color("blue") + print(msg) + color("reset") def print_yellow(msg): - color("yellow") - print(msg) - color("reset") + color("yellow") + print(msg) + color("reset") + +def copy_important_files(source_dir,destination_dir): + + originalDir = os.getcwd() + importantFiles = ["mod.cpp", + "README.md", + "AUTHORS.txt", + "LICENSE", + "logo_ace3_ca.paa" + ] + + #copy importantFiles + try: + print_blue("\nSearching for important files in " + source_dir) + print("Source_dir: " + source_dir) + print("Destination_dir: " + destination_dir) + + for file in importantFiles: + print_green("Copying file => " + os.path.join(source_dir,file)) + shutil.copyfile(os.path.join(source_dir,file),os.path.join(destination_dir,file)) + except: + print_error("COPYING IMPORTANT FILES.") + raise + + #copy all extension dlls + try: + os.chdir(os.path.join(source_dir)) + print_blue("\nSearching for DLLs in " + os.getcwd()) + filenames = glob.glob("*.dll") + + if not filenames: + print ("Empty SET") + + for dll in filenames: + print_green("Copying dll => " + os.path.join(source_dir,dll)) + if os.path.isfile(dll): + shutil.copyfile(os.path.join(source_dir,dll),os.path.join(destination_dir,dll)) + except: + print_error("COPYING DLL FILES.") + raise + finally: + os.chdir(originalDir) + + +def copy_optionals_for_building(mod,pbos): + src_directories = os.listdir(optionals_root) + current_dir = os.getcwd() + + print_blue("\nChecking Optionals folder...") + try: + + #special server.pbo processing + files = glob.glob(os.path.join(release_dir, "@ace","optionals","*.pbo")) + for file in files: + file_name = os.path.basename(file) + #print ("Adding the following file: " + file_name) + pbos.append(file_name) + pbo_path = os.path.join(release_dir, "@ace","optionals",file_name) + sigFile_name = file_name +"."+ key_name + ".bisign" + sig_path = os.path.join(release_dir, "@ace","optionals",sigFile_name) + if (os.path.isfile(pbo_path)): + print("Moving " + pbo_path + " for processing.") + shutil.move(pbo_path, os.path.join(release_dir,"@ace","addons",file_name)) + + if (os.path.isfile(sig_path)): + #print("Moving " + sig_path + " for processing.") + shutil.move(sig_path, os.path.join(release_dir,"@ace","addons",sigFile_name)) + except: + print_error("Error in moving") + raise + finally: + os.chdir(current_dir) + + print("") + try: + for dir_name in src_directories: + mod.append(dir_name) + #userconfig requires special handling since it is not a PBO source folder. + #CfgConvert fails to build server.pbo if userconfig is not found in P:\ + if (dir_name == "userconfig"): + if (os.path.exists(os.path.join(release_dir, "@ace","optionals",dir_name))): + shutil.rmtree(os.path.join(release_dir, "@ace","optionals",dir_name), True) + shutil.copytree(os.path.join(optionals_root,dir_name), os.path.join(release_dir, "@ace","optionals",dir_name)) + destination = os.path.join(work_drive,dir_name) + else: + destination = os.path.join(module_root,dir_name) + + print("Temporarily copying " + os.path.join(optionals_root,dir_name) + " => " + destination + " for building.") + if (os.path.exists(destination)): + shutil.rmtree(destination, True) + shutil.copytree(os.path.join(optionals_root,dir_name), destination) + except: + print_error("Copy Optionals Failed") + raise + finally: + os.chdir(current_dir) + + +def cleanup_optionals(mod): + print("") + try: + for dir_name in mod: + #userconfig requires special handling since it is not a PBO source folder. + if (dir_name == "userconfig"): + destination = os.path.join(work_drive,dir_name) + else: + destination = os.path.join(module_root,dir_name) + + print("Cleaning " + destination) + + try: + file_name = "ace_{}.pbo".format(dir_name) + src_file_path = os.path.join(release_dir, "@ace","addons",file_name) + dst_file_path = os.path.join(release_dir, "@ace","optionals",file_name) + + sigFile_name = file_name +"."+ key_name + ".bisign" + src_sig_path = os.path.join(release_dir, "@ace","addons",sigFile_name) + dst_sig_path = os.path.join(release_dir, "@ace","optionals",sigFile_name) + + if (os.path.isfile(src_file_path)): + #print("Preserving " + file_name) + os.renames(src_file_path,dst_file_path) + if (os.path.isfile(src_sig_path)): + #print("Preserving " + sigFile_name) + os.renames(src_sig_path,dst_sig_path) + except FileExistsError: + print_error(file_name + " already exists") + continue + shutil.rmtree(destination) + + except: + print_error("Cleaning Optionals Failed") + raise + + +def purge(dir, pattern, friendlyPattern="files"): + print_green("Deleting " + friendlyPattern + " files from directory: " + dir) + for f in os.listdir(dir): + if re.search(pattern, f): + os.remove(os.path.join(dir, f)) + + +def build_signature_file(file_name): + global key + global dssignfile + print("Signing with " + key + ".") + ret = subprocess.call([dssignfile, key, file_name]) + if ret == 0: + return True + else: + return False + + +def check_for_obsolete_pbos(addonspath, file): + module = file[4:-4] + if not os.path.exists(os.path.join(addonspath, module)): + return True + return False ############################################################################### + def main(argv): - """Build an Arma addon suite in a directory from rules in a make.cfg file.""" - print_blue(("\nmake.py for Arma, v" + __version__)) + """Build an Arma addon suite in a directory from rules in a make.cfg file.""" + print_blue(("\nmake.py for Arma, modified for Advanced Combat Environment v" + __version__)) - if sys.platform != "win32": - print_error("Non-Windows platform (Cygwin?). Please re-run from cmd.") - sys.exit(1) + global work_drive + global module_root + global release_dir + global module_root_parent + global optionals_root + global key_name + global key + global dssignfile - reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) - try: - k = winreg.OpenKey(reg, r"Software\bohemia interactive\arma 3 tools") - arma3tools_path = winreg.QueryValueEx(k, "path")[0] - winreg.CloseKey(k) - except: - raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") + if sys.platform != "win32": + print_error("Non-Windows platform (Cygwin?). Please re-run from cmd.") + sys.exit(1) - # Default behaviors - test = False # Copy to Arma 3 directory? - arg_modules = False # Only build modules on command line? - make_release = False # Make zip file from the release? - release_version = 0 # Version of release - use_pboproject = True # Default to pboProject build tool - make_target = "DEFAULT" # Which section in make.cfg to use for the build - new_key = False # Make a new key and use it to sign? - quiet = False # Suppress output from build tool? + reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) + try: + k = winreg.OpenKey(reg, r"Software\bohemia interactive\arma 3 tools") + arma3tools_path = winreg.QueryValueEx(k, "path")[0] + winreg.CloseKey(k) + except: + raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") - # Parse arguments - if "help" in argv or "-h" in argv or "--help" in argv: - print (""" + # Default behaviors + test = False # Copy to Arma 3 directory? + arg_modules = False # Only build modules on command line? + make_release = False # Make zip file from the release? + release_version = 0 # Version of release + use_pboproject = True # Default to pboProject build tool + make_target = "DEFAULT" # Which section in make.cfg to use for the build + new_key = True # Make a new key and use it to sign? + quiet = False # Suppress output from build tool? + + # Parse arguments + if "help" in argv or "-h" in argv or "--help" in argv: + print (""" make.py [help] [test] [force] [key ] [target ] [release ] [module name] [module name] [...] test -- Copy result to Arma 3. release -- Make archive with . force -- Ignore cache and build all. +checkexternal -- Check External Files target -- Use rules in make.cfg under heading [] rather than default [Make] key -- Use key in working directory with to sign. If it does not @@ -335,503 +527,584 @@ If a file called $NOBIN$ is found in the module directory, that module will not See the make.cfg file for additional build options. """) - sys.exit(0) - - if "force" in argv: - argv.remove("force") - force_build = True - else: - force_build = False - - if "test" in argv: - test = True - argv.remove("test") - - if "release" in argv: - make_release = True - release_version = argv[argv.index("release") + 1] - argv.remove(release_version) - argv.remove("release") - - if "target" in argv: - make_target = argv[argv.index("target") + 1] - argv.remove("target") - argv.remove(make_target) - force_build = True - - if "key" in argv: - new_key = True - key_name = argv[argv.index("key") + 1] - argv.remove("key") - argv.remove(key_name) - - if "quiet" in argv: - quiet = True - argv.remove("quiet") - - # Get the directory the make script is in. - make_root = os.path.dirname(os.path.realpath(__file__)) - make_root_parent = os.path.abspath(os.path.join(os.getcwd(), os.pardir)) - os.chdir(make_root) - - # Get latest commit ID - try: - gitpath = os.path.join(os.path.dirname(make_root), ".git") - assert os.path.exists(gitpath) - - commit_id = subprocess.check_output(["git", "rev-parse", "HEAD"]) - commit_id = str(commit_id, "utf-8")[:8] - except: - print_error("FAILED TO DETERMINE COMMIT ID.") - commit_id = "NOGIT" - - cfg = configparser.ConfigParser(); - try: - cfg.read(os.path.join(make_root, "make.cfg")) - - # Project name (with @ symbol) - project = cfg.get(make_target, "project", fallback="@"+os.path.basename(os.getcwd())) - - # Private key path - key = cfg.get(make_target, "key", fallback=None) - - # Project prefix (folder path) - prefix = cfg.get(make_target, "prefix", fallback="") - - # Should we autodetect modules on a complete build? - module_autodetect = cfg.getboolean(make_target, "module_autodetect", fallback=True) - - # Manual list of modules to build for a complete build - modules = cfg.get(make_target, "modules", fallback=None) - # Parse it out - if modules: - modules = [x.strip() for x in modules.split(',')] - else: - modules = [] - - # List of directories to ignore when detecting - ignore = [x.strip() for x in cfg.get(make_target, "ignore", fallback="release").split(',')] - - # BI Tools work drive on Windows - work_drive = cfg.get(make_target, "work_drive", fallback="P:\\") - - # Which build tool should we use? - build_tool = cfg.get(make_target, "build_tool", fallback="addonbuilder").lower() - - # Release/build directory, relative to script dir - release_dir = cfg.get(make_target, "release_dir", fallback="release") - - # Project PBO file prefix (files are renamed to prefix_name.pbo) - pbo_name_prefix = cfg.get(make_target, "pbo_name_prefix", fallback=None) - - # Project module Root - module_root_parent = os.path.abspath(os.path.join(os.path.join(work_drive, prefix), os.pardir)) - module_root = cfg.get(make_target, "module_root", fallback=os.path.join(make_root_parent, "addons")) - print_green ("module_root: " + module_root) - if (os.path.isdir(module_root)): - os.chdir(module_root) - else: - print_error ("Directory " + module_root + " does not exist.") - sys.exit() - - except: - raise - print_error("Could not parse make.cfg.") - sys.exit(1) - - - - # See if we have been given specific modules to build from command line. - if len(argv) > 1 and not make_release: - arg_modules = True - modules = argv[1:] - - # Find the tools we need. - try: - tools = find_bi_tools(work_drive) - addonbuilder = tools[0] - dssignfile = tools[1] - dscreatekey = tools[2] - cfgconvert = tools[3] - - except: - print_error("Arma 3 Tools are not installed correctly or the P: drive has not been created.") - sys.exit(1) - - if build_tool == "pboproject": - try: - depbo_tools = find_depbo_tools("HKLM") - if depbo_tools == -1: - depbo_tools = find_depbo_tools("HKCU") - pboproject = depbo_tools[0] - rapifyTool = depbo_tools[1] - makepboTool = depbo_tools[2] - except: - raise - print_error("Could not find dePBO tools. Download the needed tools from: https://dev.withsix.com/projects/mikero-pbodll/files") - sys.exit(1) - - # Try to open and deserialize build cache file. - try: - cache = {} - with open(os.path.join(make_root, "make.cache"), 'r') as f: - cache_raw = f.read() - - cache = json.loads(cache_raw) - - except: - print ("No cache found.") - cache = {} - - # Get list of subdirs in make root. - dirs = next(os.walk(module_root))[1] - - # Autodetect what directories to build. - if module_autodetect and not arg_modules: - modules = [] - for path in dirs: - # Any dir that has a config.cpp in its root is an addon to build. - config_path = os.path.join(path, 'config.cpp') - if os.path.isfile(config_path) and not path in ignore: - modules.append(path) - - # Make the key specified from command line if necessary. - if new_key: - if not os.path.isfile(os.path.join(module_root, key_name + ".biprivatekey")): - print_green("\nRequested key does not exist.") - ret = subprocess.call([dscreatekey, key_name]) # Created in make_root - if ret == 0: - print_blue("Created: " + os.path.join(module_root, key_name + ".biprivatekey")) - else: - print_error("Failed to create key!") - - try: - print_blue("Copying public key to release directory.") - - try: - os.makedirs(os.path.join(module_root, release_dir, "Keys")) - except: - pass - - shutil.copyfile(os.path.join(module_root, key_name + ".bikey"), os.path.join(module_root, release_dir, "Keys", key_name + ".bikey")) - - except: - raise - print_error("Could not copy key to release directory.") - - else: - print_green("\nNOTE: Using key " + os.path.join(module_root, key_name + ".biprivatekey")) - - key = os.path.join(module_root, key_name + ".biprivatekey") - - - # For each module, prep files and then build. - for module in modules: - print_green("\nMaking " + module + "-"*max(1, (60-len(module)))) - - # Cache check - if module in cache: - old_sha = cache[module] - else: - old_sha = "" - - #We always build ACE_common so we can properly show the correct version stamp in the RPT file. - if module == "common": - old_sha = "" - - # Hash the module - new_sha = get_directory_hash(os.path.join(module_root, module)) - - # Check if it needs rebuilt - # print ("Hash:", new_sha) - if old_sha == new_sha: - if not force_build: - print("Module has not changed.") - # Skip everything else - continue - - # Only do this if the project isn't stored directly on the work drive. - # Split the path at the drive name and see if they are on the same drive (usually P:) - if os.path.splitdrive(module_root)[0] != os.path.splitdrive(work_drive)[0]: - try: - # Remove old work drive version (ignore errors) - shutil.rmtree(os.path.join(work_drive, prefix, module), True) - - # Copy module to the work drive - shutil.copytree(module, os.path.join(work_drive, prefix, module)) - - except: - raise - print_error("ERROR: Could not copy module to work drive. Does the module exist?") - input("Press Enter to continue...") - print("Resuming build...") - continue - #else: - #print("WARNING: Module is stored on work drive (" + work_drive + ").") - - try: - # Remove the old pbo, key, and log - old = os.path.join(module_root, release_dir, project, "Addons", module) + "*" - files = glob.glob(old) - for f in files: - os.remove(f) - - if pbo_name_prefix: - old = os.path.join(module_root, release_dir, project, "Addons", pbo_name_prefix+module) + "*" - files = glob.glob(old) - for f in files: - os.remove(f) - except: - raise - print_error("ERROR: Could not copy module to work drive. Does the module exist?") - input("Press Enter to continue...") - print("Resuming build...") - continue - - # Build the module into a pbo - print_blue("Building: " + os.path.join(work_drive, prefix, module)) - print_blue("Destination: " + os.path.join(module_root, release_dir, project, "Addons")) - - # Make destination folder (if needed) - try: - os.makedirs(os.path.join(module_root, release_dir, project, "Addons")) - except: - pass - - # Run build tool - build_successful = False - if build_tool == "pboproject": - try: - #PABST: Convert config (run the macro'd config.cpp through CfgConvert twice to produce a de-macro'd cpp that pboProject can read without fucking up: - shutil.copyfile(os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.backup")) - - os.chdir("P:\\") - - cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-bin", "-dst", os.path.join(work_drive, prefix, module, "config.bin"), os.path.join(work_drive, prefix, module, "config.cpp")] - ret = subprocess.call(cmd) - if ret != 0: - print_error("CfgConvert -bin return code == " + str(ret) + ". Usually means there is a syntax error within the config.cpp file.") - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - - cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-txt", "-dst", os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.bin")] - ret = subprocess.call(cmd) - if ret != 0: - print_error("CfgConvert -txt return code == " + str(ret) + ". Usually means there is a syntax error within the config.cpp file.") - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - - - # Include build number - try: - configpath = os.path.join(work_drive, prefix, module, "config.cpp") - f = open(configpath, "r") - configtext = f.read() - f.close() - - if configtext: - patchestext = re.search(r"class CfgPatches\n\{(.*?)\n\}", configtext, re.DOTALL).group(1) - patchestext = re.sub(r'version(.*?)="(.*?)"', r'version\1="\2-{}"'.format(commit_id), patchestext) - configtext = re.sub(r"class CfgPatches\n\{(.*?)\n\}", "class CfgPatches\n{"+patchestext+"\n}", configtext, flags=re.DOTALL) - f = open(configpath, "w") - f.write(configtext) - f.close() - else: - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - os.rename(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - except: - raise - print_error("Failed to include build number") - continue - - if os.path.isfile(os.path.join(work_drive, prefix, module, "$NOBIN$")): - print_green("$NOBIN$ Found. Proceeding with non-binarizing!") - cmd = [makepboTool, "-P","-A","-L","-N","-G", os.path.join(work_drive, prefix, module),os.path.join(module_root, release_dir, project,"Addons")] - - else: - cmd = [pboproject, "-P", os.path.join(work_drive, prefix, module), "+Engine=Arma3", "-S","+Noisy", "+X", "+Clean", "+Mod="+os.path.join(module_root, release_dir, project), "-Key"] - - color("grey") - if quiet: - devnull = open(os.devnull, 'w') - ret = subprocess.call(cmd, stdout=devnull) - devnull.close() - else: - ret = subprocess.call(cmd) - color("reset") - - if ret == 0: - print_green("pboProject return code == " + str(ret)) - # Prettyprefix rename the PBO if requested. - if pbo_name_prefix: - try: - os.rename(os.path.join(module_root, release_dir, project, "Addons", module+".pbo"), os.path.join(module_root, release_dir, project, "Addons", pbo_name_prefix+module+".pbo")) - except: - raise - print_error("Could not rename built PBO with prefix.") - # Sign result - if key: - print("Signing with " + key + ".") - if pbo_name_prefix: - ret = subprocess.call([dssignfile, key, os.path.join(module_root, release_dir, project, "Addons", pbo_name_prefix + module + ".pbo")]) - else: - ret = subprocess.call([dssignfile, key, os.path.join(module_root, release_dir, project, "Addons", module + ".pbo")]) - - if ret == 0: - build_successful = True - else: - build_successful = True - - if not build_successful: - print_error("pboProject return code == " + str(ret)) - print_error("Module not successfully built/signed.") - print ("Resuming build...") - continue - - #PABST: cleanup config BS (you could comment this out to see the "de-macroed" cpp - #print_green("\Pabst (restoring): " + os.path.join(work_drive, prefix, module, "config.cpp")) - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - os.remove(os.path.join(work_drive, prefix, module, "config.bin")) - os.rename(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - - # Back to the root - os.chdir(module_root) - - except: - raise - print_error("Could not run Addon Builder.") - input("Press Enter to continue...") - print ("Resuming build...") - continue - - elif build_tool== "addonbuilder": - # Detect $NOBIN$ and do not binarize if found. - if os.path.isfile(os.path.join(work_drive, prefix, module, "$NOBIN$")): - do_binarize = False - print("$NOBIN$ file found in module, packing only.") - else: - do_binarize = True - try: - # Call AddonBuilder - os.chdir("P:\\") - - cmd = [addonbuilder, os.path.join(work_drive, prefix, module), os.path.join(make_root, release_dir, project, "Addons"), "-clear", "-project="+work_drive] - if not do_binarize: - cmd.append("-packonly") - - if quiet: - previousDirectory = os.getcwd() - os.chdir(arma3tools_path) - devnull = open(os.devnull, 'w') - ret = subprocess.call(cmd, stdout=devnull) - devnull.close() - os.chdir(previousDirectory) - else: - previousDirectory = os.getcwd() - os.chdir(arma3tools_path) - print_error("Current directory - " + os.getcwd()) - ret = subprocess.call(cmd) - os.chdir(previousDirectory) - print_error("Current directory - " + os.getcwd()) - color("reset") - print_green("completed") - # Prettyprefix rename the PBO if requested. - if pbo_name_prefix: - try: - os.rename(os.path.join(make_root, release_dir, project, "Addons", module+".pbo"), os.path.join(make_root, release_dir, project, "Addons", pbo_name_prefix+module+".pbo")) - except: - raise - print_error("Could not rename built PBO with prefix.") - - if ret == 0: - # Sign result - if key: - print("Signing with " + key + ".") - if pbo_name_prefix: - ret = subprocess.call([dssignfile, key, os.path.join(make_root, release_dir, project, "Addons", pbo_name_prefix + module + ".pbo")]) - else: - ret = subprocess.call([dssignfile, key, os.path.join(make_root, release_dir, project, "Addons", module + ".pbo")]) - - if ret == 0: - build_successful = True - else: - build_successful = True - - if not build_successful: - print_error("Module not successfully built.") - - # Back to the root - os.chdir(make_root) - - except: - raise - print_error("Could not run Addon Builder.") - input("Press Enter to continue...") - print ("Resuming build...") - continue - - else: - print_error("Unknown build_tool " + build_tool + "!") - - # Update the hash for a successfully built module - if build_successful: - cache[module] = new_sha - - # Done building all modules! - - # Write out the cache state - cache_out = json.dumps(cache) - with open(os.path.join(make_root, "make.cache"), 'w') as f: - f.write(cache_out) - - # Delete the pboproject temp files if building a release. - if make_release and build_tool == "pboproject": - try: - shutil.rmtree(os.path.join(module_root, release_dir, project, "temp"), True) - except: - print_error("ERROR: Could not delete pboProject temp files.") - - print_green("\nDone.") - - # Make release - if make_release: - print_blue("\nMaking release: " + project + "-" + release_version + ".zip") - - try: - # Delete all log files - for root, dirs, files in os.walk(os.path.join(module_root, release_dir, project, "Addons")): - for currentFile in files: - if currentFile.lower().endswith("log"): - os.remove(os.path.join(root, currentFile)) - - # Create a zip with the contents of release/ in it - shutil.make_archive(project + "-" + release_version, "zip", os.path.join(module_root, release_dir)) - except: - raise - print_error("Could not make release.") - - # Copy to Arma 3 folder for testing - if test: - print_blue("\nCopying to Arma 3.") - - if sys.platform == "win32": - reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) - try: - k = winreg.OpenKey(reg, r"SOFTWARE\Wow6432Node\Bohemia Interactive\Arma 3") - a3_path = winreg.EnumValue(k, 1)[1] - winreg.CloseKey(k) - except: - print_error("Could not find Arma 3's directory in the registry.") - else: - a3_path = cygwin_a3path - - if os.path.exists(a3_path): - try: - shutil.rmtree(os.path.join(a3_path, project), True) - shutil.copytree(os.path.join(module_root, release_dir, project), os.path.join(a3_path, project)) - except: - print_error("Could not copy files. Is Arma 3 running?") + sys.exit(0) + + if "force" in argv: + argv.remove("force") + force_build = True + else: + force_build = False + + if "test" in argv: + test = True + argv.remove("test") + + if "release" in argv: + make_release = True + release_version = argv[argv.index("release") + 1] + argv.remove(release_version) + argv.remove("release") + + if "target" in argv: + make_target = argv[argv.index("target") + 1] + argv.remove("target") + argv.remove(make_target) + force_build = True + + if "key" in argv: + new_key = True + key_name = argv[argv.index("key") + 1] + argv.remove("key") + argv.remove(key_name) + + if "quiet" in argv: + quiet = True + argv.remove("quiet") + + if "checkexternal" in argv: + argv.remove("checkexternal") + check_external = True + else: + check_external = False + + print_yellow("\nCheck external references is set to " + str(check_external)) + + # Get the directory the make script is in. + make_root = os.path.dirname(os.path.realpath(__file__)) + make_root_parent = os.path.abspath(os.path.join(os.getcwd(), os.pardir)) + os.chdir(make_root) + + # Get latest commit ID + try: + gitpath = os.path.join(os.path.dirname(make_root), ".git") + assert os.path.exists(gitpath) + + commit_id = subprocess.check_output(["git", "rev-parse", "HEAD"]) + commit_id = str(commit_id, "utf-8")[:8] + key_name = str(key_name+"-"+commit_id) + except: + print_error("FAILED TO DETERMINE COMMIT ID.") + commit_id = "NOGIT" + + cfg = configparser.ConfigParser(); + try: + cfg.read(os.path.join(make_root, "make.cfg")) + + # Project name (with @ symbol) + project = cfg.get(make_target, "project", fallback="@"+os.path.basename(os.getcwd())) + + # BI Tools work drive on Windows + work_drive = cfg.get(make_target, "work_drive", fallback="P:\\") + + # Private key path + key = cfg.get(make_target, "key", fallback=None) + + # Private key creation directory + private_key_path = cfg.get(make_target, "private_key_path", fallback=os.path.join(work_drive, "private_keys")) + + # Project prefix (folder path) + prefix = cfg.get(make_target, "prefix", fallback="") + + # Should we autodetect modules on a complete build? + module_autodetect = cfg.getboolean(make_target, "module_autodetect", fallback=True) + + # Manual list of modules to build for a complete build + modules = cfg.get(make_target, "modules", fallback=None) + # Parse it out + if modules: + modules = [x.strip() for x in modules.split(',')] + else: + modules = [] + + # List of directories to ignore when detecting + ignore = [x.strip() for x in cfg.get(make_target, "ignore", fallback="release").split(',')] + + # Which build tool should we use? + build_tool = cfg.get(make_target, "build_tool", fallback="addonbuilder").lower() + + # Release/build directory, relative to script dir + release_dir = cfg.get(make_target, "release_dir", fallback="release") + + # Project PBO file prefix (files are renamed to prefix_name.pbo) + pbo_name_prefix = cfg.get(make_target, "pbo_name_prefix", fallback=None) + + # Project module Root + module_root_parent = os.path.abspath(os.path.join(os.path.join(work_drive, prefix), os.pardir)) + module_root = cfg.get(make_target, "module_root", fallback=os.path.join(make_root_parent, "addons")) + optionals_root = os.path.join(module_root_parent, "optionals") + print_green ("module_root: " + module_root) + + if (os.path.isdir(module_root)): + os.chdir(module_root) + else: + print_error ("Directory " + module_root + " does not exist.") + sys.exit() + + if (os.path.isdir(optionals_root)): + print_green ("optionals_root: " + optionals_root) + else: + print_error ("Directory " + optionals_root + " does not exist.") + sys.exit() + + print_green ("release_dir: " + release_dir) + + except: + raise + print_error("Could not parse make.cfg.") + sys.exit(1) + + # See if we have been given specific modules to build from command line. + if len(argv) > 1 and not make_release: + arg_modules = True + modules = argv[1:] + + # Find the tools we need. + try: + tools = find_bi_tools(work_drive) + addonbuilder = tools[0] + dssignfile = tools[1] + dscreatekey = tools[2] + cfgconvert = tools[3] + + except: + print_error("Arma 3 Tools are not installed correctly or the P: drive has not been created.") + sys.exit(1) + + if build_tool == "pboproject": + try: + depbo_tools = find_depbo_tools("HKLM") + if depbo_tools == -1: + depbo_tools = find_depbo_tools("HKCU") + pboproject = depbo_tools[0] + rapifyTool = depbo_tools[1] + makepboTool = depbo_tools[2] + except: + raise + print_error("Could not find dePBO tools. Download the needed tools from: https://dev.withsix.com/projects/mikero-pbodll/files") + sys.exit(1) + + # Try to open and deserialize build cache file. + try: + cache = {} + with open(os.path.join(make_root, "make.cache"), 'r') as f: + cache_raw = f.read() + + cache = json.loads(cache_raw) + + except: + print ("No cache found.") + cache = {} + + if not os.path.isdir(os.path.join(release_dir, project, "addons")): + try: + os.makedirs(os.path.join(release_dir, project, "addons")) + except: + print_error("Cannot create release directory") + raise + + if not os.path.isdir(os.path.join(release_dir, project, "keys")): + try: + os.makedirs(os.path.join(release_dir, project, "keys")) + except: + print_error("Cannot create release directory") + raise + + #Temporarily copy optionals_root for building. They will be removed later. + optionals_modules = [] + optional_files = [] + copy_optionals_for_building(optionals_modules,optional_files) + + # Get list of subdirs in make root. + dirs = next(os.walk(module_root))[1] + + # Autodetect what directories to build. + if module_autodetect and not arg_modules: + modules = [] + for path in dirs: + # Any dir that has a config.cpp in its root is an addon to build. + config_path = os.path.join(path, 'config.cpp') + if os.path.isfile(config_path) and not path in ignore: + modules.append(path) + + # Make the key specified from command line if necessary. + if new_key: + if not os.path.isfile(os.path.join(private_key_path, key_name + ".biprivatekey")): + print_yellow("\nRequested key does not exist.") + try: + os.makedirs(private_key_path) + except: + pass + curDir = os.getcwd() + os.chdir(private_key_path) + ret = subprocess.call([dscreatekey, key_name]) # Created in make_root + os.chdir(curDir) + if ret == 0: + print_green("Created: " + os.path.join(private_key_path, key_name + ".biprivatekey")) + print("Removing any old signature keys...") + purge(os.path.join(module_root, release_dir, project, "addons"), "^.*\.bisign$","*.bisign") + purge(os.path.join(module_root, release_dir, project, "optionals"), "^.*\.bisign$","*.bisign") + purge(os.path.join(module_root, release_dir, project, "keys"), "^.*\.bikey$","*.bikey") + else: + print_error("Failed to create key!") + + try: + print("Copying public key to release directory.") + + try: + os.makedirs(os.path.join(module_root, release_dir, project, "keys")) + except: + pass + + shutil.copyfile(os.path.join(private_key_path, key_name + ".bikey"), os.path.join(module_root, release_dir, project, "keys", key_name + ".bikey")) + + except: + print_error("Could not copy key to release directory.") + raise + + else: + print_green("\nNOTE: Using key " + os.path.join(private_key_path, key_name + ".biprivatekey")) + + key = os.path.join(private_key_path, key_name + ".biprivatekey") + + # Remove any obsolete files. + print_blue("\nChecking for obsolete files...") + obsolete_check_path = os.path.join(module_root, release_dir, project,"addons") + for file in os.listdir(obsolete_check_path): + if (file.endswith(".pbo") and os.path.isfile(os.path.join(obsolete_check_path,file))): + if check_for_obsolete_pbos(module_root, file): + fileName = os.path.splitext(file)[0] + print_yellow("Removing obsolete file => " + file) + purge(obsolete_check_path,fileName+"\..",fileName+".*") + + # For each module, prep files and then build. + print_blue("\nBuilding...") + for module in modules: + print_green("\nMaking " + module + "-"*max(1, (60-len(module)))) + missing = False + sigMissing = False + + # Cache check + if module in cache: + old_sha = cache[module] + else: + old_sha = "" + + #We always build ACE_common so we can properly show the correct version stamp in the RPT file. + if module == "common": + old_sha = "" + + # Hash the module + new_sha = get_directory_hash(os.path.join(module_root, module)) + + # Is the pbo or sig file missing? + missing = not os.path.isfile(os.path.join(release_dir, project, "addons", "ace_{}.pbo".format(module))) + sigFile = pbo_name_prefix+module + ".pbo." + key_name + ".bisign" + sigMissing = not os.path.isfile(os.path.join(release_dir, project, "addons", sigFile )) + + if missing: + print_yellow("Missing PBO file ace_{}.pbo".format(module) + ". Building...") + + # Check if it needs rebuilt + # print ("Hash:", new_sha) + if old_sha == new_sha and not missing: + if not force_build: + print("Module has not changed.") + if sigMissing: + if key: + print("Missing Signature key " + sigFile) + build_signature_file(os.path.join(module_root, release_dir, project, "addons", pbo_name_prefix + module + ".pbo")) + # Skip everything else + continue + + # Only do this if the project isn't stored directly on the work drive. + # Split the path at the drive name and see if they are on the same drive (usually P:) + if os.path.splitdrive(module_root)[0] != os.path.splitdrive(work_drive)[0]: + try: + # Remove old work drive version (ignore errors) + shutil.rmtree(os.path.join(work_drive, prefix, module), True) + + # Copy module to the work drive + shutil.copytree(module, os.path.join(work_drive, prefix, module)) + + except: + raise + print_error("ERROR: Could not copy module to work drive. Does the module exist?") + input("Press Enter to continue...") + print("Resuming build...") + continue + #else: + #print("WARNING: Module is stored on work drive (" + work_drive + ").") + + try: + # Remove the old pbo, key, and log + old = os.path.join(module_root, release_dir, project, "addons", pbo_name_prefix+module) + "*" + files = glob.glob(old) + for f in files: + os.remove(f) + + if pbo_name_prefix: + old = os.path.join(module_root, release_dir, project, "addons", pbo_name_prefix+module) + "*" + files = glob.glob(old) + for f in files: + os.remove(f) + except: + raise + print_error("ERROR: Could not copy module to work drive. Does the module exist?") + input("Press Enter to continue...") + print("Resuming build...") + continue + + # Build the module into a pbo + print_blue("Building: " + os.path.join(work_drive, prefix, module)) + print_blue("Destination: " + os.path.join(module_root, release_dir, project, "addons")) + + # Make destination folder (if needed) + try: + os.makedirs(os.path.join(module_root, release_dir, project, "addons")) + except: + pass + + # Run build tool + build_successful = False + if build_tool == "pboproject": + try: + #PABST: Convert config (run the macro'd config.cpp through CfgConvert twice to produce a de-macro'd cpp that pboProject can read without fucking up: + shutil.copyfile(os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.backup")) + + os.chdir("P:\\") + + cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-bin", "-dst", os.path.join(work_drive, prefix, module, "config.bin"), os.path.join(work_drive, prefix, module, "config.cpp")] + ret = subprocess.call(cmd) + if ret != 0: + print_error("CfgConvert -bin return code == " + str(ret) + ". Usually means there is a syntax error within the config.cpp file.") + os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) + shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) + + cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-txt", "-dst", os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.bin")] + ret = subprocess.call(cmd) + if ret != 0: + print_error("CfgConvert -txt return code == " + str(ret) + ". Usually means there is a syntax error within the config.cpp file.") + os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) + shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) + + + # Include build number + try: + configpath = os.path.join(work_drive, prefix, module, "config.cpp") + f = open(configpath, "r") + configtext = f.read() + f.close() + + if configtext: + patchestext = re.search(r"class CfgPatches\n\{(.*?)\n\}", configtext, re.DOTALL).group(1) + patchestext = re.sub(r'version(.*?)="(.*?)"', r'version\1="\2-{}"'.format(commit_id), patchestext) + configtext = re.sub(r"class CfgPatches\n\{(.*?)\n\}", "class CfgPatches\n{"+patchestext+"\n}", configtext, flags=re.DOTALL) + f = open(configpath, "w") + f.write(configtext) + f.close() + else: + os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) + os.rename(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) + except: + raise + print_error("Failed to include build number") + continue + + if os.path.isfile(os.path.join(work_drive, prefix, module, "$NOBIN$")): + print_green("$NOBIN$ Found. Proceeding with non-binarizing!") + cmd = [makepboTool, "-P","-A","-L","-N","-G", os.path.join(work_drive, prefix, module),os.path.join(module_root, release_dir, project,"addons")] + + else: + if check_external: + cmd = [pboproject, "-P", os.path.join(work_drive, prefix, module), "+Engine=Arma3", "-S","+Noisy", "+X", "+Clean", "+Mod="+os.path.join(module_root, release_dir, project), "-Key"] + else: + cmd = [pboproject, "-P", os.path.join(work_drive, prefix, module), "+Engine=Arma3", "-S","+Noisy", "-X", "+Clean", "+Mod="+os.path.join(module_root, release_dir, project), "-Key"] + + color("grey") + if quiet: + devnull = open(os.devnull, 'w') + ret = subprocess.call(cmd, stdout=devnull) + devnull.close() + else: + ret = subprocess.call(cmd) + color("reset") + + if ret == 0: + print_green("pboProject return code == " + str(ret)) + # Prettyprefix rename the PBO if requested. + if pbo_name_prefix: + try: + os.rename(os.path.join(module_root, release_dir, project, "addons", module+".pbo"), os.path.join(module_root, release_dir, project, "addons", pbo_name_prefix+module+".pbo")) + except: + raise + print_error("Could not rename built PBO with prefix.") + # Sign result + if key: + print("Signing with " + key + ".") + if pbo_name_prefix: + ret = subprocess.call([dssignfile, key, os.path.join(module_root, release_dir, project, "addons", pbo_name_prefix + module + ".pbo")]) + else: + ret = subprocess.call([dssignfile, key, os.path.join(module_root, release_dir, project, "addons", module + ".pbo")]) + + if ret == 0: + build_successful = True + else: + build_successful = True + + if not build_successful: + print_error("pboProject return code == " + str(ret)) + print_error("Module not successfully built/signed.") + print ("Resuming build...") + continue + + #PABST: cleanup config BS (you could comment this out to see the "de-macroed" cpp + #print_green("\Pabst (restoring): " + os.path.join(work_drive, prefix, module, "config.cpp")) + os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) + os.remove(os.path.join(work_drive, prefix, module, "config.bin")) + os.rename(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) + + # Back to the root + os.chdir(module_root) + + except: + raise + print_error("Could not run Addon Builder.") + input("Press Enter to continue...") + print ("Resuming build...") + continue + + elif build_tool== "addonbuilder": + # Detect $NOBIN$ and do not binarize if found. + if os.path.isfile(os.path.join(work_drive, prefix, module, "$NOBIN$")): + do_binarize = False + print("$NOBIN$ file found in module, packing only.") + else: + do_binarize = True + try: + # Call AddonBuilder + os.chdir("P:\\") + + cmd = [addonbuilder, os.path.join(work_drive, prefix, module), os.path.join(make_root, release_dir, project, "addons"), "-clear", "-project="+work_drive] + if not do_binarize: + cmd.append("-packonly") + + if quiet: + previousDirectory = os.getcwd() + os.chdir(arma3tools_path) + devnull = open(os.devnull, 'w') + ret = subprocess.call(cmd, stdout=devnull) + devnull.close() + os.chdir(previousDirectory) + else: + previousDirectory = os.getcwd() + os.chdir(arma3tools_path) + print_error("Current directory - " + os.getcwd()) + ret = subprocess.call(cmd) + os.chdir(previousDirectory) + print_error("Current directory - " + os.getcwd()) + color("reset") + print_green("completed") + # Prettyprefix rename the PBO if requested. + if pbo_name_prefix: + try: + os.rename(os.path.join(make_root, release_dir, project, "addons", module+".pbo"), os.path.join(make_root, release_dir, project, "addons", pbo_name_prefix+module+".pbo")) + except: + raise + print_error("Could not rename built PBO with prefix.") + + if ret == 0: + # Sign result + if key: + print("Signing with " + key + ".") + if pbo_name_prefix: + ret = subprocess.call([dssignfile, key, os.path.join(make_root, release_dir, project, "addons", pbo_name_prefix + module + ".pbo")]) + else: + ret = subprocess.call([dssignfile, key, os.path.join(make_root, release_dir, project, "addons", module + ".pbo")]) + + if ret == 0: + build_successful = True + else: + build_successful = True + + if not build_successful: + print_error("Module not successfully built.") + + # Back to the root + os.chdir(make_root) + + except: + raise + print_error("Could not run Addon Builder.") + input("Press Enter to continue...") + print ("Resuming build...") + continue + + else: + print_error("Unknown build_tool " + build_tool + "!") + + # Update the hash for a successfully built module + if build_successful: + cache[module] = new_sha + + # Done building all modules! + + # Write out the cache state + cache_out = json.dumps(cache) + with open(os.path.join(make_root, "make.cache"), 'w') as f: + f.write(cache_out) + + # Delete the pboproject temp files if building a release. + if make_release and build_tool == "pboproject": + try: + shutil.rmtree(os.path.join(module_root, release_dir, project, "temp"), True) + except: + print_error("ERROR: Could not delete pboProject temp files.") + + copy_important_files(module_root_parent,os.path.join(release_dir, "@ace")) + cleanup_optionals(optionals_modules) + + # Make release + if make_release: + print_blue("\nMaking release: " + project + "-" + release_version + ".zip") + + try: + # Delete all log files + for root, dirs, files in os.walk(os.path.join(module_root, release_dir, project, "addons")): + for currentFile in files: + if currentFile.lower().endswith("log"): + os.remove(os.path.join(root, currentFile)) + + # Create a zip with the contents of release/ in it + shutil.make_archive(project + "-" + release_version, "zip", os.path.join(module_root, release_dir)) + except: + raise + print_error("Could not make release.") + + # Copy to Arma 3 folder for testing + if test: + print_blue("\nCopying to Arma 3.") + + if sys.platform == "win32": + reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) + try: + k = winreg.OpenKey(reg, r"SOFTWARE\Wow6432Node\Bohemia Interactive\Arma 3") + a3_path = winreg.EnumValue(k, 1)[1] + winreg.CloseKey(k) + except: + print_error("Could not find Arma 3's directory in the registry.") + else: + a3_path = cygwin_a3path + + if os.path.exists(a3_path): + try: + shutil.rmtree(os.path.join(a3_path, project), True) + shutil.copytree(os.path.join(module_root, release_dir, project), os.path.join(a3_path, project)) + except: + print_error("Could not copy files. Is Arma 3 running?") + + print_green("\nDone.") + if __name__ == "__main__": - main(sys.argv) + main(sys.argv) input("Press Enter to continue...") diff --git a/tools/make64.py b/tools/make64.py deleted file mode 100644 index b6635f884e..0000000000 --- a/tools/make64.py +++ /dev/null @@ -1,837 +0,0 @@ -#!/usr/bin/env python -# vim: set fileencoding=utf-8 : - -# make.py -# An Arma 3 addon build system - -############################################################################### - -# The MIT License (MIT) - -# Copyright (c) 2013-2014 Ryan Schultz - -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -############################################################################### - -__version__ = "0.3dev" - -import sys - -if sys.version_info[0] == 2: - print("Python 3 is required.") - sys.exit(1) - -import os -import os.path -import shutil -import platform -import glob -import subprocess -import hashlib -import configparser -import json -import traceback -import time -import re - -if sys.platform == "win32": - import winreg - -############################################################################### -# http://akiscode.com/articles/sha-1directoryhash.shtml -# Copyright (c) 2009 Stephen Akiki -# MIT License (Means you can do whatever you want with this) -# See http://www.opensource.org/licenses/mit-license.php -# Error Codes: -# -1 -> Directory does not exist -# -2 -> General error (see stack traceback) -def get_directory_hash(directory): - directory_hash = hashlib.sha1() - if not os.path.exists (directory): - return -1 - - try: - for root, dirs, files in os.walk(directory): - for names in files: - path = os.path.join(root, names) - try: - f = open(path, 'rb') - except: - # You can't open the file for some reason - f.close() - continue - - while 1: - # Read file in as little chunks - buf = f.read(4096) - if not buf: break - new = hashlib.sha1(buf) - directory_hash.update(new.digest()) - f.close() - - except: - # Print the stack traceback - traceback.print_exc() - return -2 - - return directory_hash.hexdigest() - -# Copyright (c) André Burgaud -# http://www.burgaud.com/bring-colors-to-the-windows-console-with-python/ -if sys.platform == "win32": - from ctypes import windll, Structure, c_short, c_ushort, byref - - SHORT = c_short - WORD = c_ushort - - class COORD(Structure): - """struct in wincon.h.""" - _fields_ = [ - ("X", SHORT), - ("Y", SHORT)] - - class SMALL_RECT(Structure): - """struct in wincon.h.""" - _fields_ = [ - ("Left", SHORT), - ("Top", SHORT), - ("Right", SHORT), - ("Bottom", SHORT)] - - class CONSOLE_SCREEN_BUFFER_INFO(Structure): - """struct in wincon.h.""" - _fields_ = [ - ("dwSize", COORD), - ("dwCursorPosition", COORD), - ("wAttributes", WORD), - ("srWindow", SMALL_RECT), - ("dwMaximumWindowSize", COORD)] - - # winbase.h - STD_INPUT_HANDLE = -10 - STD_OUTPUT_HANDLE = -11 - STD_ERROR_HANDLE = -12 - - # wincon.h - FOREGROUND_BLACK = 0x0000 - FOREGROUND_BLUE = 0x0001 - FOREGROUND_GREEN = 0x0002 - FOREGROUND_CYAN = 0x0003 - FOREGROUND_RED = 0x0004 - FOREGROUND_MAGENTA = 0x0005 - FOREGROUND_YELLOW = 0x0006 - FOREGROUND_GREY = 0x0007 - FOREGROUND_INTENSITY = 0x0008 # foreground color is intensified. - - BACKGROUND_BLACK = 0x0000 - BACKGROUND_BLUE = 0x0010 - BACKGROUND_GREEN = 0x0020 - BACKGROUND_CYAN = 0x0030 - BACKGROUND_RED = 0x0040 - BACKGROUND_MAGENTA = 0x0050 - BACKGROUND_YELLOW = 0x0060 - BACKGROUND_GREY = 0x0070 - BACKGROUND_INTENSITY = 0x0080 # background color is intensified. - - stdout_handle = windll.kernel32.GetStdHandle(STD_OUTPUT_HANDLE) - SetConsoleTextAttribute = windll.kernel32.SetConsoleTextAttribute - GetConsoleScreenBufferInfo = windll.kernel32.GetConsoleScreenBufferInfo - - def get_text_attr(): - """Returns the character attributes (colors) of the console screen - buffer.""" - csbi = CONSOLE_SCREEN_BUFFER_INFO() - GetConsoleScreenBufferInfo(stdout_handle, byref(csbi)) - return csbi.wAttributes - - def set_text_attr(color): - """Sets the character attributes (colors) of the console screen - buffer. Color is a combination of foreground and background color, - foreground and background intensity.""" - SetConsoleTextAttribute(stdout_handle, color) -############################################################################### - -def find_bi_tools(work_drive): - """Find BI tools.""" - - reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) - try: - k = winreg.OpenKey(reg, r"Software\bohemia interactive\arma 3 tools") - arma3tools_path = winreg.QueryValueEx(k, "path")[0] - winreg.CloseKey(k) - except: - raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") - - addonbuilder_path = os.path.join(arma3tools_path, "AddonBuilder", "AddonBuilder.exe") - dssignfile_path = os.path.join(arma3tools_path, "DSSignFile", "DSSignFile.exe") - dscreatekey_path = os.path.join(arma3tools_path, "DSSignFile", "DSCreateKey.exe") - cfgconvert_path = os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe") - - if os.path.isfile(addonbuilder_path) and os.path.isfile(dssignfile_path) and os.path.isfile(dscreatekey_path) and os.path.isfile(cfgconvert_path): - return [addonbuilder_path, dssignfile_path, dscreatekey_path, cfgconvert_path] - else: - raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") - -def find_depbo_tools(regKey): - """Use registry entries to find DePBO-based tools.""" - stop = False - - if regKey == "HKCU": - reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) - stop = True - else: - reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) - - try: - k = winreg.OpenKey(reg, r"Software\Wow6432Node\Mikero\pboProject") - try: - pboproject_path = winreg.QueryValueEx(k, "exe")[0] - winreg.CloseKey(k) - print("Found pboproject.") - except: - print_error("ERROR: Could not find pboProject.") - - k = winreg.OpenKey(reg, r"Software\Wow6432Node\Mikero\rapify") - try: - rapify_path = winreg.QueryValueEx(k, "exe")[0] - winreg.CloseKey(k) - print("Found rapify.") - except: - print_error("Could not find rapify.") - - k = winreg.OpenKey(reg, r"Software\Wow6432Node\Mikero\MakePbo") - try: - makepbo_path = winreg.QueryValueEx(k, "exe")[0] - winreg.CloseKey(k) - print("Found makepbo.") - except: - print_error("Could not find makepbo.") - except: - if stop == True: - raise Exception("BadDePBO", "DePBO tools not installed correctly") - return -1 - - - #Strip any quotations from the path due to a MikeRo tool bug which leaves a trailing space in some of its registry paths. - return [pboproject_path.strip('"'),rapify_path.strip('"'),makepbo_path.strip('"')] - -def color(color): - """Set the color. Works on Win32 and normal terminals.""" - if sys.platform == "win32": - if color == "green": - set_text_attr(FOREGROUND_GREEN | get_text_attr() & 0x0070 | FOREGROUND_INTENSITY) - elif color == "red": - set_text_attr(FOREGROUND_RED | get_text_attr() & 0x0070 | FOREGROUND_INTENSITY) - elif color == "blue": - set_text_attr(FOREGROUND_BLUE | get_text_attr() & 0x0070 | FOREGROUND_INTENSITY) - elif color == "reset": - set_text_attr(FOREGROUND_GREY | get_text_attr() & 0x0070) - elif color == "grey": - set_text_attr(FOREGROUND_GREY | get_text_attr() & 0x0070) - else : - if color == "green": - sys.stdout.write('\033[92m') - elif color == "red": - sys.stdout.write('\033[91m') - elif color == "blue": - sys.stdout.write('\033[94m') - elif color == "reset": - sys.stdout.write('\033[0m') - -def print_error(msg): - color("red") - print ("ERROR: " + msg) - color("reset") - -def print_green(msg): - color("green") - print(msg) - color("reset") - -def print_blue(msg): - color("blue") - print(msg) - color("reset") - -def print_yellow(msg): - color("yellow") - print(msg) - color("reset") - -############################################################################### - -def main(argv): - """Build an Arma addon suite in a directory from rules in a make.cfg file.""" - print_blue(("\nmake.py for Arma, v" + __version__)) - - if sys.platform != "win32": - print_error("Non-Windows platform (Cygwin?). Please re-run from cmd.") - sys.exit(1) - - reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) - try: - k = winreg.OpenKey(reg, r"Software\bohemia interactive\arma 3 tools") - arma3tools_path = winreg.QueryValueEx(k, "path")[0] - winreg.CloseKey(k) - except: - raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") - - # Default behaviors - test = False # Copy to Arma 3 directory? - arg_modules = False # Only build modules on command line? - make_release = False # Make zip file from the release? - release_version = 0 # Version of release - use_pboproject = True # Default to pboProject build tool - make_target = "DEFAULT" # Which section in make.cfg to use for the build - new_key = False # Make a new key and use it to sign? - quiet = False # Suppress output from build tool? - - # Parse arguments - if "help" in argv or "-h" in argv or "--help" in argv: - print (""" -make.py [help] [test] [force] [key ] [target ] [release ] - [module name] [module name] [...] - -test -- Copy result to Arma 3. -release -- Make archive with . -force -- Ignore cache and build all. -target -- Use rules in make.cfg under heading [] rather than - default [Make] -key -- Use key in working directory with to sign. If it does not - exist, create key. -quiet -- Suppress command line output from build tool. - -If module names are specified, only those modules will be built. - -Examples: - make.py force test - Build all modules (ignoring cache) and copy the mod folder to the Arma 3 - directory. - make.py mymodule_gun - Only build the module named 'mymodule_gun'. - make.py force key MyNewKey release 1.0 - Build all modules (ignoring cache), sign them with NewKey, and pack them - into a zip file for release with version 1.0. - - -If a file called $NOBIN$ is found in the module directory, that module will not be binarized. - -See the make.cfg file for additional build options. -""") - sys.exit(0) - - if "force" in argv: - argv.remove("force") - force_build = True - else: - force_build = False - - if "test" in argv: - test = True - argv.remove("test") - - if "release" in argv: - make_release = True - release_version = argv[argv.index("release") + 1] - argv.remove(release_version) - argv.remove("release") - - if "target" in argv: - make_target = argv[argv.index("target") + 1] - argv.remove("target") - argv.remove(make_target) - force_build = True - - if "key" in argv: - new_key = True - key_name = argv[argv.index("key") + 1] - argv.remove("key") - argv.remove(key_name) - - if "quiet" in argv: - quiet = True - argv.remove("quiet") - - # Get the directory the make script is in. - make_root = os.path.dirname(os.path.realpath(__file__)) - make_root_parent = os.path.abspath(os.path.join(os.getcwd(), os.pardir)) - os.chdir(make_root) - - # Get latest commit ID - try: - gitpath = os.path.join(os.path.dirname(make_root), ".git") - assert os.path.exists(gitpath) - - commit_id = subprocess.check_output(["git", "rev-parse", "HEAD"]) - commit_id = str(commit_id, "utf-8")[:8] - except: - print_error("FAILED TO DETERMINE COMMIT ID.") - commit_id = "NOGIT" - - cfg = configparser.ConfigParser(); - try: - cfg.read(os.path.join(make_root, "make.cfg")) - - # Project name (with @ symbol) - project = cfg.get(make_target, "project", fallback="@"+os.path.basename(os.getcwd())) - - # Private key path - key = cfg.get(make_target, "key", fallback=None) - - # Project prefix (folder path) - prefix = cfg.get(make_target, "prefix", fallback="") - - # Should we autodetect modules on a complete build? - module_autodetect = cfg.getboolean(make_target, "module_autodetect", fallback=True) - - # Manual list of modules to build for a complete build - modules = cfg.get(make_target, "modules", fallback=None) - # Parse it out - if modules: - modules = [x.strip() for x in modules.split(',')] - else: - modules = [] - - # List of directories to ignore when detecting - ignore = [x.strip() for x in cfg.get(make_target, "ignore", fallback="release").split(',')] - - # BI Tools work drive on Windows - work_drive = cfg.get(make_target, "work_drive", fallback="P:\\") - - # Which build tool should we use? - build_tool = cfg.get(make_target, "build_tool", fallback="addonbuilder").lower() - - # Release/build directory, relative to script dir - release_dir = cfg.get(make_target, "release_dir", fallback="release") - - # Project PBO file prefix (files are renamed to prefix_name.pbo) - pbo_name_prefix = cfg.get(make_target, "pbo_name_prefix", fallback=None) - - # Project module Root - module_root_parent = os.path.abspath(os.path.join(os.path.join(work_drive, prefix), os.pardir)) - module_root = cfg.get(make_target, "module_root", fallback=os.path.join(make_root_parent, "addons")) - print_green ("module_root: " + module_root) - if (os.path.isdir(module_root)): - os.chdir(module_root) - else: - print_error ("Directory " + module_root + " does not exist.") - sys.exit() - - except: - raise - print_error("Could not parse make.cfg.") - sys.exit(1) - - - - # See if we have been given specific modules to build from command line. - if len(argv) > 1 and not make_release: - arg_modules = True - modules = argv[1:] - - # Find the tools we need. - try: - tools = find_bi_tools(work_drive) - addonbuilder = tools[0] - dssignfile = tools[1] - dscreatekey = tools[2] - cfgconvert = tools[3] - - except: - print_error("Arma 3 Tools are not installed correctly or the P: drive has not been created.") - sys.exit(1) - - if build_tool == "pboproject": - try: - depbo_tools = find_depbo_tools("HKLM") - if depbo_tools == -1: - depbo_tools = find_depbo_tools("HKCU") - pboproject = depbo_tools[0] - rapifyTool = depbo_tools[1] - makepboTool = depbo_tools[2] - except: - raise - print_error("Could not find dePBO tools. Download the needed tools from: https://dev.withsix.com/projects/mikero-pbodll/files") - sys.exit(1) - - # Try to open and deserialize build cache file. - try: - cache = {} - with open(os.path.join(make_root, "make.cache"), 'r') as f: - cache_raw = f.read() - - cache = json.loads(cache_raw) - - except: - print ("No cache found.") - cache = {} - - # Get list of subdirs in make root. - dirs = next(os.walk(module_root))[1] - - # Autodetect what directories to build. - if module_autodetect and not arg_modules: - modules = [] - for path in dirs: - # Any dir that has a config.cpp in its root is an addon to build. - config_path = os.path.join(path, 'config.cpp') - if os.path.isfile(config_path) and not path in ignore: - modules.append(path) - - # Make the key specified from command line if necessary. - if new_key: - if not os.path.isfile(os.path.join(module_root, key_name + ".biprivatekey")): - print_green("\nRequested key does not exist.") - ret = subprocess.call([dscreatekey, key_name]) # Created in make_root - if ret == 0: - print_blue("Created: " + os.path.join(module_root, key_name + ".biprivatekey")) - else: - print_error("Failed to create key!") - - try: - print_blue("Copying public key to release directory.") - - try: - os.makedirs(os.path.join(module_root, release_dir, "Keys")) - except: - pass - - shutil.copyfile(os.path.join(module_root, key_name + ".bikey"), os.path.join(module_root, release_dir, "Keys", key_name + ".bikey")) - - except: - raise - print_error("Could not copy key to release directory.") - - else: - print_green("\nNOTE: Using key " + os.path.join(module_root, key_name + ".biprivatekey")) - - key = os.path.join(module_root, key_name + ".biprivatekey") - - - # For each module, prep files and then build. - for module in modules: - print_green("\nMaking " + module + "-"*max(1, (60-len(module)))) - - # Cache check - if module in cache: - old_sha = cache[module] - else: - old_sha = "" - - #We always build ACE_common so we can properly show the correct version stamp in the RPT file. - if module == "common": - old_sha = "" - - # Hash the module - new_sha = get_directory_hash(os.path.join(module_root, module)) - - # Check if it needs rebuilt - # print ("Hash:", new_sha) - if old_sha == new_sha: - if not force_build: - print("Module has not changed.") - # Skip everything else - continue - - # Only do this if the project isn't stored directly on the work drive. - # Split the path at the drive name and see if they are on the same drive (usually P:) - if os.path.splitdrive(module_root)[0] != os.path.splitdrive(work_drive)[0]: - try: - # Remove old work drive version (ignore errors) - shutil.rmtree(os.path.join(work_drive, prefix, module), True) - - # Copy module to the work drive - shutil.copytree(module, os.path.join(work_drive, prefix, module)) - - except: - raise - print_error("ERROR: Could not copy module to work drive. Does the module exist?") - input("Press Enter to continue...") - print("Resuming build...") - continue - #else: - #print("WARNING: Module is stored on work drive (" + work_drive + ").") - - try: - # Remove the old pbo, key, and log - old = os.path.join(module_root, release_dir, project, "Addons", module) + "*" - files = glob.glob(old) - for f in files: - os.remove(f) - - if pbo_name_prefix: - old = os.path.join(module_root, release_dir, project, "Addons", pbo_name_prefix+module) + "*" - files = glob.glob(old) - for f in files: - os.remove(f) - except: - raise - print_error("ERROR: Could not copy module to work drive. Does the module exist?") - input("Press Enter to continue...") - print("Resuming build...") - continue - - # Build the module into a pbo - print_blue("Building: " + os.path.join(work_drive, prefix, module)) - print_blue("Destination: " + os.path.join(module_root, release_dir, project, "Addons")) - - # Make destination folder (if needed) - try: - os.makedirs(os.path.join(module_root, release_dir, project, "Addons")) - except: - pass - - # Run build tool - build_successful = False - if build_tool == "pboproject": - try: - #PABST: Convert config (run the macro'd config.cpp through CfgConvert twice to produce a de-macro'd cpp that pboProject can read without fucking up: - shutil.copyfile(os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.backup")) - - os.chdir("P:\\") - - cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-bin", "-dst", os.path.join(work_drive, prefix, module, "config.bin"), os.path.join(work_drive, prefix, module, "config.cpp")] - ret = subprocess.call(cmd) - if ret != 0: - print_error("CfgConvert -bin return code == " + str(ret) + ". Usually means there is a syntax error within the config.cpp file.") - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - - cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-txt", "-dst", os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.bin")] - ret = subprocess.call(cmd) - if ret != 0: - print_error("CfgConvert -txt return code == " + str(ret) + ". Usually means there is a syntax error within the config.cpp file.") - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - - - # Include build number - try: - configpath = os.path.join(work_drive, prefix, module, "config.cpp") - f = open(configpath, "r") - configtext = f.read() - f.close() - - if configtext: - patchestext = re.search(r"class CfgPatches\n\{(.*?)\n\}", configtext, re.DOTALL).group(1) - patchestext = re.sub(r'version(.*?)="(.*?)"', r'version\1="\2-{}"'.format(commit_id), patchestext) - configtext = re.sub(r"class CfgPatches\n\{(.*?)\n\}", "class CfgPatches\n{"+patchestext+"\n}", configtext, flags=re.DOTALL) - f = open(configpath, "w") - f.write(configtext) - f.close() - else: - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - os.rename(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - except: - raise - print_error("Failed to include build number") - continue - - if os.path.isfile(os.path.join(work_drive, prefix, module, "$NOBIN$")): - print_green("$NOBIN$ Found. Proceeding with non-binarizing!") - cmd = [makepboTool, "-P","-A","-L","-N","-G", os.path.join(work_drive, prefix, module),os.path.join(module_root, release_dir, project,"Addons")] - - else: - cmd = [pboproject, "-P", os.path.join(work_drive, prefix, module), "+Engine=Arma3", "-S","+Noisy", "+X", "+Clean", "+Mod="+os.path.join(module_root, release_dir, project), "-Key"] - - color("grey") - if quiet: - devnull = open(os.devnull, 'w') - ret = subprocess.call(cmd, stdout=devnull) - devnull.close() - else: - ret = subprocess.call(cmd) - color("reset") - - if ret == 0: - print_green("pboProject return code == " + str(ret)) - # Prettyprefix rename the PBO if requested. - if pbo_name_prefix: - try: - os.rename(os.path.join(module_root, release_dir, project, "Addons", module+".pbo"), os.path.join(module_root, release_dir, project, "Addons", pbo_name_prefix+module+".pbo")) - except: - raise - print_error("Could not rename built PBO with prefix.") - # Sign result - if key: - print("Signing with " + key + ".") - if pbo_name_prefix: - ret = subprocess.call([dssignfile, key, os.path.join(module_root, release_dir, project, "Addons", pbo_name_prefix + module + ".pbo")]) - else: - ret = subprocess.call([dssignfile, key, os.path.join(module_root, release_dir, project, "Addons", module + ".pbo")]) - - if ret == 0: - build_successful = True - else: - build_successful = True - - if not build_successful: - print_error("pboProject return code == " + str(ret)) - print_error("Module not successfully built/signed.") - print ("Resuming build...") - continue - - #PABST: cleanup config BS (you could comment this out to see the "de-macroed" cpp - #print_green("\Pabst (restoring): " + os.path.join(work_drive, prefix, module, "config.cpp")) - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - os.remove(os.path.join(work_drive, prefix, module, "config.bin")) - os.rename(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - - # Back to the root - os.chdir(module_root) - - except: - raise - print_error("Could not run Addon Builder.") - input("Press Enter to continue...") - print ("Resuming build...") - continue - - elif build_tool== "addonbuilder": - # Detect $NOBIN$ and do not binarize if found. - if os.path.isfile(os.path.join(work_drive, prefix, module, "$NOBIN$")): - do_binarize = False - print("$NOBIN$ file found in module, packing only.") - else: - do_binarize = True - try: - # Call AddonBuilder - os.chdir("P:\\") - - cmd = [addonbuilder, os.path.join(work_drive, prefix, module), os.path.join(make_root, release_dir, project, "Addons"), "-clear", "-project="+work_drive] - if not do_binarize: - cmd.append("-packonly") - - if quiet: - previousDirectory = os.getcwd() - os.chdir(arma3tools_path) - devnull = open(os.devnull, 'w') - ret = subprocess.call(cmd, stdout=devnull) - devnull.close() - os.chdir(previousDirectory) - else: - previousDirectory = os.getcwd() - os.chdir(arma3tools_path) - print_error("Current directory - " + os.getcwd()) - ret = subprocess.call(cmd) - os.chdir(previousDirectory) - print_error("Current directory - " + os.getcwd()) - color("reset") - print_green("completed") - # Prettyprefix rename the PBO if requested. - if pbo_name_prefix: - try: - os.rename(os.path.join(make_root, release_dir, project, "Addons", module+".pbo"), os.path.join(make_root, release_dir, project, "Addons", pbo_name_prefix+module+".pbo")) - except: - raise - print_error("Could not rename built PBO with prefix.") - - if ret == 0: - # Sign result - if key: - print("Signing with " + key + ".") - if pbo_name_prefix: - ret = subprocess.call([dssignfile, key, os.path.join(make_root, release_dir, project, "Addons", pbo_name_prefix + module + ".pbo")]) - else: - ret = subprocess.call([dssignfile, key, os.path.join(make_root, release_dir, project, "Addons", module + ".pbo")]) - - if ret == 0: - build_successful = True - else: - build_successful = True - - if not build_successful: - print_error("Module not successfully built.") - - # Back to the root - os.chdir(make_root) - - except: - raise - print_error("Could not run Addon Builder.") - input("Press Enter to continue...") - print ("Resuming build...") - continue - - else: - print_error("Unknown build_tool " + build_tool + "!") - - # Update the hash for a successfully built module - if build_successful: - cache[module] = new_sha - - # Done building all modules! - - # Write out the cache state - cache_out = json.dumps(cache) - with open(os.path.join(make_root, "make.cache"), 'w') as f: - f.write(cache_out) - - # Delete the pboproject temp files if building a release. - if make_release and build_tool == "pboproject": - try: - shutil.rmtree(os.path.join(module_root, release_dir, project, "temp"), True) - except: - print_error("ERROR: Could not delete pboProject temp files.") - - print_green("\nDone.") - - # Make release - if make_release: - print_blue("\nMaking release: " + project + "-" + release_version + ".zip") - - try: - # Delete all log files - for root, dirs, files in os.walk(os.path.join(module_root, release_dir, project, "Addons")): - for currentFile in files: - if currentFile.lower().endswith("log"): - os.remove(os.path.join(root, currentFile)) - - # Create a zip with the contents of release/ in it - shutil.make_archive(project + "-" + release_version, "zip", os.path.join(module_root, release_dir)) - except: - raise - print_error("Could not make release.") - - # Copy to Arma 3 folder for testing - if test: - print_blue("\nCopying to Arma 3.") - - if sys.platform == "win32": - reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) - try: - k = winreg.OpenKey(reg, r"SOFTWARE\Wow6432Node\Bohemia Interactive\Arma 3") - a3_path = winreg.EnumValue(k, 1)[1] - winreg.CloseKey(k) - except: - print_error("Could not find Arma 3's directory in the registry.") - else: - a3_path = cygwin_a3path - - if os.path.exists(a3_path): - try: - shutil.rmtree(os.path.join(a3_path, project), True) - shutil.copytree(os.path.join(module_root, release_dir, project), os.path.join(a3_path, project)) - except: - print_error("Could not copy files. Is Arma 3 running?") - -if __name__ == "__main__": - main(sys.argv) -input("Press Enter to continue...") diff --git a/tools/search_privates.py b/tools/search_privates.py new file mode 100644 index 0000000000..37320214fc --- /dev/null +++ b/tools/search_privates.py @@ -0,0 +1,129 @@ +#!/usr/bin/env python3 + +import fnmatch +import os +import re +import ntpath +import sys +import argparse + +def get_private_declare(content): + priv_declared = [] + + srch = re.compile('private.*') + priv_srch_declared = srch.findall(content) + priv_srch_declared = sorted(set(priv_srch_declared)) + + priv_dec_str = ''.join(priv_srch_declared) + + srch = re.compile('(? 0: + print (filepath) + + private_output = 'private['; + first = True + for bad_priv in missing: + if first: + first = False + private_output = private_output + '"' + bad_priv + else: + private_output = private_output + '", "' + bad_priv + + private_output = private_output + '"];'; + print (private_output) + + for bad_priv in missing: + print ('\t' + bad_priv) + bad_count_file = bad_count_file + 1 + + + + return bad_count_file + +def main(): + + print("#########################") + print("# Search your Privates #") + print("#########################") + + sqf_list = [] + bad_count = 0 + + parser = argparse.ArgumentParser() + parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default=".") + args = parser.parse_args() + + for root, dirnames, filenames in os.walk('../addons' + '/' + args.module): + for filename in fnmatch.filter(filenames, '*.sqf'): + sqf_list.append(os.path.join(root, filename)) + + for filename in sqf_list: + bad_count = bad_count + check_privates(filename) + + + print ("Bad Count {0}".format(bad_count)) + +if __name__ == "__main__": + main() diff --git a/tools/search_unused_privates.py b/tools/search_unused_privates.py new file mode 100644 index 0000000000..b9bdd880ce --- /dev/null +++ b/tools/search_unused_privates.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python3 + +import fnmatch +import os +import re +import ntpath +import sys +import argparse + +def get_private_declare(content): + priv_declared = [] + + srch = re.compile('private.*') + priv_srch_declared = srch.findall(content) + priv_srch_declared = sorted(set(priv_srch_declared)) + + priv_dec_str = ''.join(priv_srch_declared) + + srch = re.compile('(? 0: + print (filepath) + + private_output = 'private['; + first = True + for bad_priv in unused: + if first: + first = False + private_output = private_output + '"' + bad_priv + else: + private_output = private_output + '", "' + bad_priv + + private_output = private_output + '"];'; + print (private_output) + + for bad_priv in unused: + print ('\t' + bad_priv) + bad_count_file = bad_count_file + 1 + + + + return bad_count_file + +def main(): + + print("#########################") + print("# Search your Privates #") + print("#########################") + + sqf_list = [] + bad_count = 0 + + parser = argparse.ArgumentParser() + parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default=".") + args = parser.parse_args() + + for root, dirnames, filenames in os.walk('../addons' + '/' + args.module): + for filename in fnmatch.filter(filenames, '*.sqf'): + sqf_list.append(os.path.join(root, filename)) + + for filename in sqf_list: + bad_count = bad_count + check_privates(filename) + + + print ("Bad Count {0}".format(bad_count)) + +if __name__ == "__main__": + main() diff --git a/tools/stringtableduplicates.py b/tools/stringtableduplicates.py index 16b2763853..49f5bcb743 100755 --- a/tools/stringtableduplicates.py +++ b/tools/stringtableduplicates.py @@ -2,55 +2,59 @@ import os import sys + +import xml.dom from xml.dom import minidom -# STRINGTABLE DUPLICATE FINDER +# STRINGTABLE DIAG TOOL # Author: KoffeinFlummi -# ---------------------------- -# Counts duplicate stringtable entries +# --------------------- +# Counts duplicates stringtable entries + + +def check_module(projectpath, module): + """ Checks the given module for all the different languages. """ + localized = [] + + stringtablepath = os.path.join(projectpath, module, "stringtable.xml") + try: + xmldoc = minidom.parse(stringtablepath) + except IOError: + return 0 + keys = xmldoc.getElementsByTagName("Key") + + duplicates = 0 + for key in keys: + children = key.childNodes + entries = [] + for c in range(children.length): + entries.append(children.item(c)) + entries = list(filter(lambda x: x.nodeType == x.ELEMENT_NODE, entries)) + entries = list(map(lambda x: str(x.nodeName).lower(), entries)) + diff = len(entries) - len(list(set(entries))) + duplicates += diff + if diff > 0: + print(key.getAttribute("ID")) + + return duplicates def main(): scriptpath = os.path.realpath(__file__) projectpath = os.path.dirname(os.path.dirname(scriptpath)) projectpath = os.path.join(projectpath, "addons") - entries = {} + print("###############################") + print("# Stringtable Duplicates Tool #") + print("###############################\n") + duplicates = 0 for module in os.listdir(projectpath): - if module[0] == ".": - continue - stringtablepath = os.path.join(projectpath, module, "stringtable.xml") - try: - xmldoc = minidom.parse(stringtablepath) - except: - continue + d = check_module(projectpath, module) - keys = xmldoc.getElementsByTagName("English") - for key in keys: - text = key.firstChild.wholeText - parentid = key.parentNode.getAttribute("ID") - if text in entries: - entries[text].append(parentid) - else: - entries[text] = [parentid] + print("# {} {}".format(module.ljust(20), d)) + duplicates += d - entries = {k: v for k, v in entries.items() if len(v) > 1} - output = list([[k, v] for k, v in entries.items()]) - output = sorted(output, key=lambda x: len(x[1])*-1) - - print("Potential duplicate stringtable entries:\n") - for l in output: - k, v = l - print(k.ljust(50), end=" ") - print("Listed %i times in: %s" % (len(v), ", ".join(v))) - - print("\n# MARKDOWN\n") - - print("| Text | # Occurences | Containing Entries |") - print("|------|-------------:|--------------------|") - - for l in output: - print("| %s | %i | %s |" % (l[0], len(l[1]), ", ".join(l[1]))) + print("\nTotal number of duplicates: {}".format(duplicates)) if __name__ == "__main__": main()