diff --git a/AUTHORS.txt b/AUTHORS.txt index 62329d7c1d..80046475ff 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -1,4 +1,4 @@ -# ACE 3 CONTRIBUTOR LIST +# ACE3 CONTRIBUTOR LIST # If you contributed, but are not listed here, contact me: # koffeinflummi@gmail.com # @@ -14,6 +14,7 @@ Garth "L-H" de Wet Giallustio Glowbal Janus +jokoho482 ` Kieran NouberNou PabstMirror @@ -50,6 +51,7 @@ Coren Crusty Dharma Bellamkonda Dimaslg +Drill eRazeri evromalarkey F3 Project @@ -68,8 +70,7 @@ Hamburger SV Harakhti havena Hawkins -Head -jokoho482 ` +Head Jonpas Karneck Kavinsky @@ -81,6 +82,7 @@ Macusercom MarcBook meat Michail Nikolaev +MikeMatrix nic547 nikolauska nomisum @@ -106,5 +108,3 @@ Valentin Torikian VyMajoris(W-Cephei) Winter zGuba -Drill -MikeMatrix diff --git a/README.md b/README.md index 2739ce55be..755eaceb30 100644 --- a/README.md +++ b/README.md @@ -3,75 +3,75 @@

- ACE3 version + ACE3 Version - ACE3 download + ACE3 Download - ACE3 issues + ACE3 Issues - - BIF thread + + BIF Thread - ACE3 license + ACE3 License

-

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

+

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. 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**, 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. +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 ACE3 by simply excluding any components they don't need, or those possibly in conflict with other mods. Modules themselves, e.g. the medical system, also include various customization options, allowing mission designers to tweak the overall experience. ### 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 +- 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 #### 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
+- 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) +- [Getting started](http://ace3mod.com/wiki/user/getting-started.html) #### Contributing -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. +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 ACE3, 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. 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) +- [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 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. +- [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 ACE3 for testing purposes. diff --git a/addons/advanced_ballistics/XEH_postInit.sqf b/addons/advanced_ballistics/XEH_postInit.sqf index b199acb9e5..1f9002e606 100644 --- a/addons/advanced_ballistics/XEH_postInit.sqf +++ b/addons/advanced_ballistics/XEH_postInit.sqf @@ -6,9 +6,8 @@ GVAR(currentbulletID) = -1; GVAR(Protractor) = false; GVAR(ProtractorStart) = ACE_time; - +GVAR(allBullets) = []; GVAR(currentGrid) = 0; -GVAR(initMessageEnabled) = false; GVAR(extensionAvailable) = true; /* @TODO: Remove this until versioning is in sync with cmake/build versioning diff --git a/addons/advanced_ballistics/XEH_preInit.sqf b/addons/advanced_ballistics/XEH_preInit.sqf index 12018ad412..f722d9c573 100644 --- a/addons/advanced_ballistics/XEH_preInit.sqf +++ b/addons/advanced_ballistics/XEH_preInit.sqf @@ -13,5 +13,5 @@ PREP(initializeTerrainExtension); PREP(initModuleSettings); PREP(readAmmoDataFromConfig); PREP(readWeaponDataFromConfig); - +PREP(handleFirePFH); ADDON = true; diff --git a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf index 28df9d1d97..8b0c78e86c 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf @@ -8,29 +8,29 @@ * 1: temperature - degrees celcius * * Return Value: - * 0: muzzle velocity shift - m/s + * muzzle velocity shift - m/s * - * Return value: - * None + * Public: No */ #include "script_component.hpp" -private ["_muzzleVelocityShiftTable", "_temperature", "_muzzleVelocityShift", "_temperatureIndexA", "_temperatureIndexB", "_temperatureRatio"]; -_muzzleVelocityShiftTable = _this select 0; -_temperature = _this select 1; +private ["_muzzleVelocityShiftTableUpperLimit", "_temperatureIndexFunction", + "_temperatureIndexA", "_temperatureIndexB", "_interpolationRatio"]; +params["_muzzleVelocityShiftTable", "_temperature"]; -if (count _muzzleVelocityShiftTable != 11) exitWith { 0 }; +// Check if muzzleVelocityShiftTable is Larger Than 11 Entrys +_muzzleVelocityShiftTableUpperLimit = _muzzleVelocityShiftTable select 10; +if (isNil "_muzzleVelocityShiftTableUpperLimit") exitWith { 0 }; -_temperatureIndexA = floor((_temperature + 15) / 5); -_temperatureIndexA = 0 max _temperatureIndexA; -_temperatureIndexA = _temperatureIndexA min 10; +// Find exact data index required for given temperature +_temperatureIndexFunction = (_temperature + 15) / 5; -_temperatureIndexB = ceil((_temperature + 15) / 5); -_temperatureIndexB = 0 max _temperatureIndexB; -_temperatureIndexB = _temperatureIndexB min 10; +// lower and upper data index used for interpolation +_temperatureIndexA = (0 max (floor(_temperatureIndexFunction))) min 10; +_temperatureIndexB = (0 max (ceil(_temperatureIndexFunction))) min 10; -_temperatureRatio = ((_temperature + 15) / 5) - floor((_temperature + 15) / 5); +// Interpolation ratio +_interpolationRatio = _temperatureIndexFunction - floor(_temperatureIndexFunction); -_muzzleVelocityShift = (_muzzleVelocityShiftTable select _temperatureIndexA) * (1 - _temperatureRatio) + (_muzzleVelocityShiftTable select _temperatureIndexB) * _temperatureRatio; - -_muzzleVelocityShift +// Interpolation +(_muzzleVelocityShiftTable select _temperatureIndexA) * (1 - _interpolationRatio) + (_muzzleVelocityShiftTable select _temperatureIndexB) * _interpolationRatio // Return diff --git a/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf b/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf index b0166109f5..fac048c061 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf @@ -17,12 +17,9 @@ */ #include "script_component.hpp" -private ["_ballisticCoefficient", "_temperature", "_pressure", "_relativeHumidity", "_atmosphereModel", "_airDensity"]; -_ballisticCoefficient = _this select 0; -_temperature = _this select 1; // in C -_pressure = _this select 2; // in hPa -_relativeHumidity = _this select 3; // as ratio 0-1 -_atmosphereModel = _this select 4; // "ICAO" or "ASM" +private "_airDensity"; + +params ["_ballisticCoefficient", "_temperature"/*in C*/, "_pressure"/*in hPa*/, "_relativeHumidity"/*as ratio 0-1*/, "_atmosphereModel"/*"ICAO" or "ASM"*/]; _airDensity = [_temperature, _pressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); diff --git a/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf b/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf index de037f49bc..9c46cc2423 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf @@ -1,5 +1,5 @@ /* - * Author: Ruthberg + * Author: Ruthberg, MikeMatrix, joko // Jonas * * Calculates the muzzle velocity shift caused by different barrel lengths * @@ -10,46 +10,61 @@ * 3: muzzle velocity - m/s * * Return Value: - * 0: muzzle velocity shift - m/s + * muzzle velocity shift - m/s * - * Return value: - * None + * Public: No */ #include "script_component.hpp" -private ["_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity", "_lowerIndex", "_upperIndex", "_barrelLengthRatio", "_muzzleVelocityNew"]; -_barrelLength = _this select 0; -_muzzleVelocityTable = _this select 1; -_barrelLengthTable = _this select 2; -_muzzleVelocity = _this select 3; +scopeName "main"; +private ["_muzzleVelocityTableCount", "_barrelLengthTableCount", "_lowerDataIndex", + "_upperDataIndex", "_lowerBarrelLength", "_upperBarrelLength", "_lowerMuzzleVelocity", + "_upperMuzzleVelocity", "_interpolationRatio"]; +params ["_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity"]; + +// If barrel length is not defined, then there is no point in calculating muzzle velocity if (_barrelLength == 0) exitWith { 0 }; -if (count _muzzleVelocityTable != count _barrelLengthTable) exitWith { 0 }; -if (count _muzzleVelocityTable == 0 || count _barrelLengthTable == 0) exitWith { 0 }; -if (count _muzzleVelocityTable == 1) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity }; -_lowerIndex = 0; -_upperIndex = (count _barrelLengthTable) - 1; +_muzzleVelocityTableCount = count _muzzleVelocityTable; +_barrelLengthTableCount = count _barrelLengthTable; -if (_barrelLength <= (_barrelLengthTable select _lowerIndex)) exitWith { (_muzzleVelocityTable select _lowerIndex) - _muzzleVelocity }; -if (_barrelLength >= (_barrelLengthTable select _upperIndex)) exitWith { (_muzzleVelocityTable select _upperIndex) - _muzzleVelocity }; +// Exit if tables are different sizes, have no elements or have only one element +if (_muzzleVelocityTableCount != _barrelLengthTableCount || _muzzleVelocityTableCount == 0 || _barrelLengthTableCount == 0) exitWith { 0 }; +if (_muzzleVelocityTableCount == 1) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity }; -for "_i" from 0 to (count _barrelLengthTable) - 1 do { - if (_barrelLength >= _barrelLengthTable select _i) then { - _lowerIndex = _i; - }; -}; -for "_i" from (count _barrelLengthTable) - 1 to 0 step -1 do { - if (_barrelLength <= _barrelLengthTable select _i) then { - _upperIndex = _i; +// If we have the precise barrel length value, return result immediately +if (_barrelLength in _barrelLengthTable) exitWith { + (_muzzleVelocityTable select (_barrelLengthTable find _barrelLength)) - _muzzleVelocity +}; + +// Limit values to lower and upper bound of data we have available +if (_barrelLength <= (_barrelLengthTable select 0)) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity }; +if (_barrelLength >= (_barrelLengthTable select _barrelLengthTableCount - 1)) exitWith { (_muzzleVelocityTable select _barrelLengthTableCount - 1) - _muzzleVelocity }; + +// Find closest bordering values for barrel length +{ + if (_barrelLength <= _x) then { + _upperDataIndex = _forEachIndex; + _lowerDataIndex = _upperDataIndex - 1; + breakTo "main"; }; +} forEach _barrelLengthTable; + +// Worst case scenario +if (isNil "_lowerDataIndex" || isNil "_upperDataIndex") exitWith {0}; + +_lowerBarrelLength = _barrelLengthTable select _lowerDataIndex; +_upperBarrelLength = _barrelLengthTable select _upperDataIndex; +_lowerMuzzleVelocity = _muzzleVelocityTable select _lowerDataIndex; +_upperMuzzleVelocity = _muzzleVelocityTable select _upperDataIndex; + +// Calculate interpolation ratio +_interpolationRatio = if (abs (_lowerBarrelLength - _upperBarrelLength) > 0) then { + (_upperBarrelLength - _barrelLength) / (_upperBarrelLength - _lowerBarrelLength) +} else { + 0 }; -_barrelLengthRatio = 0; -if ((_barrelLengthTable select _upperIndex) - (_barrelLengthTable select _lowerIndex) > 0) then { - _barrelLengthRatio = ((_barrelLengthTable select _upperIndex) - _barrelLength) / ((_barrelLengthTable select _upperIndex) - (_barrelLengthTable select _lowerIndex)); -}; - -_muzzleVelocityNew = (_muzzleVelocityTable select _lowerIndex) + ((_muzzleVelocityTable select _upperIndex) - (_muzzleVelocityTable select _lowerIndex)) * (1 - _barrelLengthRatio); - -_muzzleVelocityNew - _muzzleVelocity +// Calculate interpolated muzzle velocity shift +(_lowerMuzzleVelocity + ((_upperMuzzleVelocity - _lowerMuzzleVelocity) * (1 - _interpolationRatio))) - _muzzleVelocity // Return diff --git a/addons/advanced_ballistics/functions/fnc_calculateRetardation.sqf b/addons/advanced_ballistics/functions/fnc_calculateRetardation.sqf index 433dafbe10..0bd801c6b9 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateRetardation.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateRetardation.sqf @@ -4,142 +4,129 @@ * Calculates the retardation of the bullet * * Arguments: - * 0: drag model - 1-7 + * 0: drag model - integer 1-7 * 1: drag coefficient - bc * 2: velocity - m/s * * Return Value: - * 0: retardation - m/(s^2) + * retardation - m/(s^2) * - * Return value: - * None + * Public: No */ #include "script_component.hpp" // Source: GNU Exterior Ballistics -private ["_dragModel", "_dragCoefficient", "_velocity", "_A", "_M", "_result"]; -_dragModel = _this select 0; -_dragCoefficient = _this select 1; -_velocity = (_this select 2) * 3.2808399; - -_A = -1; -_M = -1; -_result = 0; +private ["_A", "_M"]; +params ["_dragModel", "_dragCoefficient", "_velocity"]; +_velocity = _velocity * 3.2808399; switch _dragModel do { - case 1: - { - switch true do { - case (_velocity > 4230) : { _A = 0.0001477404177730177; _M = 1.9565; }; - case (_velocity > 3680) : { _A = 0.0001920339268755614; _M = 1.925 ; }; - case (_velocity > 3450) : { _A = 0.0002894751026819746; _M = 1.875 ; }; - case (_velocity > 3295) : { _A = 0.0004349905111115636; _M = 1.825 ; }; - case (_velocity > 3130) : { _A = 0.0006520421871892662; _M = 1.775 ; }; - case (_velocity > 2960) : { _A = 0.0009748073694078696; _M = 1.725 ; }; - case (_velocity > 2830) : { _A = 0.001453721560187286; _M = 1.675 ; }; - case (_velocity > 2680) : { _A = 0.002162887202930376; _M = 1.625 ; }; - case (_velocity > 2460) : { _A = 0.003209559783129881; _M = 1.575 ; }; - case (_velocity > 2225) : { _A = 0.003904368218691249; _M = 1.55 ; }; - case (_velocity > 2015) : { _A = 0.003222942271262336; _M = 1.575 ; }; - case (_velocity > 1890) : { _A = 0.002203329542297809; _M = 1.625 ; }; - case (_velocity > 1810) : { _A = 0.001511001028891904; _M = 1.675 ; }; - case (_velocity > 1730) : { _A = 0.0008609957592468259; _M = 1.75 ; }; - case (_velocity > 1595) : { _A = 0.0004086146797305117; _M = 1.85 ; }; - case (_velocity > 1520) : { _A = 0.0001954473210037398; _M = 1.95 ; }; - case (_velocity > 1420) : { _A = 0.00005431896266462351; _M = 2.125 ; }; - case (_velocity > 1360) : { _A = 0.000008847742581674416; _M = 2.375 ; }; - case (_velocity > 1315) : { _A = 0.000001456922328720298; _M = 2.625 ; }; - case (_velocity > 1280) : { _A = 0.0000002419485191895565; _M = 2.875 ; }; - case (_velocity > 1220) : { _A = 0.00000001657956321067612; _M = 3.25 ; }; - case (_velocity > 1185) : { _A = 0.0000000004745469537157371; _M = 3.75 ; }; - case (_velocity > 1150) : { _A = 0.00000000001379746590025088; _M = 4.25 ; }; - case (_velocity > 1100) : { _A = 0.0000000000004070157961147882; _M = 4.75 ; }; - case (_velocity > 1060) : { _A = 0.00000000000002938236954847331; _M = 5.125 ; }; - case (_velocity > 1025) : { _A = 0.00000000000001228597370774746; _M = 5.25 ; }; - case (_velocity > 980) : { _A = 0.00000000000002916938264100495; _M = 5.125 ; }; - case (_velocity > 945) : { _A = 0.0000000000003855099424807451; _M = 4.75 ; }; - case (_velocity > 905) : { _A = 0.00000000001185097045689854; _M = 4.25 ; }; - case (_velocity > 860) : { _A = 0.0000000003566129470974951; _M = 3.75 ; }; - case (_velocity > 810) : { _A = 0.00000001045513263966272; _M = 3.25 ; }; - case (_velocity > 780) : { _A = 0.0000001291159200846216; _M = 2.875 ; }; - case (_velocity > 750) : { _A = 0.0000006824429329105383; _M = 2.625 ; }; - case (_velocity > 700) : { _A = 0.000003569169672385163; _M = 2.375 ; }; - case (_velocity > 640) : { _A = 0.00001839015095899579; _M = 2.125 ; }; - case (_velocity > 600) : { _A = 0.00005711174688734240; _M = 1.950 ; }; - case (_velocity > 550) : { _A = 0.00009226557091973427; _M = 1.875 ; }; - case (_velocity > 250) : { _A = 0.00009337991957131389; _M = 1.875 ; }; - case (_velocity > 100) : { _A = 0.00007225247327590413; _M = 1.925 ; }; - case (_velocity > 65) : { _A = 0.00005792684957074546; _M = 1.975 ; }; - case (_velocity > 0) : { _A = 0.00005206214107320588; _M = 2.000 ; }; + case 1: { + call { + if (_velocity > 4230) exitWith { _A = 0.0001477404177730177; _M = 1.9565; }; + if (_velocity > 3680) exitWith { _A = 0.0001920339268755614; _M = 1.925; }; + if (_velocity > 3450) exitWith { _A = 0.0002894751026819746; _M = 1.875; }; + if (_velocity > 3295) exitWith { _A = 0.0004349905111115636; _M = 1.825; }; + if (_velocity > 3130) exitWith { _A = 0.0006520421871892662; _M = 1.775; }; + if (_velocity > 2960) exitWith { _A = 0.0009748073694078696; _M = 1.725; }; + if (_velocity > 2830) exitWith { _A = 0.001453721560187286; _M = 1.675; }; + if (_velocity > 2680) exitWith { _A = 0.002162887202930376; _M = 1.625; }; + if (_velocity > 2460) exitWith { _A = 0.003209559783129881; _M = 1.575; }; + if (_velocity > 2225) exitWith { _A = 0.003904368218691249; _M = 1.55; }; + if (_velocity > 2015) exitWith { _A = 0.003222942271262336; _M = 1.575; }; + if (_velocity > 1890) exitWith { _A = 0.002203329542297809; _M = 1.625; }; + if (_velocity > 1810) exitWith { _A = 0.001511001028891904; _M = 1.675; }; + if (_velocity > 1730) exitWith { _A = 0.0008609957592468259; _M = 1.75; }; + if (_velocity > 1595) exitWith { _A = 0.0004086146797305117; _M = 1.85; }; + if (_velocity > 1520) exitWith { _A = 0.0001954473210037398; _M = 1.95; }; + if (_velocity > 1420) exitWith { _A = 0.00005431896266462351; _M = 2.125; }; + if (_velocity > 1360) exitWith { _A = 0.000008847742581674416; _M = 2.375; }; + if (_velocity > 1315) exitWith { _A = 0.000001456922328720298; _M = 2.625; }; + if (_velocity > 1280) exitWith { _A = 0.0000002419485191895565; _M = 2.875; }; + if (_velocity > 1220) exitWith { _A = 0.00000001657956321067612; _M = 3.25; }; + if (_velocity > 1185) exitWith { _A = 0.0000000004745469537157371; _M = 3.75; }; + if (_velocity > 1150) exitWith { _A = 0.00000000001379746590025088; _M = 4.25; }; + if (_velocity > 1100) exitWith { _A = 0.0000000000004070157961147882; _M = 4.75; }; + if (_velocity > 1060) exitWith { _A = 0.00000000000002938236954847331; _M = 5.125; }; + if (_velocity > 1025) exitWith { _A = 0.00000000000001228597370774746; _M = 5.25; }; + if (_velocity > 980) exitWith { _A = 0.00000000000002916938264100495; _M = 5.125; }; + if (_velocity > 945) exitWith { _A = 0.0000000000003855099424807451; _M = 4.75; }; + if (_velocity > 905) exitWith { _A = 0.00000000001185097045689854; _M = 4.25; }; + if (_velocity > 860) exitWith { _A = 0.0000000003566129470974951; _M = 3.75; }; + if (_velocity > 810) exitWith { _A = 0.00000001045513263966272; _M = 3.25; }; + if (_velocity > 780) exitWith { _A = 0.0000001291159200846216; _M = 2.875; }; + if (_velocity > 750) exitWith { _A = 0.0000006824429329105383; _M = 2.625; }; + if (_velocity > 700) exitWith { _A = 0.000003569169672385163; _M = 2.375; }; + if (_velocity > 640) exitWith { _A = 0.00001839015095899579; _M = 2.125; }; + if (_velocity > 600) exitWith { _A = 0.00005711174688734240; _M = 1.950; }; + if (_velocity > 550) exitWith { _A = 0.00009226557091973427; _M = 1.875; }; + if (_velocity > 250) exitWith { _A = 0.00009337991957131389; _M = 1.875; }; + if (_velocity > 100) exitWith { _A = 0.00007225247327590413; _M = 1.925; }; + if (_velocity > 65) exitWith { _A = 0.00005792684957074546; _M = 1.975; }; + if (_velocity > 0) exitWith { _A = 0.00005206214107320588; _M = 2.000; }; }; }; - case 2: - { - switch true do { - case (_velocity > 1674) : { _A = 0.0079470052136733; _M = 1.36999902851493; }; - case (_velocity > 1172) : { _A = 0.00100419763721974; _M = 1.65392237010294; }; - case (_velocity > 1060) : { _A = 0.0000000000000000000000715571228255369; _M = 7.91913562392361; }; - case (_velocity > 949) : { _A = 0.000000000139589807205091; _M = 3.81439537623717; }; - case (_velocity > 670) : { _A = 0.000234364342818625; _M = 1.71869536324748; }; - case (_velocity > 335) : { _A = 0.000177962438921838; _M = 1.76877550388679; }; - case (_velocity > 0) : { _A = 0.0000518033561289704; _M = 1.98160270524632; }; + case 2: { + call { + if (_velocity > 1674) exitWith { _A = 0.0079470052136733; _M = 1.36999902851493; }; + if (_velocity > 1172) exitWith { _A = 0.00100419763721974; _M = 1.65392237010294; }; + if (_velocity > 1060) exitWith { _A = 0.0000000000000000000000715571228255369; _M = 7.91913562392361; }; + if (_velocity > 949) exitWith { _A = 0.000000000139589807205091; _M = 3.81439537623717; }; + if (_velocity > 670) exitWith { _A = 0.000234364342818625; _M = 1.71869536324748; }; + if (_velocity > 335) exitWith { _A = 0.000177962438921838; _M = 1.76877550388679; }; + if (_velocity > 0) exitWith { _A = 0.0000518033561289704; _M = 1.98160270524632; }; }; }; - case 5: - { - switch true do { - case (_velocity > 1730) : { _A = 0.00724854775171929; _M = 1.41538574492812; }; - case (_velocity > 1228) : { _A = 0.0000350563361516117; _M = 2.13077307854948; }; - case (_velocity > 1116) : { _A = 0.000000000000184029481181151; _M = 4.81927320350395; }; - case (_velocity > 1004) : { _A = 0.000000000000000000000134713064017409; _M = 7.8100555281422 ; }; - case (_velocity > 837) : { _A = 0.000000103965974081168; _M = 2.84204791809926; }; - case (_velocity > 335) : { _A = 0.0001093015938698234; _M = 1.81096361579504; }; - case (_velocity > 0) : { _A = 0.0000351963178524273; _M = 2.00477856801111; }; + case 5: { + call { + if (_velocity > 1730) exitWith { _A = 0.00724854775171929; _M = 1.41538574492812; }; + if (_velocity > 1228) exitWith { _A = 0.0000350563361516117; _M = 2.13077307854948; }; + if (_velocity > 1116) exitWith { _A = 0.000000000000184029481181151; _M = 4.81927320350395; }; + if (_velocity > 1004) exitWith { _A = 0.000000000000000000000134713064017409; _M = 7.8100555281422; }; + if (_velocity > 837) exitWith { _A = 0.000000103965974081168; _M = 2.84204791809926; }; + if (_velocity > 335) exitWith { _A = 0.0001093015938698234; _M = 1.81096361579504; }; + if (_velocity > 0) exitWith { _A = 0.0000351963178524273; _M = 2.00477856801111; }; }; }; - case 6: - { - switch true do { - case (_velocity > 3236) : { _A = 0.0455384883480781; _M = 1.15997674041274; }; - case (_velocity > 2065) : { _A = 0.07167261849653769; _M = 1.10704436538885; }; - case (_velocity > 1311) : { _A = 0.00166676386084348; _M = 1.60085100195952; }; - case (_velocity > 1144) : { _A = 0.000000101482730119215; _M = 2.9569674731838 ; }; - case (_velocity > 1004) : { _A = 0.00000000000000000431542773103552; _M = 6.34106317069757; }; - case (_velocity > 670) : { _A = 0.0000204835650496866; _M = 2.11688446325998; }; - case (_velocity > 0) : { _A = 0.0000750912466084823; _M = 1.92031057847052; }; + case 6: { + call { + if (_velocity > 3236) exitWith { _A = 0.0455384883480781; _M = 1.15997674041274; }; + if (_velocity > 2065) exitWith { _A = 0.07167261849653769; _M = 1.10704436538885; }; + if (_velocity > 1311) exitWith { _A = 0.00166676386084348; _M = 1.60085100195952; }; + if (_velocity > 1144) exitWith { _A = 0.000000101482730119215; _M = 2.9569674731838; }; + if (_velocity > 1004) exitWith { _A = 0.00000000000000000431542773103552; _M = 6.34106317069757; }; + if (_velocity > 670) exitWith { _A = 0.0000204835650496866; _M = 2.11688446325998; }; + if (_velocity > 0) exitWith { _A = 0.0000750912466084823; _M = 1.92031057847052; }; }; }; - case 7: - { - switch true do { - case (_velocity > 4200) : { _A = 0.00000000129081656775919; _M = 3.24121295355962; }; - case (_velocity > 3000) : { _A = 0.0171422231434847; _M = 1.27907168025204; }; - case (_velocity > 1470) : { _A = 0.00233355948302505; _M = 1.52693913274526; }; - case (_velocity > 1260) : { _A = 0.000797592111627665; _M = 1.67688974440324; }; - case (_velocity > 1110) : { _A = 0.00000000000571086414289273; _M = 4.3212826264889 ; }; - case (_velocity > 960) : { _A = 0.0000000000000000302865108244904; _M = 5.99074203776707; }; - case (_velocity > 670) : { _A = 0.00000752285155782535; _M = 2.1738019851075 ; }; - case (_velocity > 540) : { _A = 0.0000131766281225189; _M = 2.08774690257991; }; - case (_velocity > 0) : { _A = 0.0000134504843776525; _M = 2.08702306738884; }; + case 7: { + call { + if (_velocity > 4200) exitWith { _A = 0.00000000129081656775919; _M = 3.24121295355962; }; + if (_velocity > 3000) exitWith { _A = 0.0171422231434847; _M = 1.27907168025204; }; + if (_velocity > 1470) exitWith { _A = 0.00233355948302505; _M = 1.52693913274526; }; + if (_velocity > 1260) exitWith { _A = 0.000797592111627665; _M = 1.67688974440324; }; + if (_velocity > 1110) exitWith { _A = 0.00000000000571086414289273; _M = 4.3212826264889; }; + if (_velocity > 960) exitWith { _A = 0.0000000000000000302865108244904; _M = 5.99074203776707; }; + if (_velocity > 670) exitWith { _A = 0.00000752285155782535; _M = 2.1738019851075; }; + if (_velocity > 540) exitWith { _A = 0.0000131766281225189; _M = 2.08774690257991; }; + if (_velocity > 0) exitWith { _A = 0.0000134504843776525; _M = 2.08702306738884; }; }; }; - case 8: - { - switch true do { - case (_velocity > 3571) : { _A = 0.0112263766252305; _M = 1.33207346655961; }; - case (_velocity > 1841) : { _A = 0.0167252613732636; _M = 1.28662041261785; }; - case (_velocity > 1120) : { _A = 0.00220172456619625; _M = 1.55636358091189; }; - case (_velocity > 1088) : { _A = 0.00000000000000020538037167098; _M = 5.80410776994789; }; - case (_velocity > 976) : { _A = 0.00000000000592182174254121; _M = 4.29275576134191; }; - case (_velocity > 0) : { _A = 0.000043917343795117; _M = 1.99978116283334; }; + case 8: { + call { + if (_velocity > 3571) exitWith { _A = 0.0112263766252305; _M = 1.33207346655961; }; + if (_velocity > 1841) exitWith { _A = 0.0167252613732636; _M = 1.28662041261785; }; + if (_velocity > 1120) exitWith { _A = 0.00220172456619625; _M = 1.55636358091189; }; + if (_velocity > 1088) exitWith { _A = 0.00000000000000020538037167098; _M = 5.80410776994789; }; + if (_velocity > 976) exitWith { _A = 0.00000000000592182174254121; _M = 4.29275576134191; }; + if (_velocity > 0) exitWith { _A = 0.000043917343795117; _M = 1.99978116283334; }; }; }; }; -if (_A != -1 && _M != -1 && _velocity > 0 && _velocity < 10000) then { - _result = _A * (_velocity ^ _M) / _dragCoefficient; - _result = _result / 3.2808399; +if (!isNil "_A" && !isNil "_M" && _velocity > 0 && _velocity < 10000) then { + (_A * (_velocity ^ _M) / _dragCoefficient) / 3.2808399 +} else { + 0 }; - -_result diff --git a/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf b/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf index 9b205c3ec2..671ab2ccb0 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf @@ -13,33 +13,23 @@ * 6: barometric Pressure - hPA * * Return Value: - * 0: stability factor + * stability factor * * Public: No */ #include "script_component.hpp" -private ["_caliber", "_bulletLength", "_bulletMass", "_barrelTwist", "_muzzleVelocity", "_temperature", "_barometricPressure", "_l", "_t", "_stabilityFactor"]; -_caliber = _this select 0; -_bulletLength = _this select 1; -_bulletMass = _this select 2; -_barrelTwist = _this select 3; -_muzzleVelocity = _this select 4; -_temperature = _this select 5; -_barometricPressure = _this select 6; +private ["_twist", "_length", "_stabilityFactor"]; +params ["_caliber", "_bulletLength", "_bulletMass", "_barrelTwist", "_muzzleVelocity", "_temperature", "_barometricPressure"]; // Source: http://www.jbmballistics.com/ballistics/bibliography/articles/miller_stability_1.pdf -_t = _barrelTwist / _caliber; -_l = _bulletLength / _caliber; +_twist = _barrelTwist / _caliber; +_length = _bulletLength / _caliber; -_stabilityFactor = 7587000 * _bulletMass / (_t^2 * _caliber^3 * _l * (1 + _l^2)); +_stabilityFactor = 7587000 * _bulletMass / (_twist^2 * _caliber^3 * _length * (1 + _length^2)); if (_muzzleVelocity > 341.376) then { - _stabilityFactor = _stabilityFactor * (_muzzleVelocity / 853.44) ^ (1/3); + (_stabilityFactor * (_muzzleVelocity / 853.44) ^ (1/3)) * KELVIN(_temperature) / KELVIN(15) * 1013.25 / _barometricPressure } else { - _stabilityFactor = _stabilityFactor * (_muzzleVelocity / 341.376) ^ (1/3); + (_stabilityFactor * (_muzzleVelocity / 341.376) ^ (1/3)) * KELVIN(_temperature) / KELVIN(15) * 1013.25 / _barometricPressure }; - -_stabilityFactor = _stabilityFactor * KELVIN(_temperature) / KELVIN(15) * 1013.25 / _barometricPressure; - -_stabilityFactor diff --git a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf index 1a4c344b2e..9debec1dc8 100644 --- a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf +++ b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf @@ -8,6 +8,8 @@ * * Return value: * None + * + * Public: No */ #include "script_component.hpp" @@ -15,8 +17,6 @@ #define __ctrl1 (__dsp displayCtrl 132950) #define __ctrl2 (__dsp displayCtrl 132951) -private ["_inclinationAngle", "_refPosition"]; - if (GVAR(Protractor)) exitWith { GVAR(Protractor) = false; 1 cutText ["", "PLAIN"]; @@ -32,30 +32,26 @@ EGVAR(weather,WindInfo) = false; GVAR(Protractor) = true; [{ + params ["","_idPFH"]; if !(GVAR(Protractor) && !(weaponLowered ACE_player) && currentWeapon ACE_player == primaryWeapon ACE_player) exitWith { GVAR(Protractor) = false; 1 cutText ["", "PLAIN"]; - [_this select 1] call cba_fnc_removePerFrameHandler; + [_idPFH] call cba_fnc_removePerFrameHandler; }; - - _refPosition = [SafeZoneX + 0.001, SafeZoneY + 0.001, 0.2, 0.2 * 4/3]; - - _inclinationAngle = asin((ACE_player weaponDirection currentWeapon ACE_player) select 2); - _inclinationAngle = -58 max _inclinationAngle min 58; - + 1 cutRsc ["RscProtractor", "PLAIN", 1, false]; - + __ctrl1 ctrlSetScale 1; __ctrl1 ctrlCommit 0; __ctrl1 ctrlSetText QUOTE(PATHTOF(UI\protractor.paa)); __ctrl1 ctrlSetTextColor [1, 1, 1, 1]; - + __ctrl2 ctrlSetScale 1; - __ctrl2 ctrlSetPosition [(_refPosition select 0), (_refPosition select 1) - 0.0012 * _inclinationAngle, (_refPosition select 2), (_refPosition select 3)]; + __ctrl2 ctrlSetPosition [SafeZoneX + 0.001, SafeZoneY + 0.001 - 0.0012 * (-58 max (asin((ACE_player weaponDirection currentWeapon ACE_player) select 2)) min 58), 0.2, 0.2 * 4/3]; __ctrl2 ctrlCommit 0; __ctrl2 ctrlSetText QUOTE(PATHTOF(UI\protractor_marker.paa)); __ctrl2 ctrlSetTextColor [1, 1, 1, 1]; - + }, 0.1, []] call CBA_fnc_addPerFrameHandler; true diff --git a/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf new file mode 100644 index 0000000000..2ae2bf2f9c --- /dev/null +++ b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf @@ -0,0 +1,47 @@ +/* + * Author: Glowbal, Ruthberg, joko // Jonas + * Handle the PFH for Bullets + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +private "_deleted"; + + + +_deleted = 0; + +{ + private ["_bulletVelocity", "_bulletPosition", "_bulletSpeed"]; + _x params["_bullet","_caliber","_bulletTraceVisible","_index"]; + + _bulletVelocity = velocity _bullet; + + _bulletSpeed = vectorMagnitude _bulletVelocity; + + if (!alive _bullet || _bulletSpeed < 100) exitWith { + GVAR(allBullets) deleteAt (_forEachIndex - _deleted); + _deleted = _deleted + 1; + }; + + _bulletPosition = getPosASL _bullet; + + if (_bulletTraceVisible && _bulletSpeed > 500) then { + drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""]; + }; + + _aceTimeSecond = floor ACE_time; + call compile ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, _aceTimeSecond, ACE_time - _aceTimeSecond]); +} forEach GVAR(allBullets); + +if (GVAR(allBullets) isEqualTo []) then { + [_this select 1] call CBA_fnc_removePerFrameHandler; + GVAR(BulletPFH) = nil; +}; diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index 7c01bd9f23..74c16bdd47 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -13,28 +13,28 @@ * 6: projectile - Object of the projectile that was shot * * Return Value: - * Nothing + * None * * Public: No */ #include "script_component.hpp" -private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_stabilityFactor"]; -_unit = _this select 0; -_weapon = _this select 1; -_mode = _this select 3; -_ammo = _this select 4; -_magazine = _this select 5; -_bullet = _this select 6; +// Early Quiting +if (!hasInterface) exitWith {}; +if (!GVAR(enabled)) exitWith {}; + +// Parameterization +private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_stabilityFactor"]; +params ["_unit", "_weapon", "", "_mode", "_ammo", "_magazine", "_bullet"]; _abort = false; -if (!hasInterface) exitWith {}; -if (!alive _bullet) exitWith {}; -if (!GVAR(enabled)) exitWith {}; -if (!([_unit] call EFUNC(common,isPlayer))) exitWith {}; -if (underwater _unit) exitWith {}; + + if (!(_ammo isKindOf "BulletBase")) exitWith {}; +if (!alive _bullet) exitWith {}; +if (!([_unit] call EFUNC(common,isPlayer))) exitWith {}; if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {}; +if (underwater _unit) exitWith {}; if (!GVAR(simulateForEveryone) && !(local _unit)) then { // The shooter is non local _abort = true; @@ -53,39 +53,44 @@ if (!GVAR(simulateForEveryone) && !(local _unit)) then { if (GVAR(disabledInFullAutoMode) && getNumber(configFile >> "CfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) then { _abort = true; }; if (_abort || !(GVAR(extensionAvailable))) exitWith { - if (missionNamespace getVariable [QEGVAR(windDeflection,enabled), false]) then { - EGVAR(windDeflection,trackedBullets) pushBack [_bullet, getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction")]; - }; + [_bullet, getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction")] call EFUNC(winddeflection,updateTrajectoryPFH); }; +// Get Weapon and Ammo Configurations _AmmoCacheEntry = uiNamespace getVariable format[QGVAR(%1), _ammo]; -if (isNil {_AmmoCacheEntry}) then { +if (isNil "_AmmoCacheEntry") then { _AmmoCacheEntry = _ammo call FUNC(readAmmoDataFromConfig); }; _WeaponCacheEntry = uiNamespace getVariable format[QGVAR(%1), _weapon]; -if (isNil {_WeaponCacheEntry}) then { +if (isNil "_WeaponCacheEntry") then { _WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig); }; +_AmmoCacheEntry params ["_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable"]; +_WeaponCacheEntry params ["_barrelTwist", "_twistDirection", "_barrelLength"]; + + _bulletVelocity = velocity _bullet; _muzzleVelocity = vectorMagnitude _bulletVelocity; if (GVAR(barrelLengthInfluenceEnabled)) then { - _muzzleVelocityShift = [_WeaponCacheEntry select 2, _AmmoCacheEntry select 10, _AmmoCacheEntry select 11, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); - if (_muzzleVelocityShift != 0) then { - _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); - _bullet setVelocity _bulletVelocity; - _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift; + _barrelVelocityShift = uiNamespace getVariable [format [QGVAR(%1_muzzleVelocityShift),_weapon],nil]; + if (isNil "_barrelVelocityShift") then { + _barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); + uiNamespace setVariable [format [QGVAR(%1_muzzleVelocityShift),_weapon],_muzzleVelocityShift]; }; }; if (GVAR(ammoTemperatureEnabled)) then { _temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight); - _muzzleVelocityShift = [_AmmoCacheEntry select 9, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift); + _temperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift)); +}; + +if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then { if (_muzzleVelocityShift != 0) then { + _muzzleVelocity = _muzzleVelocity + (_barrelVelocityShift + _ammoTemperatureVelocityShift); _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); _bullet setVelocity _bulletVelocity; - _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift; }; }; @@ -102,43 +107,22 @@ if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then { }; }; -_caliber = _AmmoCacheEntry select 1; -_bulletLength = _AmmoCacheEntry select 2; -_bulletMass = _AmmoCacheEntry select 3; -_barrelTwist = _WeaponCacheEntry select 0; _stabilityFactor = 1.5; - if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { - _temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight); + if (isNil "_temperature") then { + _temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight); + }; _barometricPressure = ((getPosASL _bullet) select 2) call EFUNC(weather,calculateBarometricPressure); _stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call FUNC(calculateStabilityFactor); }; 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), _AmmoCacheEntry select 0, _AmmoCacheEntry select 6, _AmmoCacheEntry select 7, _AmmoCacheEntry select 8, _AmmoCacheEntry select 5, _stabilityFactor, _WeaponCacheEntry select 1, _muzzleVelocity, _AmmoCacheEntry select 4, getPosASL _bullet, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), overcast, floor(ACE_time), ACE_time - floor(ACE_time)]; +_aceTimeSecond = floor ACE_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(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), overcast, _aceTimeSecond, ACE_time - _aceTimeSecond]; -[{ - 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 > 500) then { - drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""]; - }; +GVAR(allBullets) pushBack [_bullet, _caliber, _bulletTraceVisible, GVAR(currentbulletID)]; - 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(ACE_time), ACE_time - floor(ACE_time)]); - -}, GVAR(simulationInterval), [_bullet, _caliber, _bulletTraceVisible, GVAR(currentbulletID)]] call CBA_fnc_addPerFrameHandler; +if (isNil QGVAR(BulletPFH)) then { + GVAR(BulletPFH) = [FUNC(handleFirePFH), GVAR(simulationInterval), []] call CBA_fnc_addPerFrameHandler; +}; diff --git a/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf b/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf index 186c0d0649..4898c51c10 100644 --- a/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf +++ b/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf @@ -8,17 +8,13 @@ * 2: activated * * Return Value: - * None + * None * * Public: No */ - #include "script_component.hpp" -private ["_logic", "_units", "_activated"]; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +params ["_logic","_units", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf index b2fc7ba084..53ac6aa874 100644 --- a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf +++ b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf @@ -3,10 +3,10 @@ * Initializes the advanced ballistics dll extension with terrain data * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Public: No */ @@ -22,9 +22,9 @@ _initStartTime = ACE_time; _mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize"); if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith { - if (GVAR(initMessageEnabled)) then { + #ifdef DEBUG_MODE_FULL systemChat "AdvancedBallistics: Terrain already initialized"; - }; + #endIf }; _mapGrids = ceil(_mapSize / 50) + 1; @@ -33,19 +33,16 @@ _gridCells = _mapGrids * _mapGrids; GVAR(currentGrid) = 0; [{ - private ["_args", "_mapGrids", "_gridCells", "_initStartTime"]; - _args = _this select 0; - _mapGrids = _args select 0; - _gridCells = _args select 1; - _initStartTime = _args select 2; - + params ["_args","_idPFH"]; + _args params ["_mapGrids", "_gridCells", "_initStartTime"]; + if (GVAR(currentGrid) >= _gridCells) exitWith { - if (GVAR(initMessageEnabled)) then { + #ifdef DEBUG_MODE_FULL systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", ceil(ACE_time - _initStartTime)]; - }; - [_this select 1] call cba_fnc_removePerFrameHandler; + #endif + [_idPFH] call cba_fnc_removePerFrameHandler; }; - + for "_i" from 1 to 50 do { _x = floor(GVAR(currentGrid) / _mapGrids) * 50; _y = (GVAR(currentGrid) - floor(GVAR(currentGrid) / _mapGrids) * _mapGrids) * 50; @@ -57,5 +54,5 @@ GVAR(currentGrid) = 0; GVAR(currentGrid) = GVAR(currentGrid) + 1; if (GVAR(currentGrid) >= _gridCells) exitWith {}; }; - + }, 0, [_mapGrids, _gridCells, _initStartTime]] call CBA_fnc_addPerFrameHandler diff --git a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf index 10e7e60df2..9839c1dcc3 100644 --- a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf +++ b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf @@ -4,61 +4,53 @@ * Reads the ammo class config and updates the config cache * * Arguments: - * 0: ammo - classname + * ammo - classname * * Return Value: - * 0: [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable] + * 0: _airFriction + * 1: _caliber + * 2: _bulletLength + * 3: _bulletMass + * 4: _transonicStabilityCoef + * 5: _dragModel + * 6: _ballisticCoefficients + * 7: _velocityBoundaries + * 8: _atmosphereModel + * 9: _ammoTempMuzzleVelocityShifts + * 10: _muzzleVelocityTable + * 11: _barrelLengthTable * - * Return value: - * None + * Public: No */ #include "script_component.hpp" private ["_ammo", "_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_result"]; -_ammo = _this; +_ammoConfig = configFile >> "CfgAmmo" >> _this; -_airFriction = getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction"); -_caliber = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_caliber"); -_bulletLength = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_bulletLength"); -_bulletMass = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_bulletMass"); -_transonicStabilityCoef = 0.5; -if (isNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef")) then { - _transonicStabilityCoef = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef"); +_airFriction = getNumber(_ammoConfig >> "airFriction"); +_caliber = getNumber(_ammoConfig >> "ACE_caliber"); +_bulletLength = getNumber(_ammoConfig >> "ACE_bulletLength"); +_bulletMass = getNumber(_ammoConfig >> "ACE_bulletMass"); +_transonicStabilityCoef = getNumber(_ammoConfig >> "ACE_transonicStabilityCoef"); +if (_transonicStabilityCoef == 0) then { + _transonicStabilityCoef = 0.5; }; -_dragModel = 1; -_ballisticCoefficients = []; -_velocityBoundaries = []; -_atmosphereModel = "ICAO"; -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; - }; +_dragModel = getNumber(_ammoConfig >> "ACE_dragModel"); +if (_dragModel == 0 || !(_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"); -}; -_ammoTempMuzzleVelocityShifts = []; -if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts")) then { - _ammoTempMuzzleVelocityShifts = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts"); -}; -_muzzleVelocityTable = []; -_barrelLengthTable = []; -if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocities")) then { - _muzzleVelocityTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocities"); -}; -if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengths")) then { - _barrelLengthTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengths"); +_ballisticCoefficients = getArray(_ammoConfig >> "ACE_ballisticCoefficients"); +_velocityBoundaries = getArray(_ammoConfig >> "ACE_velocityBoundaries"); +_atmosphereModel = getText(_ammoConfig >> "ACE_standardAtmosphere"); +if (_atmosphereModel isEqualTo "") then { + _atmosphereModel = "ICAO"; }; +_ammoTempMuzzleVelocityShifts = getArray(_ammoConfig >> "ACE_ammoTempMuzzleVelocityShifts"); +_muzzleVelocityTable = getArray(_ammoConfig >> "ACE_muzzleVelocities"); +_barrelLengthTable = getArray(_ammoConfig >> "ACE_barrelLengths"); _result = [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable]; -uiNamespace setVariable [format[QGVAR(%1), _ammo], _result]; +uiNamespace setVariable [format[QGVAR(%1), _this], _result]; _result diff --git a/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf index 8a1a29f7b0..8e13dc04dc 100644 --- a/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf +++ b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf @@ -4,28 +4,28 @@ * Reads the weapon class config and updates the config cache * * Arguments: - * 0: weapon - classname + * weapon - classname * * Return Value: - * 0: [_barrelTwist, _twistDirection, _barrelLength] + * 0: _barrelTwist + * 1: _twistDirection + * 2: _barrelLength * - * Return value: - * None + * Public: No */ #include "script_component.hpp" -private ["_weapon", "_barrelTwist", "_twistDirection", "_barrelLength", "_result"]; -_weapon = _this; +private ["_weaponConfig", "_barrelTwist", "_twistDirection", "_barrelLength", "_result"]; +_weaponConfig = (configFile >> "CfgWeapons" >> _this); -_barrelTwist = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelTwist"); +_barrelTwist = getNumber(_weaponConfig >> "ACE_barrelTwist"); _twistDirection = 1; -if (isNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_twistDirection")) then { - _twistDirection = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_twistDirection"); - if (_twistDirection != -1 && _twistDirection != 0 && _twistDirection != 1) then { - _twistDirection = 1; - }; +_twistDirection = getNumber(_weaponConfig >> "ACE_twistDirection"); +if !(_twistDirection in [-1, 0, 1]) then { + _twistDirection = 1; }; -_barrelLength = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelLength"); + +_barrelLength = getNumber(_weaponConfig >> "ACE_barrelLength"); _result = [_barrelTwist, _twistDirection, _barrelLength]; diff --git a/addons/advanced_ballistics/stringtable.xml b/addons/advanced_ballistics/stringtable.xml index b30485aae6..45e0d042a5 100644 --- a/addons/advanced_ballistics/stringtable.xml +++ b/addons/advanced_ballistics/stringtable.xml @@ -32,6 +32,7 @@ Erweiterte Ballistik Pokročilá balistika Balística avançada + Fejlett ballisztika Advanced Ballistics @@ -40,6 +41,7 @@ Erweiterte Ballistik Pokročilá balistika Balística avançada + Fejlett ballisztika Enables advanced ballistics @@ -48,6 +50,7 @@ Aktiviert die erweiterte Ballistik Aktivuje pokročilou balistiku Ativa balística avançada + Engedélyezi a fejlett ballisztikát Enabled For Snipers @@ -56,6 +59,7 @@ Für Scharfschützen aktiviert Povoleno pro odstřelovače Ativar para caçadores + Mesterlövészeknek engedélyezve Enables advanced ballistics for non local snipers (when using high power optics) @@ -64,6 +68,7 @@ Aktiviert die erweiterte Ballistik für nicht lokale Scharfschützen (bei Benutzung von Optiken mit starker Vergrößerung) Aktivuje pokročilou balistiku pro nelokální odstřelovače (když používá výkonnou optiku) Ativa balística avançada para caçadores não locais (quando usando miras telescópicas) + Engedélyezi a fejlett ballisztikát nem-helyi mesterlövészeknek (nagy-teljesítményű optika használatakor) Enabled For Group Members @@ -72,6 +77,7 @@ Für Gruppenmitglieder aktiviert Povoleno pro členy skupiny Ativada para membros do grupo + Csoporttagoknak engedélyezve Enables advanced ballistics for non local group members @@ -80,6 +86,7 @@ Aktiviert die erweiterte Ballistik für nicht lokale Gruppenmitglieder Aktivuje pokročilou balistiku pro nelokální členy skupiny Ativa balística avançada para membros de grupo não locais + Engedélyezi a fejlett ballisztikát nem-helyi csoporttagoknak Enabled For Everyone @@ -88,6 +95,7 @@ Für jeden aktiviert Povoleno pro všechny Ativada para todos + Mindenkinek engedélyezve Enables advanced ballistics for all non local players (enabling this may degrade performance during heavy firefights in multiplayer) @@ -96,6 +104,7 @@ Aktiviert die erweiterte Ballistik für alle nicht lokalen Spieler (das Aktivieren dieser Funktion kann zur Beeinträchtigung des Spielerlebnisses im Multiplayer führen) Aktivovat pokročilou balistiku pro všechny nelokální hráče (aktivace této možnosti způsobuje pokles snímu za sekundu během těžké přestřelky v multiplayeru) Ativa balística avançada para todos os jogadores não locais (ativando isso pode degradar a performance durante troca de tiros intensas no multiplayer) + Engedélyezi a fejlett ballisztikát az összes nem-helyi játékosnak (ez a funkció leronthatja a teljesítményt intenzív többjátékos tűzharcok alatt) Always Enabled For Group Members @@ -104,6 +113,7 @@ Für Gruppenmitglieder immer aktiviert Vždy povoleno pro členy skupiny Sempre ativada para membros do grupo + Mindig engedélyezve csoporttagoknak Always enables advanced ballistics when a group member fires @@ -112,6 +122,7 @@ Aktiviert die erweiterte Ballistik immer, wenn ein Gruppenmitglied schießt Aktivuje pokročilou balistiku pro členy skupiny Sempre ative balística avançada quando um membro do grupo disparar + Mindig engedélyezi a fejlett ballisztikát, ha egy csoporttag tüzel Disabled In FullAuto Mode @@ -120,6 +131,7 @@ Beim vollautomatischen Feuern deaktiviert Zakázáno v automatickém režimu střelby Desabilitar no modo automático + Automata módban letiltva Disables the advanced ballistics during full auto fire @@ -128,6 +140,7 @@ Deaktiviert die erweiterte Ballistik beim vollautomatischen Feuern Zákáže pokročilou balistiku během střelby v režimu automat Desabilitar a balística avançada durante fogo automático + Letiltja a fejlett ballisztikát automata tüzelés folyamán Enable Ammo Temperature Simulation @@ -136,6 +149,7 @@ Simulation der Munitionstemperatur aktivieren Povolit simulaci teploty munice Ativar simulação de temperatura de munição + Lőszer-hő szimuláció engedélyezése Muzzle velocity varies with ammo temperature @@ -144,6 +158,7 @@ Munitionstemperatur hat Einfluss auf die Mündungsgeschwindigkeit Úsťová rychlost je závislá na teplotě munice A velocidade de saída varia com a temperatura da munição + A kezdősebesség a lőszer hőmérsékletétől függően változó Enable Barrel Length Simulation @@ -152,6 +167,7 @@ Simulation der Lauflänge aktivieren Povolit simulaci délky hlavně Ativar a simulação de comprimento do cano + Csőhossz-szimuláció engedélyezése Muzzle velocity varies with barrel length @@ -160,6 +176,7 @@ Lauflänge beeinflusst Mündungsgeschwindigkeit Úsťová rychlost je závislá na délce hlavně A velocidade de saída caria com o comprimento do cano + A kezdősebesség a cső hosszától függően változó Enable Bullet Trace Effect @@ -168,6 +185,7 @@ Geschossspureffekt aktivieren Povolit efekt trasírek Ativa efeito traçante de projétil + Nyomkövető-effekt engedélyezése Enables a bullet trace effect to high caliber bullets (only visible when looking through high power optics) @@ -176,6 +194,7 @@ Aktiviere Geschossspureffekt für hohe Kaliber (bei Benutzung von Optiken mit starker Vergrößerung) Aktivuje efekt trasírek z vysokokaliberních zbraní (viditelné pouze skrze výkonnou optiku) Ativa o efeito traçante de projétil para projéteis de alto calibre (somente visível quando observado por miras telescópicas) + Engedélyezi a nagy kaliberű lövedékek nyomának vizuális követését (csak nagy teljesítményű optikán keresztül látható) Simulation Interval @@ -184,6 +203,7 @@ Simulationsintervall Interval simulace Intervalo da simulação + Szimuláció intervalluma Defines the interval between every calculation step @@ -192,6 +212,7 @@ Legt das Intervall zwischen den Berechnungsschritten fest Určuje interval mezi každým výpočtem Define o intervalo entre cada cálculo + Meghatározza a számítási lépések közötti időintervallumot Simulation Radius @@ -200,6 +221,7 @@ Simulationsradius Rozsah simulace Raio de simulação + Szimuláció hatóköre Defines the radius around the player (in meters) at which advanced ballistics are applied to projectiles @@ -208,12 +230,14 @@ Gibt den Radius (in Metern) um den Spieler an, bei dem die erweiterte Ballistik auf Geschosse angewendet wird Určuje oblast kolem hráče (v metrech), kde je pokročilá balistika použita na projektil Define o raio ao redor do jogador (em metros) onde a balística avançada será aplicada aos projéteis + Meghatározza a játékos körüli hatókört (méterben), ahol a lövedékek fejlett ballisztikát használnak This module enables advanced ballistics simulation - meaning the trajectory of projectiles is influenced by variables like air temperature, atmospheric pressure, humidity, gravity, the type of ammunition and the weapon from which it was fired. Moduł ten pozwala aktywować zaawansowaną balistykę biorącą przy obliczeniach trajektorii lotu pocisku pod uwagę takie rzeczy jak temperatura powietrza, ciśnienie atmosferyczne, wilgotność powietrza, siły Coriolisa i Eotvosa, grawitację a także broń z jakiej wykonywany jest strzał oraz rodzaj amunicji. Wszystko to sprowadza się na bardzo dokładne odwzorowanie balistyki. Tento modul umožňuje aktivovat pokročilou balistiku, která vypočítává trajektorii kulky a bere do úvahy věci jako je teplota vzduchu, atmosférický tlak, vlhkost vzduchu, gravitaci, typ munice a zbraň, ze které je náboj vystřelen. To vše přispívá k velmi přesné balistice. Este módulo permite que você ative cálculos de balística avançada, fazendo a trajetória do projétil levar em consideração coisas como temperatura do ar, pressão atmosférica, umidade, força de Coriolis, a gravidade, o modelo da arma no qual o disparo é realizado e o tipo de munição. Tudo isso acrescenta-se a um balística muito precisa. + Ez a modul engedélyezi a fejlett ballisztikai szimulációt - a lövedékek röppályáját befolyásolni fogja a levegő hőmérséklete, légnyomás, páratartalom, gravitáció, a lövedék fajtája, valamint a fegyver, amiből kilőtték a lövedéket. \ No newline at end of file diff --git a/addons/attach/CfgEventHandlers.hpp b/addons/attach/CfgEventHandlers.hpp index 3daad1425a..c050fbd1c7 100644 --- a/addons/attach/CfgEventHandlers.hpp +++ b/addons/attach/CfgEventHandlers.hpp @@ -8,3 +8,24 @@ class Extended_PostInit_EventHandlers { clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) ); }; }; +class Extended_GetIn_EventHandlers { + class All { + class ADDON { + getIn = QUOTE(_this call FUNC(handleGetIn)); + }; + }; +}; +class Extended_GetOut_EventHandlers { + class All { + class ADDON { + getOut = QUOTE(_this call FUNC(handleGetOut)); + }; + }; +}; +class Extended_Killed_EventHandlers { + class All { + class ADDON { + killed = QUOTE(_this call FUNC(handleKilled)); + }; + }; +}; diff --git a/addons/attach/XEH_preInit.sqf b/addons/attach/XEH_preInit.sqf index 06c6ed1b01..17b8490a77 100644 --- a/addons/attach/XEH_preInit.sqf +++ b/addons/attach/XEH_preInit.sqf @@ -7,6 +7,9 @@ PREP(canAttach); PREP(canDetach); PREP(detach); PREP(getChildrenAttachActions); +PREP(handleGetIn); +PREP(handleGetOut); +PREP(handleKilled); PREP(placeApprove); ADDON = true; diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index bd363b1307..6362edb33c 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -17,15 +17,14 @@ */ #include "script_component.hpp" -private ["_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID", "_model"]; -params ["_attachToVehicle","_unit","_args"]; +params ["_attachToVehicle","_unit","_args", ["_silentScripted", false]]; _args params [["_itemClassname","", [""]]]; -TRACE_3("params",_attachToVehicle,_unit,_itemClassname); +TRACE_4("params",_attachToVehicle,_unit,_itemClassname,_silentScripted); + +private ["_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID", "_model"]; //Sanity Check (_unit has item in inventory, not over attach limit) -if ((_itemClassname == "") || {!(_this call FUNC(canAttach))}) exitWith {ERROR("Tried to attach, but check failed");}; - -_selfAttachPosition = [_unit, [-0.05, 0, 0.12], "rightshoulder"]; +if ((_itemClassname == "") || {(!_silentScripted) && {!(_this call FUNC(canAttach))}}) exitWith {ERROR("Tried to attach, but check failed");}; _itemVehClass = getText (configFile >> "CfgWeapons" >> _itemClassname >> "ACE_Attachable"); _onAtachText = getText (configFile >> "CfgWeapons" >> _itemClassname >> "displayName"); @@ -40,12 +39,13 @@ if (_itemVehClass == "") exitWith {ERROR("no ACE_Attachable for Item");}; _onAtachText = format [localize LSTRING(Item_Attached), _onAtachText]; if (_unit == _attachToVehicle) then { //Self Attachment - _unit removeItem _itemClassname; // Remove item _attachedItem = _itemVehClass createVehicle [0,0,0]; - _attachedItem attachTo _selfAttachPosition; - [_onAtachText] call EFUNC(common,displayTextStructured); - _attachToVehicle setVariable [QGVAR(Objects), [_attachedItem], true]; - _attachToVehicle setVariable [QGVAR(ItemNames), [_itemClassname], true]; + _attachedItem attachTo [_unit, [-0.05, 0, 0.12], "rightshoulder"]; + if (!_silentScripted) then { + _unit removeItem _itemClassname; // Remove item + [_onAtachText] call EFUNC(common,displayTextStructured); + }; + _unit setVariable [QGVAR(attached), [[_attachedItem, _itemClassname]], true]; } else { GVAR(placeAction) = PLACE_WAITING; diff --git a/addons/attach/functions/fnc_canAttach.sqf b/addons/attach/functions/fnc_canAttach.sqf index 20a49c09be..37d92e8908 100644 --- a/addons/attach/functions/fnc_canAttach.sqf +++ b/addons/attach/functions/fnc_canAttach.sqf @@ -17,14 +17,17 @@ */ #include "script_component.hpp" -private ["_attachLimit", "_attachedObjects","_playerPos"]; params ["_attachToVehicle","_player","_args"]; _args params [["_itemClassname","", [""]]]; -TRACE_3("params",_attachToVehicle,_unit,_itemClassname); +TRACE_3("params",_attachToVehicle,_player,_itemClassname); + +private ["_attachLimit", "_attachedObjects"]; _attachLimit = [6, 1] select (_player == _attachToVehicle); -_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; +_attachedObjects = _attachToVehicle getVariable [QGVAR(attached), []]; -_playerPos = (ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot")); - -(canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemClassname in ((itemsWithMagazines _player) + [""])}; +((_player == _attachToVehicle) || {canStand _player}) && +{(_attachToVehicle distance _player) < 7} && +{alive _attachToVehicle} && +{(count _attachedObjects) < _attachLimit} && +{_itemClassname in ((itemsWithMagazines _player) + [""])}; diff --git a/addons/attach/functions/fnc_canDetach.sqf b/addons/attach/functions/fnc_canDetach.sqf index ba3182ddea..915295e6c9 100644 --- a/addons/attach/functions/fnc_canDetach.sqf +++ b/addons/attach/functions/fnc_canDetach.sqf @@ -16,25 +16,25 @@ */ #include "script_component.hpp" -private ["_attachedObjects", "_inRange"]; params ["_attachToVehicle", "_unit"]; TRACE_2("params",_attachToVehicle,_unit); -_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; +_attachedList = _attachToVehicle getVariable [QGVAR(attached), []]; +if ((count _attachedList) == 0) exitWith {false}; + +private ["_inRange"]; _inRange = false; -if (_unit == _attachToVehicle) then { - _inRange = count _attachedObjects > 0; -} else { - //Scan if unit is within range (using 2d distance) - private ["_unitPos", "_objectPos"]; - _unitPos = getPos _unit; - _unitPos set [2,0]; - { - _objectPos = getPos _x; - _objectPos set [2, 0]; - if (_objectPos distance _unitPos < 4) exitWith {_inRange = true}; - } forEach _attachedObjects; -}; +{ + _x params ["_xObject"]; + if (isNull _xObject) exitWith { + TRACE_1("Null attached",_x); + _attachedList deleteAt _forEachIndex; + _attachToVehicle setVariable [QGVAR(attached), _attachedList, true]; + }; + if (((getPos _unit) distance2d (getPos _xObject)) < 4) exitWith {_inRange = true}; +} forEach _attachedList; -canStand _unit && {_inRange} && {alive _attachToVehicle} +_inRange && +{(_unit == _attachToVehicle) || {canStand _unit}} && +{alive _attachToVehicle} diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index 98f482f17b..05c625b374 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -16,15 +16,12 @@ */ #include "script_component.hpp" -private ["_attachedObjects", "_attachedItems", "_itemDisplayName", - "_attachedObject", "_attachedIndex", "_itemName", "_minDistance", - "_unitPos", "_objectPos" -]; params ["_attachToVehicle","_unit"], TRACE_2("params",_attachToVehicle,_unit); -_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; -_attachedItems = _attachToVehicle getVariable [QGVAR(ItemNames), []]; +private ["_attachedList", "_itemDisplayName", "_attachedObject", "_attachedIndex", "_itemName", "_minDistance"]; + +_attachedList = _attachToVehicle getVariable [QGVAR(attached), []]; _attachedObject = objNull; _attachedIndex = -1; @@ -32,18 +29,17 @@ _itemName = ""; //Find closest attached object _minDistance = 1000; -_unitPos = getPos _unit; -_unitPos set [2,0]; + { - _objectPos = getPos _x; - _objectPos set [2, 0]; - if (_objectPos distance _unitPos < _minDistance) then { - _minDistance = _objectPos distance _unitPos; - _attachedObject = _x; - _itemName = _attachedItems select _forEachIndex; + _x params ["_xObject", "_xItemName"]; + + if (((getPos _unit) distance2d (getPos _xObject)) < _minDistance) then { + _minDistance = ((getPos _unit) distance2d (getPos _xObject)); + _attachedObject = _xObject; + _itemName = _xItemName; _attachedIndex = _forEachIndex; }; -} forEach _attachedObjects; +} forEach _attachedList; // Check if unit has an attached item if (isNull _attachedObject || {_itemName == ""}) exitWith {ERROR("Could not find attached object")}; @@ -68,10 +64,8 @@ if (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) then }; // Reset unit variables -_attachedObjects deleteAt _attachedIndex; -_attachedItems deleteAt _attachedIndex; -_attachToVehicle setVariable [QGVAR(Objects), _attachedObjects, true]; -_attachToVehicle setVariable [QGVAR(ItemNames), _attachedItems, true]; +_attachedList deleteAt _attachedIndex; +_attachToVehicle setVariable [QGVAR(attached), _attachedList, true]; // Display message _itemDisplayName = getText (configFile >> "CfgWeapons" >> _itemName >> "displayName"); diff --git a/addons/attach/functions/fnc_handleGetIn.sqf b/addons/attach/functions/fnc_handleGetIn.sqf new file mode 100644 index 0000000000..b7b2997081 --- /dev/null +++ b/addons/attach/functions/fnc_handleGetIn.sqf @@ -0,0 +1,38 @@ +/* + * Author: PabstMirror + * Handles when a unit gets in to a vehicle. + * + * Arguments: + * 0: vehicle + * 1: dunno + * 2: unit + * + * Return Value: + * None + * + * Example: + * [car2, x, player] call ACE_attach_fnc_handleGetIn + * + * Public: No + */ +#include "script_component.hpp" + +if (!isServer) exitWith {}; + +params ["", "", "_unit"]; +TRACE_1("params",_unit); + +private ["_attachedList"]; + +_attachedList = _unit getVariable [QGVAR(attached), []]; +if ((count _attachedList) == 0) exitWith {}; + +(_attachedList select 0) params ["_xObject"]; +if (!isNull _xObject) then { + detach _xObject; + _xObject setPos ((getPos _unit) vectorAdd [0, 0, -1000]); + [{deleteVehicle (_this select 0)}, [_xObject], 2] call EFUNC(common,waitAndExecute); + (_attachedList select 0) set [0, objNull]; +}; + +_unit setVariable [QGVAR(attached), _attachedList, true]; diff --git a/addons/attach/functions/fnc_handleGetOut.sqf b/addons/attach/functions/fnc_handleGetOut.sqf new file mode 100644 index 0000000000..57fb69cf15 --- /dev/null +++ b/addons/attach/functions/fnc_handleGetOut.sqf @@ -0,0 +1,35 @@ +/* + * Author: PabstMirror + * Handles when a unit gets in to a vehicle. + * + * Arguments: + * 0: vehicle + * 1: dunno + * 2: unit + * + * Return Value: + * None + * + * Example: + * [car2, x, player] call ACE_attach_fnc_handleGetOut + * + * Public: No + */ +#include "script_component.hpp" + +if (!isServer) exitWith {}; + +params ["", "", "_unit"]; +TRACE_1("params",_unit); + +private ["_attachedList"]; + +_attachedList = _unit getVariable [QGVAR(attached), []]; +if ((count _attachedList) == 0) exitWith {}; + +(_attachedList select 0) params ["_xObject", "_xItemName"]; +if (isNull _xObject) then { + TRACE_1("null attached when exiting vehicle, scripted reattach",_xItemName); + _unit setVariable [QGVAR(attached), [], true]; + [_unit, _unit, _xItemName, true] call FUNC(attach); +}; diff --git a/addons/attach/functions/fnc_handleKilled.sqf b/addons/attach/functions/fnc_handleKilled.sqf new file mode 100644 index 0000000000..06c5473c88 --- /dev/null +++ b/addons/attach/functions/fnc_handleKilled.sqf @@ -0,0 +1,39 @@ +/* + * Author: PabstMirror + * Handles when vehicle or man is killed. + * Note: Runs where unit is local. + * + * Arguments: + * 0: DeadVehicle + * + * Return Value: + * None + * + * Example: + * [bob1] call ACE_attach_fnc_handleKilled + * + * Public: No + */ +#include "script_component.hpp" + +params ["_deadUnit"]; +TRACE_1("params",_deadUnit); + +private ["_attachedList"]; + +_attachedList = _deadUnit getVariable [QGVAR(attached), []]; + +if ((count _attachedList) == 0) exitWith {}; + +{ + _x params ["_xObject"]; + TRACE_2("detaching",_xObject,_deadUnit); + detach _xObject; + //If it's a vehicle, also delete the attached + if (!(_deadUnit isKindOf "CAManBase")) then { + _xObject setPos ((getPos _deadUnit) vectorAdd [0, 0, -1000]); + [{deleteVehicle (_this select 0)}, [_xObject], 2] call EFUNC(common,waitAndExecute); + }; +} forEach _attachedList; + +_deadUnit setVariable [QGVAR(attached), nil, true]; diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index 0656e7880f..b8e2cc17fb 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -25,7 +25,7 @@ */ #include "script_component.hpp" -private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"]; +private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_attachList"]; params ["_unit", "_attachToVehicle", "_itemClassname", "_itemVehClass", "_onAtachText", "_startingPosition"]; TRACE_6("params",_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition); @@ -87,12 +87,9 @@ _attachedObject attachTo [_attachToVehicle, _endPosTestOffset]; //Remove Item from inventory _unit removeItem _itemClassname; -//Add Object to ACE_AttachedObjects and ACE_AttachedItemNames -_currentObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; -_currentObjects pushBack _attachedObject; -_attachToVehicle setVariable [QGVAR(Objects), _currentObjects, true]; -_currentItemNames = _attachToVehicle getVariable [QGVAR(ItemNames), []]; -_currentItemNames pushBack _itemClassname; -_attachToVehicle setVariable [QGVAR(ItemNames), _currentItemNames, true]; +//Add Object to attached array +_attachList = _attachToVehicle getVariable [QGVAR(attached), []]; +_attachList pushBack [_attachedObject, _itemClassname]; +_attachToVehicle setVariable [QGVAR(attached), _attachList, true]; [_onAtachText] call EFUNC(common,displayTextStructured); diff --git a/addons/backpacks/XEH_preInit.sqf b/addons/backpacks/XEH_preInit.sqf index a47825d0b0..f4c6a1a5d8 100644 --- a/addons/backpacks/XEH_preInit.sqf +++ b/addons/backpacks/XEH_preInit.sqf @@ -3,7 +3,6 @@ ADDON = false; PREP(backpackOpened); -PREP(getBackpackAssignedUnit); PREP(isBackpack); PREP(onOpenInventory); diff --git a/addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf b/addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf deleted file mode 100644 index 85f5966aa9..0000000000 --- a/addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Author: commy2 - * - * Returns the unit that has the given backpack object equipped. - * - * Argument: - * 0: Executing Unit (Object) - * 1: A backpack object (Object) - * - * Return value: - * Unit that has the backpack equipped. (Object) - */ -#include "script_component.hpp" -scopeName "main"; - -params ["_unit","_backpack"]; -_target = objNull; -{ - if (backpackContainer _x == _backpack) then {_target = _x; breakTo "main"}; -} count nearestObjects [_unit, ["Man"], 5]; -if (isNull _target) exitWith {ACE_Player}; -_target diff --git a/addons/backpacks/functions/fnc_onOpenInventory.sqf b/addons/backpacks/functions/fnc_onOpenInventory.sqf index d79f8aed9b..afeeb21313 100644 --- a/addons/backpacks/functions/fnc_onOpenInventory.sqf +++ b/addons/backpacks/functions/fnc_onOpenInventory.sqf @@ -1,7 +1,7 @@ /* * Author: commy2 * - * Handle the open inventory event. Display message on traget client. + * Handle the open inventory event. Display message on target client. * * Argument: * Input from "InventoryOpened" eventhandler @@ -11,16 +11,17 @@ */ #include "script_component.hpp" -private "_target"; -params ["","_backpack"]; +params ["_unit","_backpack"]; -// exit if the target is not a backpack -if !([_backpack] call FUNC(isBackpack)) exitWith {}; +// exit if the target is not a real backpack, i.e. parachute, static weapon bag etc. +if !([_backpack] call FUNC(isBackpack)) exitWith {false}; // get the unit that wears the backpack object -_target = _this call FUNC(getBackpackAssignedUnit); +private "_target"; +_target = objectParent _backpack; if (isNull _target) exitWith {false}; + // raise event on target unit ["backpackOpened", _target, [_target, _backpack]] call EFUNC(common,targetEvent); diff --git a/addons/ballistics/stringtable.xml b/addons/ballistics/stringtable.xml index db44078980..70591dcbfe 100644 --- a/addons/ballistics/stringtable.xml +++ b/addons/ballistics/stringtable.xml @@ -1599,6 +1599,7 @@ [ACE] Munitionskiste [ACE] Bedna s municí [ACE] Caixa com suprimentos de munição + [ACE] Lőszeres láda \ No newline at end of file diff --git a/addons/captives/CfgMoves.hpp b/addons/captives/CfgMoves.hpp index aa64e85e22..8fa3440706 100644 --- a/addons/captives/CfgMoves.hpp +++ b/addons/captives/CfgMoves.hpp @@ -18,6 +18,11 @@ class CfgMovesBasic { default = "ACE_AmovPercMstpSsurWnonDnon"; PutDown = ""; }; + class ACE_CivilHandCuffedFFVActions: ACE_CivilStandHandcuffedActions { + stop = "ACE_HandcuffedFFV"; + StopRelaxed = "ACE_HandcuffedFFV"; + default = "ACE_HandcuffedFFV"; + }; }; }; @@ -30,6 +35,12 @@ class CfgMovesMaleSdr: CfgMovesBasic { class CutSceneAnimationBase; + #define MACRO_ANIMATION \ + head = "headDefault"; \ + aimingBody = "aimingNo"; \ + forceAim = 1; \ + static = 1; + //Handcuffed Anims: class ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon: CutSceneAnimationBase { actions = "ACE_CivilStandHandcuffedActions"; @@ -40,6 +51,7 @@ class CfgMovesMaleSdr: CfgMovesBasic { ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; canReload = 0; + MACRO_ANIMATION }; class ACE_AmovPercMstpScapWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon { file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_Ease"; @@ -47,14 +59,25 @@ class CfgMovesMaleSdr: CfgMovesBasic { ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01}; looped = 1; + MACRO_ANIMATION }; class ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon { actions = "CivilStandActions"; file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\amovpercmstpsnonwnondnon_easeout"; ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1}; + MACRO_ANIMATION }; + //Handcuffed-FFV: + class ACE_HandcuffedFFV: ACE_AmovPercMstpScapWnonDnon { + file = "\A3\cargoposes_F_heli\anim\passenger_flatground_3idleunarmed.rtm"; + actions = "ACE_CivilHandCuffedFFVActions"; + ConnectTo[] = {}; + MACRO_ANIMATION + }; + + //Surrender Anims: class ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon: CutSceneAnimationBase { actions = "ACE_CivilStandSurrenderActions"; @@ -65,6 +88,7 @@ class CfgMovesMaleSdr: CfgMovesBasic { ConnectTo[] = {"ACE_AmovPercMstpSsurWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; canReload = 0; + MACRO_ANIMATION }; class ACE_AmovPercMstpSsurWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon { file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon"; @@ -72,6 +96,7 @@ class CfgMovesMaleSdr: CfgMovesBasic { looped = 1; ConnectTo[] = {"ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01}; + MACRO_ANIMATION }; class ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon { speed = 0.5; //for gameplay reasons, slow this down @@ -79,6 +104,7 @@ class CfgMovesMaleSdr: CfgMovesBasic { file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon"; ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon",0.1}; + MACRO_ANIMATION }; }; }; diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index 774ecf87e3..afda86cfda 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -12,17 +12,17 @@ class CfgVehicles { exceptions[] = {}; icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); }; - class ACE_RemoveHandcuffs { - displayName = CSTRING(ReleaseCaptive); - selection = "righthand"; - distance = 2; - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs)); - statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs)); - exceptions[] = {}; - icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); - }; class ACE_MainActions { + class ACE_RemoveHandcuffs { + displayName = CSTRING(ReleaseCaptive); + selection = "righthand"; + distance = 2; + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs)); + exceptions[] = {}; + icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); + }; class ACE_EscortCaptive { displayName = CSTRING(EscortCaptive); distance = 4; @@ -97,7 +97,7 @@ class CfgVehicles { }; }; -#define MACRO_LOADUNLOADCAPTIVE \ +#define MACRO_LOADCAPTIVE \ class ACE_Actions { \ class ACE_MainActions { \ class GVAR(LoadCaptive) { \ @@ -113,27 +113,27 @@ class CfgVehicles { class LandVehicle; class Car: LandVehicle { - MACRO_LOADUNLOADCAPTIVE + MACRO_LOADCAPTIVE }; class Tank: LandVehicle { - MACRO_LOADUNLOADCAPTIVE + MACRO_LOADCAPTIVE }; class Air; class Helicopter: Air { - MACRO_LOADUNLOADCAPTIVE + MACRO_LOADCAPTIVE }; class Plane: Air { - MACRO_LOADUNLOADCAPTIVE + MACRO_LOADCAPTIVE }; class Ship; class Ship_F: Ship { - MACRO_LOADUNLOADCAPTIVE + MACRO_LOADCAPTIVE }; class StaticWeapon: LandVehicle { - MACRO_LOADUNLOADCAPTIVE + MACRO_LOADCAPTIVE }; class Box_NATO_Support_F; diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index da2192d3d6..1372b4e10a 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -6,12 +6,11 @@ if (isServer) then { addMissionEventHandler ["HandleDisconnect", { - PARAMS_1(_disconnectedPlayer); + params ["_disconnectedPlayer"]; private "_escortedUnit"; _escortedUnit = _disconnectedPlayer getVariable [QGVAR(escortedUnit), objNull]; if ((!isNull _escortedUnit) && {(attachedTo _escortedUnit) == _disconnectedPlayer}) then { detach _escortedUnit; - //systemChat "debug: DC detach"; }; if (_disconnectedPlayer getVariable [QGVAR(isEscorting), false]) then { _disconnectedPlayer setVariable [QGVAR(isEscorting), false, true]; diff --git a/addons/captives/XEH_preInit.sqf b/addons/captives/XEH_preInit.sqf index 31bcbe8e02..d2b5b615bb 100644 --- a/addons/captives/XEH_preInit.sqf +++ b/addons/captives/XEH_preInit.sqf @@ -16,6 +16,7 @@ PREP(doFriskPerson); PREP(doLoadCaptive); PREP(doRemoveHandcuffs); PREP(doUnloadCaptive); +PREP(findEmptyNonFFVCargoSeat); PREP(handleGetIn); PREP(handleGetOut); PREP(handleKilled); diff --git a/addons/captives/functions/fnc_canLoadCaptive.sqf b/addons/captives/functions/fnc_canLoadCaptive.sqf index 0e028ac1ec..a59c2e3be6 100644 --- a/addons/captives/functions/fnc_canLoadCaptive.sqf +++ b/addons/captives/functions/fnc_canLoadCaptive.sqf @@ -11,28 +11,36 @@ * The return value * * Example: - * [player, bob] call ACE_captives_fnc_canLoadCaptive + * [player, bob, car] call ACE_captives_fnc_canLoadCaptive * * Public: No */ #include "script_component.hpp" -private ["_objects"]; params ["_unit", "_target","_vehicle"]; -if (isNull _target) then { - _objects = attachedObjects _unit; - _objects = [_objects, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter); - if ((count _objects) > 0) then {_target = _objects select 0;}; +if ((isNull _target) && {_unit getVariable [QGVAR(isEscorting), false]}) then { + //Looking at a vehicle while escorting, get target from attached objects: + { + if (_x getVariable [QGVAR(isHandcuffed), false]) exitWith { + _target = _x; + }; + } forEach (attachedObjects _unit); }; +if ((isNull _target) || {(vehicle _target) != _target} || {!(_target getVariable [QGVAR(isHandcuffed), false])}) exitWith {false}; if (isNull _vehicle) then { - _objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10]; - if ((count _objects) > 0) then {_vehicle = _objects select 0;}; + //Looking at a captive unit, search for nearby vehicles with valid seats: + { + if ((_x emptyPositions "cargo") > 0) exitWith { + _vehicle = _x; + }; + } forEach (nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10]); +} else { + //We have a vehicle picked, make sure it has empty seats: + if ((_vehicle emptyPositions "cargo") == 0) then { + _vehicle = objNull; + }; }; -(!isNull _target) -&& {!isNull _vehicle} -&& {_unit getVariable [QGVAR(isEscorting), false]} -&& {_target getVariable [QGVAR(isHandcuffed), false]} -&& {_vehicle emptyPositions "cargo" > 0} +(!isNull _vehicle) diff --git a/addons/captives/functions/fnc_canRemoveHandcuffs.sqf b/addons/captives/functions/fnc_canRemoveHandcuffs.sqf index e8bbe3b50e..e36ba5cd5b 100644 --- a/addons/captives/functions/fnc_canRemoveHandcuffs.sqf +++ b/addons/captives/functions/fnc_canRemoveHandcuffs.sqf @@ -20,4 +20,5 @@ params ["_unit", "_target"]; //Unit is handcuffed and not currently being escorted _target getVariable [QGVAR(isHandcuffed), false] && -{isNull (attachedTo _target)} +{isNull (attachedTo _target)} && +{(vehicle _target) == _target} diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf index bb070b057a..08b64195f3 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -35,7 +35,9 @@ if (_state) then { nil, 20, false, true, "", QUOTE(!isNull (GETVAR(_target,QGVAR(escortedUnit),objNull)))]; [{ - EXPLODE_3_PVT((_this select 0),_unit,_target,_actionID); + params ["_args", "_pfID"]; + _args params ["_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 { _unit setVariable [QGVAR(isEscorting), false, true]; diff --git a/addons/captives/functions/fnc_doFriskPerson.sqf b/addons/captives/functions/fnc_doFriskPerson.sqf index e14025b88f..9a8a423dc3 100644 --- a/addons/captives/functions/fnc_doFriskPerson.sqf +++ b/addons/captives/functions/fnc_doFriskPerson.sqf @@ -18,7 +18,6 @@ private ["_weapon", "_listedItemClasses", "_actions", "_allGear"]; -PARAMS_2(_player,_unit); params ["_player", "_unit"]; _weapon = currentWeapon _player; diff --git a/addons/captives/functions/fnc_doLoadCaptive.sqf b/addons/captives/functions/fnc_doLoadCaptive.sqf index d7df42eb0a..a4d7df8892 100644 --- a/addons/captives/functions/fnc_doLoadCaptive.sqf +++ b/addons/captives/functions/fnc_doLoadCaptive.sqf @@ -1,6 +1,6 @@ /* * Author: commy2 - * Unit loads the target object into a vehicle. + * Unit loads the target object into a vehicle. (logic same as canLoadCaptive) * * Arguments: * 0: Unit that wants to load a captive @@ -17,24 +17,34 @@ */ #include "script_component.hpp" -private "_objects"; - params ["_unit", "_target","_vehicle"]; -if (isNull _target) then { - _objects = attachedObjects _unit; - _objects = [_objects, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter); - if ((count _objects) > 0) then {_target = _objects select 0;}; +if ((isNull _target) && {_unit getVariable [QGVAR(isEscorting), false]}) then { + //Looking at a vehicle while escorting, get target from attached objects: + { + if (_x getVariable [QGVAR(isHandcuffed), false]) exitWith { + _target = _x; + }; + } forEach (attachedObjects _unit); }; -if (isNull _target) exitWith {}; +if ((isNull _target) || {(vehicle _target) != _target} || {!(_target getVariable [QGVAR(isHandcuffed), false])}) exitWith {ERROR("");}; if (isNull _vehicle) then { - _objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10]; - if ((count _objects) > 0) then {_vehicle = _objects select 0;}; + //Looking at a captive unit, search for nearby vehicles with valid seats: + { + // if (([_x] call FUNC(findEmptyNonFFVCargoSeat)) != -1) exitWith { + if ((_x emptyPositions "cargo") > 0) exitWith { + _vehicle = _x; + }; + } forEach (nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10]); +} else { + // if (([_vehicle] call FUNC(findEmptyNonFFVCargoSeat)) == -1) then { + if ((_vehicle emptyPositions "cargo") == 0) then { + _vehicle = objNull; + }; }; -if (isNull _vehicle) exitWith {}; -if ((!isNil "_target") && {!isNil "_vehicle"}) then { - _unit setVariable [QGVAR(isEscorting), false, true]; - ["MoveInCaptive", [_target], [_target, _vehicle]] call EFUNC(common,targetEvent); -}; +if (isNull _vehicle) exitWith {ERROR("");}; + +_unit setVariable [QGVAR(isEscorting), false, true]; +["MoveInCaptive", [_target], [_target, _vehicle]] call EFUNC(common,targetEvent); diff --git a/addons/captives/functions/fnc_findEmptyNonFFVCargoSeat.sqf b/addons/captives/functions/fnc_findEmptyNonFFVCargoSeat.sqf new file mode 100644 index 0000000000..cf67614f91 --- /dev/null +++ b/addons/captives/functions/fnc_findEmptyNonFFVCargoSeat.sqf @@ -0,0 +1,67 @@ +/* + * Author: PabstMirror + * Finds a free cargo seat, searching non FFV first + * + * Arguments: + * 0: The Vehicle + * + * Return Value: + * ARRAY [seat index , is FFV ] + * + * Example: + * [car1] call ACE_captives_fnc_findEmptyNonFFVCargoSeat + * + * Public: No + */ +#include "script_component.hpp" + +params ["_vehicle"]; +TRACE_1("params", _vehicle); + +_vehicleConfig = configFile >> "CfgVehicles" >> (typeOf _vehicle); + +_proxyOrder = getArray (_vehicleConfig >> "getInProxyOrder"); +_transportSoldier = getNumber (_vehicleConfig >> "transportSoldier"); +_realCargoCount = if (isArray (_vehicleConfig >> "getInProxyOrder")) then {count _proxyOrder} else {_transportSoldier}; + +//Find FFV turrets: +_ffvCargoIndexes = []; +{ + _turretConfig = [_vehicleConfig, _x] call EFUNC(common,getTurretConfigPath); + _isCargoProxy = ((getText (_turretConfig >> "proxyType")) == "CPCargo") && {isNumber (_turretConfig >> "proxyIndex")}; + + if (_isCargoProxy) then { + _proxyCargoIndex = getNumber (_turretConfig >> "proxyIndex"); + _cargoIndex = _proxyOrder find _proxyCargoIndex; + _ffvCargoIndexes pushBack _cargoIndex; + }; +} forEach (allTurrets [_vehicle, true]); + +//Find Empty Seats: +_occupiedSeats = []; +{ + _x params ["", "", "_xIndex"]; + if (_xIndex > -1) then {_occupiedSeats pushBack _xIndex;}; +} forEach (fullCrew _vehicle); + +TRACE_3("Searching for empty seat",_realCargoCount,_ffvCargoIndexes,_occupiedSeats); + +_emptyCargoSeatReturn = [-1, false]; + +//First seach for non-ffv seats: +for "_index" from 0 to (_realCargoCount - 1) do { + if ((!(_index in _ffvCargoIndexes)) && {!(_index in _occupiedSeats)}) exitWith { + _emptyCargoSeatReturn = [_index, false]; + }; +}; + +//Only use FFV if none found: +if (_emptyCargoSeatReturn isEqualTo [-1, false]) then { + for "_index" from 0 to (_realCargoCount - 1) do { + if (!(_index in _occupiedSeats)) exitWith { + _emptyCargoSeatReturn = [_index, true]; + }; + }; +}; + +_emptyCargoSeatReturn diff --git a/addons/captives/functions/fnc_handleGetIn.sqf b/addons/captives/functions/fnc_handleGetIn.sqf index 487e7d4179..5476073b38 100644 --- a/addons/captives/functions/fnc_handleGetIn.sqf +++ b/addons/captives/functions/fnc_handleGetIn.sqf @@ -4,8 +4,8 @@ * * Arguments: * 0: _vehicle - * 2: dunno - * 1: _unit + * 1: dunno + * 2: _unit * * Return Value: * The return value @@ -17,7 +17,8 @@ */ #include "script_component.hpp" -params ["_vehicle", "_dontcare","_unit"]; +params ["_vehicle", "","_unit"]; +TRACE_2("params",_vehicle,_unit); if (local _unit) then { if (_unit getVariable [QGVAR(isEscorting), false]) then { @@ -27,4 +28,18 @@ if (local _unit) then { if (_unit getVariable [QGVAR(isSurrendering), false]) then { [_unit, false] call FUNC(setSurrender); }; + + if (_unit getVariable [QGVAR(isHandcuffed), false]) then { + //Need to force animation for FFV turrets + _turretPath = []; + { + _x params ["_xUnit", "", "", "_xTurretPath"]; + if (_unit == _xUnit) exitWith {_turretPath = _xTurretPath}; + } forEach (fullCrew (vehicle _unit)); + if (!(_turretPath isEqualTo [])) then { + TRACE_1("Setting FFV Handcuffed Animation",_turretPath); + [_unit, "ACE_HandcuffedFFV", 2] call EFUNC(common,doAnimation); + [_unit, "ACE_HandcuffedFFV", 1] call EFUNC(common,doAnimation); + }; + }; }; diff --git a/addons/captives/functions/fnc_handleGetOut.sqf b/addons/captives/functions/fnc_handleGetOut.sqf index daf88b7e34..dea97eb600 100644 --- a/addons/captives/functions/fnc_handleGetOut.sqf +++ b/addons/captives/functions/fnc_handleGetOut.sqf @@ -4,8 +4,8 @@ * * Arguments: * 0: _vehicle - * 2: dunno - * 1: _unit + * 1: dunno + * 2: _unit * * Return Value: * The return value @@ -17,17 +17,21 @@ */ #include "script_component.hpp" -params ["_vehicle", "_dontcare","_unit"]; +params ["_vehicle", "", "_unit"]; +TRACE_2("params",_vehicle,_unit); if ((local _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}) then { private ["_cargoIndex"]; _cargoIndex = _unit getVariable [QGVAR(CargoIndex), -1]; - //If captive was not "unloaded", then move them back into the vehicle. - if (_cargoIndex != -1) exitWith { + if (_cargoIndex != -1) then { + //If captive was not "unloaded", then move them back into the vehicle. + TRACE_1("forcing back into vehicle",_cargoIndex); _unit moveInCargo [_vehicle, _cargoIndex]; + } else { + //Getting out of vehicle: + [_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation); + [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); }; - - [_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation); }; diff --git a/addons/captives/functions/fnc_handleUnitInitPost.sqf b/addons/captives/functions/fnc_handleUnitInitPost.sqf index 66cbcff794..52957acd68 100644 --- a/addons/captives/functions/fnc_handleUnitInitPost.sqf +++ b/addons/captives/functions/fnc_handleUnitInitPost.sqf @@ -18,7 +18,7 @@ params ["_unit"]; // prevent players from throwing grenades (added to all units) -[_unit, "Throw", {((_this select 1) getVariable [QGVAR(isHandcuffed), false]) || {(_this select 1) getVariable [QGVAR(isSurrendering), false]}}, {}] call EFUNC(common,addActionEventhandler); +// [_unit, "Throw", {systemChat "a"; ((_this select 1) getVariable [QGVAR(isHandcuffed), false]) || {(_this select 1) getVariable [QGVAR(isSurrendering), false]}; true}, {systemChat "b";}] call EFUNC(common,addActionEventhandler); if (local _unit) then { // reset status on mission start diff --git a/addons/captives/functions/fnc_moduleSurrender.sqf b/addons/captives/functions/fnc_moduleSurrender.sqf index 64c80af35c..bdb0f7c1b5 100644 --- a/addons/captives/functions/fnc_moduleSurrender.sqf +++ b/addons/captives/functions/fnc_moduleSurrender.sqf @@ -26,11 +26,11 @@ if (!_activated) exitWith {}; if (local _logic) then { //Modules run before postInit can instal the event handler, so we need to wait a little bit [{ - PARAMS_1(_units); + params ["_units"]; { ["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent); } forEach _units; - }, [_units], 0.05, 0.05]call EFUNC(common,waitAndExecute); + }, [_units], 0.05]call EFUNC(common,waitAndExecute); deleteVehicle _logic; }; diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index 9bde3b399d..a8c8e02fd4 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -17,6 +17,7 @@ #include "script_component.hpp" params ["_unit","_state"]; +TRACE_2("params",_unit,_state); if (!local _unit) exitwith { ERROR("running setHandcuffed on remote unit"); @@ -43,24 +44,47 @@ if (_state) then { // fix anim on mission start (should work on dedicated servers) [{ params ["_unit"]; - if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then { + if (!(_unit getVariable [QGVAR(isHandcuffed), false])) exitWith {}; + + if ((vehicle _unit) == _unit) then { [_unit] call EFUNC(common,fixLoweredRifleAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); + } else { + [_unit, "ACE_HandcuffedFFV", 2] call EFUNC(common,doAnimation); + [_unit, "ACE_HandcuffedFFV", 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); + //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 ["_unit", "_newAnimation"]; + TRACE_2("AnimChanged",_unit,_newAnimation); + if (_unit == (vehicle _unit)) then { if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { TRACE_1("Handcuff animation interrupted",_newAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); }; - }]; - _unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID]; + } else { - }; - }, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute); + _turretPath = []; + { + _x params ["_xUnit", "", "", "_xTurretPath"]; + if (_unit == _xUnit) exitWith {_turretPath = _xTurretPath}; + } forEach (fullCrew (vehicle _unit)); + TRACE_1("turret Path",_turretPath); + if (_turretPath isEqualTo []) exitWith {}; + + TRACE_1("Handcuff (FFV) animation interrupted",_newAnimation); + [_unit, "ACE_HandcuffedFFV", 2] call EFUNC(common,doAnimation); + [_unit, "ACE_HandcuffedFFV", 1] call EFUNC(common,doAnimation); + }; + }]; + TRACE_2("Adding animChangedEH",_unit,_animChangedEHID); + _unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID]; + + }, [_unit], 0.01] call EFUNC(common,waitAndExecute); } else { _unit setVariable [QGVAR(isHandcuffed), false, true]; [_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus); @@ -68,6 +92,7 @@ if (_state) then { //remove AnimChanged EH private "_animChangedEHID"; _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1]; + TRACE_1("removing animChanged EH",_animChangedEHID); _unit removeEventHandler ["AnimChanged", _animChangedEHID]; _unit setVariable [QGVAR(handcuffAnimEHID), -1]; diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index 4fad2d3853..dd9ac417c5 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -17,6 +17,7 @@ #include "script_component.hpp" params ["_unit","_state"]; +TRACE_2("params",_unit,_state); if (!local _unit) exitwith { ERROR("running surrender on remote unit"); @@ -43,13 +44,13 @@ if (_state) then { // fix anim on mission start (should work on dedicated servers) [{ - PARAMS_1(_unit); + params ["_unit"]; 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); + params ["_unit", "_newAnimation"]; if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { TRACE_1("Surrender animation interrupted",_newAnimation); [_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation); @@ -57,7 +58,7 @@ if (_state) then { }]; _unit setVariable [QGVAR(surrenderAnimEHID), _animChangedEHID]; }; - }, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute); + }, [_unit], 0.01] call EFUNC(common,waitAndExecute); } else { _unit setVariable [QGVAR(isSurrendering), false, true]; [_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus); @@ -85,8 +86,8 @@ if (_state) then { //spin up a PFEH, to watching animationState for the next 20 seconds to make sure we don't enter "hands up" //Handles long animation chains [{ - PARAMS_2(_args,_pfID); - EXPLODE_2_PVT(_args,_unit,_maxTime); + params ["_args", "_pfID"]; + _args params ["_unit", "_maxTime"]; //If waited long enough or they re-surrendered or they are unconscious, exit loop if ((ACE_time > _maxTime) || {_unit getVariable [QGVAR(isSurrendering), false]} || {_unit getVariable ["ACE_isUnconscious", false]}) exitWith { [_pfID] call CBA_fnc_removePerFrameHandler; diff --git a/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf b/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf index 7e30fe4af4..0839c61ea1 100644 --- a/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf +++ b/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf @@ -16,11 +16,17 @@ */ #include "script_component.hpp" +params ["_target","_vehicle"]; +TRACE_2("params",_target,_vehicle); + private ["_cargoIndex"]; -params ["_target","_vehicle"]; +_getSeat = [_vehicle] call FUNC(findEmptyNonFFVCargoSeat); +TRACE_1("free cargo seat",_getSeat); +_cargoIndex = _getSeat select 0; +if (_cargoIndex == -1) exitWith {ERROR("cargo index -1");}; + +_target moveInCargo [_vehicle, _cargoIndex]; +_target assignAsCargoIndex [_vehicle, _cargoIndex]; -_target moveInCargo _vehicle; -_target assignAsCargo _vehicle; -_cargoIndex = _vehicle getCargoIndex _target; _target setVariable [QGVAR(CargoIndex), _cargoIndex, true]; diff --git a/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf b/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf index 000d5ef568..ce44b5926f 100644 --- a/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf +++ b/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf @@ -16,8 +16,11 @@ #include "script_component.hpp" params ["_unit"]; +TRACE_1("params",_unit); + _unit setVariable [QGVAR(CargoIndex), -1, true]; moveOut _unit; [_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation); +[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); unassignVehicle _unit; diff --git a/addons/captives/script_component.hpp b/addons/captives/script_component.hpp index e68eb19d2f..375c956129 100644 --- a/addons/captives/script_component.hpp +++ b/addons/captives/script_component.hpp @@ -1,6 +1,8 @@ #define COMPONENT captives #include "\z\ace\addons\main\script_mod.hpp" +// #define DEBUG_MODE_FULL + #ifdef DEBUG_ENABLED_CAPTIVES #define DEBUG_MODE_FULL #endif diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 08982b7277..41391fa96b 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -164,6 +164,7 @@ Einheit kapitulieren lassen Vzdávající se jednotka Fazer unidade se render + Egység kapitulálása Sync a unit to make them surrender.<br />Source: ace_captives @@ -172,6 +173,7 @@ Einheit synchronisieren, um sie kapitulieren zu lassen.<br />Quelle: ace_captives Synchronizuj s jednotkou, která se má vzdát.<br />Zdroj: ace_captives Sincroniza uma unidade para fazer com que ela se renda. <br/>Fonte: ace_captives + Egység szinkronizálása, hogy kapituláljon.<br />Forrás: ace_captives Captives Settings @@ -180,6 +182,7 @@ Nastavení zajatce Gefangenen-Einstellungen Ajustes de prisioneiros + Fogoly-beállítások Controls settings for surrender and cable ties @@ -188,6 +191,7 @@ Toto kontroluje nastavení kapitulace a pout Einstellungen zur Kapitulation und Kabelbindern Controla as configurações de rendição e abraçadeiras + Szabályozza a kapituláció és bilincselés beállításait Can handcuff own side @@ -196,6 +200,7 @@ Může spoutat spolubojovníky Kann Teamkollegen fesseln Pode algemar o próprio lado + Saját oldal megbilincselhető Can players cabletie units on their own side @@ -204,6 +209,7 @@ Mohou hráči spoutat jednotky na své straně Können Spieler eigene Einheiten fesseln Os jogadores podem algemar unidades do seu lado + A játékosok megkötözhetik-e a saját oldalukon lévő egységeket Allow surrendering @@ -212,6 +218,7 @@ Povolit vzdávání Kapitulation erlauben Permite rendição + Kapituláció engedélyezése Players can surrender after holstering their weapon @@ -220,6 +227,7 @@ Hráč se může vzdát poté, co si skryje zbraň Spieler können kapitulieren, nachdem sie ihre Waffe geholstert haben Jogadores podem se render depois de guardar sua arma + A játékosok megadhatják magukat a fegyverük elrakása után Require surrendering diff --git a/addons/cargo/CfgEventHandlers.hpp b/addons/cargo/CfgEventHandlers.hpp index 76e367bbd3..15aaaadad6 100644 --- a/addons/cargo/CfgEventHandlers.hpp +++ b/addons/cargo/CfgEventHandlers.hpp @@ -4,6 +4,12 @@ class Extended_PreInit_EventHandlers { }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; + class Extended_Killed_EventHandlers { class All { init = QUOTE(call FUNC(handleDestroyed)); diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf new file mode 100644 index 0000000000..6501044c9d --- /dev/null +++ b/addons/cargo/XEH_postInit.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +["LoadCargo", {_this call FUNC(loadItem)}] call EFUNC(common,addEventHandler); +["UnloadCargo", {_this call FUNC(unloadItem)}] call EFUNC(common,addEventHandler); +["AddCargoByClass", {_this call FUNC(addCargoItem)}] call EFUNC(common,addEventHandler); diff --git a/addons/cargo/XEH_preInit.sqf b/addons/cargo/XEH_preInit.sqf index 9cc90501c1..8924cacfd5 100644 --- a/addons/cargo/XEH_preInit.sqf +++ b/addons/cargo/XEH_preInit.sqf @@ -2,6 +2,7 @@ ADDON = false; +PREP(addCargoItem); PREP(canLoad); PREP(canLoadItemIn); PREP(canUnloadItem); @@ -21,8 +22,4 @@ PREP(validateCargoSpace); GVAR(initializedItemClasses) = []; -if (isServer) then { - ["cargo_hideItem", {params ["_object", "_status"]; _object hideObjectGlobal _status;}] call EFUNC(common,addEventHandler); -}; - ADDON = true; diff --git a/addons/cargo/functions/fnc_addCargoItem.sqf b/addons/cargo/functions/fnc_addCargoItem.sqf new file mode 100644 index 0000000000..1233d0228d --- /dev/null +++ b/addons/cargo/functions/fnc_addCargoItem.sqf @@ -0,0 +1,38 @@ +/* + * Author: Glowbal, Jonpas + * Adds a cargo item to the vehicle. + * + * Arguments: + * 0: Item Classname + * 1: Vehicle + * 2: Amount (default: 1) + * + * Return Value: + * None + * + * Example: + * ["item", vehicle] call ace_cargo_fnc_addCargoItem + * + * Public: No + */ +#include "script_component.hpp" + +private ["_position", "_item", "_i"]; +params ["_itemClass", "_vehicle", ["_amount", 1]]; +TRACE_3("params",_itemClass,_vehicle,_amount); + +_position = getPos _vehicle; +_position set [1, (_position select 1) + 1]; +_position set [2, (_position select 2) + 7.5]; + +for "_i" from 1 to _amount do { + _item = createVehicle [_itemClass, _position, [], 0, "CAN_COLLIDE"]; + + // Load item or delete it if no space left + if !([_item, _vehicle] call FUNC(loadItem)) exitWith { + deleteVehicle _item; + }; + + // Invoke listenable event + ["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent); +}; diff --git a/addons/cargo/functions/fnc_canLoad.sqf b/addons/cargo/functions/fnc_canLoad.sqf index da41d93358..f5d1304a95 100644 --- a/addons/cargo/functions/fnc_canLoad.sqf +++ b/addons/cargo/functions/fnc_canLoad.sqf @@ -18,6 +18,8 @@ params ["_player", "_object"]; +if (!([_player, _object, []] call EFUNC(common,canInteractWith))) exitWith {false}; + private ["_nearestVehicle"]; _nearestVehicle = [_player] call FUNC(findNearestVehicle); diff --git a/addons/cargo/functions/fnc_getSizeItem.sqf b/addons/cargo/functions/fnc_getSizeItem.sqf index a3556c8a25..dacd6a4982 100644 --- a/addons/cargo/functions/fnc_getSizeItem.sqf +++ b/addons/cargo/functions/fnc_getSizeItem.sqf @@ -19,7 +19,7 @@ private "_config"; params ["_item"]; -_config = (configFile >> "CfgVehicles" >> typeof _item >> QGVAR(size)); +_config = (configFile >> "CfgVehicles" >> typeOf _item >> QGVAR(size)); if (isNumber (_config)) exitWith { _item getVariable [QGVAR(size), getNumber (_config)] diff --git a/addons/cargo/functions/fnc_initVehicle.sqf b/addons/cargo/functions/fnc_initVehicle.sqf index 8449a316b2..b817688336 100644 --- a/addons/cargo/functions/fnc_initVehicle.sqf +++ b/addons/cargo/functions/fnc_initVehicle.sqf @@ -1,6 +1,6 @@ /* * Author: Glowbal - * Initializes vehicle, adds open caro menu action if available. + * Initializes vehicle, adds open cargo menu action if available. * * Arguments: * 0: Vehicle @@ -25,20 +25,8 @@ _initializedClasses = GETMVAR(GVAR(initializedClasses),[]); if (isServer) then { { if (isClass _x) then { - private ["_className", "_amount","_position","_object"]; - _className = getText (_x >> "type"); - _amount = getNumber (_x >> "amount"); - _position = getPos _vehicle; - _position set [1, (_position select 1) + 1]; - _position set [2, (_position select 2) + 7.5]; - for "_i" from 1 to _amount do { - _object = createVehicle [_className, _position, [], 0, "CAN_COLLIDE"]; - if !([_object, _vehicle] call FUNC(loadItem)) exitWith { - deleteVehicle _object; - }; - }; + ["AddCargoByClass", [getText (_x >> "type"), _vehicle, getNumber (_x >> "amount")]] call EFUNC(common,localEvent); }; - nil } count ("true" configClasses (configFile >> "CfgVehicles" >> _type >> "ACE_Cargo" >> "Cargo")); }; @@ -51,7 +39,10 @@ SETMVAR(GVAR(initializedClasses),_initializedClasses); if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) exitWith {}; private ["_text", "_condition", "_statement", "_icon", "_action"]; -_condition = {GVAR(enable)}; +_condition = { + params ["_target", "_player"]; + GVAR(enable) && {[_player, _target, []] call EFUNC(common,canInteractWith)} +}; _text = localize LSTRING(openMenu); _statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);}; _icon = ""; diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index f8816f3b8f..cf81bdbe6c 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -32,6 +32,9 @@ _vehicle setVariable [QGVAR(space), _space - _itemSize, true]; detach _item; _item attachTo [_vehicle,[0,0,100]]; -["cargo_hideItem", [_item, true]] call EFUNC(common,serverEvent); +["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent); + +// Invoke listenable event +["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent); true diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf index f6d70591df..1390a8c20d 100644 --- a/addons/cargo/functions/fnc_unloadItem.sqf +++ b/addons/cargo/functions/fnc_unloadItem.sqf @@ -58,8 +58,11 @@ _vehicle setVariable [QGVAR(space), (_space + _itemSize), true]; detach _item; _item setPosASL (_emptyPos call EFUNC(common,PositiontoASL)); -["cargo_hideItem", [_item, false]] call EFUNC(common,serverEvent); +["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent); // TOOO maybe drag/carry the unloaded item? +// Invoke listenable event +["cargoUnloaded", [_item, _vehicle]] call EFUNC(common,globalEvent); + true diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index bf699ab83c..ba014ff182 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -1,4 +1,6 @@ // ACE - Common + +// #define ENABLE_PERFORMANCE_COUNTERS #include "script_component.hpp" //IGNORE_PRIVATE_WARNING("_handleNetEvent", "_handleRequestAllSyncedEvents", "_handleRequestSyncedEvent", "_handleSyncedEvent"); @@ -111,6 +113,7 @@ if(!isServer) then { if (isServer) then { [FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler; }; + call FUNC(checkFiles); @@ -203,10 +206,12 @@ GVAR(OldCameraView) = cameraView; GVAR(OldPlayerVehicle) = vehicle ACE_player; GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex); GVAR(OldPlayerWeapon) = currentWeapon ACE_player; +GVAR(OldVisibleMap) = false; // PFH to raise varios events [{ - private ["_newCameraView", "_newInventoryDisplayIsOpen", "_newPlayerInventory", "_newPlayerTurret", "_newPlayerVehicle", "_newPlayerVisionMode", "_newPlayerWeapon", "_newZeusDisplayIsOpen"]; + BEGIN_COUNTER(stateChecker); + private ["_newCameraView", "_newInventoryDisplayIsOpen", "_newPlayerInventory", "_newPlayerTurret", "_newPlayerVehicle", "_newPlayerVisionMode", "_newPlayerWeapon", "_newZeusDisplayIsOpen", "_newVisibleMap"]; // "playerInventoryChanged" event _newPlayerInventory = [ACE_player] call FUNC(getAllGear); if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then { @@ -270,26 +275,27 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player; GVAR(OldPlayerWeapon) = _newPlayerWeapon; ["playerWeaponChanged", [ACE_player, _newPlayerWeapon]] call FUNC(localEvent); }; - + + // "visibleMapChanged" event + _newVisibleMap = visibleMap; + if (!_newVisibleMap isEqualTo GVAR(OldVisibleMap)) then { + // Raise ACE event locally + GVAR(OldVisibleMap) = _newVisibleMap; + ["visibleMapChanged", [ACE_player, _newVisibleMap]] call FUNC(localEvent); + }; + + END_COUNTER(stateChecker); + }, 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 private ["_isCamera"]; - _isCamera = {!isNull _x} count ALL_CAMERAS > 0; + _isCamera = call FUNC(isfeatureCameraActive); if !(_isCamera isEqualTo GVAR(OldIsCamera)) then { // Raise ACE event locally GVAR(OldIsCamera) = _isCamera; @@ -317,7 +323,7 @@ GVAR(OldIsCamera) = false; // Lastly, do JIP events // JIP Detection and event trigger. Run this at the very end, just in case anything uses it -if(isMultiplayer && { ACE_time > 0 || isNull player } ) then { +if (didJip) then { // We are jipping! Get ready and wait, and throw the event [{ if(!(isNull player)) then { @@ -371,5 +377,4 @@ GVAR(deviceKeyCurrentIndex) = -1; {false}, [0xC7, [true, false, false]], false] call cba_fnc_addKeybind; //SHIFT + Home Key - GVAR(commonPostInited) = true; diff --git a/addons/common/functions/fnc_checkFiles.sqf b/addons/common/functions/fnc_checkFiles.sqf index 647a1b00a6..c1a0b1cb89 100644 --- a/addons/common/functions/fnc_checkFiles.sqf +++ b/addons/common/functions/fnc_checkFiles.sqf @@ -20,7 +20,9 @@ _version = getText (configFile >> "CfgPatches" >> "ace_main" >> "versionStr"); diag_log text format ["[ACE]: ACE is version %1.", _version]; private "_addons"; -_addons = activatedAddons; +//_addons = activatedAddons; // broken with High-Command module, see #2134 +_addons = "true" configClasses (configFile >> "CfgPatches");// +_addons = [_addons, {toLower configName _this}] call FUNC(map);// _addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter); { @@ -80,7 +82,7 @@ if (isMultiplayer) then { diag_log text format ["[ACE] ERROR: %1", _errorMsg]; - if (hasInterface) then {diag_log str "1"; + if (hasInterface) then { ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); }; }; @@ -91,7 +93,7 @@ if (isMultiplayer) then { diag_log text format ["[ACE] ERROR: %1", _errorMsg]; - if (hasInterface) then {diag_log str "1"; + if (hasInterface) then { ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); }; }; diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 0bbe6564da..e542e28ae8 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -477,6 +477,7 @@ Überprüfe PBOs Zkontrolovat PBO Verificar PBOs + PBO-k ellenőrzése Sprawdzaj spójność addonów z serwerem @@ -492,6 +493,7 @@ Aktion Akce Ação + Cselekvés What to do with people who do not have the right PBOs? @@ -500,6 +502,7 @@ Was soll mit Leuten passieren, die nicht die richtigen PBOs haben? Co udělat s lidmi, co nemají správné addony? O que fazer com pessoas que não tem os PBOs corretos? + Mi legyen azokkal a személyekkel, akiknek nincsenek meg a helyes PBO-k? Warn once @@ -508,6 +511,7 @@ Einmal verwarnen Upozornit jednou Avisar uma vez + Egyszeri figyelmeztetés Warn (permanent) @@ -516,6 +520,7 @@ Immer verwarnen Upozornit (permanentně) Avisar (permanente) + Figyelmeztetés (tartós) Kick @@ -524,6 +529,7 @@ Kicken Vyhodit Chutar + Kirúgás Check all addons @@ -532,6 +538,7 @@ Alle Addons überprüfen Zkontrolovat všechny addony Verificar todos addons + Összes bővítmény ellenőrzése Check all addons instead of only those of ACE? @@ -540,6 +547,7 @@ Alle Addons anstatt nur ACE überprüfen? Zkontrolovat všechny addony namísto jen těch od ACE? Verificar todos addons invés de só os do ACE? + Az összes bővítmény ellenőrzése, csak az ACE helyett? Whitelist @@ -548,6 +556,7 @@ Whitelist Seznam povolených Lista branca + Fehérlista What addons are allowed regardless? @@ -556,6 +565,7 @@ Welche Addons werden dennoch erlaubt? Jaké addony jsou povoleny? Quais addons são permitidos de qualquer maneira? + Milyen bővítmények vannak feltétlenül engedélyezve? LSD Vehicles @@ -564,6 +574,7 @@ LSD-Fahrzeuge LSD vozidla Veículos LSD + LSD járművek Adds LSD effect to synchronized vehicle @@ -572,6 +583,7 @@ Fügt einen LSD-Effekt zum synchronisierten Fahrzeug hinzu Přidá LSD efekt pro synchronizované vozidla Adiciona efeito LSD ao veículo sincronizado + LSD-effekt hozzáadása a szinkronizált járművekhez Toggle Handheld Device @@ -580,6 +592,7 @@ Ativa dispositivo de mão Przełącz urządzenie podręczne Přepnout ruční zařízení + Kézi eszköz kapcsolása Close Handheld Device @@ -588,6 +601,7 @@ Fecha dispositivo de mão Zamknij urządzenie podręczne Zavřít ruční zařízení + Kézi eszköz bezárása Cycle Handheld Devices @@ -596,6 +610,7 @@ Troca dispositivos de mão Następne urządzenie podręczne Procházet ruční zařízení + Kézi eszköz váltása Disabled diff --git a/addons/concertina_wire/CfgVehicles.hpp b/addons/concertina_wire/CfgVehicles.hpp index d0514aa700..81304da853 100644 --- a/addons/concertina_wire/CfgVehicles.hpp +++ b/addons/concertina_wire/CfgVehicles.hpp @@ -74,6 +74,7 @@ class CfgVehicles { scope = 2; displayName = $STR_ACE_CONCERTINA_WIRE; model = PATHTOF(data\ACE_ConcertinaWire.p3d); + EGVAR(logistics_wirecutter,isFence) = 1; class ACE_Actions { class ACE_MainActions { selection = ""; diff --git a/addons/dragging/XEH_clientInit.sqf b/addons/dragging/XEH_clientInit.sqf index 21d699c688..e80d63cfde 100644 --- a/addons/dragging/XEH_clientInit.sqf +++ b/addons/dragging/XEH_clientInit.sqf @@ -1,7 +1,7 @@ // by PabstMirror, commy2 #include "script_component.hpp" -[{_this call DFUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler); +[DFUNC(handleScrollWheel)] call EFUNC(common,addScrollWheelEventHandler); if (isNil "ACE_maxWeightDrag") then { ACE_maxWeightDrag = 800; @@ -15,11 +15,11 @@ if (isNil "ACE_maxWeightCarry") then { ["isNotCarrying", {!((_this select 0) getVariable [QGVAR(isCarrying), false])}] call EFUNC(common,addCanInteractWithCondition); // release object on player change. This does work when returning to lobby, but not when hard disconnecting. -["playerChanged", {_this call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); +["playerChanged", DFUNC(handlePlayerChanged)] call EFUNC(common,addEventhandler); ["playerVehicleChanged", {[ACE_player, objNull] call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); -["playerWeaponChanged", {_this call DFUNC(handlePlayerWeaponChanged)}] call EFUNC(common,addEventhandler); +["playerWeaponChanged", DFUNC(handlePlayerWeaponChanged)] call EFUNC(common,addEventhandler); // handle waking up dragged unit and falling unconscious while dragging -["medical_onUnconscious", {_this call DFUNC(handleUnconscious)}] call EFUNC(common,addEventhandler); +["medical_onUnconscious", DFUNC(handleUnconscious)] call EFUNC(common,addEventhandler); //@todo Captivity? diff --git a/addons/dragging/XEH_serverInit.sqf b/addons/dragging/XEH_serverInit.sqf index f6c231d275..01d78ef4e3 100644 --- a/addons/dragging/XEH_serverInit.sqf +++ b/addons/dragging/XEH_serverInit.sqf @@ -2,4 +2,4 @@ #include "script_component.hpp" // release object on hard disconnection. Function is identical to killed -addMissionEventHandler ["HandleDisconnect", {_this call DFUNC(handleKilled)}]; +addMissionEventHandler ["HandleDisconnect", DFUNC(handleKilled)]; diff --git a/addons/dragging/functions/fnc_canCarry.sqf b/addons/dragging/functions/fnc_canCarry.sqf index 6472124aef..a6b8fed5ab 100644 --- a/addons/dragging/functions/fnc_canCarry.sqf +++ b/addons/dragging/functions/fnc_canCarry.sqf @@ -3,19 +3,18 @@ * * Check if unit can carry the object. Doesn't check weight. * - * Argument: - * 0: Unit that should do the carrying (Object) - * 1: Object to carry (Object) + * Arguments: + * 0: Unit that should do the carrying + * 1: Object to carry * - * Return value: - * Can the unit carry the object? (Bool) + * Return Value: + * Can the unit carry the object? + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +params ["_unit", "_target"]; if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf index 7eedfce179..4ab3562ba2 100644 --- a/addons/dragging/functions/fnc_canDrag.sqf +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -3,12 +3,14 @@ * * Check if unit can drag the object. Doesn't check weight. * - * Argument: - * 0: Unit that should do the dragging (Object) - * 1: Object to drag (Object) + * Arguments: + * 0: Unit that should do the dragging + * 1: Object to drag * - * Return value: - * Can the unit drag the object? (Bool) + * Return Value: + * Can the unit drag the object? + * + * Public: No */ #include "script_component.hpp" @@ -22,4 +24,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 && {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 +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})}; diff --git a/addons/dragging/functions/fnc_canDrop.sqf b/addons/dragging/functions/fnc_canDrop.sqf index df75b9540f..58c02cab07 100644 --- a/addons/dragging/functions/fnc_canDrop.sqf +++ b/addons/dragging/functions/fnc_canDrop.sqf @@ -3,19 +3,18 @@ * * Check if unit can drop the object. * - * Argument: - * 0: Unit that currently drags a object (Object) - * 1: Object that is dragged (Object) + * Arguments: + * 0: Unit that currently drags a object + * 1: Object that is dragged * - * Return value: - * Can the unit drop the object? (Bool) + * Return Value: + * Can the unit drop the object? + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +params ["_unit", "_target"]; if !([_unit, _target, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/dragging/functions/fnc_canDrop_carry.sqf b/addons/dragging/functions/fnc_canDrop_carry.sqf index 9efbbe9b0f..430b12c642 100644 --- a/addons/dragging/functions/fnc_canDrop_carry.sqf +++ b/addons/dragging/functions/fnc_canDrop_carry.sqf @@ -3,19 +3,18 @@ * * Check if unit can drop the carried object. * - * Argument: - * 0: Unit that currently carries a object (Object) - * 1: Object that is carried (Object) + * Arguments: + * 0: Unit that currently carries a object + * 1: Object that is carried * - * Return value: - * Can the unit drop the object? (Bool) + * Return Value: + * Can the unit drop the object? + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +params ["_unit", "_target"]; if !([_unit, _target, ["isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index bb413d8240..7f70b2bdc5 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -3,19 +3,18 @@ * * Carry an object. * - * Argument: - * 0: Unit that should do the carrying (Object) - * 1: Object to carry (Object) + * Arguments: + * 0: Unit that should do the carrying + * 1: Object to carry * - * Return value: - * NONE. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +params ["_unit", "_target"]; // get attachTo offset and direction. private ["_position", "_direction"]; diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index 3ad1f89f77..d0eb7fda17 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -1,21 +1,31 @@ -// by commy2 +/* + * Author: commy2 + * + * PFH for Carry Object + * + * Arguments: + * ? + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" #ifdef DEBUG_ENABLED_DRAGGING systemChat format ["%1 carryObjectPFH running", ACE_time]; #endif -private ["_unit", "_target"]; - -_unit = _this select 0 select 0; -_target = _this select 0 select 1; +params ["_args", "_idPFH"]; +_args params ["_unit","_target"]; if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; // drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject_carry); - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index e4b200c4dd..d12a98213a 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -3,28 +3,25 @@ * * Drag an object. Called from ace_dragging_fnc_startDrag * - * Argument: - * 0: Unit that should do the dragging (Object) - * 1: Object to drag (Object) + * Arguments: + * 0: Unit that should do the dragging + * 1: Object to drag * - * Return value: - * NONE. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +private ["_position", "_direction", "_offset", "_actionID"]; +params ["_unit", "_target"]; // get attachTo offset and direction. -private ["_position", "_direction"]; - _position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]]; _direction = _target getVariable [QGVAR(dragDirection), 0]; // add height offset of model -private "_offset"; _offset = (_target modelToWorldVisual [0, 0, 0] select 2) - (_unit modelToWorldVisual [0, 0, 0] select 2); _position = _position vectorAdd [0, 0, _offset]; @@ -41,7 +38,6 @@ _unit setVariable [QGVAR(isDragging), true, true]; _unit setVariable [QGVAR(draggedObject), _target, true]; // add scrollwheel action to release object -private "_actionID"; _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; if (_actionID != -1) then { diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index 465107af39..dea8897b27 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -1,21 +1,31 @@ -// by commy2 +/* + * Author: commy2 + * + * PFH for Drag Object + * + * Arguments: + * ? + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" #ifdef DEBUG_ENABLED_DRAGGING systemChat format ["%1 dragObjectPFH running", ACE_time]; #endif -private ["_unit", "_target"]; - -_unit = _this select 0 select 0; -_target = _this select 0 select 1; +params ["_args", "_idPFH"]; +_args params ["_unit", "_target"]; if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; // drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject); - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 9589457dbe..2ae07be091 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -3,19 +3,18 @@ * * Drop a dragged object. * - * Argument: - * 0: Unit that drags the other object (Object) - * 1: Dragged object to drop (Object) + * Arguments: + * 0: Unit that drags the other object + * 1: Dragged object to drop * - * Return value: - * NONE. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +params ["_unit", "_target"]; // remove scroll wheel action _unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]); diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index b6dfe9fc45..86009ac867 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -3,19 +3,18 @@ * * Drop a carried object. * - * Argument: - * 0: Unit that carries the other object (Object) - * 1: Carried object to drop (Object) + * Arguments: + * 0: Unit that carries the other object + * 1: Carried object to drop * - * Return value: - * NONE. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +params ["_unit", "_target"]; // remove scroll wheel action _unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]); diff --git a/addons/dragging/functions/fnc_getWeight.sqf b/addons/dragging/functions/fnc_getWeight.sqf index 871c49db89..dcdcbbf3fe 100644 --- a/addons/dragging/functions/fnc_getWeight.sqf +++ b/addons/dragging/functions/fnc_getWeight.sqf @@ -1,54 +1,45 @@ /* - Name: AGM_Drag_fnc_GetWeight - - Author(s): - L-H, edited by commy2 - - Description: - Returns the weight of a crate. - - Parameters: - 0: OBJECT - Crate to get weight of - - Returns: - NUMBER - Weight - - Example: - _weight = Crate1 call AGM_Drag_fnc_GetWeight; + * Author: L-H, edited by commy2, rewritten by joko // Jonas + * + * Returns the weight of a crate. + * + * Arguments: + * 0: Crate to get weight of + * + * Return Value: + * Total Weight + * + * Example: + * _weight = Crate1 call ace_dragging_fnc_getweight; + * + * Public: No */ #include "script_component.hpp" -private "_object"; - -_object = _this select 0; - -private ["_totalWeight", "_fnc","_fnc_Extra"]; +private "_totalWeight"; +params ["_object"]; +// Initialize the total weight. _totalWeight = 0; -_fnc_Extra = { - private ["_weight", "_items"]; - _items = _this select 0; - _weight = 0; - { - _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> (_this select 2) >> "mass") * ((_items select 1) select _foreachIndex)); - } foreach (_items select 0); - - _weight -}; -_fnc = { - private ["_weight", "_items"]; - _items = _this select 0; - _weight = 0; - { - _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> "mass") * ((_items select 1) select _foreachIndex)); - } foreach (_items select 0); - - _weight -}; -_totalWeight = ([getMagazineCargo _object, "CfgMagazines"] call _fnc); -_totalWeight = _totalWeight + ([getItemCargo _object, "CfgWeapons", "ItemInfo"] call _fnc_Extra); -_totalWeight = _totalWeight + ([getWeaponCargo _object, "CfgWeapons", "WeaponSlotsInfo"] call _fnc_Extra); -_totalWeight = _totalWeight + ([getBackpackCargo _object, "CfgVehicles"] call _fnc); -_totalWeight = _totalWeight * 0.5; // Mass in Arma isn't an exact amount but rather a volume/weight value. This attempts to work around that by making it a usable value. (sort of). +// Cycle through all item types with their assigned config paths. +{ + _x params["_items","_getConfigCode"]; + _items params ["_item", "_count"]; + // Cycle through all items and read their mass out of the config. + { + // Multiply mass with amount of items and add the mass to the total weight. + _totalWeight = _totalWeight + (getNumber ((call _getConfigCode) >> "mass") * (_count select _forEachIndex)); + } forEach _item; + true +} count [ + [getMagazineCargo _object, {configFile >> "CfgMagazines" >> _x}], + [getBackpackCargo _object, {configFile >> "CfgVehicles" >> _x}], + [getItemCargo _object, {configFile >> "CfgWeapons" >> _x >> "ItemInfo"}], + [getWeaponCargo _object, {configFile >> "CfgWeapons" >> _x >> "WeaponSlotsInfo"}] +]; -_totalWeight +// add Weight of create to totalWeight +_totalWeight = _totalWeight + (getNumber (configFile >> "CfgVehicles" >> typeof _object >> "mass")); + +// Mass in Arma isn't an exact amount but rather a volume/weight value. This attempts to work around that by making it a usable value. (sort of). +_totalWeight * 0.5 diff --git a/addons/dragging/functions/fnc_handleAnimChanged.sqf b/addons/dragging/functions/fnc_handleAnimChanged.sqf index 14b2eff611..0694687ca4 100644 --- a/addons/dragging/functions/fnc_handleAnimChanged.sqf +++ b/addons/dragging/functions/fnc_handleAnimChanged.sqf @@ -1,4 +1,20 @@ -// by commy2 +/* + * Author: commy2 + * + * Handle the animaion for a Unit for Dragging Module + * + * Arguments: + * 0: Unit + * 1: animaion + * + * Return Value: + * None + * + * Example: + * [_unit, "amovpercmstpsnonwnondnon"] call ace_dragging_fnc_handleAnimChanged; + * + * Public: No +*/ #include "script_component.hpp" private ["_unit", "_anim"]; diff --git a/addons/dragging/functions/fnc_handleKilled.sqf b/addons/dragging/functions/fnc_handleKilled.sqf index 4dcfc77fcd..2d0923d624 100644 --- a/addons/dragging/functions/fnc_handleKilled.sqf +++ b/addons/dragging/functions/fnc_handleKilled.sqf @@ -1,9 +1,22 @@ -// by commy2 +/* + * Author: commy2 + * + * Handle death of the dragger + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [_unit] call ace_dragging_fnc_handleKilled; + * + * Public: No +*/ #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +params ["_unit"]; if (_unit getVariable [QGVAR(isDragging), false]) then { private "_draggedObject"; diff --git a/addons/dragging/functions/fnc_handlePlayerChanged.sqf b/addons/dragging/functions/fnc_handlePlayerChanged.sqf index e2dd41021b..41c9091c72 100644 --- a/addons/dragging/functions/fnc_handlePlayerChanged.sqf +++ b/addons/dragging/functions/fnc_handlePlayerChanged.sqf @@ -1,10 +1,23 @@ -// by commy2 +/* + * Author: commy2 + * + * Handle player changes. + * + * Arguments: + * 0: New Player Unit + * 1: Old Player Unit + * + * Return Value: + * None + * + * Example: + * [_unitNew, _unitOld] call ace_dragging_fnc_handlePlayerChanged; + * + * Public: No +*/ #include "script_component.hpp" -private ["_newPlayer", "_oldPlayer"]; - -_newPlayer = _this select 0; -_oldPlayer = _this select 1; +params ["_newPlayer", "_oldPlayer"]; { if (_x getVariable [QGVAR(isDragging), false]) then { diff --git a/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf b/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf index a7f9be7681..e0f1b2a8e4 100644 --- a/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf +++ b/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf @@ -1,10 +1,23 @@ -// by commy2 +/* + * Author: commy2 + * + * Handle the Weapon Changed Event + * + * Arguments: + * 0: Unit + * 1: Weapon + * + * Return Value: + * None + * + * Example: + * [_unit, _currentWeapon] call ace_dragging_fnc_handlePlayerWeaponChanged; + * + * Public: No +*/ #include "script_component.hpp" -private ["_unit", "_weapon"]; - -_unit = _this select 0; -_weapon = _this select 1; +params ["_unit", "_weapon"]; if (_unit getVariable [QGVAR(isDragging), false]) then { diff --git a/addons/dragging/functions/fnc_handleScrollWheel.sqf b/addons/dragging/functions/fnc_handleScrollWheel.sqf index 96f46413bc..cd613316ec 100644 --- a/addons/dragging/functions/fnc_handleScrollWheel.sqf +++ b/addons/dragging/functions/fnc_handleScrollWheel.sqf @@ -3,38 +3,38 @@ * * Handles raising and lowering the dragged weapon to be able to place it on top of objects. * - * Argument: - * 0: Scroll amount (Number) + * Arguments: + * 0: Scroll amount * - * Return value: - * Handled or not. (Bool) + * Return Value: + * Handled or not. + * + * Public: No */ #include "script_component.hpp" -// requires modifier key to be hold down -if (GETMVAR(ACE_Modifier,0) == 0) exitWith {false}; +private ["_unit", "_carriedItem", "_position", "_maxHeight"]; + +params ["_scrollAmount"]; + +// requires modifier key to be hold down +if (missionNamespace getVariable ["ACE_Modifier", 0] == 0) exitWith {false}; -private "_unit"; _unit = ACE_player; // EH is always assigned. Exit and don't overwrite input if not carrying if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {false}; -private "_scrollAmount"; -_scrollAmount = _this select 0; // move carried item 15 cm per scroll interval _scrollAmount = _scrollAmount * 0.15; -private "_carriedItem"; _carriedItem = _unit getVariable [QGVAR(carriedObject), objNull]; //disabled for persons if (_carriedItem isKindOf "CAManBase") exitWith {false}; -private ["_position", "_maxHeight"]; - _position = getPosATL _carriedItem; _maxHeight = (_unit modelToWorldVisual [0,0,0]) select 2; diff --git a/addons/dragging/functions/fnc_handleUnconscious.sqf b/addons/dragging/functions/fnc_handleUnconscious.sqf index 31c703f37b..b87e36b92d 100644 --- a/addons/dragging/functions/fnc_handleUnconscious.sqf +++ b/addons/dragging/functions/fnc_handleUnconscious.sqf @@ -1,17 +1,29 @@ -// by commy2 +/* + * Author: commy2 + * + * Handle the Unconscious of a Unit while Dragging + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [_unit] call ace_dragging_fnc_handleUnconscious; + * + * Public: No +*/ #include "script_component.hpp" -private ["_unit", "_isUnconscious"]; +private ["_player", "_draggedObject", "_carriedObject"]; -_unit = _this select 0; -_isUnconscious = _this select 1; +params ["_unit"]; -private "_player"; _player = ACE_player; if (_player getVariable [QGVAR(isDragging), false]) then { - private "_draggedObject"; _draggedObject = _player getVariable [QGVAR(draggedObject), objNull]; // handle falling unconscious @@ -28,7 +40,6 @@ if (_player getVariable [QGVAR(isDragging), false]) then { if (_player getVariable [QGVAR(isCarrying), false]) then { - private "_carriedObject"; _carriedObject = _player getVariable [QGVAR(carriedObject), objNull]; // handle falling unconscious diff --git a/addons/dragging/functions/fnc_initObject.sqf b/addons/dragging/functions/fnc_initObject.sqf index 65866bd028..0dd36568bc 100644 --- a/addons/dragging/functions/fnc_initObject.sqf +++ b/addons/dragging/functions/fnc_initObject.sqf @@ -4,23 +4,22 @@ * Initialize variables for drag or carryable objects. Called from init EH. * * Argument: - * 0: Any object (Object) + * 0: Any object * - * Return value: - * NONE. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private "_object"; +private ["_position", "_direction", "_config"]; -_object = _this select 0; +params ["_object"]; -private "_config"; _config = configFile >> "CfgVehicles" >> typeOf _object; if (getNumber (_config >> QGVAR(canDrag)) == 1) then { - private ["_position", "_direction"]; - _position = getArray (_config >> QGVAR(dragPosition)); _direction = getNumber (_config >> QGVAR(dragDirection)); @@ -28,8 +27,6 @@ if (getNumber (_config >> QGVAR(canDrag)) == 1) then { }; if (getNumber (_config >> QGVAR(canCarry)) == 1) then { - private ["_position", "_direction"]; - _position = getArray (_config >> QGVAR(carryPosition)); _direction = getNumber (_config >> QGVAR(carryDirection)); diff --git a/addons/dragging/functions/fnc_initPerson.sqf b/addons/dragging/functions/fnc_initPerson.sqf index 0dc2af1389..c0a951771c 100644 --- a/addons/dragging/functions/fnc_initPerson.sqf +++ b/addons/dragging/functions/fnc_initPerson.sqf @@ -4,16 +4,16 @@ * Initialize variables for drag or carryable persons. Called from init EH. * * Argument: - * 0: Any Unit (Object) + * 0: Unit * * Return value: - * NONE. + * None + * + * Public: No */ #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +params ["_unit"]; [_unit, true, [0,1.1,0.092], 180] call FUNC(setDraggable); [_unit, true, [0.4,-0.1,-1.25], 195] call FUNC(setCarryable); // hard-coded selection: "LeftShoulder" diff --git a/addons/dragging/functions/fnc_isObjectOnObject.sqf b/addons/dragging/functions/fnc_isObjectOnObject.sqf index 0a8624820e..e8ab5f307a 100644 --- a/addons/dragging/functions/fnc_isObjectOnObject.sqf +++ b/addons/dragging/functions/fnc_isObjectOnObject.sqf @@ -1,6 +1,16 @@ -// by commy2 - -private "_object"; -_object = _this select 0; +/* + * Author: commy2 + * + * Check if Object is Overlapping + * + * Argument: + * 0: Object + * + * Return value: + * + * + * Public: No + */ +params ["_object"]; (getPosATL _object select 2) - (getPos _object select 2) > 1E-5 diff --git a/addons/dragging/functions/fnc_setCarryable.sqf b/addons/dragging/functions/fnc_setCarryable.sqf index 52c6e5643a..6bf05e5fde 100644 --- a/addons/dragging/functions/fnc_setCarryable.sqf +++ b/addons/dragging/functions/fnc_setCarryable.sqf @@ -4,25 +4,21 @@ * Enable the object to be carried. * * Argument: - * 0: Any object (Object) - * 1: true to enable carrying, false to disable (Bool) - * 2: Position offset for attachTo command (Array, optinal; default: [0,1,1]) - * 3: Direction in degree to rotate the object after attachTo (Number, optional; default: 0) + * 0: Any object + * 1: true to enable carrying, false to disable + * 2: Position offset for attachTo command (default: [0,1,1]) + * 3: Direction in degree to rotate the object after attachTo (default: 0) * - * Return value: - * NONE. + * Return Value: + * None + * + * Public: Yes */ #include "script_component.hpp" -private ["_carryAction", "_dropAction", "_object", "_enableCarry", "_position", "_direction"]; -//IGNORE_PRIVATE_WARNING("_player", "_target"); +private ["_carryAction", "_dropAction", "_type", "_initializedClasses"]; -_this resize 4; - -_object = _this select 0; -_enableCarry = _this select 1; -_position = _this select 2; -_direction = _this select 3; +params ["_object", "_enableCarry", "_position", "_direction"]; if (isNil "_position") then { _position = _object getVariable [QGVAR(carryPosition), [0,1,1]]; @@ -38,8 +34,6 @@ _object setVariable [QGVAR(carryPosition), _position]; _object setVariable [QGVAR(carryDirection), _direction]; // add action to class if it is not already present -private ["_type", "_initializedClasses"]; - _type = typeOf _object; _initializedClasses = GETGVAR(initializedClasses_carry,[]); diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf index 7745bd2d3e..bbfca9d868 100644 --- a/addons/dragging/functions/fnc_setDraggable.sqf +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -10,19 +10,15 @@ * 3: Direction in degree to rotate the object after attachTo (Number, optional; default: 0) * * Return value: - * NONE. + * None + * + * Public: Yes */ #include "script_component.hpp" -private ["_dragAction", "_dropAction", "_object", "_enableDrag", "_position", "_direction"]; +private ["_dragAction", "_dropAction", "_type", "_initializedClasses"]; //IGNORE_PRIVATE_WARNING("_player", "_target"); - -_this resize 4; - -_object = _this select 0; -_enableDrag = _this select 1; -_position = _this select 2; -_direction = _this select 3; +params ["_object", "_enableDrag", "_position", "_direction"]; if (isNil "_position") then { _position = _object getVariable [QGVAR(dragPosition), [0,0,0]]; @@ -38,8 +34,6 @@ _object setVariable [QGVAR(dragPosition), _position]; _object setVariable [QGVAR(dragDirection), _direction]; // add action to class if it is not already present -private ["_type", "_initializedClasses"]; - _type = typeOf _object; _initializedClasses = GETGVAR(initializedClasses,[]); diff --git a/addons/dragging/functions/fnc_startCarry.sqf b/addons/dragging/functions/fnc_startCarry.sqf index 5521bec375..a95a8f9fb4 100644 --- a/addons/dragging/functions/fnc_startCarry.sqf +++ b/addons/dragging/functions/fnc_startCarry.sqf @@ -3,29 +3,28 @@ * * Start the carrying process. * - * Argument: - * 0: Unit that should do the carrying (Object) - * 1: Object to carry (Object) + * Arguments: + * 0: Unit that should do the carrying + * 1: Object to carry * - * Return value: - * NONE. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_target"]; +private ["_weight", "_timer"]; -_unit = _this select 0; -_target = _this select 1; +params ["_unit", "_target"]; // check weight -private "_weight"; _weight = [_target] call FUNC(getWeight); -if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith { +if (_weight > missionNamespace getVariable ["ACE_maxWeightCarry", 1E11]) exitWith { [localize LSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); }; -private "_timer"; _timer = ACE_time + 5; // handle objects vs persons diff --git a/addons/dragging/functions/fnc_startCarryPFH.sqf b/addons/dragging/functions/fnc_startCarryPFH.sqf index 47824a8e76..ae5ad17978 100644 --- a/addons/dragging/functions/fnc_startCarryPFH.sqf +++ b/addons/dragging/functions/fnc_startCarryPFH.sqf @@ -1,25 +1,34 @@ -// by commy2 +/* + * Author: commy2 + * + * Carry PFH + * + * Arguments: + * ? + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" #ifdef DEBUG_ENABLED_DRAGGING systemChat format ["%1 startCarryPFH running", ACE_time]; #endif -private ["_unit", "_target", "_timeOut"]; - -_unit = _this select 0 select 0; -_target = _this select 0 select 1; -_timeOut = _this select 0 select 2; +params ["_args", "_idPFH"]; +_args params ["_unit", "_target", "_timeOut"]; // handle aborting carry if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; // same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject); - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; // handle persons vs objects @@ -27,11 +36,11 @@ if (_target isKindOf "CAManBase") then { if (ACE_time > _timeOut) exitWith { [_unit, _target] call FUNC(carryObject); - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; } else { if (ACE_time > _timeOut) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; // drop if in timeout private "_draggedObject"; @@ -43,7 +52,7 @@ if (_target isKindOf "CAManBase") then { if (stance _unit == "STAND") exitWith { [_unit, _target] call FUNC(carryObject); - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; }; diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf index 1d4eb9a158..d3e55bdaea 100644 --- a/addons/dragging/functions/fnc_startDrag.sqf +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -4,24 +4,21 @@ * Start the dragging process. * * Argument: - * 0: Unit that should do the dragging (Object) - * 1: Object to drag (Object) + * 0: Unit that should do the dragging + * 1: Object to drag * * Return value: - * NONE. + * None */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +params ["_unit", "_target"]; // check weight private "_weight"; _weight = [_target] call FUNC(getWeight); -if (_weight > GETMVAR(ACE_maxWeightDrag,1E11)) exitWith { +if (_weight > missionNamespace getVariable ["ACE_maxWeightDrag", 1E11]) exitWith { [localize LSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); }; diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf index 65cf0a2431..f527cda7d8 100644 --- a/addons/dragging/functions/fnc_startDragPFH.sqf +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -1,30 +1,39 @@ -// by commy2 +/* + * Author: commy2 + * + * Drag PFH + * + * Arguments: + * ? + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" #ifdef DEBUG_ENABLED_DRAGGING systemChat format ["%1 startDragPFH running", ACE_time]; #endif -private ["_unit", "_target", "_timeOut"]; - -_unit = _this select 0 select 0; -_target = _this select 0 select 1; -_timeOut = _this select 0 select 2; +params ["_args", "_idPFH"]; +_args params ["_unit", "_target", "_timeOut"]; // handle aborting drag if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; // same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject); - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; // timeout. Do nothing. Quit. ACE_time, because anim length is linked to ingame ACE_time. if (ACE_time > _timeOut) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; // drop if in timeout private "_draggedObject"; @@ -36,5 +45,5 @@ if (ACE_time > _timeOut) exitWith { if (animationState _unit in DRAG_ANIMATIONS) exitWith { [_unit, _target] call FUNC(dragObject); - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index e1255d962f..b115ca0752 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -492,7 +492,7 @@ Spínač mrtvého muže Czuwak Detonador de hombre muerto - Dead Man's Switch + Halott ember kapcsolója Detonador do homem morto Кнопка мертвеца Detonatore a rilascio @@ -528,6 +528,7 @@ Sprengstoffsystem Systém výbušnin Sistema de explosivos + Robbanóanyag-rendszer Require specialists? @@ -536,6 +537,7 @@ Benötigt Sprengstoffexperten? Vyžadovat specialistu? Requer especialista? + Specialisták igénylése? Require explosive specialists to disable explosives? Default: No @@ -544,6 +546,7 @@ Benötige Sprengstoffexperte um Sprengladungen zu entschärfen? Standard: Nein Vyžadovat specialistu na zneškodnění výbušniny? Výchozí: Ne Requer especialista em explosivos para desativar explosivos? Padrão: Não + Szükséges-e egy specialista a robbanóanyagok hatástalanításához? Alapértelmezett: Nem Punish non-specialists? @@ -552,6 +555,7 @@ Bestrafe Nicht-Sprengstoffexperten? Potrestat, pokud není specialista? Punir não especialistas? + Nem-specialisták büntetése? Increase the time it takes to complete actions for non-specialists? Default: Yes @@ -560,6 +564,7 @@ Entschärfungszeit für Nicht-Sprengstoffexperten erhöhen? Standard: Ja Zvýšit čas potřebný k dokončení akce pokud není specialista? Výchozí: Ano Aumentar o tempo necessário para completar ações por não especialistas? Padrão: Sim + Nem-specialisták esetén több ideig tartson a cselekvés befejezése? Alapértelmezett: Igen Explode on defusal? @@ -567,6 +572,7 @@ Eksplozja przy rozbrajaniu? Explodovat při zneškodňování? Explotar al desactivar? + Robbanás hatástalanításkor? Enable certain explosives to explode on defusal? Default: Yes @@ -574,6 +580,7 @@ Spraw, aby niektóre ładunki wybuchowe eksplodowały przy próbie ich rozbrojenia? Domyślnie:Tak Umožnit u některých výbušnin explozi při pokusu je zneškodnit? Výchozí: Ano ¿Habilitar ciertos explosivos para estallar al desactivar? Por defecto: Sí + Meghatározott robbanóanyagok felrobbanjanak-e hatástalanításkor? Alapértelmezett: Igen This module adjusts the settings related to explosives. @@ -581,6 +588,7 @@ Dieses Modul erlaubt die Einstellungen für Sprengstoffe zu verändern. Tento modul umoňuje přizpůsobit nastavení týkajících se výbušnin. Este módulo permite personalizar as definições relacionadas a explosivos. + Ez a modul a robbanóanyagokhoz kötött beállításokat szabályozza. \ No newline at end of file diff --git a/addons/finger/functions/fnc_perFrameEH.sqf b/addons/finger/functions/fnc_perFrameEH.sqf index d6297a4095..7f0150c492 100644 --- a/addons/finger/functions/fnc_perFrameEH.sqf +++ b/addons/finger/functions/fnc_perFrameEH.sqf @@ -41,7 +41,7 @@ _iconSize = BASE_SIZE * _fovCorrection; _drawColor set [3, ((_drawColor select 3) * (_timeLeftToShow / 0.5))]; }; - drawIcon3D [QUOTE(PATHTOF(UI\fp_icon.paa)), _drawColor, _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "PuristaMedium"]; + drawIcon3D [QUOTE(PATHTOF(UI\fp_icon2.paa)), _drawColor, _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "PuristaMedium"]; }; } count (GVAR(fingersHash) select 0); diff --git a/addons/finger/stringtable.xml b/addons/finger/stringtable.xml index f11f36d971..11d326a6dc 100644 --- a/addons/finger/stringtable.xml +++ b/addons/finger/stringtable.xml @@ -5,46 +5,56 @@ Show pointing indicator to self Отображать пальце-индикатор для показывающего игрока Pokaż indykator wskazywania palcem dla siebie + Saját mutatási indikátor megjelenítése Render the indicator for the pointing player. This option doesn't affect whether the other players would see the indicator Отображать индикатор для показывающего игрока. Эта настройка не влияет на то, будутт ли другие игроки видеть индикатор Wyświetl indykator kiedy wskazujesz coś palcem. Ta opcja nie wpływa na to, czy inni gracze zobaczą ten indykator czy też nie. + Az indikátor megjelenítése a mutató játékosnak. Ez a beállítás nem változtat azon, hogy más játékosok látják-e az indikátort. Pointing indicator Пальце-индикатор Indykator palca + Ujj-indikátor Color of the pointing indicator circle Цвет индикатора пальце-указания Kolor okręgu wyświetlanego przy wskazywaniu palcem + Mutatási indikátor körének színe Action "point a finger at" Действие "показать пальцем на" Akcja "wskaż palcem" + Cselekvés "ujj rámutatása" Points, and shows a virtual marker of where you are looking to nearby units. Can be held down. Wskazuje a także wyświetla wirtualny marker-okrąg w miejscu, w które patrzysz, dla wszystkich pobliskich jednostek. Może być przytrzymywany. + Mutat, és elhelyez egy virtuális jelölőt a nézett területhez közeli egységekhez. Lenyomva tartható. Pointing Settings Ustawienia wskazywania palcem + Ujj beállításai Pointing Enabled Aktywuj wskazywanie + Mutatás engedélyezése Pointing Max Range Maks. zasięg wskazywania + Ujj maximum hatótávja Max range between players to show the pointing indicator [default: 4 meters] Określ dystans na jakim można wskazywać coś palcem innym graczom. [domyślnie: 4m] + A maximális távolság, amelyben a közeli játékosoknak megjelenik az indikátor. [alapértelmezett: 4 méter] diff --git a/addons/finger/ui/fp_icon2.paa b/addons/finger/ui/fp_icon2.paa new file mode 100644 index 0000000000..4f7fde9f10 Binary files /dev/null and b/addons/finger/ui/fp_icon2.paa differ diff --git a/addons/flashlights/$PBOPREFIX$ b/addons/flashlights/$PBOPREFIX$ new file mode 100644 index 0000000000..674d0d255c --- /dev/null +++ b/addons/flashlights/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\flashlights \ No newline at end of file diff --git a/addons/flashlights/CfgEventHandlers.hpp b/addons/flashlights/CfgEventHandlers.hpp new file mode 100644 index 0000000000..d5f49bd5c3 --- /dev/null +++ b/addons/flashlights/CfgEventHandlers.hpp @@ -0,0 +1,5 @@ +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient) ); + }; +}; diff --git a/addons/flashlights/CfgSounds.hpp b/addons/flashlights/CfgSounds.hpp new file mode 100644 index 0000000000..f0fabe3a39 --- /dev/null +++ b/addons/flashlights/CfgSounds.hpp @@ -0,0 +1,7 @@ +class CfgSounds { + class ACE_flashlights_flashlightClick { + name = "ACE_flashlights_flashlightClick"; + sound[] = {"\a3\sounds_f\weapons\Other\dry4.wss", 0.2, 2}; + titles[] = {}; + }; +}; \ No newline at end of file diff --git a/addons/flashlights/CfgVehicles.hpp b/addons/flashlights/CfgVehicles.hpp new file mode 100644 index 0000000000..fa766ad87b --- /dev/null +++ b/addons/flashlights/CfgVehicles.hpp @@ -0,0 +1,89 @@ +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + //todo: add flashlight attach actions + }; + }; + + class Item_Base_F; + + class ACE_Flashlight_MX991Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = CSTRING(MX991_DisplayName); + author = ECSTRING(common,ACETeam); + vehicleClass = "WeaponAccessories"; + class TransportItems { + class ACE_Flashlight_MX991 { + name = "ACE_Flashlight_MX991"; + count = 1; + }; + }; + }; + + class ACE_Flashlight_KSF1Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = CSTRING(KSF1_DisplayName); + author = ECSTRING(common,ACETeam); + vehicleClass = "WeaponAccessories"; + class TransportItems { + class ACE_Flashlight_KSF1 { + name = "ACE_Flashlight_KSF1"; + count = 1; + }; + }; + }; + + class ACE_Flashlight_XL50Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = CSTRING(XL50_DisplayName); + author = ECSTRING(common,ACETeam); + vehicleClass = "WeaponAccessories"; + class TransportItems { + class ACE_Flashlight_XL50 { + name = "ACE_Flashlight_XL50"; + count = 1; + }; + }; + }; + + class NATO_Box_Base; + class EAST_Box_Base; + class IND_Box_Base; + class FIA_Box_Base_F; + + class Box_NATO_Support_F: NATO_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_Flashlight_MX991,12); + }; + }; + + class Box_East_Support_F: EAST_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_Flashlight_KSF1,12); + }; + }; + + class Box_IND_Support_F: IND_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_Flashlight_XL50,12); + }; + }; + + class Box_FIA_Support_F: FIA_Box_Base_F { + class TransportItems { + MACRO_ADDITEM(ACE_Flashlight_MX991,12); + }; + }; + + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_Flashlight_MX991,12); + MACRO_ADDITEM(ACE_Flashlight_KSF1,12); + MACRO_ADDITEM(ACE_Flashlight_XL50,12); + }; + }; +}; \ No newline at end of file diff --git a/addons/flashlights/CfgWeapons.hpp b/addons/flashlights/CfgWeapons.hpp new file mode 100644 index 0000000000..09fe70d764 --- /dev/null +++ b/addons/flashlights/CfgWeapons.hpp @@ -0,0 +1,61 @@ +class CfgWeapons { + + class ItemCore; + class ACE_ItemCore; + class InventoryItem_Base_F; + class InventoryFlashlightItem_Base_F; + + class acc_flashlight: ItemCore { + class ItemInfo: InventoryFlashlightItem_Base_F { + class Flashlight { + ACE_Flashlight_Colour = "white"; + ACE_Flashlight_Size = 2.75; + }; + }; + }; + + class ACE_Flashlight_MX991: ACE_ItemCore { + displayName = CSTRING(MX991_DisplayName); + descriptionShort = CSTRING(MX991_Description); + model = QUOTE(PATHTOF(data\MX_991.p3d)); + picture = PATHTOF(UI\mx991_ca.paa); + scope = 2; + class ItemInfo: InventoryItem_Base_F { + mass = 1; + class FlashLight { + ACE_Flashlight_Colour = "red"; + ACE_Flashlight_Size = 1.75; + }; + }; + }; + + class ACE_Flashlight_KSF1: ACE_ItemCore { + displayName = CSTRING(KSF1_DisplayName); + descriptionShort = CSTRING(KSF1_Description); + model = QUOTE(PATHTOF(data\KSF_1.p3d)); + picture = PATHTOF(UI\ksf1_ca.paa); + scope = 2; + class ItemInfo: InventoryItem_Base_F { + mass = 1; + class FlashLight { + ACE_Flashlight_Colour = "red"; + ACE_Flashlight_Size = 1.5; + }; + }; + }; + + class ACE_Flashlight_XL50: ACE_ItemCore { + displayName = CSTRING(XL50_DisplayName); + descriptionShort = CSTRING(XL50_Description); + model = QUOTE(PATHTOF(data\Maglight.p3d)); + picture = PATHTOF(UI\xl50_ca.paa); + scope = 2; + class ItemInfo: InventoryItem_Base_F { + mass = 1; + class FlashLight { + ACE_Flashlight_Colour = "white"; + ACE_Flashlight_Size = 2.15; + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/flashlights/README.md b/addons/flashlights/README.md new file mode 100644 index 0000000000..6a04b78091 --- /dev/null +++ b/addons/flashlights/README.md @@ -0,0 +1,11 @@ +ace_flashlights +======= + +Flashlights for use on map and to attach to player. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [voiper](https://github.com/voiperr) diff --git a/addons/flashlights/UI/Flashlight_Beam_blue_ca.paa b/addons/flashlights/UI/Flashlight_Beam_blue_ca.paa new file mode 100644 index 0000000000..737780d1c8 Binary files /dev/null and b/addons/flashlights/UI/Flashlight_Beam_blue_ca.paa differ diff --git a/addons/flashlights/UI/Flashlight_Beam_green_ca.paa b/addons/flashlights/UI/Flashlight_Beam_green_ca.paa new file mode 100644 index 0000000000..b075990ba6 Binary files /dev/null and b/addons/flashlights/UI/Flashlight_Beam_green_ca.paa differ diff --git a/addons/flashlights/UI/Flashlight_Beam_red_ca.paa b/addons/flashlights/UI/Flashlight_Beam_red_ca.paa new file mode 100644 index 0000000000..5afd4e66d5 Binary files /dev/null and b/addons/flashlights/UI/Flashlight_Beam_red_ca.paa differ diff --git a/addons/flashlights/UI/Flashlight_Beam_white_ca.paa b/addons/flashlights/UI/Flashlight_Beam_white_ca.paa new file mode 100644 index 0000000000..08460e9a9c Binary files /dev/null and b/addons/flashlights/UI/Flashlight_Beam_white_ca.paa differ diff --git a/addons/flashlights/UI/Flashlight_Beam_yellow_ca.paa b/addons/flashlights/UI/Flashlight_Beam_yellow_ca.paa new file mode 100644 index 0000000000..8593ac8706 Binary files /dev/null and b/addons/flashlights/UI/Flashlight_Beam_yellow_ca.paa differ diff --git a/addons/flashlights/UI/KSF1_ca.paa b/addons/flashlights/UI/KSF1_ca.paa new file mode 100644 index 0000000000..5a89051c05 Binary files /dev/null and b/addons/flashlights/UI/KSF1_ca.paa differ diff --git a/addons/flashlights/UI/mx991_ca.paa b/addons/flashlights/UI/mx991_ca.paa new file mode 100644 index 0000000000..9385ec675a Binary files /dev/null and b/addons/flashlights/UI/mx991_ca.paa differ diff --git a/addons/flashlights/UI/xl50_ca.paa b/addons/flashlights/UI/xl50_ca.paa new file mode 100644 index 0000000000..55aaa0cbcd Binary files /dev/null and b/addons/flashlights/UI/xl50_ca.paa differ diff --git a/addons/flashlights/XEH_postInitClient.sqf b/addons/flashlights/XEH_postInitClient.sqf new file mode 100644 index 0000000000..09cdcdd1f2 --- /dev/null +++ b/addons/flashlights/XEH_postInitClient.sqf @@ -0,0 +1,8 @@ +#include "script_component.hpp" + +// Exit on Headless as well +if !(hasInterface) exitWith {}; + +LOG(MSG_INIT); + +//todo: make flashlights attachable to players \ No newline at end of file diff --git a/addons/flashlights/config.cpp b/addons/flashlights/config.cpp new file mode 100644 index 0000000000..b34c4b8000 --- /dev/null +++ b/addons/flashlights/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {"ACE_Flashlight_MX991", "ACE_Flashlight_KSF1", "ACE_Flashlight_XL50"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interaction"}; + author[] = {"voiper"}; + authorUrl = "https://github.com/voiperr/"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" +#include "CfgSounds.hpp" diff --git a/addons/flashlights/data/KSF_1.p3d b/addons/flashlights/data/KSF_1.p3d new file mode 100644 index 0000000000..0ec2fd23c6 Binary files /dev/null and b/addons/flashlights/data/KSF_1.p3d differ diff --git a/addons/flashlights/data/KSF_1.rvmat b/addons/flashlights/data/KSF_1.rvmat new file mode 100644 index 0000000000..113fe0cc14 --- /dev/null +++ b/addons/flashlights/data/KSF_1.rvmat @@ -0,0 +1,79 @@ +ambient[]={1,1,1,1}; +diffuse[]={1,1,1,1}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={0.6,0.6,0.6,1}; //amount of glossiness - the higher the number, the higher the glossiness +specularPower=700; //area of glossiness - the higher the number, the smaller the area +PixelShaderID="Super"; +VertexShaderID="Super"; + +class Stage1 { + texture="z\ace\addons\flashlights\data\KSF_1_nohq.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 { + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage3 { + texture="#(argb,8,8,3)color(0,0,0,0,mc)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage4 { + texture="#(argb,8,8,3)color(1,1,1,1,as)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,1}; + }; +}; +class Stage5 { + texture="z\ace\addons\flashlights\data\KSF_1_smdi.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 { + texture="#(ai,64,64,1)fresnel(4.7,1.2)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; +class Stage7 { + texture="a3\data_f\env_land_ca.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; diff --git a/addons/flashlights/data/KSF_1_co.paa b/addons/flashlights/data/KSF_1_co.paa new file mode 100644 index 0000000000..bb31888863 Binary files /dev/null and b/addons/flashlights/data/KSF_1_co.paa differ diff --git a/addons/flashlights/data/KSF_1_nohq.paa b/addons/flashlights/data/KSF_1_nohq.paa new file mode 100644 index 0000000000..8c5ada23c8 Binary files /dev/null and b/addons/flashlights/data/KSF_1_nohq.paa differ diff --git a/addons/flashlights/data/KSF_1_smdi.paa b/addons/flashlights/data/KSF_1_smdi.paa new file mode 100644 index 0000000000..b12f26e5f4 Binary files /dev/null and b/addons/flashlights/data/KSF_1_smdi.paa differ diff --git a/addons/flashlights/data/MX_991.p3d b/addons/flashlights/data/MX_991.p3d new file mode 100644 index 0000000000..c79c330ea3 Binary files /dev/null and b/addons/flashlights/data/MX_991.p3d differ diff --git a/addons/flashlights/data/MX_991.rvmat b/addons/flashlights/data/MX_991.rvmat new file mode 100644 index 0000000000..0268d4903c --- /dev/null +++ b/addons/flashlights/data/MX_991.rvmat @@ -0,0 +1,79 @@ +ambient[]={1,1,1,1}; +diffuse[]={1,1,1,1}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={0.6,0.6,0.6,1}; //amount of glossiness - the higher the number, the higher the glossiness +specularPower=700; //area of glossiness - the higher the number, the smaller the area +PixelShaderID="Super"; +VertexShaderID="Super"; + +class Stage1 { + texture="z\ace\addons\flashlights\data\MX_991_nohq.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 { + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage3 { + texture="#(argb,8,8,3)color(0,0,0,0,mc)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage4 { + texture="#(argb,8,8,3)color(1,1,1,1,as)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,1}; + }; +}; +class Stage5 { + texture="#(rgb,1,1,1)color(0.2,0.2,1,1)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 { + texture="#(ai,64,64,1)fresnel(4.7,1.2)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; +class Stage7 { + texture="a3\data_f\env_land_ca.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; diff --git a/addons/flashlights/data/MX_991_co.paa b/addons/flashlights/data/MX_991_co.paa new file mode 100644 index 0000000000..598dda174b Binary files /dev/null and b/addons/flashlights/data/MX_991_co.paa differ diff --git a/addons/flashlights/data/MX_991_nohq.paa b/addons/flashlights/data/MX_991_nohq.paa new file mode 100644 index 0000000000..565df542e1 Binary files /dev/null and b/addons/flashlights/data/MX_991_nohq.paa differ diff --git a/addons/flashlights/data/Maglight.p3d b/addons/flashlights/data/Maglight.p3d new file mode 100644 index 0000000000..6ce3b9fcd4 Binary files /dev/null and b/addons/flashlights/data/Maglight.p3d differ diff --git a/addons/flashlights/data/Maglite.rvmat b/addons/flashlights/data/Maglite.rvmat new file mode 100644 index 0000000000..960599813b --- /dev/null +++ b/addons/flashlights/data/Maglite.rvmat @@ -0,0 +1,79 @@ +ambient[]={1,1,1,1}; +diffuse[]={1,1,1,1}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={0.6,0.6,0.6,1}; //amount of glossiness - the higher the number, the higher the glossiness +specularPower=700; //area of glossiness - the higher the number, the smaller the area +PixelShaderID="Super"; +VertexShaderID="Super"; + +class Stage1 { + texture="z\ace\addons\flashlights\data\Maglite_nohq.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 { + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage3 { + texture="#(argb,8,8,3)color(0,0,0,0,mc)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage4 { + texture="#(argb,8,8,3)color(1,1,1,1,as)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,1}; + }; +}; +class Stage5 { + texture="z\ace\addons\flashlights\data\Maglite_smdi.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 { + texture="#(ai,64,64,1)fresnel(4.7,1.2)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; +class Stage7 { + texture="a3\data_f\env_land_ca.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; diff --git a/addons/flashlights/data/Maglite_co.paa b/addons/flashlights/data/Maglite_co.paa new file mode 100644 index 0000000000..8a399b25cc Binary files /dev/null and b/addons/flashlights/data/Maglite_co.paa differ diff --git a/addons/flashlights/data/Maglite_nohq.paa b/addons/flashlights/data/Maglite_nohq.paa new file mode 100644 index 0000000000..43282a963b Binary files /dev/null and b/addons/flashlights/data/Maglite_nohq.paa differ diff --git a/addons/flashlights/data/Maglite_smdi.paa b/addons/flashlights/data/Maglite_smdi.paa new file mode 100644 index 0000000000..093d83e145 Binary files /dev/null and b/addons/flashlights/data/Maglite_smdi.paa differ diff --git a/addons/flashlights/script_component.hpp b/addons/flashlights/script_component.hpp new file mode 100644 index 0000000000..ba740c22fc --- /dev/null +++ b/addons/flashlights/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT flashlights +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_FLASHLIGHTS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_FLASHLIGHTS + #define DEBUG_SETTINGS DEBUG_SETTINGS_FLASHLIGHTS +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/flashlights/stringtable.xml b/addons/flashlights/stringtable.xml new file mode 100644 index 0000000000..e871360bf3 --- /dev/null +++ b/addons/flashlights/stringtable.xml @@ -0,0 +1,29 @@ + + + + + Fulton MX-991 + Fulton MX-991 + + + Flashlight with red filter. For use on map. + Latarka z czerwonym filtrem. Używana do podświetlania mapy. + + + Maglite XL50 + Maglite XL50 + + + White mini flashlight. For use on map. + Mini latarka. Światło białe. Używana do podświetlania mapy. + + + KSF-1 + KSF-1 + + + Flashlight with red filter. For use on map. + Latarka z czerwonym filtrem. Używana do podświetlania mapy. + + + \ No newline at end of file diff --git a/addons/frag/stringtable.xml b/addons/frag/stringtable.xml index 5a59b15a4a..205fb50c75 100644 --- a/addons/frag/stringtable.xml +++ b/addons/frag/stringtable.xml @@ -8,6 +8,7 @@ Splittersimulation Simulace fragmentace Simulação de fragmentação + Repesz-szimuláció Enable the ACE Fragmentation Simulation @@ -16,6 +17,7 @@ Aktiviere die ACE-Splittersimulation Povolit ACE simulaci fragmentace Ativa a simulação de fragmentação do ACE + Az ACE repesz-szimuláció engedélyezése Spalling Simulation @@ -24,6 +26,7 @@ Explosionssimulation Simulace úlomků Simulação de estilhaços + Pattogzás-szimuláció Enable the ACE Spalling Simulation @@ -32,6 +35,7 @@ Aktiviere ACE-Explosionssimulation Povolit ACE simulaci úlomků Ativa a simulação de estilhaços do ACE + Az ACE pattogzás-szimuláció engedélyezése Maximum Projectiles Tracked @@ -40,6 +44,7 @@ Maximalzahl der verfolgten Projektile Maximální počet sledovaných projektilů Máximo de projéteis rastreados + Maximum követett repeszek This setting controls the maximum amount of projectiles the fragmentation and spalling system will track at any given time. If more projectiles are fired, they will not be tracked. Lower this setting if you do not want FPS drops at high-count projectile scenarios ( >200 rounds in the air at once) @@ -48,6 +53,7 @@ Diese Einstellung steuert die maximale Anzahl an Projektilen, die das Splitter- und Explosionssystem gleichzeitig verfolgen wird. Wenn mehr Projektile abgefeuert werden, werden sie nicht verfolgt werden. Diese Einstellung zu verringern, kann FPS-Einbrüche bei Szenarien mit vielen Projektilen verhindern (>200 Objekte gleichzeitig in der Luft) Toto nastavení kontroluje maximální množství projektilů z fragmentace a úlomků, která jsou sledována v dané době. Pokud je vystřeleno více projektilů, tak nebudou sledovány. Snižte toto nastavení pokud si nepřejete propady FPS v situacích, kde je velké množství projektilů ( >200 nábojů najednou ve vzduchu) Esta definição controla a quantidade máxima de projéteis que o sistema de fragmentação e estilhaçamento irá acompanhar em qualquer momento. Se mais projéteis são disparados, eles não serão rastreados. Diminua essa configuração se você não quiser que o FPS caia em cenários com alta contagem de projéteis (> 200 projéteis no ar ao mesmo tempo) + Ez a beállítás szabályozza a repeszeződés és pattogzás által kilőtt objektumok követett számát. Ha több ez a szám, ezek az objektumok nem lesznek követve. Csökkentsd ezt a beállítást, ha nem akarsz lassulásokat magas-törmelékmennyiségű helyzetekben (200+ repesz a levegőben egyszerre) Maximum Projectiles Per Frame @@ -56,6 +62,7 @@ Maks. liczba pocisków na klatkę Maximální počet projektilů ze jeden snímek Projéteis máximos por quadro + Maximum repesz/képkocka The number of spall track calculations to perform in any given frame. This helps spread the FPS impact of tracking spall rounds across multiple frames, limiting its impact even further. @@ -64,6 +71,7 @@ El número de cálculos de esquirlas que se hará en cualquier cuadro. Esto ayuda a dispersar el impacto en FPS del seguimiento de esquirlas de balas a través de múltiples cuadros, lo que limita aún más su impacto. Počet úlomků v daném snímku. Toto pomáhá rozšířit FPS dopad sledovaného úlomku napříč více snímky, omezuje jeho vliv ještě více. O número de cálculos por estilhaço rastreado para executar em qualquer quadro. Isso ajuda a distribuir o impacto no FPS do rastreamento de estilhaço em vários quadros, o que limita o seu impacto ainda mais. + A lepattogzási útvonalak számításának darabjai képkockánként. Ez eloszlatja az FPS-megszakadást több képkockára, ezzel csökkentve a súlyosságát. (SP Only) Frag/Spall Debug Tracing @@ -72,6 +80,7 @@ (Pouze SP) Debug sledování Frag/Úlomků (nur SP) Splitter-/Explosions-Debug-Verfolgung (Somente SP) Depuração de fragmentação e estilhaços traçantes + (Csak SP) Repesz/Pattogzás debug követés (SP Only) Requires a mission/editor restart. Enables visual tracing of fragmentation and spalling rounds in SP game mode only. @@ -80,6 +89,7 @@ (nur SP) Splitter-/Explosions-Debugging (Pouze SP) Vyžaduje restart mise/editoru. Aktivuje vizuální stopování fragmentace a úlomů pouze v režimu jednoho hráče. (Somente SP) Requer um reinício de missão / editor. Habilita o rastreamento visual de projéteis de fragmentação e estilhaçamento apenas no modo de jogo SP. + (Csak SP) Küldetés/Editor újraindítás szükséges. Engedélyezi a repeszek és pattogzó lövedékek vizuális nyomkövetését, csak egyjátékos módok alatt. - + \ No newline at end of file diff --git a/addons/goggles/functions/fnc_checkGoggles.sqf b/addons/goggles/functions/fnc_checkGoggles.sqf index f222ea9881..84b86c3da4 100644 --- a/addons/goggles/functions/fnc_checkGoggles.sqf +++ b/addons/goggles/functions/fnc_checkGoggles.sqf @@ -18,7 +18,7 @@ if (!alive ace_player) exitWith {}; if (true) then { // Detect if curator interface is open and disable effects - if (!isNull(findDisplay 312)) exitWith { + if !(isNull curatorCamera) exitWith { if (GVAR(EffectsActive)) then { call FUNC(removeGlassesEffect); }; diff --git a/addons/goggles/functions/fnc_isGogglesVisible.sqf b/addons/goggles/functions/fnc_isGogglesVisible.sqf index 253a82f0a3..80f9de4830 100644 --- a/addons/goggles/functions/fnc_isGogglesVisible.sqf +++ b/addons/goggles/functions/fnc_isGogglesVisible.sqf @@ -15,17 +15,14 @@ */ #include "script_component.hpp" -PARAMS_1(_unit); - +params ["_unit"]; private ["_currentGlasses", "_result", "_position", "_visible"]; _currentGlasses = goggles _unit; _result = false; -if ((vehicle _unit) != _unit) exitWith {(cameraView != "GUNNER")}; - if (_currentGlasses != "") then { - _position =(getPosASLW _unit); + _position = getPosASLW _unit; if (surfaceIsWater _position && {((_position select 2) < 0.25)}) exitWith { _result = ([_currentGlasses] call FUNC(isDivingGoggles)); }; diff --git a/addons/grenades/CfgAmmo.hpp b/addons/grenades/CfgAmmo.hpp index 61f20eb935..b14a806b4c 100644 --- a/addons/grenades/CfgAmmo.hpp +++ b/addons/grenades/CfgAmmo.hpp @@ -5,87 +5,94 @@ class CfgAmmo { flareSize = 12; timeToLive = 60; }; + class F_40mm_White: FlareBase { intensity = 40000; flareSize = 12; }; + class F_20mm_White: FlareBase { intensity = 20000; flareSize = 6; }; + class F_Signal_Green: FlareBase { intensity = 20000; flareSize = 12; }; + class Flare_82mm_AMOS_White: FlareCore { intensity = 80000; flareSize = 12; timeToLive = 60; }; - class F_20mm_Red: F_20mm_White {}; - class F_20mm_Green: F_20mm_White {}; - class F_20mm_Yellow: F_20mm_White {}; - class ACE_F_Hand_White: F_20mm_White { - grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; - soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; - SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; - 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; - }; - class ACE_F_Hand_Red: F_20mm_Red { - grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; - soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; - SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; - 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; - }; - class ACE_F_Hand_Green: F_20mm_Green { - grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; - soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; - SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; - 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; - }; - class ACE_F_Hand_Yellow: F_20mm_Yellow { - grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; - soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; - SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; - 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; }; - class ACE_G_M84: F_20mm_Yellow { - useFlare = 0; - flareSize = 0; - intensity = 0; - grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; - soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; - SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; - 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 = 6; - fuseDistance = 2.3; + class F_20mm_Red; + class ACE_F_Hand_Red: F_20mm_Red { + timeToLive = 60; + }; + + class F_20mm_Green; + class ACE_F_Hand_Green: F_20mm_Green { + timeToLive = 60; + }; + + class F_20mm_Yellow; + class ACE_F_Hand_Yellow: F_20mm_Yellow { + timeToLive = 60; + }; + + class SmokeShell; + class ACE_G_Handflare_White: SmokeShell { + GVAR(flare) = 1; + GVAR(color)[] = {0.5,0.5,0.5,0.5}; + model = "\A3\weapons_f\ammo\flare_white"; + dangerRadiusHit = -1; + suppressionRadiusHit = -1; + typicalSpeed = 22; + cost = 100; + deflecting = 30; + explosionTime = 3; + timeToLive = 60; + grenadeFireSound[] = {}; + grenadeBurningSound[] = {}; + aiAmmoUsageFlags = "4 + 2"; + smokeColor[] = {0,0,0,0}; + effectsSmoke = "ACE_HandFlareEffect"; + whistleDist = 0; + }; + class ACE_G_Handflare_Red: ACE_G_Handflare_White { + GVAR(color)[] = {0.5,0.25,0.25,0.5}; + model = "\A3\weapons_f\ammo\flare_red"; + }; + class ACE_G_Handflare_Green: ACE_G_Handflare_White { + GVAR(color)[] = {0.25,0.5,0.25,0.5}; + model = "\A3\weapons_f\ammo\flare_green"; + }; + class ACE_G_Handflare_Yellow: ACE_G_Handflare_White { + GVAR(color)[] = {0.5,0.5,0.25,0.5}; + model = "\A3\weapons_f\ammo\flare_yellow"; + }; + + class ACE_G_M84: SmokeShell { + GVAR(flashbang) = 1; model = PATHTOF(models\ACE_m84_thrown.p3d); + dangerRadiusHit = -1; + suppressionRadiusHit = 20; + typicalSpeed = 22; + cost = 40; + deflecting = 15; + explosionTime = 2.3; + timeToLive = 6; + grenadeFireSound[] = {}; + grenadeBurningSound[] = {}; + aiAmmoUsageFlags = "0"; + smokeColor[] = {0,0,0,0}; + effectsSmoke = "ACE_M84FlashbangEffect"; + whistleDist = 0; }; }; diff --git a/addons/grenades/CfgMagazines.hpp b/addons/grenades/CfgMagazines.hpp index 31e80dc545..16dd9929ff 100644 --- a/addons/grenades/CfgMagazines.hpp +++ b/addons/grenades/CfgMagazines.hpp @@ -1,3 +1,4 @@ + class CfgMagazines { class HandGrenade; class ACE_HandFlare_Base: HandGrenade { @@ -8,55 +9,60 @@ class CfgMagazines { mass = 4; initSpeed = 22; }; + class ACE_HandFlare_White: ACE_HandFlare_Base { author = ECSTRING(common,ACETeam); scope = 2; - ammo = "ACE_F_Hand_White"; displayname = CSTRING(M127A1_White_Name); descriptionshort = CSTRING(M127A1_White_Description); displayNameShort = CSTRING(M127A1_White_NameShort); model = "\A3\weapons_f\ammo\flare_white"; picture = "\A3\Weapons_F\Data\UI\gear_flare_white_ca.paa"; + ammo = "ACE_G_Handflare_White"; }; + class ACE_HandFlare_Red: ACE_HandFlare_Base { author = ECSTRING(common,ACETeam); scope = 2; - ammo = "ACE_F_Hand_Red"; displayname = CSTRING(M127A1_Red_Name); descriptionshort = CSTRING(M127A1_Red_Description); displayNameShort = CSTRING(M127A1_Red_NameShort); model = "\A3\weapons_f\ammo\flare_red"; picture = "\A3\Weapons_F\Data\UI\gear_flare_red_ca.paa"; + ammo = "ACE_G_Handflare_Red"; }; + class ACE_HandFlare_Green: ACE_HandFlare_Base { author = ECSTRING(common,ACETeam); scope = 2; - ammo = "ACE_F_Hand_Green"; displayname = CSTRING(M127A1_Green_Name); descriptionshort = CSTRING(M127A1_Green_Description); displayNameShort = CSTRING(M127A1_Green_NameShort); model = "\A3\weapons_f\ammo\flare_green"; picture = "\A3\Weapons_F\Data\UI\gear_flare_green_ca.paa"; + ammo = "ACE_G_Handflare_Green"; }; + class ACE_HandFlare_Yellow: ACE_HandFlare_Base { author = ECSTRING(common,ACETeam); scope = 2; - ammo = "ACE_F_Hand_Yellow"; displayname = CSTRING(M127A1_Yellow_Name); descriptionshort = CSTRING(M127A1_Yellow_Description); displayNameShort = CSTRING(M127A1_Yellow_NameShort); model = "\A3\weapons_f\ammo\flare_yellow"; picture = "\A3\Weapons_F\Data\UI\gear_flare_yellow_ca.paa"; + ammo = "ACE_G_Handflare_Yellow"; }; + class ACE_M84: HandGrenade { author = ECSTRING(common,ACETeam); - ammo = "ACE_G_M84"; displayname = CSTRING(M84_Name); descriptionshort = CSTRING(M84_Description); displayNameShort = "M84"; - mass = 4; model = PATHTOF(models\ACE_m84.p3d); picture = PATHTOF(UI\ACE_m84_x_ca.paa); + ammo = "ACE_G_M84"; + mass = 4; }; class 3Rnd_UGL_FlareGreen_F; @@ -65,6 +71,7 @@ class CfgMagazines { ammo = "F_40mm_Green"; initSpeed = 120; }; + class 6Rnd_RedSignal_F: 6Rnd_GreenSignal_F { author = ECSTRING(common,ACETeam); ammo = "F_40mm_Red"; diff --git a/addons/grenades/Effects.hpp b/addons/grenades/Effects.hpp new file mode 100644 index 0000000000..3cbcef9a38 --- /dev/null +++ b/addons/grenades/Effects.hpp @@ -0,0 +1,8 @@ + +class ACE_M84FlashbangEffect { + // empty +}; + +class ACE_HandFlareEffect { + // empty +}; diff --git a/addons/grenades/XEH_preInit.sqf b/addons/grenades/XEH_preInit.sqf index 0df2e235fd..631cecca85 100644 --- a/addons/grenades/XEH_preInit.sqf +++ b/addons/grenades/XEH_preInit.sqf @@ -2,6 +2,7 @@ ADDON = false; +PREP(flare); PREP(flashbangExplosionEH); PREP(flashbangThrownFuze); PREP(nextMode); diff --git a/addons/grenades/config.cpp b/addons/grenades/config.cpp index c2a899d66c..2f9e631fe1 100644 --- a/addons/grenades/config.cpp +++ b/addons/grenades/config.cpp @@ -17,3 +17,5 @@ class CfgPatches { #include "CfgWeapons.hpp" #include "CfgMagazines.hpp" #include "CfgVehicles.hpp" + +#include "Effects.hpp" diff --git a/addons/grenades/functions/fnc_flare.sqf b/addons/grenades/functions/fnc_flare.sqf new file mode 100644 index 0000000000..bf1d571640 --- /dev/null +++ b/addons/grenades/functions/fnc_flare.sqf @@ -0,0 +1,40 @@ +/* + * Author: commy2 + * Makes flare shine. + * + * Arguments: + * 0: The flare + * 1: Color of flare + * 2: Intensity of flare + * 3: Flare lifetime + * + * Return Value: + * None + * + * Example: + * [_nade, [0.5,0.5,0.5], 0.5, 60] call ace_grenades_fnc_flare + * + * Public: No + */ +#include "script_component.hpp" + +params ["_projectile", "_color", "_intensity", "_timeToLive"]; + +private "_light"; +_light = "#lightpoint" createVehicleLocal position _projectile; + +_light setLightColor _color; +_light setLightAmbient _color; +_light setLightIntensity _intensity; +_light setLightBrightness 0.8; + +_light setLightUseFlare true; +_light setLightFlareSize 3.0; +_light setLightFlareMaxDistance 1000; + +_light setLightDayLight true; + +_light lightAttachObject [_projectile, [0,0,0]]; +//_light attachTo [_projectile, [0,0,0]]; + +[{deleteVehicle _this}, _light, _timeToLive, 1] call EFUNC(common,waitAndExecute); diff --git a/addons/grenades/functions/fnc_throwGrenade.sqf b/addons/grenades/functions/fnc_throwGrenade.sqf index 03e67a152a..9439aef4bd 100644 --- a/addons/grenades/functions/fnc_throwGrenade.sqf +++ b/addons/grenades/functions/fnc_throwGrenade.sqf @@ -21,22 +21,50 @@ */ #include "script_component.hpp" -private ["_mode", "_fuzeTime"]; -params ["_unit", "_weapon", "", "", "", "", "_projectile"]; +params ["_unit", "_weapon", "", "", "_ammo", "", "_projectile"]; -if (_unit != ACE_player) exitWith {}; if (_weapon != "Throw") exitWith {}; +// http://feedback.arma3.com/view.php?id=12340 +if (isNull _projectile) then { + _projectile = nearestObject [_unit, _ammo]; +}; + +// handle special grenades +if (local _unit) then { + if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(flashbang)) == 1) then { + private "_fuzeTime"; + _fuzeTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosionTime"); + + [FUNC(flashbangThrownFuze), [_projectile], _fuzeTime, 0] call EFUNC(common,waitAndExecute); + }; +}; + +if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(flare)) == 1) then { + private ["_fuzeTime", "_timeToLive", "_color", "_intensity"]; + + _fuzeTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosionTime"); + _timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "timeToLive"); + _color = getArray (configFile >> "CfgAmmo" >> _ammo >> QGVAR(color)); + _intensity = _color select 3; + _color resize 3; + + [FUNC(flare), [_projectile, _color, _intensity, _timeToLive], _fuzeTime, 0] call EFUNC(common,waitAndExecute); +}; + +// handle throw modes +if (_unit != ACE_player) exitWith {}; + +private "_mode"; _mode = missionNamespace getVariable [QGVAR(currentThrowMode), 0]; if (_mode != 0) then { private "_velocity"; - _velocity = velocity _projectile; switch (_mode) do { //high throw - case 1 : { + case 1 : { _velocity = [ 0.5 * (_velocity select 0), 0.5 * (_velocity select 1), @@ -44,24 +72,18 @@ if (_mode != 0) then { ]; }; //precise throw - case 2 : { + case 2 : { _velocity = (_unit weaponDirection _weapon) vectorMultiply (vectorMagnitude _velocity); }; //roll grande - case 3 : { + case 3 : { //@todo }; //drop grenade - case 4 : { + case 4 : { _velocity = [0, 0, 0]; }; }; _projectile setVelocity _velocity; }; - -if (typeOf _projectile == "ACE_G_M84") then { - _fuzeTime = getNumber (configFile >> "CfgAmmo" >> typeOf _projectile >> "fuseDistance"); - // _fuzeTime = getNumber (configFile >> "CfgAmmo" >> typeOf _projectile >> "explosionTime"); //@toDo pretty sure this should be explosionTime not fuseDistance - [FUNC(flashbangThrownFuze), [_projectile], _fuzeTime, 0] call EFUNC(common,waitAndExecute); -}; diff --git a/addons/hearing/ACE_Settings.hpp b/addons/hearing/ACE_Settings.hpp index 867914b857..262c3edc34 100644 --- a/addons/hearing/ACE_Settings.hpp +++ b/addons/hearing/ACE_Settings.hpp @@ -19,4 +19,10 @@ class ACE_Settings { isClientSettable = 1; displayName = CSTRING(DisableEarRinging); }; + class GVAR(enabledForZeusUnits) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(enabledForZeusUnits_DisplayName); + description = CSTRING(enabledForZeusUnits_Description); + }; }; diff --git a/addons/hearing/CfgEventHandlers.hpp b/addons/hearing/CfgEventHandlers.hpp index ce968ed2ca..f09f259266 100644 --- a/addons/hearing/CfgEventHandlers.hpp +++ b/addons/hearing/CfgEventHandlers.hpp @@ -29,7 +29,7 @@ class Extended_FiredNear_EventHandlers { class Extended_Explosion_EventHandlers { class CAManBase { class GVAR(ExplosionNear) { - clientExplosion = QUOTE( if (GVAR(enableCombatDeafness) && {_this select 0 == ACE_player}) then {_this call FUNC(explosionNear)}; ); + clientExplosion = QUOTE(_this call FUNC(explosionNear);); }; }; }; diff --git a/addons/hearing/CfgVehicles.hpp b/addons/hearing/CfgVehicles.hpp index 44ea8f734f..2273653c3a 100644 --- a/addons/hearing/CfgVehicles.hpp +++ b/addons/hearing/CfgVehicles.hpp @@ -130,6 +130,12 @@ class CfgVehicles { }; }; }; + class enabledForZeusUnits { + displayName = CSTRING(enabledForZeusUnits_DisplayName); + description = CSTRING(enabledForZeusUnits_Description); + typeName = "BOOL"; + defaultValue = 1; + }; }; class ModuleDescription { description = CSTRING(Module_Description); diff --git a/addons/hearing/CfgWeapons.hpp b/addons/hearing/CfgWeapons.hpp index 2806ef9970..7c21baaed2 100644 --- a/addons/hearing/CfgWeapons.hpp +++ b/addons/hearing/CfgWeapons.hpp @@ -47,5 +47,16 @@ class CfgWeapons { GVAR(lowerVolume) = 0.60; }; class H_Cap_marshal: H_Cap_headphones {}; -}; + class H_HelmetB_light: H_HelmetB { + GVAR(protection) = 0.8; + GVAR(lowerVolume) = 0.20; + }; + + class H_HelmetB_plain_mcamo; + class H_HelmetSpecB: H_HelmetB_plain_mcamo { + GVAR(protection) = 0.8; + GVAR(lowerVolume) = 0.20; + }; + +}; diff --git a/addons/hearing/XEH_postInit.sqf b/addons/hearing/XEH_postInit.sqf index ad73ed55d5..66406ad917 100644 --- a/addons/hearing/XEH_postInit.sqf +++ b/addons/hearing/XEH_postInit.sqf @@ -15,7 +15,7 @@ GVAR(time4) = 0; ["SettingsInitialized", { // Spawn volume updating process - [FUNC(updateVolume), 1, [false] ] call CBA_fnc_addPerFrameHandler; + [FUNC(updateVolume), 1, [false]] call CBA_fnc_addPerFrameHandler; }] call EFUNC(common,addEventHandler); //Update veh attunation when player veh changes diff --git a/addons/hearing/functions/fnc_addEarPlugs.sqf b/addons/hearing/functions/fnc_addEarPlugs.sqf index 62ed4518e2..b2e43bc718 100644 --- a/addons/hearing/functions/fnc_addEarPlugs.sqf +++ b/addons/hearing/functions/fnc_addEarPlugs.sqf @@ -14,8 +14,7 @@ * Public: No */ #include "script_component.hpp" - -PARAMS_1(_unit); +params ["_unit"]; // Exit if hearing is disabled or soldier has earplugs already in (persistence scenarios) if (!GVAR(enableCombatDeafness) || {[_unit] call FUNC(hasEarPlugsIn)}) exitWith {}; diff --git a/addons/hearing/functions/fnc_earRinging.sqf b/addons/hearing/functions/fnc_earRinging.sqf index 6a896c1820..f4db19e6ea 100644 --- a/addons/hearing/functions/fnc_earRinging.sqf +++ b/addons/hearing/functions/fnc_earRinging.sqf @@ -15,12 +15,12 @@ * Public: No */ #include "script_component.hpp" - -PARAMS_2(_unit,_strength); +params ["_unit", "_strength"]; if (_unit != ACE_player) exitWith {}; if (_strength < 0.05) exitWith {}; if (!isNull curatorCamera) exitWith {}; +if ((!GVAR(enabledForZeusUnits)) && {player != ACE_player}) exitWith {}; if (_unit getVariable ["ACE_hasEarPlugsin", false]) then { _strength = _strength / 4; diff --git a/addons/hearing/functions/fnc_explosionNear.sqf b/addons/hearing/functions/fnc_explosionNear.sqf index dde9bc50cc..7e4d0b9bfc 100644 --- a/addons/hearing/functions/fnc_explosionNear.sqf +++ b/addons/hearing/functions/fnc_explosionNear.sqf @@ -19,10 +19,14 @@ //Only run if deafness or ear ringing is enabled: if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {}; -PARAMS_2(_unit,_damage); +params ["_unit", "_damage"]; + +if (_unit != ACE_player) exitWith {}; + +TRACE_2("explosion near player",_unit,_damage); private ["_strength"]; -_strength = 0 max _damage; +_strength = (0 max _damage) * 30; if (_strength < 0.01) exitWith {}; -[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2, 0] call EFUNC(common,waitAndExecute); +[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2] call EFUNC(common,waitAndExecute); diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 6fc48b27fa..1ee84a2dc8 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -7,8 +7,8 @@ * 1: Firer: Object - Object which fires a weapon near the unit * 2: Distance - Distance in meters between the unit and firer * 3: weapon - Fired weapon - * 4: muzzle - Muzzle that was used - * 5: mod - Current mode of the fired weapon + * 4: muzzle - Muzzle that was used (not used) + * 5: mode - Current mode of the fired weapon (not used) * 6: ammo - Ammo used * * Return Value: @@ -16,6 +16,7 @@ * * Example: * [clientFiredNearEvent] call ace_hearing_fnc_firedNear + * [player, player, 10, "arifle_MX_ACO_pointer_F", "arifle_MX_ACO_pointer_F", "single", "B_65x39_Caseless"] call ace_hearing_fnc_firedNear * * Public: No */ @@ -24,14 +25,14 @@ //Only run if deafness or ear ringing is enabled: if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {}; -PARAMS_7(_object,_firer,_distance,_weapon,_muzzle,_mode,_ammo); +params ["_object", "_firer", "_distance", "_weapon", "", "", "_ammo"]; //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 (_distance > 50) exitWith {}; -private ["_silencer", "_audibleFireCoef", "_loudness", "_strength", "_vehAttenuation", "_magazine", "_muzzles", "_weaponMagazines", "_muzzleMagazines", "_ammoType", "_initSpeed", "_ammoConfig", "_caliber", "_parentClasses"]; +private ["_silencer", "_audibleFireCoef", "_loudness", "_strength", "_vehAttenuation", "_magazine", "_muzzles", "_weaponMagazines", "_muzzleMagazines", "_ammoType", "_initSpeed", "_ammoConfig", "_caliber"]; _vehAttenuation = if ((ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_player}) then {1} else {GVAR(playerVehAttenuation)}; @@ -58,7 +59,7 @@ if (count _weaponMagazines == 0) then { _muzzleMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazines"); _weaponMagazines append _muzzleMagazines; }; - } forEach _muzzles; + } count _muzzles; { _ammoType = getText(configFile >> "CfgMagazines" >> _x >> "ammo"); _weaponMagazines set [_forEachIndex, [_x, _ammoType]]; @@ -68,33 +69,30 @@ if (count _weaponMagazines == 0) then { _magazine = ""; { - EXPLODE_2_PVT(_x,_magazineType,_ammoType); + _x params ["_magazineType", "_ammoType"]; if (_ammoType == _ammo) exitWith { _magazine = _magazineType; }; -} forEach _weaponMagazines; +} count _weaponMagazines; if (_magazine == "") exitWith {}; _initSpeed = getNumber(configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); _ammoConfig = (configFile >> "CfgAmmo" >> _ammo); -_parentClasses = [_ammoConfig, true] call BIS_fnc_returnParents; _caliber = getNumber(_ammoConfig >> "ACE_caliber"); -_caliber = switch (true) do { - case ("ShellBase" in _parentClasses): { 80 }; - case ("RocketBase" in _parentClasses): { 200 }; - case ("MissileBase" in _parentClasses): { 600 }; - case ("SubmunitionBase" in _parentClasses): { 80 }; - default { - if (_caliber <= 0) then { 6.5 } else { _caliber }; - }; +_caliber = call { + if (_ammo isKindOf ["ShellBase", (configFile >> "CfgAmmo")]) exitWith { 80 }; + if (_ammo isKindOf ["RocketBase", (configFile >> "CfgAmmo")]) exitWith { 200 }; + if (_ammo isKindOf ["MissileBase", (configFile >> "CfgAmmo")]) exitWith { 600 }; + if (_ammo isKindOf ["SubmunitionBase", (configFile >> "CfgAmmo")]) exitWith { 80 }; + if (_caliber <= 0) then { 6.5 } else { _caliber }; }; _loudness = (_caliber ^ 1.25 / 10) * (_initspeed / 1000) * _audibleFireCoef / 5; _strength = _vehAttenuation * (_loudness - (_loudness / 50 * _distance)); // linear drop off -//systemChat format["%1 : %2 : %3", _strength, _initSpeed, _parentClasses]; +//systemChat format["%1 : %2", _strength, _initSpeed]; //systemChat format["%1 : %2 : %3", _weapon, _magazine, _initSpeed]; if (_strength < 0.01) exitWith {}; -[{_this call FUNC(earRinging)}, [ACE_player, _strength], 0.2, 0] call EFUNC(common,waitAndExecute); +[{_this call FUNC(earRinging)}, [ACE_player, _strength], 0.2] call EFUNC(common,waitAndExecute); diff --git a/addons/hearing/functions/fnc_hasEarPlugsIn.sqf b/addons/hearing/functions/fnc_hasEarPlugsIn.sqf index 58dc302888..67a76685f4 100644 --- a/addons/hearing/functions/fnc_hasEarPlugsIn.sqf +++ b/addons/hearing/functions/fnc_hasEarPlugsIn.sqf @@ -14,7 +14,6 @@ * Public: No */ #include "script_component.hpp" - -PARAMS_1(_unit); +params ["_unit"]; _unit getVariable ["ACE_hasEarPlugsin", false] diff --git a/addons/hearing/functions/fnc_moduleHearing.sqf b/addons/hearing/functions/fnc_moduleHearing.sqf index 6ec0af0231..2b4daecc72 100644 --- a/addons/hearing/functions/fnc_moduleHearing.sqf +++ b/addons/hearing/functions/fnc_moduleHearing.sqf @@ -10,9 +10,7 @@ */ #include "script_component.hpp" -PARAMS_3(_logic,_units,_activated); - -if !(_activated) exitWith {}; +params ["_logic"]; [_logic, QGVAR(enableCombatDeafness), "EnableCombatDeafness"] call EFUNC(common,readSettingFromModule); @@ -21,4 +19,6 @@ if ((_logic getVariable "DisableEarRinging") != -1) then { [_logic, QGVAR(DisableEarRinging), "DisableEarRinging"] call EFUNC(common,readSettingFromModule); }; +[_logic, QGVAR(enabledForZeusUnits), "enabledForZeusUnits"] call EFUNC(common,readSettingFromModule); + diag_log text "[ACE]: Hearing Module Initialized."; diff --git a/addons/hearing/functions/fnc_putInEarplugs.sqf b/addons/hearing/functions/fnc_putInEarplugs.sqf index 8b11e6ba25..8d5479c17b 100644 --- a/addons/hearing/functions/fnc_putInEarplugs.sqf +++ b/addons/hearing/functions/fnc_putInEarplugs.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_player); +params ["_player"]; // Plugs in inventory, putting them in _player removeItem "ACE_EarPlugs"; diff --git a/addons/hearing/functions/fnc_removeEarplugs.sqf b/addons/hearing/functions/fnc_removeEarplugs.sqf index 19a34831cd..f5b5ca2442 100644 --- a/addons/hearing/functions/fnc_removeEarplugs.sqf +++ b/addons/hearing/functions/fnc_removeEarplugs.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_player); +params ["_player"]; if !(_player canAdd "ACE_EarPlugs") exitWith { // inventory full [localize LSTRING(Inventory_Full)] call EFUNC(common,displayTextStructured); diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index 3a72e8eb3b..f1cb063971 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -19,9 +19,9 @@ //Only run if deafness or ear ringing is enabled: if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {}; -EXPLODE_1_PVT((_this select 0),_justUpdateVolume); - private["_volume", "_soundTransitionTime"]; +(_this select 0) params ["_justUpdateVolume"]; + GVAR(deafnessDV) = (GVAR(deafnessDV) min 20) max 0; GVAR(volume) = (1 - (GVAR(deafnessDV) / 20)) max 0; diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index a3af102580..2e58162b15 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -116,14 +116,16 @@ Gehör Sluch Audição + Hallás - Enable combat deafness? + Combat Deafness Wł. głuchotę bojową ¿Habilitar sordera de combate? Aktiviere Taubheit im Gefecht? Povolit ztrátu sluchu? Ativar surdez em combate? + Harci süketség engedélyezése? Reduces the hearing ability as the player takes hearing damage @@ -132,6 +134,7 @@ Aktiviere Taubheit im Gefecht? Povolit ztrátu sluchu? Ativar surdez em combate? + Harci süketség engedélyezése? Controls combat deafness and ear ringing. When activated, players can be deafened when a gun is fired in their vicinity or an explosion takes place without hearing protection @@ -140,5 +143,11 @@ Ztráta sluchu je možná ve chvíly, kdy se v bezprostřední blízkosti střílí z velkorážní zbraně nebo při bombardování a osoba je bez ochrany sluchu (např. špunty). Tento modul umožňuje tuto věc povolit nebo zakázat. Este módulo ativa / desativa surdez em combate. Quando ativado, os jogadores podem ficar surdos quando uma arma é disparada ao seu redor ou uma explosão ocorre sem proteção auditiva. + + Effect Zeus RC + + + Allow zeus remote controlled units to be able to take hearing damage. + - \ No newline at end of file + diff --git a/addons/huntir/functions/fnc_cam.sqf b/addons/huntir/functions/fnc_cam.sqf index bcc553fff0..9eb22b9fb5 100644 --- a/addons/huntir/functions/fnc_cam.sqf +++ b/addons/huntir/functions/fnc_cam.sqf @@ -7,13 +7,13 @@ * 0: HuntIR * * Return Value: - * Nothing + * None * * Public: No */ #include "script_component.hpp" -PARAMS_1(_huntIR); +params ["_huntIR"]; GVAR(huntIR) = _huntIR; GVAR(pos) = getPosVisual GVAR(huntIR); @@ -73,7 +73,8 @@ GVAR(no_cams) sort true; if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))} && {_x getHitPointDamage "HitCamera" < 0.25}) then { GVAR(no_cams) pushBack _x; }; - } forEach GVAR(nearHuntIRs); + true + } count GVAR(nearHuntIRs); { if (((getPosVisual _x) select 2) <= 20 || {!(_x in GVAR(nearHuntIRs))} || {_x getHitPointDamage "HitCamera" >= 0.25}) then { GVAR(no_cams) deleteAt _forEachIndex; @@ -82,19 +83,19 @@ GVAR(no_cams) sort true; }; }; } forEach GVAR(no_cams); - + GVAR(cur_cam) = 0 max GVAR(cur_cam) min ((count GVAR(no_cams)) - 1); if (count GVAR(no_cams) > 0) then { GVAR(huntIR) = GVAR(no_cams) select GVAR(cur_cam); }; - + GVAR(pos) = getPosVisual GVAR(huntIR); - + if ((!dialog) || (count GVAR(no_cams) == 0) || ((GVAR(pos) select 2) <= 20)) exitWith { [_this select 1] call cba_fnc_removePerFrameHandler; - + GVAR(stop) = true; - + GVAR(pphandle) ppEffectEnable true; ppEffectDestroy GVAR(pphandle); @@ -108,7 +109,7 @@ GVAR(no_cams) sort true; deleteVehicle GVAR(logic); if (player != ACE_player) then { player remoteControl ACE_player; - }; + }; }; switch (GVAR(ZOOM)) do { @@ -131,7 +132,7 @@ GVAR(no_cams) sort true; }; private ["_cam_coord_y", "_cam_coord_x", "_cam_time", "_cam_pos"]; - + GVAR(logic) setPosATL (GVAR(pos) vectorAdd [0, 0, -5]); GVAR(logic) setDir GVAR(ROTATE); GVAR(logic) setVectorUp [0.0001, 0.0001, 1]; diff --git a/addons/huntir/functions/fnc_handleFired.sqf b/addons/huntir/functions/fnc_handleFired.sqf index 121cd9fd12..1919b4547c 100644 --- a/addons/huntir/functions/fnc_handleFired.sqf +++ b/addons/huntir/functions/fnc_handleFired.sqf @@ -13,19 +13,19 @@ * 6: projectile - Object of the projectile that was shot * * Return Value: - * Nothing + * None * * Public: No */ #include "script_component.hpp" -PARAMS_7(_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); +params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"]; if (_ammo != "F_HuntIR") exitWith {}; [{ - PARAMS_1(_projectile); - + params ["_projectile"]; + //If null (deleted or hit water) exit: if (isNull _projectile) exitWith {}; //If it's not spinning (hit ground), bail: @@ -33,15 +33,16 @@ if (_ammo != "F_HuntIR") exitWith {}; "ACE_HuntIR_Propell" createVehicle (getPosATL _projectile); [{ - PARAMS_1(_position); private ["_huntir"]; + params ["_position"]; _huntir = createVehicle ["ACE_HuntIR", _position, [], 0, "FLY"]; _huntir setPosATL _position; _huntir setVariable [QGVAR(startTime), ACE_time, true]; [{ - EXPLODE_1_PVT(_this select 0,_huntir); + params ["_args", "_idPFH"]; + _args params ["_huntir"]; if (isNull _huntir) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; private ["_parachuteDamage", "_velocity"]; _parachuteDamage = _huntir getHitPointDamage "HitParachute"; diff --git a/addons/huntir/functions/fnc_huntir.sqf b/addons/huntir/functions/fnc_huntir.sqf index 27fd5e280b..b1c269533d 100644 --- a/addons/huntir/functions/fnc_huntir.sqf +++ b/addons/huntir/functions/fnc_huntir.sqf @@ -4,10 +4,10 @@ * HuntIR monitor system * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Public: No */ @@ -35,21 +35,21 @@ createDialog "ace_huntir_cam_dialog_off"; GVAR(connectionDelay) = 5; GVAR(state) = "searching"; GVAR(message) = []; - GVAR(messageSearching) = toArray "Searching....."; + GVAR(messageSearching) = toArray "Searching....."; GVAR(messageConnecting) = toArray "Connecting....."; [{ //Close monitor if we no longer have item: if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNameSpace getVariable ["ace_huntir_monitor", displayNull])}) then { closeDialog 0; }; - + private ["_elapsedTime", "_nearestHuntIRs"]; _elapsedTime = ACE_time - GVAR(startTime); _nearestHuntIRs = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE]; - + if ((!dialog) || GVAR(done)) exitWith { [_this select 1] call cba_fnc_removePerFrameHandler; - + if (dialog && GVAR(state) == "connected") then { [_nearestHuntIRs select 0] call FUNC(cam); } else { diff --git a/addons/huntir/functions/fnc_huntirCompass.sqf b/addons/huntir/functions/fnc_huntirCompass.sqf index 30fcf45900..ff06b47df3 100644 --- a/addons/huntir/functions/fnc_huntirCompass.sqf +++ b/addons/huntir/functions/fnc_huntirCompass.sqf @@ -4,10 +4,10 @@ * HuntIR monitor compass * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Public: No */ @@ -32,7 +32,7 @@ disableSerialization; private ["_fnc_correctIt"]; _fnc_correctIt = { - PARAMS_2(_pos,_dir); + params ["_pos", "_dir"]; if (_dir >= 270 || {_dir <= 90}) then { _pos set [1, (_pos select 1) + __OFFSET_Y] }; @@ -51,16 +51,17 @@ _fnc_correctIt = { HUNTIR_CAM_ROSE_LAYER_ID cutRsc ["ace_huntir_cam_rose", "PLAIN"]; [{ - EXPLODE_1_PVT(_this select 0,_fnc_correctIt); - + params ["_args", "_idPFH"]; + _args params ["_fnc_correctIt"]; + if (GVAR(stop)) exitWith { HUNTIR_CAM_ROSE_LAYER_ID cutText ["", "PLAIN"]; - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; - + private ["_dir", "_x1", "_y1", "_pos"]; _dir = getDir GVAR(cam); // direction player; - + _x1 = __CENTER_X - (__RADIUS * sin(_dir)); _y1 = __CENTER_Y - (__RADIUS * cos(_dir)); _pos = [[_x1, _y1], _dir] call _fnc_correctIt; @@ -84,5 +85,5 @@ HUNTIR_CAM_ROSE_LAYER_ID cutRsc ["ace_huntir_cam_rose", "PLAIN"]; _pos = [[_x1, _y1], _dir] call _fnc_correctIt; __CHAR_E ctrlSetPosition [_pos select 0, _pos select 1, __WIDTH, __HEIGHT]; __CHAR_E ctrlCommit 0; - + }, 0.01, [_fnc_correctIt]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index cbc28e66b4..31dedfbe22 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -75,10 +75,32 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; if (GVAR(menuBackground)==2) then {(uiNamespace getVariable [QGVAR(menuBackground), displayNull]) closeDisplay 0;}; }] call EFUNC(common,addEventHandler); -// Let key work with zeus open (not perfect, enables all added hotkeys in zeus interface rather than only menu) +// Let key work with zeus open (not perfect, contains workaround to prevent other CBA keybindings) ["zeusDisplayChanged",{ if (_this select 1) then { - (finddisplay 312) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}]; - (finddisplay 312) displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}]; + (finddisplay 312) displayAddEventHandler ["KeyUp", { + _key = ["ACE3 Common","ace_interact_menu_InteractKey"] call CBA_fnc_getKeybind; + _key = _key select 5; + _dik = _key select 0; + _mods = _key select 1; + + if ((_this select 1) == _dik) then { + if ((_this select [2,3]) isEqualTo _mods) then { + [_this,'keyup'] call CBA_events_fnc_keyHandler + }; + }; + }]; + (finddisplay 312) displayAddEventHandler ["KeyDown", { + _key = ["ACE3 Common","ace_interact_menu_InteractKey"] call CBA_fnc_getKeybind; + _key = _key select 5; + _dik = _key select 0; + _mods = _key select 1; + + if ((_this select 1) == _dik) then { + if ((_this select [2,3]) isEqualTo _mods) then { + [_this,'keydown'] call CBA_events_fnc_keyHandler + }; + }; + }]; }; }] call EFUNC(common,addEventHandler); diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 910b8893c6..2c8cdc279c 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -71,7 +71,7 @@ _recurseFnc = { _statement, _condition, _insertChildren, - {}, + [], [0,0,0], 10, //distace [_showDisabled,_enableInside,_canCollapse,_runOnHover, true], @@ -122,7 +122,7 @@ _actions = if (_isMan) then { // Dummy statement so it's not collapsed when there's no available actions true }, - {[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting"]] call EFUNC(common,canInteractWith)}, + {[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting", "isNotOnLadder"]] call EFUNC(common,canInteractWith)}, {}, {}, "Spine3", diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index ca06e25eb6..8c8ecf0c20 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -18,7 +18,7 @@ if (GVAR(openedMenuType) == _menuType) exitWith {true}; // Conditions: canInteract (these don't apply to zeus) if ((isNull curatorCamera) && { - !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting"]] call EFUNC(common,canInteractWith)) + !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) }) exitWith {false}; while {dialog} do { diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index 5bd8aefe21..990d7f90bf 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -90,6 +90,8 @@ Akcje Zeusa Akce Zeuse Acciones Zeus + Zeus cselekvések + Ações do Zeus Interaction - Text Max @@ -230,6 +232,7 @@ Pozadí menu interakce Interaktionsmenü-Hintergrund Fundo do menu de interação + Cselekvő menü háttere Blur the background while the interaction menu is open. @@ -238,6 +241,7 @@ Rozmazat obraz pokud je interakční menu otevřené. Den Hintergrund verschwimmen lassen, während das Interaktionsmenü geöffnet ist. Desfocar o fundo enquanto o menu de interação está aberto. + A háttér elmosása a cselekvő menü használata alatt. Blur screen @@ -246,6 +250,7 @@ Rozmazaný obraz Verschwommenes Bild Desfoque de tela + Kép elmosása Black @@ -254,22 +259,27 @@ Černý obraz Preto Schwarz + Fekete Show actions for buildings Pokazuj akcje dla budynków Zobrazit akci pro budovy Mostrar acciones para edificios + Cselekvések mutatása épületeknél + Mostrar ações para edifícios Adds interaction actions for opening doors and mounting ladders on buildings. (Note: There is a performance cost when opening interaction menu, especially in towns) Dodaje opcje interakcji dla otwierania drzwi oraz wchodzenia po drabinach do budynków. Uwaga: Użycie tej opcji może spowodować spadek wydajności menu interakcji, szczególnie w dużych miastach. Přidá možnost interakce pro otevření dvěří a umistňovat žebříky na budovy. (Poznámka: Použití této možnosti snižuje výkon při otevírání pomocí interakčního menu, zejména ve velkých městech.) Añade las acciones de interacción para la apertura de puertas y montaje de escaleras en los edificios. (Nota: Hay un coste de rendimiento al abrir el menú de interacción, especialmente en las ciudades) + Cselekvéseket engedélyez ajtók kinyitására és létrák mászására. (Figyelem: ez teljesítményvesztéssel járhat a menü megnyitásakor, főleg városokban) + Adiciona ações de interações para abrir portas e montar escadas em edifícios. (Nota: Existe um custo de performance quando aberto o menu de interação, especialmente em cidades) Interaction Menu Menu interakcji - \ No newline at end of file + diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 997974d2e3..abfdb976ab 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -191,7 +191,7 @@ class CfgVehicles { class ACE_TeamManagement { displayName = CSTRING(TeamManagement); condition = QUOTE(GVAR(EnableTeamManagement)); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; statement = ""; showDisabled = 1; priority = 3.2; @@ -201,7 +201,7 @@ class CfgVehicles { class ACE_JoinTeamRed { displayName = CSTRING(JoinTeamRed); condition = QUOTE(true); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; statement = QUOTE([ARR_2(_player,'RED')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.4; @@ -211,7 +211,7 @@ class CfgVehicles { class ACE_JoinTeamGreen { displayName = CSTRING(JoinTeamGreen); condition = QUOTE(true); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; statement = QUOTE([ARR_2(_player,'GREEN')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.3; @@ -221,7 +221,7 @@ class CfgVehicles { class ACE_JoinTeamBlue { displayName = CSTRING(JoinTeamBlue); condition = QUOTE(true); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; statement = QUOTE([ARR_2(_player,'BLUE')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.2; @@ -231,7 +231,7 @@ class CfgVehicles { class ACE_JoinTeamYellow { displayName = CSTRING(JoinTeamYellow); condition = QUOTE(true); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; statement = QUOTE([ARR_2(_player,'YELLOW')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.1; @@ -242,7 +242,7 @@ class CfgVehicles { class ACE_LeaveTeam { displayName = CSTRING(LeaveTeam); condition = QUOTE(assignedTeam _player != 'MAIN'); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; statement = QUOTE([ARR_2(_player,'MAIN')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.5; @@ -252,7 +252,7 @@ class CfgVehicles { class ACE_BecomeLeader { displayName = CSTRING(BecomeLeader); condition = QUOTE(_this call DFUNC(canBecomeLeader)); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; statement = QUOTE(_this call DFUNC(doBecomeLeader)); showDisabled = 1; priority = 1.0; @@ -262,7 +262,7 @@ class CfgVehicles { class ACE_LeaveGroup { displayName = CSTRING(LeaveGroup); condition = QUOTE(count (units group _player) > 1); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; statement = QUOTE(_oldGroup = units group _player; _newGroup = createGroup side _player; [_player] joinSilent _newGroup; {_player reveal _x} forEach _oldGroup;); showDisabled = 1; priority = 1.2; @@ -379,7 +379,7 @@ class CfgVehicles { class ACE_Equipment { displayName = CSTRING(Equipment); condition = QUOTE(true); - exceptions[] = {"isNotInside","notOnMap", "isNotSitting"}; + exceptions[] = {"isNotInside", "notOnMap", "isNotSitting"}; statement = ""; showDisabled = 1; priority = 4.5; @@ -501,8 +501,8 @@ class CfgVehicles { class ACE_Push { displayName = CSTRING(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 DFUNC(push);); + condition = QUOTE(((getMass _target) <= 2600) && {alive _target} && {(vectorMagnitude (velocity _target)) < 3}); + statement = QUOTE(_this call FUNC(push)); showDisabled = 0; priority = -1; }; diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index 7fe151dac1..8d97803b1d 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -10,6 +10,13 @@ ACE_Modifier = 0; _group selectLeader _leader; }] call EFUNC(common,addEventHandler); +//Pushing boats from FUNC(push) +[QGVAR(pushBoat), { + params ["_boat", "_newVelocity"]; + _boat setVelocity _newVelocity; +}] call EFUNC(common,addEventHandler); + + if (!hasInterface) exitWith {}; GVAR(isOpeningDoor) = false; @@ -28,7 +35,7 @@ private ["_team"]; // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (GVAR(isOpeningDoor) || {[2] call FUNC(getDoor) select 1 == ''}) exitWith {false}; + if (GVAR(isOpeningDoor) || {[MACRO_DOOR_REACH_DISTANCE] call FUNC(getDoor) select 1 == ''}) exitWith {false}; // Statement call EFUNC(interaction,openDoor); @@ -75,3 +82,4 @@ private ["_team"]; [29, [false, false, false]], false] call cba_fnc_addKeybind; ["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition); +["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition); diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index db808e2eba..9555502a93 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -18,7 +18,7 @@ private ["_info", "_phase", "_position", "_time", "_usedMouseWheel", "_getDoorAnimations"]; -_info = [2] call FUNC(getDoor); +_info = [MACRO_DOOR_REACH_DISTANCE] call FUNC(getDoor); EXPLODE_2_PVT(_info,_house,_door); @@ -36,7 +36,7 @@ if (_house animationPhase (_animations select 0) <= 0 && {_house getVariable [_l }; GVAR(isOpeningDoor) = true; -playSound "ACE_Sound_Click"; +playSound "ACE_Sound_Click"; //@todo replace with smth. more fitting [_house, _animations] spawn { private ["_house", "_animations", "_phase", "_position", "_time", "_usedMouseWheel"]; diff --git a/addons/interaction/functions/fnc_push.sqf b/addons/interaction/functions/fnc_push.sqf index 946a5118be..86ad673d9c 100644 --- a/addons/interaction/functions/fnc_push.sqf +++ b/addons/interaction/functions/fnc_push.sqf @@ -4,23 +4,23 @@ * * Arguments: * 0: Boat - * 1: Velocity + * 1: Player * * Return Value: * None * * Example: - * [target, [vector]] call ace_interaction_fnc_push + * [Boats, Jose] call ace_interaction_fnc_push * * Public: No */ - + #include "script_component.hpp" -PARAMS_2(_boat,_velocity); +params ["_boat", "_player"]; -if !(local _boat) exitWith { - [_this, QUOTE(FUNC(push)), _boat] call EFUNC(common,execRemoteFnc); -}; +private ["_newVelocity"]; -_boat setVelocity _velocity; +_newVelocity = [2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5]; + +[QGVAR(pushBoat), [_boat], [_boat, _newVelocity]] call EFUNC(common,targetEvent); diff --git a/addons/interaction/script_component.hpp b/addons/interaction/script_component.hpp index 68f22e96d7..d668387bb9 100644 --- a/addons/interaction/script_component.hpp +++ b/addons/interaction/script_component.hpp @@ -9,4 +9,6 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_INTERACTION #endif -#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" + +#define MACRO_DOOR_REACH_DISTANCE (AGLToASL positionCameraToWorld [0,0,0] vectorDistance AGLToASL (ACE_player modelToWorld (ACE_player selectionPosition "Head"))) + 2 diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index ff9990f77d..65ca6df016 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -1,811 +1,820 @@ - - - - - Interactions - Interaktionen - Interacciones - Interakce - Interakcje - Interactions - Взаимодействия - Cselekvések - Interazioni - Interaçãoes - - - Torso - Torse - Torso - Torso - Trup - Tors - Торс - Testtörzs - Torso - Torso - - - Head - Tête - Kopf - Cabeza - Hlava - Głowa - Голова - Fej - Testa - Cabeça - - - Left Arm - Bras gauche - Linker Arm - Brazo izquierdo - Levá paže - Lewe ramię - Левая рука - Bal kar - Braccio sinistro - Braço Esquerdo - - - Right Arm - Rechter Arm - Brazo derecho - Pravá paže - Prawe ramię - Bras droit - Правая рука - Jobb kar - Braccio destro - Braço Direito - - - Left Leg - Linkes Bein - Pierna izquierda - Levá noha - Lewa noga - Jambe gauche - Левая нога - Bal láb - Gamba sinistra - Perna Esquerda - - - Right Leg - Rechtes Bein - Pierna derecha - Pravá noha - Prawa noga - Jambe droite - Правая нога - Jobb láb - Gamba destra - Perna Direita - - - Weapon - Arme - Waffe - Arma - Zbraň - Broń - Оружие - Fegyver - Arma - Arma - - - Interaction Menu - Interaktionsmenü - Menú de interacción - Menu interakcji - Menu interakce - Menu d'interaction - Меню взаимодействия - Cselekvő menü - Menu de Interação - Menù interazione - - - Interaction Menu (Self) - Interaktionsmenü (selbst) - Menú de interacción (Propio) - Menu interakcji (własne) - Menu interakce (vlastní) - Menu d'interaction (Perso) - Меню взаимодействия (с собой) - Cselekvő menü (saját) - Menu de Interação (Individual) - Menù interazione (individuale) - - - Open / Close Door - Tür öffnen / schließen - Abrir / Cerrar puerta - Otwórz / Zamknij drzwi - Otevřít / Zavřít dveře - Ouvrir / Fermer Portes - Открыть / Закрыть двери - Ajtó nyitása / zárása - Abrir / Fechar Porta - Apri / Chiudi la porta - - - Lock Door - Tür sperren - Bloquear puerta - Verrouiller Porte - Blocca la porta - Заблокировать дверь - Trancar Porta - Ajtó bezárása - Zablokuj drzwi - Zamknout dveře - - - Unlock Door - Tür entsperren - Desbloquear puerta - Déverrouiller Porte - Sblocca la porta - Разблокировать дверь - Destrancar Porta - Zár kinyitása - Odblokuj drzwi - Odemknout dveře - - - Locked Door - Tür gesperrt - Puerta bloqueada - Porte Verrouillée - Porta bloccata - Дверь заблокирована - Porta Trancada - Zárt ajtó - Zablokowano drzwi - Zamčené dveře - - - Unlocked Door - Tür entsperrt - Puerta desbloqueada - Porte Déverrouillée - Porta sbloccata - Дверь разблокирована - Porta Destrancada - Nyitott ajtó - Odblokowano drzwi - Odemčené dveře - - - Join group - Gruppe beitreten - Unirse al grupo - Dołącz do grupy - Přidat se do skupiny - Rejoindre Groupe - Вступить в группу - Csatlakozás a csoporthoz - Unir-se ao grupo - Unisciti alla squadra - - - Leave Group - Gruppe verlassen - Dejar grupo - Opuść grupę - Opustit skupinu - Quitter Groupe - Выйти из группы - Csoport elhagyása - Deixar grupo - Lascia la squadra - - - Become Leader - Grp.-führung übern. - Asumir el liderazgo - Przejmij dowodzenie - Stát se velitelem - Devenir Chef de groupe - Стать лидером - Vezetés átvétele - Tornar-se Líder - Prendi il comando - - - DANCE! - TANZEN! - BAILAR! - TAŃCZ! - TANČIT! - Danse! - ТАНЦЕВАТЬ! - TÁNC! - DANCE! - DANZA! - - - Stop Dancing - Tanzen abbrechen - Dejar de bailar - Przestań tańczyć - Přestat tancovat - Arrêter de danser - Прекратить танцевать - Tánc abbahagyása - Parar de dançar - Smetti di ballare - - - << Back - << Zurück - << Atrás - << Wstecz - << Zpět - << Retour - << Назад - << Vissza - << Voltar - << Indietro - - - Gestures - Gesten - Gestos - Gesty - Posunky - Signaux - Жесты - Kézjelek - Gestos - Gesti - - - Attack - Angreifen - Atacar - Do ataku - Zaútočit - Attaquer - Атаковать - Támadás - Atacar - Attaccare - - - Advance - Vordringen - Avanzar - Naprzód - Postoupit - Avancer - Продвигаться - Előre - Avançar - Avanzare - - - Go - Los - Adelante - Szybko - Jít - Aller - Идти - Mozgás - Mover-se - Muoversi - - - Follow - Folgen - Seguirme - Za mną - Následovat - Suivre - Следовать - Utánam - Seguir - Seguire - - - Point - Zeigen - Señalar - Wskazać - Ukázat - Pointer - Точка - Mutat - Apontar - Puntare a - - - Up - Aufstehen - Arriba - Do góry - Vztyk - Debout - Вверх - Fel - Acima - Alzarsi - - - Cover - Deckung - Cubrirse - Do osłony - Krýt se - A couvert - Укрыться - Fedezékbe - Proteger-se - Copertura - - - Cease Fire - Feuer einstellen - Alto el fuego - Wstrzymać ogień - Zastavit palbu - Halte au feu - Прекратить огонь - Tüzet szüntess - Cessar Fogo - Cessare il Fuoco - - - Freeze - Keine Bewegung - Alto - Stać - Stát - Halte - Замереть - Állj - Alto - Fermi - - - Hi - Hallo - Hola - Witaj - Ahoj - Salut - Привет - Helló - Olá - Ciao - - - Put weapon on back - Waffe wegstecken - Arma a la espalda - Umieść broń na plecach - Dát zbraň na záda - Arme à la bretelle - Повесить оружие на спину - Fegyvert hátra - Colocar arma nas costas - Metti l'arma in spalla - - - Tap Shoulder - Auf Schulter klopfen - Tocar el hombro - Klepnij w ramię - Poklepat na rameno - Taper sur l'épaule - Похлопать по плечу - Vállveregetés - Tocar ombro - Dai un colpetto - - - You were tapped on the RIGHT shoulder - Te tocaron el hombro DERECHO - Dir wurde auf die rechte Schulter geklopft - On te tape sur l'épaule droite - 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 - Ti è stato dato un colpetto sulla spalla destra - - - You were tapped on the LEFT shoulder. - Te tocaron el hombro IZQUIERDO. - Dir wurde auf die linke Schulter geklopft - On te tape sur l'épaule gauche - 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. - Ti è stato dato un colpetto sulla spalla sinistra - - - Cancel - Abbrechen - Cancelar - Anuluj - Annuler - Zrušit - Annulla - Отменить - Cancelar - Mégse - - - Select - Wählen - Seleccionar - Wybierz - Sélectionner - Zvolit - Seleziona - Выбрать - Selecionar - Kiválaszt - - - Go Away! - Geh Weg! - Aléjate! - Odejdź! - Jděte pryč! - Allez-vous-en! - Уходите отсюда! - Tűnés! - Vá Embora! - Via di qui! - - - Get Down! - Auf den Boden! - Al suelo! - Padnij! - K zemi! - A terre! - A földre! - Ложись! - Abaixe-se! - A terra! - - - Team Management - Gruppenverwaltung - Gestión de equipo - Gestion d'équipe - Drużyna - Správa týmu - Управление группой - Gerenciamento de Equipe - Organizzazione Squadra - Csapat kezelése - - - Red - Rot - Rojo - Rouge - Czerwonych - Červený - Красный - Vermelha - Rosso - Piros - - - Green - Grün - Verde - Vert - Zielonych - Zelený - Зеленый - Verde - Verde - Zöld - - - Blue - Blau - Azul - Bleu - Niebieskich - Modrý - Синий - Azul - Blu - Kék - - - Yellow - Gelb - Amarillo - Jaune - Żółtych - Žlutý - Жёлтый - Amarela - Giallo - Sárga - - - Assign Red - Rot zuweisen - Asignar a rojo - Przydziel do czerwonych - Atribuir Vermelho - Hozzávonás a Piroshoz - Přiřadit k červeným - Назначить в Красную группу - Assigner à rouge - Assegna al team rosso - - - Assign Green - Grün zuweisen - Asignar a verde - Przydziel do zielonych - Atribuir Verde - Hozzávonás a Zöldhöz - Přiřadit k zeleným - Назначить в Зеленую группу - Assigner à vert - Assegna al team verde - - - Assign Blue - Blau zuweisen - Asignar a azul - Przydziel do niebieskich - Atribuir Azul - Hozzávonás a Kékhez - Přiřadit k modrým - Назначить в Синюю группу - Assigner à bleu - Assegna al team blu - - - Assign Yellow - Gelb zuweisen - Asignar a amarillo - Przydziel do żółtych - Atribuir Amarelo - Hozzávonás a Sárgához - Přiřadit ke žlutým - Назначить в Желтую группу - Assigner à jaune - Assegna al team giallo - - - Join Red - Rot beitreten - Unirse a rojo - Dołącz do czerwonych - Entrar em Vermelho - Belépés a Pirosba - Připojit k červeným - Присоединиться к Красной группе - Rejoindre rouge - Unirsi al team rosso - - - Join Green - Grün beitreten - Unirse a verde - Dołącz do zielonych - Entrar em Verde - Belépés a Zöldbe - Připojit k zeleným - Присоединиться к Зеленой группе - Rejoindre vert - Unirsi al team verde - - - Join Blue - Blau beitreten - Unirse a azul - Dołącz do niebieskich - Entrar em Azul - Belépés a Kékbe - Připojit k modrým - Присоединиться к Синей группе - Rejoindre bleu - Unirsi al team blu - - - Join Yellow - Gelb beitreten - Unirse a amarillo - Dołącz do żółtych - Entrar em Amarelo - Belépés a Sárgába - Připojit ke žlutým - Присоединиться к Жёлтой группе - Rejoindre jaune - Unirsi al team giallo - - - You joined Team %1 - Du bist Gruppe %1 beigetreten - Te has unido al equipo %1 - Tu as rejoint l'équipe %1 - Dołączyłeś do %1 - Připojil ses do %1 týmu - Вы присоединились к группе %1 - Você uniu-se à Equipe %1 - Sei entrato nel team %1 - Csatlakoztál a %1 csapathoz - - - Leave Team - Gruppe verlassen - Dejar equipo - Quitter l'équipe - Opuść drużynę - Opustit tým - Покинуть группу - Deixar Equipe - Lascia il team - Csapat elhagyása - - - You left the Team - Du hast die Gruppe verlassen - Has dejado el equipo - Tu as quitté l'équipe - Opuściłeś drużynę - Opustil jsi tým - Вы покинули группу - Você deixou a Equipe - Hai lasciato il team - Elhagytad a csapatot - - - Pardon - Begnadigen - Perdonar - Przebacz - Pardon - Pardon - Извините - Perdão - Perdona - Megbocsátás - - - Scroll - Scrollen - Przewiń - Défilement - Desplazar - Пролистать - Rolar - Scorri - Görgetés - Otáčení - - - Modifier Key - Modifikator-Taste - Modyfikator - Modifier la touche - Tecla modificadora - Клавиша-модификатор - Tecla Modificadora - Tasto modifica - Módosító billentyű - Modifikátor - - - Not in Range - Außer Reichweite - Hors de portée. - Fuera de rango - Слишком далеко - Fora do Alcançe - Hatótávolságon kívül - Poza zasięgiem - Mimo dosah - Fuori limite - - - Equipment - Ausrüstung - Equipamiento - Équipement - Ekwipunek - Vybavení - Felszerelés - Снаряжение - Equipaggiamento - Equipamento - - - Push - Schieben - Empujar - Pousser - Pchnij - Odstrčit - Tolás - Толкать - Empurrar - Spingere - - - Interact - Interagir - Interagiere - Interakce - Взаимодействовать - Interakcja - Interactuar - Cselekvés - Interagire - Interagir - - - Passengers - Insassen - Pasajeros - Пассажиры - Pasažéři - Pasażerowie - Passagers - Utasok - Passeggeri - Passageiros - - - Open - Otwórz - Otevřít - Abrir - - - Interaction System - System interakcji - Sistema de interacción - Interaktionssystem - Systém interakce - Sistema de interação - - - Enable Team Management - Wł. zarządzanie drużyną - Habilitar gestión de equipos - Aktiviere Gruppenverwaltung - Povolit správu týmu - Habilitar gestão de equipes - - - Should players be allowed to use the Team Management Menu? Default: Yes - Czy gracze mogą korzystać z menu zarządzania drużyną? Domyślnie: Tak - ¿Deben tener permitido los jugadores el uso del menu de gestión de equipos? Por defecto: Si - Sollen Spieler das Gruppenverwaltungsmenü verwenden dürfen? Standard: Ja - Mohou hráči použít menu správy týmu? Výchozí: Ano - Devem os jogadores ter permissão de usar o menu de gestão de equipes? Padrão: Sim - - - Team management allows color allocation for team members, taking team command and joining/leaving teams. - Na zarządzanie drużyną składa się: przydział kolorów dla członków drużyny, przejmowanie dowodzenia, dołączanie/opuszczanie drużyn. - Die Gruppenverwaltung erlaubt die Zuweisung von Farben für Einheiten, die Kommandierung und das Beitreten/Verlassen einer Gruppe. - Správa týmu se skládá z: přidělení barev pro členy týmu, převzetí velení, připojení/odpojení. - O módulo de gestão de equipe é composto por: a atribuição de cores para os membros da equipe, comando das equipes, juntando-se / deixando equipes. - La gestión del equipo permite la asignación de colores para los miembros del equipo, tomando el mando del equipo y uniendo/dejando equipos. - - - \ No newline at end of file + + + + + Interactions + Interaktionen + Interacciones + Interakce + Interakcje + Interactions + Взаимодействия + Cselekvések + Interazioni + Interaçãoes + + + Torso + Torse + Torso + Torso + Trup + Tors + Торс + Testtörzs + Torso + Torso + + + Head + Tête + Kopf + Cabeza + Hlava + Głowa + Голова + Fej + Testa + Cabeça + + + Left Arm + Bras gauche + Linker Arm + Brazo izquierdo + Levá paže + Lewe ramię + Левая рука + Bal kar + Braccio sinistro + Braço Esquerdo + + + Right Arm + Rechter Arm + Brazo derecho + Pravá paže + Prawe ramię + Bras droit + Правая рука + Jobb kar + Braccio destro + Braço Direito + + + Left Leg + Linkes Bein + Pierna izquierda + Levá noha + Lewa noga + Jambe gauche + Левая нога + Bal láb + Gamba sinistra + Perna Esquerda + + + Right Leg + Rechtes Bein + Pierna derecha + Pravá noha + Prawa noga + Jambe droite + Правая нога + Jobb láb + Gamba destra + Perna Direita + + + Weapon + Arme + Waffe + Arma + Zbraň + Broń + Оружие + Fegyver + Arma + Arma + + + Interaction Menu + Interaktionsmenü + Menú de interacción + Menu interakcji + Menu interakce + Menu d'interaction + Меню взаимодействия + Cselekvő menü + Menu de Interação + Menù interazione + + + Interaction Menu (Self) + Interaktionsmenü (selbst) + Menú de interacción (Propio) + Menu interakcji (własne) + Menu interakce (vlastní) + Menu d'interaction (Perso) + Меню взаимодействия (с собой) + Cselekvő menü (saját) + Menu de Interação (Individual) + Menù interazione (individuale) + + + Open / Close Door + Tür öffnen / schließen + Abrir / Cerrar puerta + Otwórz / Zamknij drzwi + Otevřít / Zavřít dveře + Ouvrir / Fermer Portes + Открыть / Закрыть двери + Ajtó nyitása / zárása + Abrir / Fechar Porta + Apri / Chiudi la porta + + + Lock Door + Tür sperren + Bloquear puerta + Verrouiller Porte + Blocca la porta + Заблокировать дверь + Trancar Porta + Ajtó bezárása + Zablokuj drzwi + Zamknout dveře + + + Unlock Door + Tür entsperren + Desbloquear puerta + Déverrouiller Porte + Sblocca la porta + Разблокировать дверь + Destrancar Porta + Zár kinyitása + Odblokuj drzwi + Odemknout dveře + + + Locked Door + Tür gesperrt + Puerta bloqueada + Porte Verrouillée + Porta bloccata + Дверь заблокирована + Porta Trancada + Zárt ajtó + Zablokowano drzwi + Zamčené dveře + + + Unlocked Door + Tür entsperrt + Puerta desbloqueada + Porte Déverrouillée + Porta sbloccata + Дверь разблокирована + Porta Destrancada + Nyitott ajtó + Odblokowano drzwi + Odemčené dveře + + + Join group + Gruppe beitreten + Unirse al grupo + Dołącz do grupy + Přidat se do skupiny + Rejoindre Groupe + Вступить в группу + Csatlakozás a csoporthoz + Unir-se ao grupo + Unisciti alla squadra + + + Leave Group + Gruppe verlassen + Dejar grupo + Opuść grupę + Opustit skupinu + Quitter Groupe + Выйти из группы + Csoport elhagyása + Deixar grupo + Lascia la squadra + + + Become Leader + Grp.-führung übern. + Asumir el liderazgo + Przejmij dowodzenie + Stát se velitelem + Devenir Chef de groupe + Стать лидером + Vezetés átvétele + Tornar-se Líder + Prendi il comando + + + DANCE! + TANZEN! + BAILAR! + TAŃCZ! + TANČIT! + Danse! + ТАНЦЕВАТЬ! + TÁNC! + DANCE! + DANZA! + + + Stop Dancing + Tanzen abbrechen + Dejar de bailar + Przestań tańczyć + Přestat tancovat + Arrêter de danser + Прекратить танцевать + Tánc abbahagyása + Parar de dançar + Smetti di ballare + + + << Back + << Zurück + << Atrás + << Wstecz + << Zpět + << Retour + << Назад + << Vissza + << Voltar + << Indietro + + + Gestures + Gesten + Gestos + Gesty + Posunky + Signaux + Жесты + Kézjelek + Gestos + Gesti + + + Attack + Angreifen + Atacar + Do ataku + Zaútočit + Attaquer + Атаковать + Támadás + Atacar + Attaccare + + + Advance + Vordringen + Avanzar + Naprzód + Postoupit + Avancer + Продвигаться + Előre + Avançar + Avanzare + + + Go + Los + Adelante + Szybko + Jít + Aller + Идти + Mozgás + Mover-se + Muoversi + + + Follow + Folgen + Seguirme + Za mną + Následovat + Suivre + Следовать + Utánam + Seguir + Seguire + + + Point + Zeigen + Señalar + Wskazać + Ukázat + Pointer + Точка + Mutat + Apontar + Puntare a + + + Up + Aufstehen + Arriba + Do góry + Vztyk + Debout + Вверх + Fel + Acima + Alzarsi + + + Cover + Deckung + Cubrirse + Do osłony + Krýt se + A couvert + Укрыться + Fedezékbe + Proteger-se + Copertura + + + Cease Fire + Feuer einstellen + Alto el fuego + Wstrzymać ogień + Zastavit palbu + Halte au feu + Прекратить огонь + Tüzet szüntess + Cessar Fogo + Cessare il Fuoco + + + Freeze + Keine Bewegung + Alto + Stać + Stát + Halte + Замереть + Állj + Alto + Fermi + + + Hi + Hallo + Hola + Witaj + Ahoj + Salut + Привет + Helló + Olá + Ciao + + + Put weapon on back + Waffe wegstecken + Arma a la espalda + Umieść broń na plecach + Dát zbraň na záda + Arme à la bretelle + Повесить оружие на спину + Fegyvert hátra + Colocar arma nas costas + Metti l'arma in spalla + + + Tap Shoulder + Auf Schulter klopfen + Tocar el hombro + Klepnij w ramię + Poklepat na rameno + Taper sur l'épaule + Похлопать по плечу + Vállveregetés + Tocar ombro + Dai un colpetto + + + You were tapped on the RIGHT shoulder + Te tocaron el hombro DERECHO + Dir wurde auf die rechte Schulter geklopft + On te tape sur l'épaule droite + 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 + Ti è stato dato un colpetto sulla spalla destra + + + You were tapped on the LEFT shoulder. + Te tocaron el hombro IZQUIERDO. + Dir wurde auf die linke Schulter geklopft + On te tape sur l'épaule gauche + 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. + Ti è stato dato un colpetto sulla spalla sinistra + + + Cancel + Abbrechen + Cancelar + Anuluj + Annuler + Zrušit + Annulla + Отменить + Cancelar + Mégse + + + Select + Wählen + Seleccionar + Wybierz + Sélectionner + Zvolit + Seleziona + Выбрать + Selecionar + Kiválaszt + + + Go Away! + Geh Weg! + Aléjate! + Odejdź! + Jděte pryč! + Allez-vous-en! + Уходите отсюда! + Tűnés! + Vá Embora! + Via di qui! + + + Get Down! + Auf den Boden! + Al suelo! + Padnij! + K zemi! + A terre! + A földre! + Ложись! + Abaixe-se! + A terra! + + + Team Management + Gruppenverwaltung + Gestión de equipo + Gestion d'équipe + Zarządzanie oddziałem + Správa týmu + Управление группой + Gerenciamento de Equipe + Organizzazione Squadra + Csapat kezelése + + + Red + Rot + Rojo + Rouge + Czerwonych + Červený + Красный + Vermelha + Rosso + Piros + + + Green + Grün + Verde + Vert + Zielonych + Zelený + Зеленый + Verde + Verde + Zöld + + + Blue + Blau + Azul + Bleu + Niebieskich + Modrý + Синий + Azul + Blu + Kék + + + Yellow + Gelb + Amarillo + Jaune + Żółtych + Žlutý + Жёлтый + Amarela + Giallo + Sárga + + + Assign Red + Rot zuweisen + Asignar a rojo + Przydziel do czerwonych + Atribuir Vermelho + Hozzávonás a Piroshoz + Přiřadit k červeným + Назначить в Красную группу + Assigner à rouge + Assegna al team rosso + + + Assign Green + Grün zuweisen + Asignar a verde + Przydziel do zielonych + Atribuir Verde + Hozzávonás a Zöldhöz + Přiřadit k zeleným + Назначить в Зеленую группу + Assigner à vert + Assegna al team verde + + + Assign Blue + Blau zuweisen + Asignar a azul + Przydziel do niebieskich + Atribuir Azul + Hozzávonás a Kékhez + Přiřadit k modrým + Назначить в Синюю группу + Assigner à bleu + Assegna al team blu + + + Assign Yellow + Gelb zuweisen + Asignar a amarillo + Przydziel do żółtych + Atribuir Amarelo + Hozzávonás a Sárgához + Přiřadit ke žlutým + Назначить в Желтую группу + Assigner à jaune + Assegna al team giallo + + + Join Red + Rot beitreten + Unirse a rojo + Dołącz do czerwonych + Entrar em Vermelho + Belépés a Pirosba + Připojit k červeným + Присоединиться к Красной группе + Rejoindre rouge + Unirsi al team rosso + + + Join Green + Grün beitreten + Unirse a verde + Dołącz do zielonych + Entrar em Verde + Belépés a Zöldbe + Připojit k zeleným + Присоединиться к Зеленой группе + Rejoindre vert + Unirsi al team verde + + + Join Blue + Blau beitreten + Unirse a azul + Dołącz do niebieskich + Entrar em Azul + Belépés a Kékbe + Připojit k modrým + Присоединиться к Синей группе + Rejoindre bleu + Unirsi al team blu + + + Join Yellow + Gelb beitreten + Unirse a amarillo + Dołącz do żółtych + Entrar em Amarelo + Belépés a Sárgába + Připojit ke žlutým + Присоединиться к Жёлтой группе + Rejoindre jaune + Unirsi al team giallo + + + You joined Team %1 + Du bist Gruppe %1 beigetreten + Te has unido al equipo %1 + Tu as rejoint l'équipe %1 + Dołączyłeś do %1 + Připojil ses do %1 týmu + Вы присоединились к группе %1 + Você uniu-se à Equipe %1 + Sei entrato nel team %1 + Csatlakoztál a %1 csapathoz + + + Leave Team + Gruppe verlassen + Dejar equipo + Quitter l'équipe + Opuść drużynę + Opustit tým + Покинуть группу + Deixar Equipe + Lascia il team + Csapat elhagyása + + + You left the Team + Du hast die Gruppe verlassen + Has dejado el equipo + Tu as quitté l'équipe + Opuściłeś drużynę + Opustil jsi tým + Вы покинули группу + Você deixou a Equipe + Hai lasciato il team + Elhagytad a csapatot + + + Pardon + Begnadigen + Perdonar + Przebacz + Pardon + Pardon + Извините + Perdão + Perdona + Megbocsátás + + + Scroll + Scrollen + Przewiń + Défilement + Desplazar + Пролистать + Rolar + Scorri + Görgetés + Otáčení + + + Modifier Key + Modifikator-Taste + Modyfikator + Modifier la touche + Tecla modificadora + Клавиша-модификатор + Tecla Modificadora + Tasto modifica + Módosító billentyű + Modifikátor + + + Not in Range + Außer Reichweite + Hors de portée. + Fuera de rango + Слишком далеко + Fora do Alcançe + Hatótávolságon kívül + Poza zasięgiem + Mimo dosah + Fuori limite + + + Equipment + Ausrüstung + Equipamiento + Équipement + Ekwipunek + Vybavení + Felszerelés + Снаряжение + Equipaggiamento + Equipamento + + + Push + Schieben + Empujar + Pousser + Pchnij + Odstrčit + Tolás + Толкать + Empurrar + Spingere + + + Interact + Interagir + Interagiere + Interakce + Взаимодействовать + Interakcja + Interactuar + Cselekvés + Interagire + Interagir + + + Passengers + Insassen + Pasajeros + Пассажиры + Pasažéři + Pasażerowie + Passagers + Utasok + Passeggeri + Passageiros + + + Open + Otwórz + Otevřít + Abrir + Nyitás + Abrir + + + Interaction System + System interakcji + Sistema de interacción + Interaktionssystem + Systém interakce + Sistema de interação + Interakciós rendszer + Sistema de interação + + + Enable Team Management + Wł. zarządzanie drużyną + Habilitar gestión de equipos + Aktiviere Gruppenverwaltung + Povolit správu týmu + Habilitar gestão de equipes + Csapatkezelés engedélyezése + Habilitar gestão de equipes + + + Should players be allowed to use the Team Management Menu? Default: Yes + Czy gracze mogą korzystać z menu zarządzania drużyną? Domyślnie: Tak + ¿Deben tener permitido los jugadores el uso del menu de gestión de equipos? Por defecto: Si + Sollen Spieler das Gruppenverwaltungsmenü verwenden dürfen? Standard: Ja + Mohou hráči použít menu správy týmu? Výchozí: Ano + Devem os jogadores ter permissão de usar o menu de gestão de equipes? Padrão: Sim + A játékosoknak engedélyezve legyen a csapatkezelő menü? Alapértelmezett: Igen + Devem os jogadores ter permissão de usar o menu de gestão de equipes? Padrão: Sim + + + Team management allows color allocation for team members, taking team command and joining/leaving teams. + Na zarządzanie drużyną składa się: przydział kolorów dla członków drużyny, przejmowanie dowodzenia, dołączanie/opuszczanie drużyn. + Die Gruppenverwaltung erlaubt die Zuweisung von Farben für Einheiten, die Kommandierung und das Beitreten/Verlassen einer Gruppe. + Správa týmu se skládá z: přidělení barev pro členy týmu, převzetí velení, připojení/odpojení. + La gestión del equipo permite la asignación de colores para los miembros del equipo, tomando el mando del equipo y uniendo/dejando equipos. + A csapatkezelés engedélyezi a tagok színének meghatározását, a vezetés átvételét, és csapatoknál be-és kilépést. + O módulo de gestão de equipe é composto por: a atribuição de cores para os membros da equipe, comando das equipes, juntando-se / deixando equipes. + + + diff --git a/addons/laserpointer/CfgJointRails.hpp b/addons/laserpointer/CfgJointRails.hpp new file mode 100644 index 0000000000..7583bd03b5 --- /dev/null +++ b/addons/laserpointer/CfgJointRails.hpp @@ -0,0 +1,8 @@ +class asdg_SlotInfo; +class asdg_FrontSideRail: asdg_SlotInfo { + class compatibleItems { + ACE_acc_pointer_red = 1; + ACE_acc_pointer_green = 1; + ACE_acc_pointer_green_IR = 1; + }; +}; diff --git a/addons/laserpointer/config.cpp b/addons/laserpointer/config.cpp index d368512257..cbb3105696 100644 --- a/addons/laserpointer/config.cpp +++ b/addons/laserpointer/config.cpp @@ -16,3 +16,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" +#include "CfgJointRails.hpp" diff --git a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf index e69fc5e271..34ca98808b 100644 --- a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf +++ b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf @@ -1,30 +1,11 @@ // by commy2 and esteldunedain #include "script_component.hpp" -private ["_p0", "_p1", "_p0Pos", "_offV1", "_offV2", "_offV3", "_camPos", "_intermediatePos", "_iteration", "_light", "_line", "_pL", "_pL2", "_pX", "_size", "_units", "_fnc_getDistanceToTerrain", "_fnc_doesIntersectWithMan"]; +params ["_unit", "_range", "_isGreen", "_brightness"]; -// 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]; +private ["_p0", "_v1", "_v2", "_v3", "_p1", "_pL", "_distance", "_pL2", "_camPos", "_size"]; - GVAR(laserdot) = _light; -};*/ - -EXPLODE_4_PVT(_this,_unit,_range,_isGreen,_brightness); - -_p0Pos = _unit modelToWorldVisual (_unit selectionPosition "righthand"); - -// Convert _p0Pos to ASL -_p0 = + _p0Pos; -if (!surfaceIsWater _p0) then { - _p0 = ATLtoASL _p0; -}; +_p0 = AGLToASL (_unit modelToWorldVisual (_unit selectionPosition "righthand")); // Find a system of orthogonal reference vectors // _v1 points in the direction of the weapon @@ -36,68 +17,22 @@ _v3 = _v2 vectorCrossProduct _v1; // Offset over the 3 reference axis // This offset could eventually be configured by weapon in the config -_offV1 = 0.31; -_offV2 = 0; -_offV3 = 0.08; +#define OFFV1 0.31 +#define OFFV2 0 +#define OFFV3 0.08 // Offset _p0, the start of the laser -_p0 = _p0 vectorAdd (_v1 vectorMultiply _offV1) vectorAdd (_v3 vectorMultiply _offV3) vectorAdd (_v2 vectorMultiply _offV2); -_p0Pos = _p0Pos vectorAdd (_v1 vectorMultiply _offV1) vectorAdd (_v3 vectorMultiply _offV3) vectorAdd (_v2 vectorMultiply _offV2); +_p0 = _p0 vectorAdd (_v1 vectorMultiply OFFV1) vectorAdd (_v3 vectorMultiply OFFV3) vectorAdd (_v2 vectorMultiply OFFV2); + // Calculate _p1, the potential end of the laser _p1 = _p0 vectorAdd (_v1 vectorMultiply _range); -//Debugaaa = lineIntersectsObjs [_p0, _p1, objNull, _unit, false, 2]; +_pL = lineIntersectsSurfaces [_p0, _p1, ACE_player, vehicle ACE_player, true, 1, "GEOM", "FIRE"] select 0 select 0; -_fnc_getDistanceToTerrain = { - private ["_distance"]; +// no intersection found, quit +if (isNil "_pL") exitWith {}; - _pX = + _p0; - _line = [_p0, _pX]; - - _distance = _this; - _iteration = _distance; - - while {_iteration > 0.05 / 2} do { - _iteration = _iteration / 2; - - _pX = _p0 vectorAdd (_v1 vectorMultiply _distance); - - _line set [1, _pX]; - - _distance = _distance + (([1, -1] select (lineIntersects (_line + [_unit]) || {terrainIntersectASL _line})) * _iteration); - - if (_distance > _this) exitWith {_distance = _this}; - }; - - _distance -}; - -// Get distance to nearest object or terrain (excluding men) -_distance = _range call _fnc_getDistanceToTerrain; - -// Find all men potentially intercepted by the ray -_intermediatePos = _p0 vectorAdd (_v1 vectorMultiply _distance/2); -if (!surfaceIsWater _intermediatePos) then { - _intermediatePos = ASLtoATL _intermediatePos; -}; -_units = nearestObjects [_intermediatePos, ["Man"], _distance/2]; - -_units deleteAt (_units find _unit); - -_fnc_doesIntersectWithMan = { - _pX = _p0 vectorAdd (_v1 vectorMultiply (_this select 1)); - if (!surfaceIsWater _pX) then { - _pX = ASLtoATL _pX; - }; - count ([_this select 0, "FIRE"] intersect [_p0Pos, _pX]) > 0 -}; - -// Test intersection with nearby men -{ - if ([_x, _distance] call _fnc_doesIntersectWithMan) then { - _distance = _distance min ((_unit distance _x) - _offV1); - }; -} forEach _units; +_distance = _p0 vectorDistance _pL; //systemChat str _distance; if (_distance < 0.5) exitWith {}; @@ -105,31 +40,29 @@ if (_distance < 0.5) exitWith {}; _pL = _p0 vectorAdd (_v1 vectorMultiply _distance); _pL2 = _p0 vectorAdd (_v1 vectorMultiply (_distance - 0.5)); -// Convert _pL to pos -if (!surfaceIsWater _pL) then { - _pL = ASLtoATL _pL; -}; +_pL = ASLtoAGL _pL; /* drawLine3D [ - _p0Pos, + _p0, _pL, [[1,0,0,1], [0,1,0,1]] select _isGreen ]; */ -_size = 2 * (_range - (positionCameraToWorld [0,0,0] vectorDistance _pL)) / _range; +//systemChat str [_unit, "FIRE"] intersect [_camPos, _pL]; _camPos = positionCameraToWorld [0,0,0.2]; if (count ([_unit, "FIRE"] intersect [_camPos, _pL]) > 0) exitWith {}; if (count ([ACE_player, "FIRE"] intersect [_camPos, _pL]) > 0) exitWith {}; // Convert _camPos to ASL -if (!surfaceIsWater _camPos) then { _camPos = ATLtoASL _camPos; }; +_camPos = AGLToASL _camPos; + if ( terrainIntersectASL [_camPos, _pL2]) exitWith {}; if ( lineIntersects [_camPos, _pL2]) exitWith {}; -//GVAR(laserdot) setPos _pL; +_size = 2 * (_range - (positionCameraToWorld [0,0,0] vectorDistance _pL)) / _range; drawIcon3D [ format ["\a3\weapons_f\acc\data\collimdot_%1_ca.paa", ["red", "green"] select _isGreen], diff --git a/addons/laserpointer/functions/fnc_onDraw.sqf b/addons/laserpointer/functions/fnc_onDraw.sqf index 09663f9ecf..9e61e70156 100644 --- a/addons/laserpointer/functions/fnc_onDraw.sqf +++ b/addons/laserpointer/functions/fnc_onDraw.sqf @@ -35,7 +35,7 @@ _brightness = 2 - call EFUNC(common,ambientBrightness); }; if (_laserID > 0 && {_x isFlashlightOn _weapon}) then { - [_x, 50, (_laserID == 2 || _isIR), _brightness] call FUNC(drawLaserpoint); + [_x, 100, (_laserID == 2 || _isIR), _brightness] call FUNC(drawLaserpoint); }; }; diff --git a/addons/logistics_wirecutter/CfgVehicles.hpp b/addons/logistics_wirecutter/CfgVehicles.hpp index a31d9c0d99..0b584409d3 100644 --- a/addons/logistics_wirecutter/CfgVehicles.hpp +++ b/addons/logistics_wirecutter/CfgVehicles.hpp @@ -5,4 +5,22 @@ class CfgVehicles { MACRO_ADDITEM(ACE_wirecutter,4); }; }; + + class Wall_F; + class NonStrategic; + + class Land_Net_Fence_4m_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Net_Fence_8m_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Net_FenceD_8m_F: Wall_F { GVAR(isFence) = 1; }; + class Land_New_WiredFence_5m_F: Wall_F { GVAR(isFence) = 1; }; + class Land_New_WiredFence_10m_Dam_F: Wall_F { GVAR(isFence) = 1; }; + class Land_New_WiredFence_10m_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Pipe_fence_4m_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Pipe_fence_4mNoLC_F: Wall_F { GVAR(isFence) = 1; }; + class Land_SportGround_fence_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Wired_Fence_4m_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Wired_Fence_4mD_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Wired_Fence_8m_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Wired_Fence_8mD_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Razorwire_F: NonStrategic { GVAR(isFence) = 1; }; }; diff --git a/addons/logistics_wirecutter/CfgWeapons.hpp b/addons/logistics_wirecutter/CfgWeapons.hpp index 4297cb3b83..2b365cc8e6 100644 --- a/addons/logistics_wirecutter/CfgWeapons.hpp +++ b/addons/logistics_wirecutter/CfgWeapons.hpp @@ -10,7 +10,7 @@ class CfgWeapons { picture = QUOTE(PATHTOF(ui\item_wirecutter_ca.paa)); scope = 2; class ItemInfo: InventoryItem_Base_F { - mass = 100; + mass = 65; }; }; }; diff --git a/addons/logistics_wirecutter/XEH_preInit.sqf b/addons/logistics_wirecutter/XEH_preInit.sqf index 44eb941c16..39620bf35c 100644 --- a/addons/logistics_wirecutter/XEH_preInit.sqf +++ b/addons/logistics_wirecutter/XEH_preInit.sqf @@ -3,9 +3,6 @@ ADDON = false; PREP(cutDownFence); -PREP(cutDownFenceAbort); -PREP(cutDownFenceCallback); -PREP(getNearestFence); PREP(interactEH); PREP(isFence); diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf index f45f0c1511..2bf807975f 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf @@ -16,21 +16,35 @@ */ #include "script_component.hpp" -#define SOUND_CLIP_TIME_SPACEING 1.5 -private ["_timeToCut", "_progressCheck"]; +params ["_unit", "_fenceObject"]; +TRACE_2("params",_unit,_fenceObject); + +private ["_timeToCut", "_progressCheck", "_onCompletion", "_onFail"]; -PARAMS_2(_unit,_fenceObject); if (_unit != ACE_player) exitWith {}; _timeToCut = if ([ACE_player] call EFUNC(common,isEngineer)) then {7.5} else {11}; [ACE_player, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation); +_onCompletion = { + TRACE_1("_onCompletion",_this); + (_this select 0) params ["_fenceObject", "", "_unit"]; + _fenceObject setdamage 1; + [_unit, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); +}; + +_onFail = { + TRACE_1("_onFail", _this); + (_this select 0) params ["", "", "_unit"]; + [_unit, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); +}; + _progressCheck = { - PARAMS_2(_args,_passedTime); - EXPLODE_2_PVT(_args,_fenceObject,_lastSoundEffectTime); + params ["_args", "_passedTime"]; + _args params ["_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]; }; @@ -38,4 +52,4 @@ _progressCheck = { ((!isNull _fenceObject) && {(damage _fenceObject) < 1} && {("ACE_wirecutter" in (items ACE_player))}) }; -[_timeToCut, [_fenceObject,0], {(_this select 0) call FUNC(cutDownFenceCallback)}, {(_this select 0) call FUNC(cutDownFenceAbort)}, localize LSTRING(CuttingFence), _progressCheck] call EFUNC(common,progressBar); +[_timeToCut, [_fenceObject,0,_unit], _onCompletion, _onFail, localize LSTRING(CuttingFence), _progressCheck] call EFUNC(common,progressBar); diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf deleted file mode 100644 index 20cb092131..0000000000 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Author: commy2 - * Stops cutting down fence (reset animation) - * - * Arguments: - * Nothing - * - * Return Value: - * Nothing - * - * Example: - * [] call ace_logistics_wirecutter_fnc_cutDownFenceAbort - * - * Public: No - */ -#include "script_component.hpp" - -[ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf deleted file mode 100644 index 57495a2a03..0000000000 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Author: PabstMirror - * Once progressbar is done: Fence is cutdown - * - * Arguments: - * 0: Fence Object - * - * Return Value: - * Nothing - * - * Example: - * [aFence] call ace_logistics_wirecutter_fnc_cutDownFenceCallback - * - * Public: No - */ -#include "script_component.hpp" - -PARAMS_1(_fenceObject); - -_fenceObject setdamage 1; -// [localize LSTRING(FenceCut)] call EFUNC(common,displayTextStructured); -[ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf b/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf deleted file mode 100644 index 15bfbdb8ef..0000000000 --- a/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Author: PabstMirror - * Gets nearest fence object (not actully used, left for utility) - * - * Arguments: - * 0: Unit - * - * Return Value: - * The return value - * - * Example: - * [player] call ace_logistics_wirecutter_fnc_getNearestFence - * - * Public: Yes - */ -#include "script_component.hpp" - -private "_nearestFence"; -PARAMS_1(_unit); - -_nearestFence = objNull; -{ - 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 05c47c4454..e93296e44a 100644 --- a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf +++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf @@ -15,22 +15,24 @@ */ #include "script_component.hpp" -PARAMS_1(_interactionType); +params ["_interactionType"]; -//Ignore self-interaction menu -if (_interactionType != 0) exitWith {}; +//Ignore self-interaction menu or mounted vehicle interaction +if ((_interactionType != 0) || {(vehicle ACE_player) != ACE_player}) exitWith {}; //for performance only do stuff it they have a wirecutter item //(if they somehow get one durring keydown they'll just have to reopen) if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; +TRACE_1("Starting wire-cut action PFEH",_interactionType); + [{ private ["_fncStatement", "_attachedFence", "_fncCondition", "_helper", "_action"]; - PARAMS_2(_args,_pfID); - EXPLODE_3_PVT(_args,_setPosition,_addedHelpers,_fencesHelped); + params ["_args", "_pfID"]; + _args params ["_setPosition", "_addedHelpers", "_fencesHelped"]; if (!EGVAR(interact_menu,keyDown)) then { - {deleteVehicle _x;} forEach _addedHelpers; + {deleteVehicle _x; nil} count _addedHelpers; [_pfID] call CBA_fnc_removePerFrameHandler; } else { // Prevent Rare Error when ending mission with interact key down: @@ -40,11 +42,12 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; if (((getPosASL ace_player) distance _setPosition) > 5) then { _fncStatement = { - PARAMS_3(_dummyTarget,_player,_attachedFence); + params ["", "_player", "_attachedFence"]; [_player, _attachedFence] call FUNC(cutDownFence); }; _fncCondition = { - PARAMS_3(_dummyTarget,_player,_attachedFence); + params ["", "_player", "_attachedFence"]; + if (!([_player, _attachedFence, []] call EFUNC(common,canInteractWith))) exitWith {false}; ((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items _player))}) }; @@ -52,15 +55,15 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; if (!(_x in _fencesHelped)) then { if ([_x] call FUNC(isFence)) then { _fencesHelped pushBack _x; - _helper = "Sign_Sphere25cm_F" createVehicleLocal (getpos _x); + _helper = "ACE_LogicDummy" createVehicleLocal (getpos _x); _action = [QGVAR(helperCutFence), (localize LSTRING(CutFence)), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), _fncStatement, _fncCondition, {}, _x, [0,0,0], 5] call EFUNC(interact_menu,createAction); [_helper, 0, [],_action] call EFUNC(interact_menu,addActionToObject); _helper setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]); - _helper hideObject true; _addedHelpers pushBack _helper; }; }; - } forEach nearestObjects [ace_player, [], 15]; + nil + } count nearestObjects [ace_player, [], 15]; _args set [0, (getPosASL ace_player)]; }; diff --git a/addons/logistics_wirecutter/functions/fnc_isFence.sqf b/addons/logistics_wirecutter/functions/fnc_isFence.sqf index 4c247b268a..c1e30a7e6f 100644 --- a/addons/logistics_wirecutter/functions/fnc_isFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_isFence.sqf @@ -16,27 +16,26 @@ */ #include "script_component.hpp" -//find is case sensitive, so keep everything lowercase -#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", "ace_concertinawire"] - -#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"] +params ["_object"]; +TRACE_1("params",_object); private ["_typeOf", "_returnValue"]; -PARAMS_1(_object); -_typeOf = toLower (typeOf _object); +_typeOf = typeOf _object; _returnValue = false; if (_typeOf != "") then { //If the fence has configEntry we can check it directly - _returnValue = _typeOf in FENCE_TYPENAMES; + _returnValue = (1 == (getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(isFence)))); } else { + //TODO: 1.50 use getModelInfo _typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d" { if ((_typeOf find _x) != -1) exitWith { _returnValue = true; }; - } forEach FENCE_P3DS; + nil + } count FENCE_P3DS; }; _returnValue diff --git a/addons/logistics_wirecutter/script_component.hpp b/addons/logistics_wirecutter/script_component.hpp index 6dae60dfd2..a86ace1592 100644 --- a/addons/logistics_wirecutter/script_component.hpp +++ b/addons/logistics_wirecutter/script_component.hpp @@ -1,6 +1,8 @@ #define COMPONENT logistics_wirecutter #include "\z\ace\addons\main\script_mod.hpp" +// #define DEBUG_MODE_FULL + #ifdef DEBUG_ENABLED_LOGISTICS_WIRECUTTER #define DEBUG_MODE_FULL #endif @@ -10,3 +12,9 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + + +//find is case sensitive, so keep everything lowercase +#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"] + +#define SOUND_CLIP_TIME_SPACEING 1.5 diff --git a/addons/main/config.cpp b/addons/main/config.cpp index 9399b14279..a013d8e971 100644 --- a/addons/main/config.cpp +++ b/addons/main/config.cpp @@ -541,48 +541,24 @@ class CfgPatches { "a3_weapons_f_vests", "a3data", "map_vr", - "extended_eventhandlers", "CBA_UI", "CBA_XEH", "CBA_XEH_A3" + "extended_eventhandlers", "cba_ui", "cba_xeh", "cba_xeh_a3", "cba_jr" }; - author[] = {"ACE Team"}; - authorUrl = ""; - versionDesc = "A.C.E."; - versionAct = QUOTE(['MAIN',_this] execVM '\z\ace\addons\main\about.sqf';); + author[] = {ECSTRING(common,ACETeam)}; + authorUrl = "http://ace3mod.com/"; VERSION_CONFIG; }; }; class CfgMods { class PREFIX { - dir = "@ACE"; - name = "Core - Advanced Combat Environment"; + dir = "@ace"; + name = "Advanced Combat Environment 3"; picture = "A3\Ui_f\data\Logos\arma3_expansion_alpha_ca"; hidePicture = "true"; hideName = "true"; actionName = "Website"; - action = "http://ace.dev-heaven.net"; - description = "Bugtracker: "; - }; -}; - -class CfgSettings { - class CBA { - class Versioning { - class PREFIX { - level = DEFAULT_VERSIONING_LEVEL; - handler = "ace_common_fnc_mismatch"; - class Dependencies { - CBA[]={"cba_main", {1,0,0}, "true"}; - XEH[]={"cba_xeh", {1,0,0}, "true"}; - }; - }; - }; - /* - class Registry { - class PREFIX { - removed[] = {}; - }; - }; - */ + action = "http://ace3mod.com/"; + description = "Issue Tracker: https://github.com/acemod/ACE3/issues"; }; }; diff --git a/addons/main/script_component.hpp b/addons/main/script_component.hpp index 9a18b78a7a..3ac1d0b7aa 100644 --- a/addons/main/script_component.hpp +++ b/addons/main/script_component.hpp @@ -3,12 +3,12 @@ // #define DEBUG_MODE_FULL -#ifdef DEBUG_ENABLED_CORE +#ifdef DEBUG_ENABLED_MAIN #define DEBUG_MODE_FULL #endif -#ifdef DEBUG_SETTINGS_CORE - #define DEBUG_SETTINGS DEBUG_SETTINGS_CORE +#ifdef DEBUG_SETTINGS_MAIN + #define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN #endif #include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index e67c45e675..41514e4aaf 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -97,5 +97,87 @@ // Time functions for accuracy per frame #define ACE_tickTime (ACE_time + (diag_tickTime - ACE_diagTime)) +#define ACE_LOG(module,level,message) diag_log text ACE_LOGFORMAT(module,level,message) +#define ACE_LOGFORMAT(module,level,message) FORMAT_2(QUOTE([ACE] (module) %1: %2),level,message) -#include "script_debug.hpp" \ No newline at end of file +#define ACE_LOGERROR(message) ACE_LOG(COMPONENT,"ERROR",message) +#define ACE_LOGERROR_1(message,arg1) ACE_LOGERROR(FORMAT_1(message,arg1)) +#define ACE_LOGERROR_2(message,arg1,arg2) ACE_LOGERROR(FORMAT_2(message,arg1,arg2)) +#define ACE_LOGERROR_3(message,arg1,arg2,arg3) ACE_LOGERROR(FORMAT_3(message,arg1,arg2,arg3)) +#define ACE_LOGERROR_4(message,arg1,arg2,arg3,arg4) ACE_LOGERROR(FORMAT_4(message,arg1,arg2,arg3,arg4)) +#define ACE_LOGERROR_5(message,arg1,arg2,arg3,arg4,arg5) ACE_LOGERROR(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5)) +#define ACE_LOGERROR_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_LOGERROR(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6)) +#define ACE_LOGERROR_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGERROR(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) +#define ACE_LOGERROR_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGERROR(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) + +#define ACE_ERRORFORMAT(message) ACE_LOGFORMAT(COMPONENT,"ERROR",message) +#define ACE_ERRORFORMAT_1(message,arg1) ACE_ERRORFORMAT(FORMAT_1(message,arg1)) +#define ACE_ERRORFORMAT_2(message,arg1,arg2) ACE_ERRORFORMAT(FORMAT_2(message,arg1,arg2)) +#define ACE_ERRORFORMAT_3(message,arg1,arg2,arg3) ACE_ERRORFORMAT(FORMAT_3(message,arg1,arg2,arg3)) +#define ACE_ERRORFORMAT_4(message,arg1,arg2,arg3,arg4) ACE_ERRORFORMAT(FORMAT_4(message,arg1,arg2,arg3,arg4)) +#define ACE_ERRORFORMAT_5(message,arg1,arg2,arg3,arg4,arg5) ACE_ERRORFORMAT(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5)) +#define ACE_ERRORFORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_ERRORFORMAT(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6)) +#define ACE_ERRORFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_ERRORFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) +#define ACE_ERRORFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_ERRORFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) + +#define ACE_LOGWARNING(message) ACE_LOG(COMPONENT,"WARNING",message) +#define ACE_LOGWARNING_1(message,arg1) ACE_LOGWARNING(FORMAT_1(message,arg1)) +#define ACE_LOGWARNING_2(message,arg1,arg2) ACE_LOGWARNING(FORMAT_2(message,arg1,arg2)) +#define ACE_LOGWARNING_3(message,arg1,arg2,arg3) ACE_LOGWARNING(FORMAT_3(message,arg1,arg2,arg3)) +#define ACE_LOGWARNING_4(message,arg1,arg2,arg3,arg4) ACE_LOGWARNING(FORMAT_4(message,arg1,arg2,arg3,arg4)) +#define ACE_LOGWARNING_5(message,arg1,arg2,arg3,arg4,arg5) ACE_LOGWARNING(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5)) +#define ACE_LOGWARNING_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_LOGWARNING(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6)) +#define ACE_LOGWARNING_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGWARNING(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) +#define ACE_LOGWARNING_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGWARNING(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) + +#define ACE_WARNINGFORMAT(message) ACE_LOGFORMAT(COMPONENT,"WARNING",message) +#define ACE_WARNINGFORMAT_1(message,arg1) ACE_WARNINGFORMAT(FORMAT_1(message,arg1)) +#define ACE_WARNINGFORMAT_2(message,arg1,arg2) ACE_WARNINGFORMAT(FORMAT_2(message,arg1,arg2)) +#define ACE_WARNINGFORMAT_3(message,arg1,arg2,arg3) ACE_WARNINGFORMAT(FORMAT_3(message,arg1,arg2,arg3)) +#define ACE_WARNINGFORMAT_4(message,arg1,arg2,arg3,arg4) ACE_WARNINGFORMAT(FORMAT_4(message,arg1,arg2,arg3,arg4)) +#define ACE_WARNINGFORMAT_5(message,arg1,arg2,arg3,arg4,arg5) ACE_WARNINGFORMAT(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5)) +#define ACE_WARNINGFORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_WARNINGFORMAT(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6)) +#define ACE_WARNINGFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_WARNINGFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) +#define ACE_WARNINGFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_WARNINGFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) + +#define ACE_LOGINFO(message) ACE_LOG(COMPONENT,"INFO",message) +#define ACE_LOGINFO_1(message,arg1) ACE_LOGINFO(FORMAT_1(message,arg1)) +#define ACE_LOGINFO_2(message,arg1,arg2) ACE_LOGINFO(FORMAT_2(message,arg1,arg2)) +#define ACE_LOGINFO_3(message,arg1,arg2,arg3) ACE_LOGINFO(FORMAT_3(message,arg1,arg2,arg3)) +#define ACE_LOGINFO_4(message,arg1,arg2,arg3,arg4) ACE_LOGINFO(FORMAT_4(message,arg1,arg2,arg3,arg4)) +#define ACE_LOGINFO_5(message,arg1,arg2,arg3,arg4,arg5) ACE_LOGINFO(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5)) +#define ACE_LOGINFO_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_LOGINFO(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6)) +#define ACE_LOGINFO_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGINFO(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) +#define ACE_LOGINFO_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGINFO(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) + +#define ACE_INFOFORMAT(message) ACE_LOGFORMAT(COMPONENT,"INFO",message) +#define ACE_INFOFORMAT_1(message,arg1) ACE_INFOFORMAT(FORMAT_1(message,arg1)) +#define ACE_INFOFORMAT_2(message,arg1,arg2) ACE_INFOFORMAT(FORMAT_2(message,arg1,arg2)) +#define ACE_INFOFORMAT_3(message,arg1,arg2,arg3) ACE_INFOFORMAT(FORMAT_3(message,arg1,arg2,arg3)) +#define ACE_INFOFORMAT_4(message,arg1,arg2,arg3,arg4) ACE_INFOFORMAT(FORMAT_4(message,arg1,arg2,arg3,arg4)) +#define ACE_INFOFORMAT_5(message,arg1,arg2,arg3,arg4,arg5) ACE_INFOFORMAT(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5)) +#define ACE_INFOFORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_INFOFORMAT(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6)) +#define ACE_INFOFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_INFOFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) +#define ACE_INFOFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_INFOFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) + +#define ACE_LOGDEBUG(message) ACE_LOG(COMPONENT,"DEBUG",message) +#define ACE_LOGDEBUG_1(message,arg1) ACE_LOGDEBUG(FORMAT_1(message,arg1)) +#define ACE_LOGDEBUG_2(message,arg1,arg2) ACE_LOGDEBUG(FORMAT_2(message,arg1,arg2)) +#define ACE_LOGDEBUG_3(message,arg1,arg2,arg3) ACE_LOGDEBUG(FORMAT_3(message,arg1,arg2,arg3)) +#define ACE_LOGDEBUG_4(message,arg1,arg2,arg3,arg4) ACE_LOGDEBUG(FORMAT_4(message,arg1,arg2,arg3,arg4)) +#define ACE_LOGDEBUG_5(message,arg1,arg2,arg3,arg4,arg5) ACE_LOGDEBUG(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5)) +#define ACE_LOGDEBUG_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_LOGDEBUG(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6)) +#define ACE_LOGDEBUG_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGDEBUG(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) +#define ACE_LOGDEBUG_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGDEBUG(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) + +#define ACE_DEBUGFORMAT(message) ACE_LOGFORMAT(COMPONENT,"DEBUG",message) +#define ACE_DEBUGFORMAT_1(message,arg1) ACE_DEBUGFORMAT(FORMAT_1(message,arg1)) +#define ACE_DEBUGFORMAT_2(message,arg1,arg2) ACE_DEBUGFORMAT(FORMAT_2(message,arg1,arg2)) +#define ACE_DEBUGFORMAT_3(message,arg1,arg2,arg3) ACE_DEBUGFORMAT(FORMAT_3(message,arg1,arg2,arg3)) +#define ACE_DEBUGFORMAT_4(message,arg1,arg2,arg3,arg4) ACE_DEBUGFORMAT(FORMAT_4(message,arg1,arg2,arg3,arg4)) +#define ACE_DEBUGFORMAT_5(message,arg1,arg2,arg3,arg4,arg5) ACE_DEBUGFORMAT(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5)) +#define ACE_DEBUGFORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_DEBUGFORMAT(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6)) +#define ACE_DEBUGFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_DEBUGFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) +#define ACE_DEBUGFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_DEBUGFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) + +#include "script_debug.hpp" diff --git a/addons/map/ACE_Settings.hpp b/addons/map/ACE_Settings.hpp index 15e2a174e4..4e2a5d5706 100644 --- a/addons/map/ACE_Settings.hpp +++ b/addons/map/ACE_Settings.hpp @@ -15,6 +15,10 @@ class ACE_Settings { value = 1; typeName = "BOOL"; }; + class GVAR(mapGlow) { + value = 1; + typeName = "BOOL"; + }; class GVAR(mapShake) { value = 1; typeName = "BOOL"; diff --git a/addons/map/CfgAmmo.hpp b/addons/map/CfgAmmo.hpp new file mode 100644 index 0000000000..805e7b3627 --- /dev/null +++ b/addons/map/CfgAmmo.hpp @@ -0,0 +1,48 @@ +class CfgAmmo { + + class FlareCore; + + class FlareBase: FlareCore {}; + class F_20mm_White: FlareBase {}; + + class ACE_FlashlightProxy_White: F_20mm_White { + model = ""; + effectFlare = "FlareShell"; + + triggerTime = 0; + intensity = 0.5; + flareSize = 1; + timeToLive = 10e10; + + lightColor[] = {1,1,1,1}; + + grenadeBurningSound[] = {}; + grenadeFireSound[] = {}; + soundTrigger[] = {}; + SmokeShellSoundHit1[] = {}; + SmokeShellSoundHit2[] = {}; + SmokeShellSoundHit3[] = {}; + SmokeShellSoundLoop1[] = {}; + SmokeShellSoundLoop2[] = {}; + }; + + class ACE_FlashlightProxy_Red: ACE_FlashlightProxy_White { + intensity = 1; + lightColor[] = {1,0,0,1}; + }; + + class ACE_FlashlightProxy_Green: ACE_FlashlightProxy_White { + intensity = 1; + lightColor[] = {0,1,0,1}; + }; + + class ACE_FlashlightProxy_Blue: ACE_FlashlightProxy_White { + intensity = 1.5; + lightColor[] = {0.25,0.25,1,1}; + }; + + class ACE_FlashlightProxy_Yellow: ACE_FlashlightProxy_White { + intensity = 1; + lightColor[] = {1,1,0.5,1}; + }; +}; \ No newline at end of file diff --git a/addons/map/CfgSounds.hpp b/addons/map/CfgSounds.hpp new file mode 100644 index 0000000000..ede59914a7 --- /dev/null +++ b/addons/map/CfgSounds.hpp @@ -0,0 +1,7 @@ +class CfgSounds { + class ACE_map_flashlightClick { + name = "ACE_map_flashlightClick"; + sound[] = {"\a3\sounds_f\weapons\Other\dry4.wss", 0.2, 2}; + titles[] = {}; + }; +}; \ No newline at end of file diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index 30cae96ef6..3b203c1f62 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -1,4 +1,20 @@ class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_MapFlashlight { + displayName = CSTRING(Action_Flashlights); + icon = QUOTE(\a3\ui_f\data\IGUI\Cfg\VehicleToggles\lightsiconon_ca.paa); + condition = QUOTE(GVAR(mapIllumination) && visibleMap && (count ([ACE_player] call FUNC(getUnitFlashlights)) > 0)); + statement = "true"; + exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; + insertChildren = QUOTE(_this call DFUNC(compileFlashlightMenu)); + showDisabled = 0; + priority = 99; + }; + }; + }; + class ACE_Module; class ACE_ModuleMap: ACE_Module { author = ECSTRING(common,ACETeam); @@ -15,6 +31,12 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 1; }; + class MapGlow { + displayName = CSTRING(MapGlow_DisplayName); + description = CSTRING(MapGlow_Description); + typeName = "BOOL"; + defaultValue = 1; + }; class MapShake { displayName = CSTRING(MapShake_DisplayName); description = CSTRING(MapShake_Description); @@ -45,7 +67,7 @@ class CfgVehicles { displayName = CSTRING(BFT_Module_DisplayName); function = QFUNC(blueForceTrackingModule); scope = 2; - isGlobal = 0; + isGlobal = 1; icon = PATHTOF(UI\Icon_Module_BFTracking_ca.paa); class Arguments { class Enabled { @@ -71,4 +93,4 @@ class CfgVehicles { description = CSTRING(BFT_Module_Description); }; }; -}; +}; \ No newline at end of file diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index 95f42db431..02800c2540 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -1,23 +1,24 @@ #include "script_component.hpp" // Exit on Headless as well -if !(hasInterface) exitWith {}; +if (!hasInterface) exitWith {}; LOG(MSG_INIT); // Calculate the maximum zoom allowed for this map call FUNC(determineZoom); -// This spawn is probably worth keeping, as pfh don't work natively on the briefing screen and IDK how reliable the hack we implemented for them is. -// The thread dies as soon as the mission start, so it's not really compiting for scheduler space. -[] spawn { - // Wait until the map display is detected - waitUntil {(!isNull findDisplay 12)}; +[{ + if (isNull findDisplay 12) exitWith {}; GVAR(lastStillPosition) = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld [0.5, 0.5]; GVAR(lastStillTime) = ACE_time; GVAR(isShaking) = false; + //map sizes are multiples of 1280 + GVAR(worldSize) = worldSize / 1280; + GVAR(mousePos) = [0.5,0.5]; + //Allow panning the lastStillPosition while mapShake is active GVAR(rightMouseButtonLastPos) = []; ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapEffects);}]; @@ -42,13 +43,69 @@ call FUNC(determineZoom); GVAR(rightMouseButtonLastPos) = []; }; }]; -}; + + //get mouse position on map + ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseMoving", { + GVAR(mousePos) = (_this select 0) ctrlMapScreenToWorld [_this select 1, _this select 2]; + }]; + ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseHolding", { + GVAR(mousePos) = (_this select 0) ctrlMapScreenToWorld [_this select 1, _this select 2]; + }]; + + [_this select 1] call CBA_fnc_removePerFrameHandler; +}, 0] call CBA_fnc_addPerFrameHandler; ["SettingsInitialized", { // Start Blue Force Tracking if Enabled if (GVAR(BFT_Enabled)) then { - diag_log text "[ACE] Blue Force Tracking Enabled (client)"; GVAR(BFT_markers) = []; [FUNC(blueForceTrackingUpdate), GVAR(BFT_Interval), []] call CBA_fnc_addPerFrameHandler; }; + + //illumination settings + if (GVAR(mapIllumination)) then { + GVAR(flashlightInUse) = ""; + GVAR(glow) = objNull; + + ["playerInventoryChanged", { + _flashlights = [ACE_player] call FUNC(getUnitFlashlights); + if ((GVAR(flashlightInUse) != "") && !(GVAR(flashlightInUse) in _flashlights)) then { + GVAR(flashlightInUse) = ""; + }; + }] call EFUNC(common,addEventHandler); + + if (GVAR(mapGlow)) then { + ["visibleMapChanged", { + params ["_player", "_mapOn"]; + if (_mapOn) then { + if (!alive _player && !isNull GVAR(glow)) then { + GVAR(flashlightInUse) = ""; + }; + if (GVAR(flashlightInUse) != "") then { + if (isNull GVAR(glow)) then { + [GVAR(flashlightInUse)] call FUNC(flashlightGlow); + }; + } else { + if (!isNull GVAR(glow)) then { + [""] call FUNC(flashlightGlow); + }; + }; + } else { + if (!isNull GVAR(glow)) then { + [""] call FUNC(flashlightGlow); + }; + }; + }] call EFUNC(common,addEventHandler); + }; + }; +}] call EFUNC(common,addEventHandler); + +// hide clock on map if player has no watch +GVAR(hasWatch) = true; + +["playerInventoryChanged", { + if (isNull (_this select 0)) exitWith { + GVAR(hasWatch) = true; + }; + GVAR(hasWatch) = "ItemWatch" in (_this select 1 select 17); }] call EFUNC(common,addEventHandler); diff --git a/addons/map/XEH_preInit.sqf b/addons/map/XEH_preInit.sqf index c5645a52e7..9e123a3877 100644 --- a/addons/map/XEH_preInit.sqf +++ b/addons/map/XEH_preInit.sqf @@ -5,10 +5,15 @@ LOG(MSG_INIT); PREP(blueForceTrackingModule); PREP(blueForceTrackingUpdate); +PREP(compileFlashlightMenu); PREP(determineMapLight); PREP(determineZoom); +PREP(flashlightGlow); +PREP(getUnitFlashlights); PREP(moduleMap); PREP(onDrawMap); +PREP(simulateMapLight); +PREP(switchFlashlight); PREP(updateMapEffects); ADDON = true; diff --git a/addons/map/config.cpp b/addons/map/config.cpp index 16cfd2bc31..6d6b4030ec 100644 --- a/addons/map/config.cpp +++ b/addons/map/config.cpp @@ -27,6 +27,8 @@ class RscEdit; #include "CfgEventHandlers.hpp" #include "CfgMarkers.hpp" #include "CfgVehicles.hpp" +#include "CfgAmmo.hpp" +#include "CfgSounds.hpp" class RscMapControl { maxSatelliteAlpha = 0.5; diff --git a/addons/map/functions/fnc_blueForceTrackingModule.sqf b/addons/map/functions/fnc_blueForceTrackingModule.sqf index 33049c38ca..bab776c9ab 100644 --- a/addons/map/functions/fnc_blueForceTrackingModule.sqf +++ b/addons/map/functions/fnc_blueForceTrackingModule.sqf @@ -12,12 +12,15 @@ #include "script_component.hpp" -if (!isServer) exitWith {}; +if !(hasInterface) exitWith {}; -PARAMS_1(_logic); +PARAMS_3(_logic,_units,_activated); + +if !(_activated) exitWith {}; [_logic, QGVAR(BFT_Enabled), "Enabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(BFT_Interval), "Interval"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(BFT_HideAiGroups), "HideAiGroups"] call EFUNC(common,readSettingFromModule); -diag_log text "[ACE]: Blue Force Tracking Module initialized. (server)"; +diag_log text "[ACE]: Blue Force Tracking Module initialized."; +TRACE_2("[ACE]: Blue Force Tracking Module initialized.", GVAR(BFT_Interval), GVAR(BFT_HideAiGroups)); diff --git a/addons/map/functions/fnc_compileFlashlightMenu.sqf b/addons/map/functions/fnc_compileFlashlightMenu.sqf new file mode 100644 index 0000000000..0d081bb57c --- /dev/null +++ b/addons/map/functions/fnc_compileFlashlightMenu.sqf @@ -0,0 +1,65 @@ +/* + * Author: voiper + * Compile list of flashlight classnames and add to the "Flashlight" parent menu. + * + * Arguments: + * 0: Vehicle + * 1: Player + * 3: Parameters + * + * Return value: + * None + * + * Example: + * [_player, _player, []] call ace_map_fnc_compileFlashlightMenu; + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_vehicle", "_player", "_parameters"]; + +_actions = []; +_flashlights = [_player] call FUNC(getUnitFlashlights); + +//add all carried flashlight menus and on/off submenu actions +{ + _displayName = getText (configFile >> "CfgWeapons" >> _x >> "displayName"); + _icon = getText (configFile >> "CfgWeapons" >> _x >> "picture"); + + _children = { + params ["_vehicle", "_player", "_flashlight"]; + _actions = []; + + _onAction = [ + (_flashlight + "_On"), + "On", + "", + {[_this select 2] call FUNC(switchFlashlight)}, + {GVAR(flashlightInUse) != (_this select 2)}, + {}, + _flashlight + ] call EFUNC(interact_menu,createAction); + + _offAction = [ + (_flashlight + "_Off"), + "Off", + "", + {[""] call FUNC(switchFlashlight)}, + {GVAR(flashlightInUse) == (_this select 2)}, + {}, + _flashlight + ] call EFUNC(interact_menu,createAction); + + _actions pushBack [_onAction, [], _player]; + _actions pushBack [_offAction, [], _player]; + + _actions + }; + + _parentAction = [_x, _displayName, _icon, {true}, {true}, _children, _x] call EFUNC(interact_menu,createAction); + _actions pushBack [_parentAction, [], _player]; +} forEach _flashlights; + +_actions \ No newline at end of file diff --git a/addons/map/functions/fnc_determineMapLight.sqf b/addons/map/functions/fnc_determineMapLight.sqf index 9c205299e6..8204b4b7f8 100644 --- a/addons/map/functions/fnc_determineMapLight.sqf +++ b/addons/map/functions/fnc_determineMapLight.sqf @@ -55,11 +55,13 @@ _fnc_calcColor = { _lightLevel = 0.04 + (0.96 * call EFUNC(common,ambientBrightness)); +/* // check if player has NVG enabled if (currentVisionMode _unit == 1) exitWith { // stick to nvg color [true, [154/255,253/255,177/255,0.5]] }; +*/ // Do not obscure the map if the ambient light level is above 0.95 if (_lightLevel > 0.95) exitWith { @@ -122,4 +124,4 @@ if (_lightLevel > 0.95) exitWith { }; // Calculate resulting map color -[true, [_lightTint, _lightLevel] call _fnc_calcColor] +[true, [_lightTint, _lightLevel] call _fnc_calcColor] \ No newline at end of file diff --git a/addons/map/functions/fnc_flashlightGlow.sqf b/addons/map/functions/fnc_flashlightGlow.sqf new file mode 100644 index 0000000000..5e72a6c183 --- /dev/null +++ b/addons/map/functions/fnc_flashlightGlow.sqf @@ -0,0 +1,35 @@ +/* + * Author: voiper + * Add or remove global flashlight glow for when player is looking at map. + * + * Arguments: + * 0: Flashlight classname ("" for off) + * + * Return value: + * None + * + * Example: + * ["ACE_Flashlight_MX991"] call ace_map_fnc_flashlightGlow; + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_flashlight"]; + +_light = GVAR(glow); +if (!isNull _light) then {deleteVehicle _light}; + +if (_flashlight != "") then { + _colour = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour"); + if !(_colour in ["white", "red", "green", "blue", "yellow"]) then {_colour = "white"}; + _class = format["ACE_FlashlightProxy_%1", _colour]; + + _light = _class createVehicle [0,0,0]; + _light attachTo [ACE_player, [0,0.5,-0.1], "head"]; +} else { + _light = objNull; +}; + +GVAR(glow) = _light; \ No newline at end of file diff --git a/addons/map/functions/fnc_getUnitFlashlights.sqf b/addons/map/functions/fnc_getUnitFlashlights.sqf new file mode 100644 index 0000000000..8fb8066374 --- /dev/null +++ b/addons/map/functions/fnc_getUnitFlashlights.sqf @@ -0,0 +1,29 @@ +/* + * Author: voiper + * Check a unit for any flashlights that can be used on map. + * + * Arguments: + * 0: Unit to check + * + * Return value: + * Flashlight classnames (empty for none) + * + * Example: + * [unit] call ace_map_fnc_getUnitFlashlights; + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_unit"]; + +_flashlights = []; + +{ + if ((isText (configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour")) && !(_x in _flashlights)) then { + _flashlights pushBack _x; + }; +} forEach (items _unit); + +_flashlights \ No newline at end of file diff --git a/addons/map/functions/fnc_moduleMap.sqf b/addons/map/functions/fnc_moduleMap.sqf index 514d2af034..b763db7eea 100644 --- a/addons/map/functions/fnc_moduleMap.sqf +++ b/addons/map/functions/fnc_moduleMap.sqf @@ -8,15 +8,17 @@ * Return Value: * None */ + #include "script_component.hpp" if !(isServer) exitWith {}; -PARAMS_3(_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; [_logic, QGVAR(mapIllumination), "MapIllumination" ] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(mapGlow), "MapGlow" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(mapShake), "MapShake" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(mapLimitZoom), "MapLimitZoom" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(mapShowCursorCoordinates), "MapShowCursorCoordinates"] call EFUNC(common,readSettingFromModule); diff --git a/addons/map/functions/fnc_onDrawMap.sqf b/addons/map/functions/fnc_onDrawMap.sqf index bc147884e4..37ec5a7000 100644 --- a/addons/map/functions/fnc_onDrawMap.sqf +++ b/addons/map/functions/fnc_onDrawMap.sqf @@ -2,3 +2,6 @@ #include "script_component.hpp" ((_this select 0) displayCtrl 1016) ctrlShow GVAR(mapShowCursorCoordinates); + +// hide clock when no watch in inventory, or whatever never ever +((_this select 0) displayCtrl 101) ctrlShow GVAR(hasWatch); diff --git a/addons/map/functions/fnc_simulateMapLight.sqf b/addons/map/functions/fnc_simulateMapLight.sqf new file mode 100644 index 0000000000..9554409e15 --- /dev/null +++ b/addons/map/functions/fnc_simulateMapLight.sqf @@ -0,0 +1,89 @@ +/* +* Author: voiper +* Draw nearby lighting and sexy flashlight beams on main map. +* +* Arguments: +* 0: Map control +* 1: Map zoom level +* 2: Current map centre +* 3: Light level from ace_map_fnc_determineMapLight +* +* Return Value: +* None +* +* Public: No +*/ + +#include "script_component.hpp" + +params ["_mapCtrl", "_mapScale", "_mapCentre", "_lightLevel"]; + +_hmd = hmd ACE_player; +_flashlight = GVAR(flashlightInUse); + +//map width (on screen) in pixels +_screenSize = 640 * safeZoneW; + +//resolution params (every frame in case resolution change) +getResolution params ["_resX", "_resY", "_viewPortX", "_viewPortY", "", "_uiScale"]; + +//engine rounds the viewport ratios, when they should be fractions; this can cause problems +_realViewPortY = _resY * _uiScale; +_realViewPortX = _realViewPortY * 4/3; + +//textures +_fillTex = "#(rgb,8,8,3)color(0,0,0,1)"; + +//colour/alpha +_lightLevel params ["_r", "_g", "_b", "_a"]; +_colourAlpha = (_r + _g + _b) min _a; +_shadeAlpha = _a; + +_colourList = [_r, _g, _b]; +_colourList sort false; +_maxColour = _colourList select 0; + +//ambient colour fill +_mapCtrl drawIcon [format["#(rgb,8,8,3)color(%1,%2,%3,1)", _r / _maxColour, _g / _maxColour, _b / _maxColour], [1,1,1,_colourAlpha], _mapCentre, _screenSize, _screenSize, 0, "", 0]; + +if (_flashlight == "") then { + //ambient shade fill + _mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], _mapCentre, _screenSize, _screenSize, 0, "", 0]; +} else { + //mouse pos + _mousePos = GVAR(mousePos); + + //flashlight settings + _colour = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour"); + if !(_colour in ["white", "red", "green", "blue", "yellow"]) then {_colour = "white"}; + _size = getNumber (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Size"); + _flashTex = format[QUOTE(PATHTOF_SYS(ace,flashlights,UI\Flashlight_Beam_%1_ca.paa)), _colour]; + _beamSize = _screenSize / _size; + + //after 5x zoom, it's simulated to be fixed (it actually gets bigger relative to zoom) + if (_mapScale < 0.2) then {_beamSize = _beamSize / (_mapScale * (1 / 0.2))}; + + //assign corrective ratio to fix sub-pixel gaps/overlaps (symptom of viewport * X/Y resolution rounding) + _viewPortRatioFixY = if (_realViewPortY != _viewPortY) then { + _realViewPortX / (_realViewPortY / _viewPortY * _viewPortX) + } else { + if (_realViewPortX != _viewPortX) then { + _realViewPortX / _viewPortX + } else { + 1 + }; + }; + + //offset the elements + _offsetX = _mapScale * GVAR(worldSize) * (_screenSize * 2 + _beamSize); + _offsetYDown = _mapScale * GVAR(worldSize) * (_screenSize + _beamSize) * _viewPortRatioFixY; + //up is bigger because of a potential exploit + _offsetYUp = _mapScale * GVAR(worldSize) * (_screenSize * 4 + _beamSize) * _viewPortRatioFixY; + + //draw the matrix /whoa + _mapCtrl drawIcon [_flashTex, [1,1,1,_shadeAlpha], _mousePos, _beamSize, _beamSize, 0, "", 0]; //centre beam + _mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], [(_mousePos select 0) - _offsetX, (_mousePos select 1)], _screenSize * 2, _beamSize, 0, "", 0]; //left + _mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], [(_mousePos select 0) + _offsetX, (_mousePos select 1)], _screenSize * 2, _beamSize, 0, "", 0]; //right + _mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], [(_mousePos select 0), (_mousePos select 1) - _offsetYDown], _screenSize * 4, _screenSize, 0, "", 0]; //down + _mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], [(_mousePos select 0), (_mousePos select 1) + _offsetYUp], _screenSize * 4, _screenSize * 4, 0, "", 0]; //up +}; \ No newline at end of file diff --git a/addons/map/functions/fnc_switchFlashlight.sqf b/addons/map/functions/fnc_switchFlashlight.sqf new file mode 100644 index 0000000000..e177f886fa --- /dev/null +++ b/addons/map/functions/fnc_switchFlashlight.sqf @@ -0,0 +1,25 @@ +/* + * Author: voioper + * Switch flashlight. + * + * Arguments: + * 0: Flashlight classname ("" for off) + * + * Return value: + * None + * + * Example: + * ["ACE_Flashlight_MX991"] call ace_map_fnc_switchFlashlight; + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_flashlight"]; + +GVAR(flashlightInUse) = _flashlight; +if (GVAR(mapGlow)) then { + [GVAR(flashlightInUse)] call FUNC(flashlightGlow); +}; +playSound "ACE_map_flashlightClick"; \ No newline at end of file diff --git a/addons/map/functions/fnc_updateMapEffects.sqf b/addons/map/functions/fnc_updateMapEffects.sqf index 3550df517c..72f5d0cec1 100644 --- a/addons/map/functions/fnc_updateMapEffects.sqf +++ b/addons/map/functions/fnc_updateMapEffects.sqf @@ -10,23 +10,21 @@ * * Public: No */ + #include "script_component.hpp" -private ["_mapCtrl","_mapScale"]; - -_mapCtrl = ((findDisplay 12) displayCtrl 51); +_mapCtrl = findDisplay 12 displayCtrl 51; _mapScale = ctrlMapScale _mapCtrl; +_mapCentre = _mapCtrl ctrlMapScreenToWorld [0.5, 0.5]; if (GVAR(mapIllumination)) then { - private ["_data","_darkenFill"]; + //get nearby lighting + _light = [[ACE_player], FUNC(determineMapLight), missionNamespace, QGVAR(mapLight), 0.1] call EFUNC(common,cachedCall); - // Calculate map illumination - _data = [[ACE_player], FUNC(determineMapLight), missionNamespace, QGVAR(mapLight), 0.1] call EFUNC(common,cachedCall); + _light params ["_applyLighting", "_lightLevel"]; - EXPLODE_2_PVT(_data,_darkenMap,_darkenColor); - if (_darkenMap) then { - _darkenFill = format["#(rgb,1,1,1)color(%1,%2,%3,%4)",_darkenColor select 0, _darkenColor select 1, _darkenColor select 2, _darkenColor select 3]; - _mapCtrl drawRectangle [(getArray(configFile >> 'CfgWorlds' >> worldName >> 'centerPosition')),80000,80000,0,_darkenColor,_darkenFill]; + if (_applyLighting) then { + [_mapCtrl, _mapScale, _mapCentre, _lightLevel] call FUNC(simulateMapLight); }; }; @@ -63,7 +61,7 @@ if (GVAR(mapShake)) then { GVAR(isShaking) = false; } else { // The map is still, store state - GVAR(lastStillPosition) = _mapCtrl ctrlMapScreenToWorld [0.5, 0.5]; + GVAR(lastStillPosition) = _mapCentre; GVAR(lastStillTime) = ACE_time; }; }; @@ -72,7 +70,7 @@ if (GVAR(mapShake)) then { if (GVAR(mapLimitZoom)) then { if (GVAR(minMapSize) >= _mapScale) then { ctrlMapAnimClear _mapCtrl; - _mapCtrl ctrlMapAnimAdd [0, GVAR(minMapSize) + 0.001, (_mapCtrl ctrlMapScreenToWorld [0.5, 0.5])]; + _mapCtrl ctrlMapAnimAdd [0, GVAR(minMapSize) + 0.001, _mapCentre]; ctrlMapAnimCommit _mapCtrl; }; -}; +}; \ No newline at end of file diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index 3f2d312fae..f996800346 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -8,6 +8,7 @@ Karte Mapa Mapa + Térkép Map illumination? @@ -16,14 +17,16 @@ Kartenausleuchtung Osvětlení mapy Iluminação do mapa? + Térkép megvilágítása? - Calculate dynamic map illumination based on light conditions? - Oblicza dynamiczne oświetlenie mapy bazujące na warunkach oświetleniowych - Calcula la iluminación dinámica del mapa basandose en las condiciones de luz - Berechne die Kartenauslichtung anhand des Umgebungslichts? - Vypočítat dynamické osvětlení mapy na základně světelných podmínek? - Calcular a iluminação dinâmica do mapa de acordo com as condições de luz? + Simulate map lighting based on ambient lighting and player's items? + + + Map flashlight glow? + + + Add external glow to players who use flashlight on map? Map shake? @@ -32,6 +35,7 @@ Kamerawackeln Třesení mapy? Tremor de mapa? + Térkép-rázkódás? Make map shake when walking? @@ -40,6 +44,7 @@ Kamerawackeln beim Gehen? Umožnit třesení mapy za pochodu? Tremer o mapa enquanto caminha? + Rázkódjon-e a térkép mozgáskor? Limit map zoom? @@ -48,6 +53,7 @@ Kartenzoom einschränken Omezit přiblížení mapy? Limitar zoom do mapa? + Térkép-nagyítás korlátozása? Limit the amount of zoom available for the map? @@ -56,6 +62,7 @@ Zoomstufe der Karte einschränken? Omezit stupeň přiblížení pro mapu? Limitar a quantidade de zoom disponível para o mapa? + Korlátozva legyen-e a nagyítás mennyisége a térképnél? Show cursor coordinates? @@ -64,6 +71,7 @@ Zeige Cursor-Koordinaten? Zobrazit souřadnice u kurzoru? Mostrar coordenadas no cursor? + Kurzor-koordináták mutatása? Show the grid coordinates on the mouse pointer? @@ -72,6 +80,7 @@ Gitter-Koordinaten auf dem Mauszeiger anzeigen? Zobrazit souřadnice u kurzoru v mapě? Mostrar as coordenadas de grade no ponteiro do mouse? + Mutatva legyen-e a kurzornál található rész rácskoordinátája? This module allows you to customize the map screen. @@ -79,14 +88,16 @@ Dieses Modul erweitert die Kartenfunktionen. Tento modul umožňuje přizpůsobit mapu s obrazem. Este módulo permite que você personalize a tela de mapa. + Ez a modul lehetővé teszi a térképnézet testreszabását. Blue Force Tracking Blue Force Tracking - Blue Force Tracking + Seguimiento de fuerzas amigas Blue Force Tracking Blue Force Tracking Rastreio de forças azuis + Blue Force követés BFT Enable @@ -94,6 +105,7 @@ Aktywuj BFT Povolit BFT Activar BFT + BFT engedélyezése Enable Blue Force Tracking. Default: No @@ -101,6 +113,7 @@ Aktywuj Blue Force Tracking. Domyślnie: Nie Povolit Blue Force Tracking. Výchozí: Ne Activar Blue Force Tracking. Por defecto: No + Blue Force követés engedélyezése. Alapértelmezett: Nem Interval @@ -109,6 +122,7 @@ Intervall Interval Intervalo + Intervallum How often the markers should be refreshed (in seconds) @@ -117,6 +131,7 @@ Wie oft sollen die Markierungen aktualisiert werden (in Sekunden) Jak často budou značky aktualizovány (v sekundách) Frequência em que os marcadores devem ser atualizados (em segundos) + Milyen gyakran frissüljenek a jelölők (másodpercben) Hide AI groups? @@ -125,6 +140,7 @@ KI-Gruppen verstecken? Skrýt AI skupiny? Esconder grupos de IA? + AI csoportok elrejtése? Hide markers for 'AI only' groups? @@ -133,6 +149,7 @@ Verstecke Marker für "nur KI"-Gruppen? Skrýt značky pouze pro AI skupiny? Esconder marcadores que pertencem ao grupo de IA? + Jelölők elrejtése "csak AI" csoportoknál? This module allows the tracking of allied units with BFT map markers. @@ -140,6 +157,31 @@ Dieses Modul ermöglicht es verbündete Einheiten mit dem BFT auf der Karte zu verfolgen. Umožňuje sledovat přátelské jednokty na mapě v rámci BFT. Permite que você acompanhe as posições no mapa das unidades aliadas com marcadores RFA. + Ez a modul lehetővé teszi a szövetséges egységek követését BFT térképjelzőjkkel. + + + Flashlights + Latarki + + + NVG + Noktowizja + + + On + Włącz + + + Off + Wyłącz + + + Increase Brightness + Zwiększ czułość + + + Decrease Brightness + Zmniejsz czułość - \ No newline at end of file + diff --git a/addons/maptools/CfgVehicles.hpp b/addons/maptools/CfgVehicles.hpp index 5c3266d2d6..063f88f38b 100644 --- a/addons/maptools/CfgVehicles.hpp +++ b/addons/maptools/CfgVehicles.hpp @@ -14,7 +14,7 @@ class CfgVehicles { class ACE_MapToolsHide { displayName = CSTRING(MapToolsHide); condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0})); - statement = QUOTE(GVAR(mapTool_Shown) = 0; [] call FUNC(updateMapToolMarkers)); + statement = QUOTE(GVAR(mapTool_Shown) = 0;); exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 1; priority = 5; @@ -22,7 +22,7 @@ class CfgVehicles { class ACE_MapToolsShowNormal { displayName = CSTRING(MapToolsShowNormal); condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 1})); - statement = QUOTE(GVAR(mapTool_Shown) = 1; [] call FUNC(updateMapToolMarkers)); + statement = QUOTE(GVAR(mapTool_Shown) = 1;); exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 1; priority = 4; @@ -30,7 +30,7 @@ class CfgVehicles { class ACE_MapToolsShowSmall { displayName = CSTRING(MapToolsShowSmall); condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 2})); - statement = QUOTE(GVAR(mapTool_Shown) = 2; [] call FUNC(updateMapToolMarkers)); + statement = QUOTE(GVAR(mapTool_Shown) = 2;); exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 1; priority = 3; @@ -38,7 +38,7 @@ class CfgVehicles { class ACE_MapToolsAlignNorth { displayName = CSTRING(MapToolsAlignNorth); condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0})); - statement = QUOTE(GVAR(mapTool_angle) = 0; [] call FUNC(updateMapToolMarkers)); + statement = QUOTE(GVAR(mapTool_angle) = 0;); exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 1; priority = 2; @@ -46,7 +46,7 @@ class CfgVehicles { class ACE_MapToolsAlignCompass { displayName = CSTRING(MapToolsAlignCompass); condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0} && {('ItemCompass' in assigneditems ACE_player) || {'ItemCompass' in assigneditems ACE_player}})); - statement = QUOTE(GVAR(mapTool_angle) = getDir ACE_player; [] call FUNC(updateMapToolMarkers)); + statement = QUOTE(GVAR(mapTool_angle) = getDir ACE_player;); exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 1; priority = 1; diff --git a/addons/maptools/XEH_postInitClient.sqf b/addons/maptools/XEH_postInitClient.sqf index 8129a75b15..06cb8eda3d 100644 --- a/addons/maptools/XEH_postInitClient.sqf +++ b/addons/maptools/XEH_postInitClient.sqf @@ -26,11 +26,11 @@ GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; _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);}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call FUNC(handleMouseButton)}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["Draw", {_this call FUNC(updateMapToolMarkers);}]; - (finddisplay _d) displayAddEventHandler ["KeyDown", {_this call FUNC(handleKeyDown);}]; + ((findDisplay _d) displayCtrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}]; + ((findDisplay _d) displayCtrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}]; + ((findDisplay _d) displayCtrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call FUNC(handleMouseButton)}]; + ((findDisplay _d) displayCtrl 51) ctrlAddEventHandler ["Draw", {_this call FUNC(updateMapToolMarkers);}]; + (findDisplay _d) displayAddEventHandler ["KeyDown", {_this call FUNC(handleKeyDown);}]; }; // Wait until the briefing map is detected @@ -64,9 +64,17 @@ GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; // Install event handlers on the map control and display (control = 51) GVAR(drawing_syncMarkers) = false; 12 call _fnc_installMapEvents; - - // Update the size and rotation of map tools - [] call FUNC(updateMapToolMarkers); - - [FUNC(mapStateUpdater), 0, []] call CBA_fnc_addPerFrameHandler; }; + +["visibleMapChanged", { + params ["", "_mapOn"]; + if (_mapOn) then { + // Show GPS if required + [GVAR(mapGpsShow)] call FUNC(openMapGps); + } else { + // Hide GPS + [false] call FUNC(openMapGps); + // Cancel drawing + call FUNC(cancelDrawing); + }; +}] call EFUNC(common,addEventHandler); diff --git a/addons/maptools/XEH_preInit.sqf b/addons/maptools/XEH_preInit.sqf index 2da38996c3..2bcd68385a 100644 --- a/addons/maptools/XEH_preInit.sqf +++ b/addons/maptools/XEH_preInit.sqf @@ -16,7 +16,6 @@ PREP(handleMouseButton); PREP(handleMouseMove); PREP(handleMouseZChanged); PREP(isInsideMapTool); -PREP(mapStateUpdater); PREP(openMapGps); PREP(openMapGpsUpdate); PREP(removeLineMarker); diff --git a/addons/maptools/functions/fnc_addLineMarker.sqf b/addons/maptools/functions/fnc_addLineMarker.sqf index 157891a262..017dc5b494 100644 --- a/addons/maptools/functions/fnc_addLineMarker.sqf +++ b/addons/maptools/functions/fnc_addLineMarker.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_4(_name,_startPos,_endPos,_color); +params ["_name", "_startPos", "_endPos", "_color"]; private ["_marker", "_difPos", "_mag"]; diff --git a/addons/maptools/functions/fnc_calculateMapScale.sqf b/addons/maptools/functions/fnc_calculateMapScale.sqf index 4723a4f5e1..78bfae43af 100644 --- a/addons/maptools/functions/fnc_calculateMapScale.sqf +++ b/addons/maptools/functions/fnc_calculateMapScale.sqf @@ -14,7 +14,7 @@ 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)]; +_pos = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld [0.5, 0.5]; +_screenOffset = ((findDisplay 12) displayCtrl 51) posWorldToScreen [(_pos select 0) + 100, (_pos select 1)]; (_screenOffset select 0) - 0.5 diff --git a/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf b/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf index 44f6ed6203..6c3c706208 100644 --- a/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf +++ b/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -PARAMS_1(_lineMarkers); +params ["_lineMarkers"]; { private "_marker"; diff --git a/addons/maptools/functions/fnc_copyMapRemoteSend.sqf b/addons/maptools/functions/fnc_copyMapRemoteSend.sqf index f4aebf6093..551019f900 100644 --- a/addons/maptools/functions/fnc_copyMapRemoteSend.sqf +++ b/addons/maptools/functions/fnc_copyMapRemoteSend.sqf @@ -12,6 +12,6 @@ #include "script_component.hpp" -PARAMS_1(_requester); +params ["_requester"]; ["drawing_sendbackMarkers", _requester, [GVAR(drawing_lineMarkers)]] call EFUNC(common,targetEvent); diff --git a/addons/maptools/functions/fnc_copyMapStart.sqf b/addons/maptools/functions/fnc_copyMapStart.sqf index a39c74d225..7295f6f499 100644 --- a/addons/maptools/functions/fnc_copyMapStart.sqf +++ b/addons/maptools/functions/fnc_copyMapStart.sqf @@ -17,6 +17,6 @@ #include "script_component.hpp" -PARAMS_1(_player,_target); +params ["_player", "_target"]; ["drawing_requestMarkers", _target, [_player]] call EFUNC(common,targetEvent); diff --git a/addons/maptools/functions/fnc_handleKeyDown.sqf b/addons/maptools/functions/fnc_handleKeyDown.sqf index d1f9e199c9..a83522ac91 100644 --- a/addons/maptools/functions/fnc_handleKeyDown.sqf +++ b/addons/maptools/functions/fnc_handleKeyDown.sqf @@ -15,11 +15,12 @@ #include "script_component.hpp" -PARAMS_5(_display,_code,_shiftKey,_ctrlKey,_altKey); +params ["", "_code"]; +TRACE_1("params",_code); private ["_handled", "_relPos", "_diffVector", "_magDiffVector", "_lambdaLong", "_lambdaTrasAbs"]; -_handled = false; +_handled = false; #define DIK_ESCAPE 0x01 #define DIK_DELETE 0xD3 @@ -30,6 +31,7 @@ if (_code == DIK_ESCAPE) exitWith { call FUNC(cancelDrawing); _handled = true; }; + _handled }; if (_code == DIK_DELETE) exitWith { @@ -65,6 +67,7 @@ if (_code == DIK_DELETE) exitWith { }; } forEach GVAR(drawing_lineMarkers); }; + _handled }; _handled diff --git a/addons/maptools/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf index 16cabe9719..442ec4d50e 100644 --- a/addons/maptools/functions/fnc_handleMouseButton.sqf +++ b/addons/maptools/functions/fnc_handleMouseButton.sqf @@ -1,6 +1,5 @@ /* * Author: esteldunedain - * * Handle mouse buttons. * * Argument: @@ -13,46 +12,39 @@ #include "script_component.hpp" -private ["_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos", "_altKey", "_gui", "_marker"]; +params ["_dir", "_params"]; +_params params ["_control", "_button", "_screenPosX", "_screenPosY", "_shiftKey", "_ctrlKey", "_altKey"]; +TRACE_2("params",_dir,_params); -PARAMS_2(_dir,_params); -_control = _params select 0; -_button = _params select 1; -_screenPos = [_params select 2, _params select 3]; -_shiftKey = _params select 4; -_ctrlKey = _params select 5; -_altKey = _params select 6; -_handled = false; +private["_gui", "_handled", "_marker", "_pos"]; +_handled = false; // If it's not a left button event, exit -if (_button != 0) exitWith {}; +if (_button != 0) exitWith {_handled}; // If releasing -if (_dir != 1 && (GVAR(mapTool_isDragging) or GVAR(mapTool_isRotating))) exitWith { - GVAR(mapTool_isDragging) = false; - GVAR(mapTool_isRotating) = false; - _handled = true; - _handled -}; - -// If clicking -if (_dir == 1) exitWith { - +if (_dir != 1) then { + if (GVAR(mapTool_isDragging) || GVAR(mapTool_isRotating)) then { + GVAR(mapTool_isDragging) = false; + GVAR(mapTool_isRotating) = false; + _handled = true; + }; +} else { + // If clicking if !(call FUNC(canDraw)) exitWith {_handled = false;}; // Transform mouse screen position to coordinates - _pos = _control ctrlMapScreenToWorld _screenPos; + _pos = _control ctrlMapScreenToWorld [_screenPosX, _screenPosY]; _pos set [count _pos, 0]; if (GVAR(drawing_isDrawing)) exitWith { // Already drawing -> Add tempLineMarker to permanent list if (GVAR(drawing_syncMarkers)) then { deleteMarkerLocal (GVAR(drawing_tempLineMarker) select 0); - // [GVAR(drawing_tempLineMarker), "FUNC(addLineMarker)", 2] call EFUNC(common,execRemoteFnc); ["drawing_addLineMarker", GVAR(drawing_tempLineMarker)] call EFUNC(common,globalEvent); // Log who drew on the briefing screen - (text format ["[ACE] Server: Player %1 drew on the briefing screen", name player]) call EFUNC(common,serverLog); + (text format ["[ACE] Server: Player %1 drew on the briefing screen", profileName]) call EFUNC(common,serverLog); } else { GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker); GVAR(drawing_lineMarkers) pushBack (+GVAR(drawing_tempLineMarker)); @@ -96,6 +88,9 @@ if (_dir == 1) exitWith { }; _handled = true; }; + _handled }; +diag_log text format ["HJa %1", _handled]; + _handled diff --git a/addons/maptools/functions/fnc_handleMouseMove.sqf b/addons/maptools/functions/fnc_handleMouseMove.sqf index 2148c5a162..b27087290b 100644 --- a/addons/maptools/functions/fnc_handleMouseMove.sqf +++ b/addons/maptools/functions/fnc_handleMouseMove.sqf @@ -1,6 +1,5 @@ /* * Author: esteldunedain - * * Handle mouse movement over the map tool. * * Argument: @@ -13,11 +12,12 @@ #include "script_component.hpp" +params ["_control", "_mousePosX", "_mousePosY"]; +TRACE_3("params",_control,_mousePosX,_mousePosY); + private ["_control", "_pos"]; -_control = _this select 0; -_pos = [_this select 1, _this select 2]; -GVAR(mousePosition) = _control ctrlMapScreenToWorld _pos; +GVAR(mousePosition) = _control ctrlMapScreenToWorld [_mousePosX, _mousePosY]; GVAR(mousePosition) set [2, 0]; //convert 2d pos to 3d // If cannot draw then exit @@ -32,6 +32,7 @@ if !(call FUNC(canDraw)) exitWith { // Handle drawing if (GVAR(drawing_isDrawing)) exitWith { GVAR(drawing_tempLineMarker) set [2, GVAR(mousePosition)]; + TRACE_1("updating line pos",GVAR(mousePosition)); GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker); false }; @@ -44,8 +45,6 @@ if (GVAR(mapTool_isDragging)) exitWith { GVAR(mapTool_pos) set [0, (GVAR(mapTool_startPos) select 0) + (GVAR(mousePosition) select 0) - (GVAR(mapTool_startDragPos) select 0)]; GVAR(mapTool_pos) set [1, (GVAR(mapTool_startPos) select 1) + (GVAR(mousePosition) select 1) - (GVAR(mapTool_startDragPos) select 1)]; - // Update the size and rotation of the maptool - [] call FUNC(updateMapToolMarkers); true }; @@ -56,8 +55,6 @@ if (GVAR(mapTool_isRotating)) exitWith { _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); - // Update the size and rotation of the maptool - [] call FUNC(updateMapToolMarkers); true }; diff --git a/addons/maptools/functions/fnc_mapStateUpdater.sqf b/addons/maptools/functions/fnc_mapStateUpdater.sqf deleted file mode 100644 index 2b4e634567..0000000000 --- a/addons/maptools/functions/fnc_mapStateUpdater.sqf +++ /dev/null @@ -1,33 +0,0 @@ - -#include "script_component.hpp" - -if (visibleMap) then { - // Show/Hide draw buttons - if ("ACE_MapTools" in items ACE_player) then { - { ((finddisplay 12) displayctrl _x) ctrlShow true; } forEach GVAR(drawing_controls); - } else { - { ((finddisplay 12) displayctrl _x) ctrlShow false; } forEach GVAR(drawing_controls); - if (GVAR(drawing_isDrawing)) then { - call FUNC(cancelDrawing); - }; - }; -}; - -//When Map is Closed: -if (GVAR(mapVisableLastFrame) && (!visibleMap)) then { - GVAR(mapVisableLastFrame) = false; - // Hide GPS - [false] call FUNC(openMapGps); - // Cancel drawing - call FUNC(cancelDrawing); -}; - -//When Map is Opened: -if ((!GVAR(mapVisableLastFrame)) && (visibleMap)) then { - //todo: "mapOpened" Event???? - GVAR(mapVisableLastFrame) = true; - // Show and update map tools if required - [] call FUNC(updateMapToolMarkers); - // Show GPS if required - [GVAR(mapGpsShow)] call FUNC(openMapGps); -}; diff --git a/addons/maptools/functions/fnc_openMapGps.sqf b/addons/maptools/functions/fnc_openMapGps.sqf index 7d29d9e169..dc2df07b57 100644 --- a/addons/maptools/functions/fnc_openMapGps.sqf +++ b/addons/maptools/functions/fnc_openMapGps.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -PARAMS_1(_shouldOpenGps); +params ["_shouldOpenGps"]; private ["_isOpen"]; diff --git a/addons/maptools/functions/fnc_removeLineMarker.sqf b/addons/maptools/functions/fnc_removeLineMarker.sqf index be82970524..bd0a16adb1 100644 --- a/addons/maptools/functions/fnc_removeLineMarker.sqf +++ b/addons/maptools/functions/fnc_removeLineMarker.sqf @@ -11,7 +11,7 @@ #include "script_component.hpp" -PARAMS_1(_name); +params ["_name"]; deleteMarkerLocal _name; { diff --git a/addons/maptools/functions/fnc_updateLineMarker.sqf b/addons/maptools/functions/fnc_updateLineMarker.sqf index a745bfa123..12aee5b1df 100644 --- a/addons/maptools/functions/fnc_updateLineMarker.sqf +++ b/addons/maptools/functions/fnc_updateLineMarker.sqf @@ -13,7 +13,8 @@ */ #include "script_component.hpp" -PARAMS_4(_name,_startPos,_endPos,_color); +params ["_name", "_startPos", "_endPos", "_color"]; +TRACE_4("params",_name,_startPos,_endPos,_color); private ["_difPos", "_mag"]; diff --git a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf index fa6db8872a..5d11c6a6e9 100644 --- a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf +++ b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf @@ -16,9 +16,19 @@ #define CENTER_OFFSET_Y_PERC 0.1606 #define CONSTANT_SCALE 0.2 -PARAMS_1(_theMap); +params ["_theMap"]; -private ["_rotatingTexture", "_textureWidth", "_scale", "_xPos", "_yPos"]; +private ["_rotatingTexture", "_textureWidth", "_scaleX", "_scaleY", "_xPos", "_yPos"]; + +// Show/Hide draw buttons +if ([] call FUNC(canDraw)) then { + { ((findDisplay 12) displayCtrl _x) ctrlShow true; } forEach GVAR(drawing_controls); +} else { + { ((findDisplay 12) displayCtrl _x) ctrlShow false; } forEach GVAR(drawing_controls); + if (GVAR(drawing_isDrawing)) then { + call FUNC(cancelDrawing); + }; +}; if (!("ACE_MapTools" in items ACE_player)|| {GVAR(mapTool_Shown) == 0}) exitWith {}; @@ -33,16 +43,18 @@ if (GVAR(mapTool_Shown) == 1) then { }; // Update scale of both parts -_scale = _textureWidth * CONSTANT_SCALE * (call FUNC(calculateMapScale)); +getResolution params ["_resWidth", "_resHeight", "", "", "_aspectRatio"]; +_scaleX = 32 * _textureWidth * CONSTANT_SCALE * (call FUNC(calculateMapScale)); +_scaleY = _scaleX * ((_resWidth / _resHeight) / _aspectRatio); //handle bad aspect ratios // Position of the fixed part _xPos = GVAR(mapTool_pos) select 0; _yPos = (GVAR(mapTool_pos) select 1) + _textureWidth * CENTER_OFFSET_Y_PERC; -_theMap drawIcon [QUOTE(PATHTOF(data\mapToolFixed.paa)), [1,1,1,1], [_xPos,_yPos], (32 * _scale), (32 * _scale), 0, "", 0]; +_theMap drawIcon [QUOTE(PATHTOF(data\mapToolFixed.paa)), [1,1,1,1], [_xPos,_yPos], _scaleX, _scaleY, 0, "", 0]; // Position and rotation of the rotating part _xPos = (GVAR(mapTool_pos) select 0) + sin(GVAR(mapTool_angle)) * _textureWidth * CENTER_OFFSET_Y_PERC; _yPos = (GVAR(mapTool_pos) select 1) + cos(GVAR(mapTool_angle)) * _textureWidth * CENTER_OFFSET_Y_PERC; -_theMap drawIcon [_rotatingTexture, [1,1,1,1], [_xPos,_yPos], (32 * _scale), (32 * _scale), GVAR(mapTool_angle), "", 0]; +_theMap drawIcon [_rotatingTexture, [1,1,1,1], [_xPos,_yPos], _scaleX, _scaleY, GVAR(mapTool_angle), "", 0]; diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index 101a721fe7..96f5493aec 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -118,7 +118,7 @@ class ACE_Medical_Actions { // What is the level of medical skill required for this treatment action? 0 = all soldiers, 1 = medic, 2 = doctor requiredMedic = 0; // The time it takes for a treatment action to complete. Time is in seconds. - treatmentTime = 5; + treatmentTime = 8; // Item required for the action. Leave empty for no item required. items[] = {"ACE_fieldDressing"}; condition = ""; @@ -154,9 +154,9 @@ class ACE_Medical_Actions { class Tourniquet: fieldDressing { displayName = CSTRING(Apply_Tourniquet); displayNameProgress = CSTRING(Applying_Tourniquet); - allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r", "body"}; + allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"}; items[] = {"ACE_tourniquet"}; - treatmentTime = 6; + treatmentTime = 4; callbackSuccess = QUOTE(DFUNC(treatmentTourniquet)); condition = QUOTE(!([ARR_2(_this select 1, _this select 2)] call FUNC(hasTourniquetAppliedTo))); litter[] = {}; @@ -335,7 +335,7 @@ class ACE_Medical_Actions { category = "advanced"; treatmentLocations[] = {"All"}; requiredMedic = 0; - treatmentTime = 2; + treatmentTime = 15; items[] = {"ACE_bodyBag"}; condition = "!alive (_this select 1);"; callbackSuccess = QUOTE(DFUNC(actionPlaceInBodyBag)); diff --git a/addons/medical/functions/fnc_actionCheckBloodPressure.sqf b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf index e8e03bb4c0..646e472f70 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressure.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf @@ -14,7 +14,8 @@ #include "script_component.hpp" -private ["_caller","_target"]; +private ["_caller","_target","_selectionName"]; _caller = _this select 0; _target = _this select 1; -[[_caller, _target], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ +_selectionName = _this select 2; +[[_caller, _target, _selectionName], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf index 82edd1749f..92120a280c 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf @@ -14,9 +14,10 @@ #include "script_component.hpp" -private ["_caller","_target","_bloodPressure","_bloodPressureHigh","_bloodPressureLow", "_logOutPut", "_output"]; +private ["_caller","_target","_selectionName","_bloodPressure","_bloodPressureHigh","_bloodPressureLow", "_logOutPut", "_output"]; _caller = _this select 0; _target = _this select 1; +_selectionName = _this select 2; _bloodPressure = [_target] call FUNC(getBloodPressure); if (!alive _target) then { @@ -54,6 +55,11 @@ if ([_caller] call FUNC(isMedic)) then { }; }; +if (_selectionName in ["hand_l","hand_r"] && {[_unit, _selectionName] call FUNC(hasTourniquetAppliedTo)}) then { + _output = LSTRING(Check_Bloodpressure_Output_6); + _logOutPut = ""; +}; + ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.75, _caller]] call EFUNC(common,targetEvent); if (_logOutPut != "") then { diff --git a/addons/medical/functions/fnc_actionCheckPulse.sqf b/addons/medical/functions/fnc_actionCheckPulse.sqf index fd96321e8f..f615c69983 100644 --- a/addons/medical/functions/fnc_actionCheckPulse.sqf +++ b/addons/medical/functions/fnc_actionCheckPulse.sqf @@ -14,7 +14,8 @@ #include "script_component.hpp" -private ["_caller","_target"]; +private ["_caller","_target","_selectionName"]; _caller = _this select 0; _target = _this select 1; -[[_caller, _target], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ +_selectionName = _this select 2; +[[_caller, _target, _selectionName], 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 d759bf1bc8..f719aad2d8 100644 --- a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf @@ -14,10 +14,10 @@ #include "script_component.hpp" -private ["_caller", "_unit", "_heartRateOutput", "_heartRate", "_logOutPut"]; +private ["_caller", "_unit", "_selectionName", "_heartRateOutput", "_heartRate", "_logOutPut"]; _caller = _this select 0; _unit = _this select 1; - +_selectionName = _this select 2; _heartRate = _unit getvariable [QGVAR(heartRate), 80]; if (!alive _unit) then { @@ -46,6 +46,11 @@ if (_heartRate > 1.0) then { }; }; +if (_selectionName in ["hand_l","hand_r"] && {[_unit, _selectionName] call FUNC(hasTourniquetAppliedTo)}) then { + _heartRateOutput = LSTRING(Check_Pulse_Output_5); + _logOutPut = LSTRING(Check_Pulse_None); +}; + ["displayTextStructured", [_caller], [[_heartRateOutput, [_unit] call EFUNC(common,getName), round(_heartRate)], 1.5, _caller]] call EFUNC(common,targetEvent); if (_logOutPut != "") then { diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index a81f43848d..f91b4ad789 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1243,7 +1243,7 @@ Trousse de premiers soins Equipo de primeros auxilios Apteczka osobista - Persönliches Verbandpäckchen + Persönliches Erste-Hilfe-Set Elsősegélycsomag Pronto soccorso personale Kit De Primeiros Socorros Pessoal @@ -1265,7 +1265,7 @@ 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. + Persönliches Erste-Hilfe-Set 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 @@ -1275,7 +1275,7 @@ Use Personal Aid Kit - Verbandpäckchen benutzen + Erste-Hilfe-Set benutzen Использовать аптечку Utiliser la Trousse de premier soins Użyj apteczki osobistej @@ -1593,6 +1593,7 @@ Keine Žádný Nada + Nincs Weak @@ -2217,6 +2218,7 @@ Obvázání odstraňuje skvrny od krve El vendaje elimina las manchas de sangre Bandagem remove manchas de sangue + A kötözés eltávolítja a vérfoltokat Pain is only temporarily suppressed @@ -2225,6 +2227,7 @@ Bolest je potlačena pouze dočasně El dolor se suprime solo temporalmente Dor é suprimida somente temporáriamente + A fájdalom csak ideiglenesen csökken Pain Effect Type @@ -2738,6 +2741,7 @@ ACE-Medicsystem ACE Zdravotnické ACE Médico + ACE Orvosi Rendszer Medical Settings [ACE] @@ -2747,6 +2751,7 @@ Medizinische Einstellungen [ACE] Lékařské nastavení [ACE] Ajustes médicos [ACE] + Orvosi beállítások [ACE] Medical Level @@ -2756,6 +2761,7 @@ Medizinisches Level Úroveň medického Nível médico + Orvosi szint What is the medical simulation level? @@ -2765,6 +2771,7 @@ Wie hoch soll das medizinische Simulationslevel sein? Jaká je úroveň lékařské simulace? Qual o nível de simulação médica? + Milyen komplex legyen az orvosi szimuláció? Basic @@ -2774,6 +2781,7 @@ Standard Základní Básica + Alap Advanced @@ -2783,6 +2791,7 @@ Erweitert Pokročilé Avançada + Fejlett Medics setting @@ -2792,6 +2801,7 @@ Medizinische Einstellungen Úroveň zdravotníků Configuração médica + Orvosok beállítása What is the level of detail prefered for medics? @@ -2800,6 +2810,7 @@ ¿Cuál es el nivel de detalle preferido para los médicos? Jaká úroveň detailů je preferována pro zdravotníky? Qual o nível de detalhe preferido para os médicos? + Mi a javasolt részletesség orvosok számára? Disable medics @@ -2809,6 +2820,7 @@ Sanitäter deaktivieren Zakázat zdravotníky Desativar médicos + Orvosok letiltása Enable Litter @@ -2818,6 +2830,7 @@ Abfälle aktivieren Povolit odpadky Ativar lixo médico + Szemét engedélyezése Enable litter being created upon treatment @@ -2827,6 +2840,7 @@ Aktiviere Abfälle, wenn eine Behandlung durchgeführt wurde Vytváří odpad zdravotnického materiálu pří léčení Ativar lixo ser criado após tratamento + Engedélyezi a szemét keletkezését ellátáskor Life time of litter objects @@ -2836,6 +2850,7 @@ Dauer des angezeigten Abfalls Životnost pro odpadky Tempo de vida dos objetos do lixo + Szemétobjektumok élettartama How long should litter objects stay? In seconds. -1 is forever. @@ -2845,6 +2860,7 @@ Wie lange sollen Abfälle am Boden liegen (in Sekunden)? -1 ist für immer. Za jak dlouho začnou odpadky mizet? V sekundách. -1 navždy. Quanto tempo os objetos do lixo devem ficar? Em segundos. -1 é para sempre. + Milyen sokáig legyenek jelen a szemétobjektumok (másodpercben)? A -1 végtelen időt jelent. Enable Screams @@ -2854,6 +2870,7 @@ Schreie aktivieren Povolit křik Ativar gritos + Kiáltások engedélyezése Enable screaming by injuried units @@ -2863,6 +2880,7 @@ Aktiviere Schreie bei verletzten Einheiten Povolit křičení zraněných jednotek Ativa gritos para unidades feridas + Engedélyezi a sérült egységek kiáltásait Player Damage @@ -2872,6 +2890,7 @@ Spielerschaden Poškození hráče Dano do jogador + Játékos sérülés What is the damage a player can take before being killed? @@ -2881,6 +2900,7 @@ Wie viel Schaden kann ein Spieler erleiden, bevor er getötet wird? Jaké poškození může hráč dostat než bude zabit? Qal é o dano que um jogador pode sofrer antes de morrer? + Mennyi sérülést szenvedhet el egy játékos, mielőtt meghal? AI Damage @@ -2890,6 +2910,7 @@ KI-Schaden Poškození AI Dano da IA + AI sérülés What is the damage an AI can take before being killed? @@ -2899,6 +2920,7 @@ Wie viel Schaden kann eine KI erleiden, bis sie getötet wird? Jaké poškození může AI dostat než bude zabito? Qual é o dano que uma IA pode sofrer antes de morrer? + Mennyi sérülést szenvedhet el egy AI, mielőtt meghal? AI Unconsciousness @@ -2908,6 +2930,7 @@ KI-Bewusstlosigkeit Bezvědomí AI Inconsciência da IA + AI eszméletlenség Allow AI to go unconscious @@ -2917,6 +2940,7 @@ KI kann bewusstlos werden Umožňuje AI upadnout do bezvědomí Permite IA ficar inconsciente + Engedélyezi az AI eszméletének elvesztését Remote Controlled AI @@ -2924,6 +2948,7 @@ IA controlada remotamente Zdalnie sterowane AI Vzdáleně ovládané AI + Távvezérelt AI Treat remote controlled units as AI not players? @@ -2931,6 +2956,7 @@ Tratar unidades remotamente controladas como IA? Traktuj jednostki zdalnie sterowane (przez Zeusa) jako AI, nie jako graczy? Ošetřit vzdáleně ovládané jednotky jako AI, ne jako hráče? + Távvezérelt egységek AI-ként, nem játékosként való kezelése? Prevent instant death @@ -2940,6 +2966,7 @@ Verhindere direkten Tod Zabránit okamžité smrti Previnir morte instantânea + Azonnali halál kiiktatása Have a unit move to unconscious instead of death @@ -2949,6 +2976,7 @@ Lässt eine Einheit bewusstlos werden anstatt zu sterben Jednotka upadne do bezvědomí namísto smrti Fazer a unidade ficar inconsciente invés de morrer + Egy egység kerüljön eszméletlen állapotba a halott helyett Bleeding coefficient @@ -2958,6 +2986,7 @@ Verblutungsmultiplikator Koeficient krvácení Coeficiente de sangramento + Vérzési koefficiens Coefficient to modify the bleeding speed @@ -2967,6 +2996,7 @@ Multiplikator um die Verblutungsgeschwindigkeit zu verändern Koeficient rychlosti krvácení Coeficiente para modificar a velocidade do sangramento + Egy szorzó a vérzés sebességének szabályozására Pain coefficient @@ -2976,6 +3006,7 @@ Schmerzmultiplikator Koeficient bolesti Coeficiente de dor + Fájdalmi koefficiens Coefficient to modify the pain intensity @@ -2985,6 +3016,7 @@ Multiplikator um den Schmerzintensität zu verändern Koeficient intenzity bolesti Coeficiente para modificar a instensidade de dor + Egy szorzó a fájdalom erősségének szabályozására Sync status @@ -2994,6 +3026,7 @@ Status synchronisieren Synchronizovat status Sincronizar estado + Szinkronizációs állapot Keep unit status synced. Recommended on. @@ -3003,6 +3036,7 @@ Status der Einheit synchron halten. Sollte aktiviert bleiben. Udržuje status jednotky synchronizovaný. Doporučeno zapnout. Mater o estado da unidade sincronizado. Recomendado ativado. + Egységállapotok szinkronizálása. Javasolt a bekapcsolása. Provides a medical system for both players and AI. @@ -3012,6 +3046,7 @@ Aktiviert ein medizinisches System für Spieler und KI. Poskytuje zdravotní systém pro hráče a AI. Proporciona o sistema médico para os jogadores e a IA. + Egy orvosi rendszert ad játékosok és AI-k számára. Advanced Medical Settings [ACE] @@ -3021,6 +3056,7 @@ Erweiterte medizinische Einstellungen [ACE] Pokročilé zdravotnické nastavení [ACE] Ajustes médicos avançados [ACE] + Fejlett orvosi beállítások [ACE] Enabled for @@ -3030,6 +3066,7 @@ Aktiviert für Povoleno pro Habilitado para + Engedélyezve... Select what units the advanced medical system will be enabled for @@ -3039,6 +3076,7 @@ Wähle aus welche Einheiten das erweiterte medizinische System haben Vyberte, pro jaké jednotky bude pokročilý zdravotní systém povolen Selecione quais unidades o sistema médico avançado será habilitado + Kiválasztható, mely egységek számára legyen engedélyezve a fejlett orvosi rendszer Players only @@ -3048,6 +3086,7 @@ Nur Spieler Pouze hráči Somente jogadores + Csak játékosok Players and AI @@ -3057,6 +3096,7 @@ Spieler und KI Hráči a AI Jogadores e IA + Játékosok és AI Enable Advanced wounds @@ -3066,6 +3106,7 @@ Aktiviere erweiterte Wunden Povolit pokročilé zranění Ativar ferimentos avançados + Komplex sebek engedélyezése Allow reopening of bandaged wounds? @@ -3075,6 +3116,7 @@ Erlaube das Öffnen von bandagierten Wunden? Umožnit znovuotevření zavázané rány? Permitr reabertura de ferimentos enfaixados? + Visszanyílhatnak a bekötözött sebek? Vehicle Crashes @@ -3084,6 +3126,7 @@ Fahrzeugunfälle Poškození z kolize Batidas de veículos + Járműbalesetek Do units take damage from a vehicle crash? @@ -3093,24 +3136,27 @@ Bekommen Einheiten von Fahrzeugunfällen Schaden? Dostane jednotka poškození při autonehodě? As unidades recebem dano de uma batida de veículo? + Sérülnek-e az egységek autós ütközés során? Allow PAK Использование аптечки Ust. apteczek osobistych Permitir EPA - Erlaube Erstehilfekasten + Erlaube Erste-Hilfe-Set Povolit osobní lékárničky Permitir Kit de Primeiros Socorros + Elsősegélycsomag engedélyezése Who can use the PAK for full heal? Кому разрешено выполнять полное лечение с помощью аптечки? Kto może skorzystać z apteczki osobistej w celu pełnego uleczenia? ¿Quién puede utilizar el EPA para una cura completa? - Wer kann den Erstehilfekasten für eine Endheilung verwenden? + Wer kann das Erste-Hilfe-Set für eine Endheilung verwenden? Kdo může použít osobní lékárničku pro plné vyléčení? Quem pode usar o KPS para cura completa? + Ki használhatja az elsősegélycsomagot teljes gyógyításra? Anyone @@ -3120,6 +3166,7 @@ Jeder Kdokoliv Qualquer um + Akárki Medics only @@ -3129,6 +3176,7 @@ Nur Sanitäter Pouze zdravotník Somente médicos + Csak orvosok Doctors only @@ -3138,54 +3186,63 @@ Nur Ärzte Pouze doktor Somente doutores + Csak doktorok Remove PAK on use Удалять аптечки после использования Usuń apteczkę po użyciu Eliminar EPA después del uso - Entferne Erstehilfekasten bei Verwendung + Entferne Erste-Hilfe-Set bei Verwendung Odebrat osobní lékárničku po použití Remover o KPS depois do uso + Elsősegélycsomag eltávolítása használatkor Should PAK be removed on usage? Нужно ли удалять аптечки после использования? Czy apteczka osobista powinna zniknąć z ekwipunku po jej użyciu? El EPA será eliminado después de usarlo - Sollen Erstehilfekästen bei Verwendung entfernt werden? + Sollen Erste-Hilfe-Sets bei Verwendung entfernt werden? Má se osobní lékárnička odstranit po použití? Deve o KPS ser removido depois do uso? + Eltávolítódjon az elsősegélycsomag használatkor? Locations PAK Место использования аптечки Ogr. apteczek osobistych Ubicacions del EPA - Orte für Erstehilfekasten + Orte für Erste-Hilfe-Set Lokace osobní lékárničky Localizações do KPS + Elsősegélycsomag helyek Where can the Personal Aid Kit be used? Где может использоваться аптечка? Gdzie można korzystać z apteczek osobistych? ¿Dónde se puede utilizar el equipo de primeros auxilios? - Wo kann der Erstehilfekasten verwendet werden? + Wo kann das Erste-Hilfe-Set verwendet werden? Kde může být použita osobní lékárnička? Onde o kit de primeiros socorros pode ser utilizado? + Hol lehet az elsősegélycsomagot használni? Condition PAK Podmínka osobní lékárničky Condición EPA Warunek apteczek + Elsősegélycsomag állapot + Condição do KPS When can the Personal Aid Kit be used? Kde může být použita osobní lékárnička? ¿Cuando se puede utilizar el Equipo de primeros auxilios? Po spełnieniu jakich warunków apteczka osobista może zostać zastosowana na pacjencie? + Mikor lehet az elsősegélycsomagot használni? + Onde o kit de primeiros socorros pode ser utilizado? Anywhere @@ -3195,6 +3252,7 @@ Überall Kdekoliv Qualquer lugar + Akárhol Medical vehicles @@ -3204,6 +3262,7 @@ Medizinische Fahrzeuge Zdravotnická vozidla Veículos médcos + Orvosi járművek Medical facility @@ -3213,6 +3272,7 @@ Medizinische Einrichtungen Zdravotnické zařízení Instalação médica + Orvosi létesítmény Vehicles & facility @@ -3222,6 +3282,7 @@ Fahrzeuge & Einrichtungen Vozidla a zařízení Veículos e instalações + Járművek & létesítmény Allow Surgical kit (Adv) @@ -3231,6 +3292,7 @@ Erlaube Operationskasten Povolit chirurgickou soupravu (Pokr.) Permite kit cirúrgico (avançado) + Sebészkészlet (Fejlett) engedélyezése Who can use the surgical kit? @@ -3240,6 +3302,7 @@ Wer kann den Operationskasten verwenden? Kdo může použít chirurgickou soupravu? Quem pode usar o kit cirúrgico? + Ki használhatja a sebészkészletet? Remove Surgical kit (Adv) @@ -3249,6 +3312,7 @@ Enrtferne Operationskasten (erweitert) Odebrat chirurgickou soupravu (Pokr.) Remover kit cirúrgico (avançado) + Sebészkészlet (Fejlett) eltávolítása Should Surgical kit be removed on usage? @@ -3258,6 +3322,7 @@ Entferne Operationskästen bei Verwendung? Odebrat chirurgickou soupravu po použití? Deve o kit cirúrgico ser removido após o uso? + Eltávolítódjon a sebészkészlet használatkor? Locations Surgical kit (Adv) @@ -3267,6 +3332,7 @@ Orte für Operationskästen (erweitert) Lokace chirurgické soupravy (Pokr.) Localizações do kit cirúrgico (avançado) + Sebészkészlet (Fejlett) helyei Where can the Surgical kit be used? @@ -3276,18 +3342,23 @@ Wo kann der Operationskasten verwendet werden? Kde může být použita chirurgická souprava? Onde o kit cirúrgico pode ser utilizado? + Hol lehet a sebészkészletet használni? Condition Surgical kit (Adv) Podmínka chirurgické soupravy (Pokr.) Condición de equipo quirúrgico (Av) Warunek zestawu chir. + Sebészkészlet állapot + Condição do Kit Cirúrgico (Avançado) When can the Surgical kit be used? Kde může být použita chirurgická souprava? ¿Cuando se puede utilizar el equipo quirúrgico? Po spełnieniu jakich warunków zestaw chirurgiczny może zostać zastosowany na pacjencie? + Mikor lehet a sebészkészletet használni? + Onde o kit cirúrgico pode ser utilizado? Bloodstains @@ -3296,6 +3367,7 @@ Skvrny od krve Manchas de sangre Manchas de sangue + Vérfoltok Bandaging removes bloodstains @@ -3304,6 +3376,7 @@ Obvázání odstraňuje skvrny od krve El vendaje elimina las manchas de sangre Bandagem remove manchas de sangue + Kötözés eltávolítja a vérfoltokat Pain suppression @@ -3312,6 +3385,7 @@ Potlačení bolesti Supresión del dolor Supressão de dor + Fájdalomcsillapítás Pain is only temporarily suppressed, not removed @@ -3320,6 +3394,7 @@ Bolest je potlačena, ale jen dočastně El dolor se suprime solo temporalmente, no se elimina. Dor é somente temporáriamente suprimida, não removida + A fájdalom csak ideiglenesen csökken, nem távolítódik el Configure the treatment settings from ACE Medical @@ -3329,6 +3404,7 @@ Behandlungseinstellungen vom ACE-Medical konfigurieren Konfigurace nastavení léčby ze zdravotnické systému ACE Configure as opções de tratamento do ACE Médico + Kezelési lehetőségek konfigurálása az ACE Orvosi rendszerből Revive Settings [ACE] @@ -3338,6 +3414,7 @@ Wiederbelebungseinstellungen [ACE] Nastavení oživení [ACE] Sistema de reavivamento [ACE] + Újraélesztés beállításai [ACE] Enable Revive @@ -3347,6 +3424,7 @@ Erlaube Wiederbelebung Povolit oživení Habilitar reavivamento + Újraélesztés engedélyezése Enable a basic revive system @@ -3356,6 +3434,7 @@ Aktiviere Standard-Wiederbelebungssystem Povolit základní systém oživení Habilitar um sistema básico de reavivamento + Egy alap újraélesztési rendszer engedélyezése Max Revive time @@ -3365,6 +3444,7 @@ Maximale Wiederbelebungszeit Maximální čas pro oživení Tempo máximo de reavivamento + Maximum újraélesztési idő Max amount of seconds a unit can spend in revive state @@ -3374,6 +3454,7 @@ Maximale Zeitspanne in Sekunden die eine Einheit im Wiederbelebungszustand verbringen kann Maximální doba v agónii v sekundách Quantidade máxima de segundos que uma unidade pode gastar em um estado de reavivamento + Maximum másodperc, amit egy egység újraélesztési állapotban tölthet Max Revive lives @@ -3383,6 +3464,7 @@ Maximale Leben bei Wiederbelebung Maximální počet oživení Vidas máximas do reavivado + Maximum újraélesztési lehetőségek Max amount of lives a unit. 0 or -1 is disabled. @@ -3392,6 +3474,7 @@ Maximale Anzahl von Leben einer Einheit. 0 or -1 bedeutet deaktiviert. Maximální počet životu pro jednotku. 0 nebo -1 je zakázáno. Quantidade máxima de vidas por unidade. 0 ou -1 é desativado. + Egy egység maximum "életei". 0 vagy -1 letiltja. Provides a medical system for both players and AI. @@ -3401,6 +3484,7 @@ Aktiviert das Medicsystem für Spieler und KI. Poskytuje zdravotní systém pro hráče a AI. Proporciona um sistema médico para jogadores e IA. + Egy orvosi rendszert ad játékosok és AI-k számára. Set Medic Class [ACE] @@ -3410,6 +3494,7 @@ Setze Sanitäterklassen [ACE] Určit třídu medika [ACE] Definir classe médica [ACE] + Orvos beállítása [ACE] List @@ -3419,6 +3504,7 @@ Liste Seznam Lista + Lista List of unit names that will be classified as medic, separated by commas. @@ -3428,6 +3514,7 @@ Liste von Namen, die als Sanitäter verwendet werden. Wird durch Kommas getrennt. Seznam osob které budou klasifikovány jako zdravotník, oddělené čárkami. Lista dos nomes das unidades que se classificam como médicos, separados por vírgulas. + Azon egységek nevei, melyek orvosként vannak meghatározva, vesszővel elválasztva. Is Medic @@ -3437,6 +3524,7 @@ Ist Sanitäter Je zdravotník É médico + Orvos-e This module allows you to assign the medic class to selected units. @@ -3444,6 +3532,7 @@ Dieses Modul legt fest welche Einheit ein Sanitäter ist. Tento modul určuje, která jednotka je zdravotník. Este módulo determina qual unidade é um paramédico. + Ez a modul engedélyezi az orvosi jelző hozzárendelését kiválasztott egységekhez. None @@ -3453,6 +3542,7 @@ Keine Žádný Nada + Nincs Regular medic @@ -3462,6 +3552,7 @@ Normaler Sanitäter Řadový zdravotník Médico regular + Hagyományos orvos Doctor (Only Advanced Medics) @@ -3471,6 +3562,7 @@ Arzt (nur erweiterte Sanitäter) Doktor (Pouze pokročilý zdravotníci) Doutor (Somente médicos avançados) + Doktor (csak fejlett orvosok) Assigns the ACE medic class to a unit @@ -3480,6 +3572,7 @@ Weise die ACE-Sanitäterklasse einer Einheit zu Přiřadí ACE třídu zdravotníka do jednotky Atribui a classe médica do ACE a uma unidade + Az ACE orvosi jelző hozzárendelése egy egységhez Set Medical Vehicle [ACE] @@ -3489,6 +3582,7 @@ Setze medizinisches Fahrzeug [ACE] Určit zdravotnické vozidlo [ACE] Definir veículo médico [ACE] + Orvosi jármű beállítása [ACE] List @@ -3498,6 +3592,7 @@ Liste Seznam Lista + Lista List of vehicles that will be classified as medical vehicle, separated by commas. @@ -3507,6 +3602,7 @@ Liste von Fahrzeugen, die als medizinische Fahrzeuge verwendet werden. Wird durch Kommas getrennt. Seznam vozidel které budou klasifikovány jako zdravotnická vozidla, oddělené čárkami. Lista de veículos que serão classificados como veículos médicos, separados por vírgulas. + Orvosi járműveknek tekintett járművek listája, vesszővel elválasztva. Is Medical Vehicle @@ -3516,6 +3612,7 @@ Ist medizinisches Fahrzeug Je zdravotnické vozidlo É um veículo médico + Orvosi jármű-e Whatever or not the objects in the list will be a medical vehicle. @@ -3525,6 +3622,7 @@ Leg fest ob das Objekt in der Liste ein medizinisches Fahrzeug ist. Ať už jsou nebo nejsou objekty v seznamu budou zdravotnická vozidla. Se serão ou não os objetos dessa lista veículos médicos. + A listában lévő objektumok orvosi járművek-e, vagy sem. Assigns the ACE medic class to a unit @@ -3534,6 +3632,7 @@ Weist die ACE-Sanitäterklasse einer Einheit zu Přiřadí ACE třídu zdravotníka do jednotky Atribui a classe médica ACE a uma unidade + Hozzárendeli az ACE orvosi jelzőt egy egységhez Set Medical Facility [ACE] @@ -3543,6 +3642,7 @@ Setze medizinische Einrichtung [ACE] Určit zdravotnické zařízení [ACE] Definir instalação médica [ACE] + Orvosi létesítmény beállítása [ACE] Is Medical Facility @@ -3552,6 +3652,7 @@ Ist eine medizinische Einrichtung Je zdravotnické zařízení É uma instalação médica + Orvosi létesítmény-e Registers an object as a medical facility @@ -3561,6 +3662,7 @@ Definiert ein Objekt als medizinische Einrichtung Registruje objekt jako zdravotnické zařízení Registra um objeto como instalacão médica + Egy objektum orvosi létesítményként való regisztrálása Defines an object as a medical facility. This allows for more advanced treatments. Can be used on buildings and vehicles. @@ -3570,6 +3672,7 @@ Definiert ein Objekt als medizinische Einrichtung. Das ermöglicht weitere Behandlungen. Kann bei Gebäuden und Fahrzeugen verwendet werden. Definuje objekt jako zdravotnické zařízení. To umožňuje více pokročilé léčení. Může být použito na budovy nebo na vozidla. Define um objeto como instalação médica. Isso permite tratamentos mais avançados. Pode ser utilizado em edifícios e veículos. + Egy objektumot orvosi létesítményként határoz meg. Ez fejlett ellátási lehetőségeket engedélyez. Használható járműveken és épületeken. [ACE] Medical Supply Crate (Basic) @@ -3579,6 +3682,7 @@ [ACE] Medizinische Kiste (standard) [ACE] Zdravotnické zásoby (základní) [ACE] Caixa com suprimentos médicos + [ACE] Orvosi láda (Alap) [ACE] Medical Supply Crate (Advanced) @@ -3588,18 +3692,23 @@ [ACE] Medizinische Kiste (erweitert) [ACE] Zdravotnické zásoby (pokročilé) [ACE] Caixa com suprimentos médicos (Avançados) + [ACE] Orvosi láda (Fejlett) Anytime Kdykoli Siempre Zawsze + Akármikor + Sempre Stable Stabilní Estable Po stabilizacji + Stabil + Estável Medical @@ -3618,4 +3727,4 @@ %1 odszedł zbyt daleko, nie można kontynuować leczenia - \ No newline at end of file + diff --git a/addons/microdagr/CfgVehicles.hpp b/addons/microdagr/CfgVehicles.hpp index 49f7a0e65c..ee16870fe0 100644 --- a/addons/microdagr/CfgVehicles.hpp +++ b/addons/microdagr/CfgVehicles.hpp @@ -37,7 +37,7 @@ class CfgVehicles { displayName = CSTRING(Module_DisplayName); function = QFUNC(moduleMapFill); scope = 2; - isGlobal = 1; + isGlobal = 0; icon = QUOTE(PATHTOF(UI\Icon_Module_microDAGR_ca.paa)); functionPriority = 0; class Arguments { @@ -46,9 +46,9 @@ class CfgVehicles { description = CSTRING(MapDataAvailable_Description); typeName = "NUMBER"; class values { - class None {name = CSTRING(None); value = MAP_DETAIL_SAT; default = 1;}; - class Side {name = CSTRING(Side); value = MAP_DETAIL_TOPOROADS;}; - class Unique {name = CSTRING(Unique); value = MAP_DETAIL_NONE;}; + class Full {name = CSTRING(MapFill_Full); value = MAP_DETAIL_SAT; default = 1;}; + class Roads {name = CSTRING(MapFill_OnlyRoads); value = MAP_DETAIL_TOPOROADS;}; + class Disabled {name = CSTRING(MapFill_None); value = MAP_DETAIL_NONE;}; }; }; }; diff --git a/addons/microdagr/functions/fnc_appMarkKeypadEntry.sqf b/addons/microdagr/functions/fnc_appMarkKeypadEntry.sqf index 0822bdf310..86ace87b3e 100644 --- a/addons/microdagr/functions/fnc_appMarkKeypadEntry.sqf +++ b/addons/microdagr/functions/fnc_appMarkKeypadEntry.sqf @@ -6,7 +6,7 @@ * 0: String version of Keypad entry ["ok","del","1",...] * * Return Value: - * Nothing + * None * * Example: * ["ok"] call ace_microdagr_fnc_appMarkKeypadEntry @@ -16,15 +16,12 @@ #include "script_component.hpp" private ["_display", "_editText", "_actualPos"]; -PARAMS_1(_keypadButton); + +params ["_keypadButton"]; disableSerialization; -_display = displayNull; -if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then { - _display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]); -} else { - _display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]); -}; +_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; + if (isNull _display) exitWith {ERROR("No Display");}; if (GVAR(currentApplicationPage) != APP_MODE_MARK) exitWith {}; diff --git a/addons/microdagr/functions/fnc_appMenuButtonConnectRangefinder.sqf b/addons/microdagr/functions/fnc_appMenuButtonConnectRangefinder.sqf index 1cf81963f5..589ec096fb 100644 --- a/addons/microdagr/functions/fnc_appMenuButtonConnectRangefinder.sqf +++ b/addons/microdagr/functions/fnc_appMenuButtonConnectRangefinder.sqf @@ -3,18 +3,18 @@ * Handles the "Connect To" button from the menu application * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: - * [] call ace_microdagr_fnc_appMenuButtonConnectRangefinder + * call ace_microdagr_fnc_appMenuButtonConnectRangefinder * * Public: No */ #include "script_component.hpp" -GVAR(currentWaypoint) = if (GVAR(currentWaypoint) == -2) then {-1} else {-2}; +GVAR(currentWaypoint) = [-2, -1] select (GVAR(currentWaypoint) == -2); GVAR(rangeFinderPositionASL) = []; [APP_MODE_INFODISPLAY] call FUNC(saveCurrentAndSetNewMode); diff --git a/addons/microdagr/functions/fnc_appSettingsLBClick.sqf b/addons/microdagr/functions/fnc_appSettingsLBClick.sqf index bc6779c10a..9e808559b2 100644 --- a/addons/microdagr/functions/fnc_appSettingsLBClick.sqf +++ b/addons/microdagr/functions/fnc_appSettingsLBClick.sqf @@ -7,7 +7,7 @@ * 1: Index * * Return Value: - * Nothing + * None * * Example: * [settingList, 1] call ace_microdagr_fnc_appSettingsLBClick @@ -17,7 +17,7 @@ #include "script_component.hpp" disableSerialization; -PARAMS_2(_control,_itemClicked); +params ["", "_itemClicked"]; switch (_itemClicked) do { case (0): { GVAR(settingUseMils) = ! GVAR(settingUseMils)}; diff --git a/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf b/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf index 1acd936370..956e24c5ba 100644 --- a/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf +++ b/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf @@ -3,13 +3,13 @@ * Handles clicking the delete button from the waypoint application * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: - * [] call ace_microdagr_fnc_appWaypointsButtonDeleteWP + * call ace_microdagr_fnc_appWaypointsButtonDeleteWP * * Public: No */ @@ -18,12 +18,8 @@ private ["_display", "_wpIndex"]; disableSerialization; -_display = displayNull; -if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then { - _display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]); -} else { - _display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]); -}; +_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select GVAR(currentShowMode) == DISPLAY_MODE_DIALOG, displayNull]; + if (isNull _display) exitWith {ERROR("No Display");}; _wpIndex = lbCurSel (_display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS); diff --git a/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf b/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf index 881c0b3b5d..d2b3b0e20c 100644 --- a/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf +++ b/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf @@ -6,10 +6,10 @@ * The "SetWP" button * * Return Value: - * Nothing + * None * * Example: - * [] call ace_microdagr_fnc_appWaypointsButtonSetWP + * [1234] call ace_microdagr_fnc_appWaypointsButtonSetWP * * Public: No */ @@ -18,7 +18,7 @@ private ["_wpListBox", "_newWpIndex", "_waypoints"]; disableSerialization; -PARAMS_1(_wpButton); +params ["_wpButton"]; _wpListBox = (ctrlParent _wpButton) displayCtrl 144501; _newWpIndex = lbCurSel _wpListBox; diff --git a/addons/microdagr/functions/fnc_canShow.sqf b/addons/microdagr/functions/fnc_canShow.sqf index 9e54f927e0..70e8989031 100644 --- a/addons/microdagr/functions/fnc_canShow.sqf +++ b/addons/microdagr/functions/fnc_canShow.sqf @@ -6,32 +6,31 @@ * The display mode to test showing * * Return Value: - * Nothing + * None * * Example: - * [mode] call ace_microdagr_fnc_canShow + * [1] call ace_microdagr_fnc_canShow * * Public: No */ #include "script_component.hpp" - -PARAMS_1(_showType); +params ["_showType"]; private ["_returnValue"]; _returnValue = false; -switch (_showType) do { -case (DISPLAY_MODE_CLOSED): {_returnValue = true}; //Can always close -case (DISPLAY_MODE_HIDDEN): {_returnValue = true}; //Can always hide - -case (DISPLAY_MODE_DIALOG): { - _returnValue = ("ACE_microDAGR" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)}; +_returnValue = switch (_showType) do { + case (DISPLAY_MODE_CLOSED): { true }; //Can always close + case (DISPLAY_MODE_HIDDEN): { true }; //Can always hide + case (DISPLAY_MODE_DIALOG): { + ("ACE_microDAGR" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)} }; -case (DISPLAY_MODE_DISPLAY): { + case (DISPLAY_MODE_DISPLAY): { //Can't have minimap up while zoomed in - _returnValue = (cameraview != "GUNNER") && {"ACE_microDAGR" in (items ACE_player)} && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)}; + (cameraview != "GUNNER") && {"ACE_microDAGR" in (items ACE_player)} && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)} }; + default { false }; }; _returnValue diff --git a/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf b/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf index c383d0a95e..f99ec78354 100644 --- a/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf +++ b/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf @@ -8,7 +8,7 @@ * 1: Waypoint Position ASL * * Return Value: - * Nothing + * None * * Example: * ["Hill 55", [41,324, 12]] call ace_microdagr_fnc_deviceAddWaypoint @@ -17,10 +17,11 @@ */ #include "script_component.hpp" -PARAMS_2(_waypointName,_waypointPosASL); - private "_waypoints"; +params ["_waypointName","_waypointPosASL"]; -_waypoints = ace_player getVariable [QGVAR(waypoints), []]; + + +_waypoints = ACE_player getVariable [QGVAR(waypoints), []]; _waypoints pushBack [_waypointName, _waypointPosASL]; -ace_player setVariable [QGVAR(waypoints), _waypoints]; +ACE_player setVariable [QGVAR(waypoints), _waypoints]; diff --git a/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf b/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf index 62ca5a222a..d3681466b4 100644 --- a/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf +++ b/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf @@ -7,7 +7,7 @@ * 0: Waypoint Index * * Return Value: - * Nothing + * None * * Example: * ["Hill 55", [41,324, 12]] call ace_microdagr_fnc_deviceDeleteWaypoint @@ -16,13 +16,12 @@ */ #include "script_component.hpp" -PARAMS_1(_wpIndex); - private "_waypoints"; +params ["_wpIndex"]; -_waypoints = ace_player getVariable [QGVAR(waypoints), []]; +_waypoints = ACE_player getVariable [QGVAR(waypoints), []]; if ((_wpIndex < 0) || (_wpIndex > ((count _waypoints) - 1))) exitWith {ERROR("out of bounds wp");}; _waypoints deleteAt _wpIndex; -ace_player setVariable [QGVAR(waypoints), _waypoints]; +ACE_player setVariable [QGVAR(waypoints), _waypoints]; diff --git a/addons/microdagr/functions/fnc_deviceGetWaypoints.sqf b/addons/microdagr/functions/fnc_deviceGetWaypoints.sqf index f90ecb06be..da3484ceb0 100644 --- a/addons/microdagr/functions/fnc_deviceGetWaypoints.sqf +++ b/addons/microdagr/functions/fnc_deviceGetWaypoints.sqf @@ -4,7 +4,7 @@ * Device saving not implemented yet, just save to player object * * Arguments: - * Nothing + * None * * Return Value: * Waypoints @@ -16,4 +16,4 @@ */ #include "script_component.hpp" -(ace_player getVariable [QGVAR(waypoints), []]) +(ACE_player getVariable [QGVAR(waypoints), []]) diff --git a/addons/microdagr/functions/fnc_dialogClosedEH.sqf b/addons/microdagr/functions/fnc_dialogClosedEH.sqf index 0a7e5e5115..5180734644 100644 --- a/addons/microdagr/functions/fnc_dialogClosedEH.sqf +++ b/addons/microdagr/functions/fnc_dialogClosedEH.sqf @@ -3,13 +3,13 @@ * Handles the dialog closeing, switches back to display mode * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: - * [] call ace_microdagr_fnc_dialogClosedEH + * call ace_microdagr_fnc_dialogClosedEH * * Public: No */ diff --git a/addons/microdagr/functions/fnc_mapButtonDownEH.sqf b/addons/microdagr/functions/fnc_mapButtonDownEH.sqf index e7d2618160..566f08dc66 100644 --- a/addons/microdagr/functions/fnc_mapButtonDownEH.sqf +++ b/addons/microdagr/functions/fnc_mapButtonDownEH.sqf @@ -10,7 +10,7 @@ * 3: MousePosY * * Return Value: - * Nothing + * None * * Example: * [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapButtonDownEH @@ -19,7 +19,7 @@ */ #include "script_component.hpp" -PARAMS_4(_theMap,_mouseButton,_xPos,_yPos); +params ["", "_mouseButton"]; //Only handle RMB if (_mouseButton != 1) exitWith {}; diff --git a/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf b/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf index 21a164ff2e..2226011215 100644 --- a/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf +++ b/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf @@ -9,7 +9,7 @@ * 3: MousePosY * * Return Value: - * Nothing + * None * * Example: * [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapDoubleTapEH @@ -18,7 +18,7 @@ */ #include "script_component.hpp" -PARAMS_4(_theMap,_mouseButton,_xPos,_yPos); +params ["_theMap", "_mouseButton", "_xPos", "_yPos"]; private ["_worldPos"]; @@ -26,7 +26,7 @@ private ["_worldPos"]; if (_mouseButton != 0) exitWith {}; _worldPos = _theMap ctrlMapScreenToWorld [_xPos, _yPos]; -_worldPos set [2, (getTerrainHeightASL _worldPos)]; +_worldPos pushBack (getTerrainHeightASL _worldPos); GVAR(newWaypointPosition) = _worldPos; [APP_MODE_MARK] call FUNC(saveCurrentAndSetNewMode); diff --git a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf index 644064d069..a74255601c 100644 --- a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf +++ b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf @@ -6,7 +6,7 @@ * 0: The Map * * Return Value: - * Nothing + * None * * Example: * [compassMap] call ace_microdagr_fnc_mapOnDrawEH @@ -15,10 +15,10 @@ */ #include "script_component.hpp" -PARAMS_1(_theMap); - private ["_mapSize", "_waypoints", "_size", "_targetPos", "_relBearing", "_wpName", "_wpPos", "_alpha"]; +params ["_theMap"]; + _mapSize = (ctrlPosition _theMap) select 3; _waypoints = [] call FUNC(deviceGetWaypoints); @@ -27,7 +27,7 @@ if (GVAR(currentApplicationPage) == 1) then { _theMap ctrlMapAnimAdd [0, DUMMY_ZOOM, DUMMY_POS]; ctrlMapAnimCommit _theMap; _size = 412 * _mapSize; - _theMap drawIcon [QUOTE(PATHTO_R(images\compass_starInverted.paa)), [1,1,1,1], DUMMY_POS, _size, _size, (-1 * (getDir ace_player)), '', 0 ]; + _theMap drawIcon [QUOTE(PATHTO_R(images\compass_starInverted.paa)), [1,1,1,1], DUMMY_POS, _size, _size, (-1 * (getDir ACE_player)), '', 0 ]; _theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [0.533,0.769,0.76,1], DUMMY_POS, _size, _size, 0, '', 0 ]; if (GVAR(currentWaypoint) != -1) then { @@ -42,23 +42,23 @@ if (GVAR(currentApplicationPage) == 1) then { }; }; if ((count _targetPos) == 3) then { - _relBearing = [ace_player, _targetPos] call BIS_fnc_relativeDirTo; + _relBearing = [ACE_player, _targetPos] call BIS_fnc_relativeDirTo; _theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [1,0.564,0.564,1], DUMMY_POS, _size, _size, _relBearing, '', 0 ]; }; }; } else { //Map Mode: if (GVAR(mapAutoTrackPosition)) then { - _theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), (getPosASL ace_player)]; + _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], (getPosASL ace_player), _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; { - EXPLODE_2_PVT(_x,_wpName,_wpPos); + _x params ["_wpName", "_wpPos"]; _alpha = if (_forEachIndex == GVAR(currentWaypoint)) then {1} else {0.5}; _theMap drawIcon [QUOTE(PATHTO_R(images\icon_mapWaypoints.paa)), [1,1,1,_alpha], _wpPos, _size, _size, 0, '', 0 ]; } forEach _waypoints; diff --git a/addons/microdagr/functions/fnc_modeMapButtons.sqf b/addons/microdagr/functions/fnc_modeMapButtons.sqf index 5de4bf9ca7..a0d74bec49 100644 --- a/addons/microdagr/functions/fnc_modeMapButtons.sqf +++ b/addons/microdagr/functions/fnc_modeMapButtons.sqf @@ -6,7 +6,7 @@ * 0: String of the map button pressed * * Return Value: - * Nothing + * None * * Example: * ["autotrack"] call ace_microdagr_fnc_modeMapButtons @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_mode); +params ["_mode"]; [-1] call FUNC(saveCurrentAndSetNewMode); //backup current draw pos/zoom diff --git a/addons/microdagr/functions/fnc_moduleMapFill.sqf b/addons/microdagr/functions/fnc_moduleMapFill.sqf index d07b0bc518..03089a4ff4 100644 --- a/addons/microdagr/functions/fnc_moduleMapFill.sqf +++ b/addons/microdagr/functions/fnc_moduleMapFill.sqf @@ -4,23 +4,18 @@ * * Arguments: * 0: logic - * 1: synced units-not used - * 2: Module Activated * * Return Value: - * Nothing + * None * * Example: - * [module, [], true] call ace_microdagr_fnc_moduleMapFill + * [module] call ace_microdagr_fnc_moduleMapFill * * Public: No */ #include "script_component.hpp" -PARAMS_3(_logic,_syncedUnits,_activated); +if !(isServer) exitWith {}; +params ["_logic"]; -if (!_activated) exitWith {WARNING("Module Placed but not active");}; - -if (isServer) then { - [_logic, QGVAR(MapDataAvailable), "MapDataAvailable"] call EFUNC(common,readSettingFromModule); -}; +[_logic, QGVAR(MapDataAvailable), "MapDataAvailable"] call EFUNC(common,readSettingFromModule); diff --git a/addons/microdagr/functions/fnc_openDisplay.sqf b/addons/microdagr/functions/fnc_openDisplay.sqf index b4cec0fe46..aa2db94827 100644 --- a/addons/microdagr/functions/fnc_openDisplay.sqf +++ b/addons/microdagr/functions/fnc_openDisplay.sqf @@ -6,7 +6,7 @@ * 0: Display Mode to show the microDAGR in * * Return Value: - * Nothing + * None * * Example: * [1] call ace_microdagr_fnc_openDisplay @@ -15,9 +15,9 @@ */ #include "script_component.hpp" -private ["_oldShowMode", "_args", "_pfID", "_player"]; +private ["_oldShowMode", "_args", "_player"]; -DEFAULT_PARAM(0,_newDisplayShowMode,-1); +params [["_newDisplayShowMode", -1, [-1]]]; _oldShowMode = GVAR(currentShowMode); if (_newDisplayShowMode == -1) then { @@ -30,11 +30,10 @@ if ((_newDisplayShowMode == DISPLAY_MODE_DISPLAY) && {!([DISPLAY_MODE_DISPLAY] c if ((_newDisplayShowMode == DISPLAY_MODE_DIALOG) && {!([DISPLAY_MODE_DIALOG] call FUNC(canShow))}) then {_newDisplayShowMode = DISPLAY_MODE_HIDDEN}; - //On first-startup if (GVAR(currentApplicationPage) == APP_MODE_NULL) then { GVAR(currentApplicationPage) = APP_MODE_INFODISPLAY; - GVAR(mapPosition) = getPos ace_player; + GVAR(mapPosition) = getPos ACE_player; }; if (_newDisplayShowMode in [DISPLAY_MODE_CLOSED, DISPLAY_MODE_HIDDEN]) then { @@ -74,14 +73,14 @@ if ((_oldShowMode == DISPLAY_MODE_CLOSED) && {GVAR(currentShowMode) != DISPLAY_M //Start a pfeh to update display and handle hiding display [{ - PARAMS_2(_args,_pfID); - EXPLODE_1_PVT(_args,_player); - if ((isNull ace_player) || {!alive ace_player} || {ace_player != _player} || {!("ACE_microDAGR" in (items ace_player))} || {GVAR(currentShowMode) == DISPLAY_MODE_CLOSED}) then { + params ["_args", "_idPFH"]; + _args params ["_player"]; + if ((isNull ACE_player) || {!alive ACE_player} || {ACE_player != _player} || {!("ACE_microDAGR" in (items ACE_player))} || {GVAR(currentShowMode) == DISPLAY_MODE_CLOSED}) then { //Close Display if still open: if (GVAR(currentShowMode) != DISPLAY_MODE_CLOSED) then { [DISPLAY_MODE_CLOSED] call FUNC(openDisplay); }; - [_pfID] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; } else { if (GVAR(currentShowMode) == DISPLAY_MODE_HIDDEN) then { //If display is hidden, and we can show, then swithc modes: @@ -96,5 +95,5 @@ if ((_oldShowMode == DISPLAY_MODE_CLOSED) && {GVAR(currentShowMode) != DISPLAY_M }; }; }; - }, 0.1, [ace_player]] call CBA_fnc_addPerFrameHandler; + }, 0.1, [ACE_player]] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/microdagr/functions/fnc_recieveRangefinderData.sqf b/addons/microdagr/functions/fnc_recieveRangefinderData.sqf index 154dfff94a..8b2c6672a8 100644 --- a/addons/microdagr/functions/fnc_recieveRangefinderData.sqf +++ b/addons/microdagr/functions/fnc_recieveRangefinderData.sqf @@ -8,7 +8,7 @@ * 2: Inclination (Degrees) * * Return Value: - * Nothing + * None * * Example: * [1000, 45, 1] call ace_microdagr_fnc_recieveRangefinderData @@ -19,7 +19,7 @@ private ["_horizontalDistance", "_verticleDistance", "_targetOffset", "_targetPosASL"]; -PARAMS_3(_slopeDistance,_azimuth,_inclination); +params ["_slopeDistance", "_azimuth", "_inclination"]; if (GVAR(currentWaypoint) != -2) exitWith {}; //Only take waypoint when "connected" if (_slopeDistance < 0) exitWith {}; //Bad Data @@ -29,6 +29,6 @@ _verticleDistance = (sin _inclination) * _slopeDistance; _targetOffset = [((sin _azimuth) * _horizontalDistance), ((cos _azimuth) * _horizontalDistance), _verticleDistance]; //This assumes the "rangefinder view" pos is very close to player, at worst the turret should only be a few meters different -_targetPosASL = (getPosASL ace_player) vectorAdd _targetOffset; +_targetPosASL = (getPosASL ACE_player) vectorAdd _targetOffset; GVAR(rangeFinderPositionASL) = _targetPosASL; diff --git a/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf b/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf index 64a5cab991..7cbec9f242 100644 --- a/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf +++ b/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf @@ -7,7 +7,7 @@ * 0: New Mode * * Return Value: - * Nothing + * None * * Example: * [2] call ace_microdagr_fnc_saveCurrentAndSetNewMode @@ -16,24 +16,21 @@ */ #include "script_component.hpp" -private ["_display", "_theMap", "_mapSize", "_centerPos", "_mapCtrlPos"]; +private ["_display", "_theMap", "_centerPos", "_mapCtrlPos"]; -PARAMS_1(_newMode); +params ["_newMode"]; disableSerialization; -_display = displayNull; -if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then { - _display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]); -} else { - _display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]); -}; +_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; + if (isNull _display) exitWith {ERROR("No Display");}; if (GVAR(currentApplicationPage) == 2) then { - _theMap = if (!GVAR(mapShowTexture)) then {_display displayCtrl IDC_MAPPLAIN} else {_display displayCtrl IDC_MAPDETAILS}; + _theMap = [_display displayCtrl IDC_MAPDETAILS, _display displayCtrl IDC_MAPPLAIN] select (!GVAR(mapShowTexture)); _mapCtrlPos = ctrlPosition _theMap; - _mapSize = _mapCtrlPos select 3; - _centerPos = [((_mapCtrlPos select 0) + (_mapCtrlPos select 2) / 2), ((_mapCtrlPos select 1) + (_mapCtrlPos select 3) / 2)]; + + _mapCtrlPos params ["_mapCtrlPosX", "_mapCtrlPosY", "_mapCtrlPosZ", "_mapSize"]; + _centerPos = [(_mapCtrlPosX + _mapCtrlPosZ / 2), (_mapCtrlPosY + _mapSize / 2)]; GVAR(mapPosition) = _theMap ctrlMapScreenToWorld _centerPos; GVAR(mapZoom) = (ctrlMapScale _theMap) * _mapSize; diff --git a/addons/microdagr/functions/fnc_showApplicationPage.sqf b/addons/microdagr/functions/fnc_showApplicationPage.sqf index 3c042fdff3..dba6b54f18 100644 --- a/addons/microdagr/functions/fnc_showApplicationPage.sqf +++ b/addons/microdagr/functions/fnc_showApplicationPage.sqf @@ -3,10 +3,10 @@ * Changes the "application page" shown on the microDAGR * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * [] call ace_microdagr_fnc_showApplicationPage @@ -19,12 +19,8 @@ private ["_display", "_theMap", "_mapSize"]; disableSerialization; -_display = displayNull; -if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then { - _display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]); -} else { - _display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]); -}; +_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; + if (isNull _display) exitWith {ERROR("No Display");}; //TopBar diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index 910f422c75..826ea55e6c 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -3,10 +3,10 @@ * Updates the display (several times a second) called from the pfeh * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * [] call ace_microdagr_fnc_updateDisplay @@ -15,15 +15,11 @@ */ #include "script_component.hpp" -private ["_display", "_waypoints", "_posString", "_eastingText", "_northingText", "_numASL", "_aboveSeaLevelText", "_compassAngleText", "_targetPos", "_targetPosName", "_targetPosLocationASL", "_bearingText", "_rangeText", "_targetName", "_bearing", "_2dDistanceKm", "_SpeedText", "_playerPos2d", "_wpListBox", "_currentIndex", "_wpName", "_wpPos", "_settingListBox", "_yearString", "_monthSring", "_dayString"]; +private ["_display", "_waypoints", "_posString", "_eastingText", "_northingText", "_numASL", "_aboveSeaLevelText", "_compassAngleText", "_targetPos", "_targetPosName", "_targetPosLocationASL", "_bearingText", "_rangeText", "_targetName", "_bearing", "_2dDistanceKm", "_SpeedText", "_wpListBox", "_currentIndex", "_wpName", "_wpPos", "_settingListBox", "_yearString", "_monthSring", "_dayString", "_daylight"]; disableSerialization; -_display = displayNull; -if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then { - _display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]); -} else { - _display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]); -}; +_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; + if (isNull _display) exitWith {ERROR("No Display");}; //Fade "shell" at night @@ -44,21 +40,21 @@ case (APP_MODE_INFODISPLAY): { (_display displayCtrl IDC_MODEDISPLAY_NORTHING) ctrlSetText _northingText; //Elevation: - _numASL = ((getPosASL ace_player) select 2) + EGVAR(common,mapAltitude); + _numASL = ((getPosASL ACE_player) select 2) + EGVAR(common,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; //Heading: _compassAngleText = if (GVAR(settingUseMils)) then { - [(floor ((6400 / 360) * (getDir ace_player))), 4, 0] call CBA_fnc_formatNumber; + [(floor ((6400 / 360) * (getDir ACE_player))), 4, 0] call CBA_fnc_formatNumber; } else { - ([(floor (getDir ace_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 + ([(floor (getDir ACE_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; (_display displayCtrl IDC_MODEDISPLAY_HEADINGNUM) ctrlSetText _compassAngleText; //Speed: - (_display displayCtrl IDC_MODEDISPLAY_SPEEDNUM) ctrlSetText format ["%1kph", (round (speed (vehicle ace_player)))];; + (_display displayCtrl IDC_MODEDISPLAY_SPEEDNUM) ctrlSetText format ["%1kph", (round (speed (vehicle ACE_player)))];; if (GVAR(currentWaypoint) == -1) then { @@ -89,13 +85,13 @@ case (APP_MODE_INFODISPLAY): { }; if (!(_targetPosLocationASL isEqualTo [])) then { - _bearing = [(getPosASL ace_player), _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 = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000; + _2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000; _rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)]; _numASL = (_targetPosLocationASL select 2) + EGVAR(common,mapAltitude); _aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber; @@ -111,14 +107,14 @@ case (APP_MODE_INFODISPLAY): { case (APP_MODE_COMPASS): { //Heading: _compassAngleText = if (GVAR(settingUseMils)) then { - [(floor ((6400 / 360) * (getDir ace_player))), 4, 0] call CBA_fnc_formatNumber; + [(floor ((6400 / 360) * (getDir ACE_player))), 4, 0] call CBA_fnc_formatNumber; } else { - ([(floor (getDir ace_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 + ([(floor (getDir ACE_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; (_display displayCtrl IDC_MODECOMPASS_HEADING) ctrlSetText _compassAngleText; //Speed: - _SpeedText = format ["%1kph", (round (speed (vehicle ace_player)))];; + _SpeedText = format ["%1kph", (round (speed (vehicle ACE_player)))];; (_display displayCtrl IDC_MODECOMPASS_SPEED) ctrlSetText _SpeedText; if (GVAR(currentWaypoint) == -1) then { @@ -126,8 +122,6 @@ case (APP_MODE_COMPASS): { (_display displayCtrl IDC_MODECOMPASS_RANGE) ctrlSetText ""; (_display displayCtrl IDC_MODECOMPASS_TARGET) ctrlSetText ""; } else { - _playerPos2d = (getPosASL ace_player) select [0,2]; - _targetPosName = ""; _targetPosLocationASL = []; @@ -147,13 +141,13 @@ case (APP_MODE_COMPASS): { _rangeText = "---"; if (!(_targetPosLocationASL isEqualTo [])) then { - _bearing = [(getPosASL ace_player), _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 = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000; + _2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000; _rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)]; }; @@ -169,9 +163,9 @@ case (APP_MODE_WAYPOINTS): { lbClear _wpListBox; { - EXPLODE_2_PVT(_x,_wpName,_wpPos); + _x params ["_wpName", "_wpPos"]; _wpListBox lbAdd _wpName; - _2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_wpPos select [0,2])) / 1000; + _2dDistanceKm = ((getPosASL ACE_player) distance2D _wpPos) / 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 f28e3397c3..c7f6cc1708 100644 --- a/addons/microdagr/stringtable.xml +++ b/addons/microdagr/stringtable.xml @@ -308,6 +308,7 @@ MicroDAGR - Vyplnění mapy MicroDAGR-Kartenfüllung Preenchimento de mapa do MicroDAGR + MicroDAGR térképkitöltés MicroDAGR Map Fill @@ -316,6 +317,7 @@ MicroDAGR - Vyplnění mapy MicroDAGR-Kartenfüllung Preenchimento de mapa do MicroDAGR + MicroDAGR térképkitöltés How much map data is filled on MicroDAGR's @@ -324,30 +326,34 @@ Wie viel Daten auf einem MicroDAGR zu sehen sind Kolik informací je načteno do MicroDAGR? Quanta informação é preenchida no mapa do MicroDAGR + Mennyi térképadatot tartalmaz a MicroDAGR - + Full Satellite + Buildings Pełna satelitarna + budynki Satelite completo + Edificios Satellitenbild + Gebäude Satelit + Budovy Satélite completo + Edifícios + Teljes műholdas + épületek - + Topographical + Roads Topograficzna + drogi Topografico + Carreteras Topografisch + Straßen Topografické + Cesty Topográfico + Estradas + Topográfia + utak - + None (Cannot use map view) Żadna (wyłącza ekran mapy) Nada (No se puede el mapa) Keine (kann keine Kartenansicht verwenden) Žádný (Nelze použít zobrazení mapy) Nada (Não pode usar a tela de mapa) + Semmi (nem használható a térképnézet) Controls how much data is filled on the microDAGR items. Less data restricts the map view to show less on the minimap.<br />Source: microDAGR.pbo @@ -356,6 +362,7 @@ Steuert wie viel Daten auf dem microDAGR zu sehen ist. Weniger Daten schränken die Kartenansicht ein, um mehr auf der Minimap zu sehen.<br />Quelle: microDAGR.pbo Tento modul umožňuje kontrolovat, kolik informací je obsaženo v MicroDAGR. Menší množství dat omezené zobrazením mapy ukazují méně věcí na minimapě.<br />Zdroj: microDAGR.pbo Controla quantos dados são preenchidos nos itens microDAGR. Menos dados restringe a visualização de mapa para mostrar menos informações no minimapa<br/>Fonte: MicroDAGR.pbo + Meghatárroza a MicroDAGR objektumok térképének tartalmát. A kevesebb adat korlátozza a térképnézeti módot az eszközön. <br />Forrás: microDAGR.pbo \ No newline at end of file diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index 2845767f15..2a0544fab7 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -104,6 +104,7 @@ Aus Vypnout Desligado + Ki Player Only @@ -112,6 +113,7 @@ Nur Spieler Pouze hráči Somente jogador + Csak játékosok Player and AI @@ -120,6 +122,7 @@ Spieler und KI Hráči a AI Jogador e IA + Játékosok és AI \ No newline at end of file diff --git a/addons/missionmodules/stringtable.xml b/addons/missionmodules/stringtable.xml index b99285850d..6085e00b32 100644 --- a/addons/missionmodules/stringtable.xml +++ b/addons/missionmodules/stringtable.xml @@ -8,6 +8,7 @@ ACE-Missionsmodule ACE Moduly mise Módulo de missões ACE + ACE küldetési modulok Ambiance Sounds [ACE] @@ -16,6 +17,7 @@ Umgebungsgeräusche [ACE] Zvuky prostředí [ACE] [ACE] Sons ambientes + Ambiens hangok [ACE] Sounds @@ -24,6 +26,7 @@ Sounds Zvuky Sons + Hangok Class names of the ambiance sounds to be played. Seperated by ',' @@ -40,6 +43,7 @@ Mindestabstand Minimální vzdálenost Distância mínima + Minimális távolság Used for calculating a random position and sets the minimal distance between the players and the played sound file(s) @@ -48,6 +52,7 @@ Wird verwendet, um eine zufällige Position zu bestimmen und setzt den Mindestabstand zwischen Spielern und der/den abzuspielenden Sounddatei(en) fest Používá se pro výpočet náhodné pozice a určuje minimální vzdálenost mezi hráči a přehrávaným zvukem. Usada para calcular uma posição aleatória e definir a distância mínima entre os jogadores e os arquivos de sons que estão sendo reproduzidos. + Egy véletlenszerű pozíció számításához használt érték, amihez megadja a minimum távolságot a játékosok és a lejátszott hangfájl(ok) között Maximum Distance @@ -56,6 +61,7 @@ Maximalabstand Maximální vzdálenost Distância máxima + Maximális távolság Used for calculating a random position and sets the maximum distance between the players and the played sound file(s) @@ -64,6 +70,7 @@ Wird verwendet, um eine zufällige Position zu bestimmen und setzt den Maximalabstand zwischen Spielern und der/den abzuspielenden Sounddatei(en) fest Používá se pro výpočet náhodné pozice a určuje maximální vzdálenost mezi hráči a přehrávaným zvukem. Usado para calcular uma posição aleatória e definir uma distância máxima entre os jogadores e os arquivos de sons que estão sendo reproduzidos. + Egy véletlenszerű pozíció számításához használt érték, amihez megadja a maximum távolságot a játékosok és a lejátszott hangfájl(ok) között Minimal Delay @@ -72,6 +79,7 @@ Minimale Verzögerung Minimální prodleva Atraso mínimo + Minimum késleltetés Minimal delay between sounds played @@ -80,6 +88,7 @@ Minimale Verzögerung zwischen abzuspielenden Sounds Minimální prodleva mezi přehrávanými zvuky Atraso mínimo entre os sons reproduzidos + Minimum késleltetés a lejátszott hangok között Maximum Delay @@ -88,6 +97,7 @@ Maximale Verzögerung Maximální prodleva Atraso máximo + Maximum késleltetés Maximum delay between sounds played @@ -96,6 +106,7 @@ Maximale Verzögerung zwischen abzuspielenden Sounds Maximální prodleva mezi přehrávanými zvuky Atraso máximo entre os sons reproduzidos + Maximum késleltetés a lejátszott hangok között Follow Players @@ -104,6 +115,7 @@ Spielern folgen Následovat hráče Seguir jogadores + Játékosok követése Follow players. If set to false, loop will play sounds only nearby logic position. @@ -112,6 +124,7 @@ Spielern folgen. Wenn auf falsch gesetzt, werden Sounds nur in der Nähe des Logikmoduls abgespielt. Následuj hráče. Pokud je FALSE, smyčka zvuku bude přehrávána na nejbližší pozici logiki. Segue os jogadores. Se esta desabilitado (falso), o loop reproduzirá os sons somente perto de sua posição lógica. + Játékosok követése. Ha le van tiltva, az ismétlés csak a legközelebbi logikai ponton játszik le hangokat. Volume @@ -120,6 +133,7 @@ Lautstärke Hlasitost Volume + Hangerő The volume of the sounds played @@ -128,6 +142,7 @@ Lautstärke der abzuspielenden Sounds Hlasitost přehrávaného zvuku O volume em que os sons serão reproduzidos + A lejátszott hangok hangereje Ambiance sounds loop (synced across MP) @@ -136,6 +151,7 @@ Umgebungsgeräusch-Schleife (im MP synchronisiert) Smyčka okkolního zvuku (synchronizováno v MP) Loop de sons ambientes (sincronizados através do MP) + Ambiens hangok folyamatossága (MP alatt szinkronizálva) \ No newline at end of file diff --git a/addons/mk6mortar/stringtable.xml b/addons/mk6mortar/stringtable.xml index 26ab485db2..394154a70b 100644 --- a/addons/mk6mortar/stringtable.xml +++ b/addons/mk6mortar/stringtable.xml @@ -56,6 +56,7 @@ MK6-Einstellungen MK6 - Nastavení Ajustes do MK6 + MK6 beállítások Air Resistance @@ -64,6 +65,7 @@ Luftwiderstand Odpor vzduchu Resistência do Ar + Légellenállás For Player Shots, Model Air Resistance and Wind Effects @@ -72,6 +74,7 @@ Für Spielerschüsse, Luftwiderstand und Windeffekte Pro hráčovu střelbu, Model odporu vzduchu a povětrných podmínek Para disparos do jogador, modelo de resistência de ar e efeitos de vento + Játékos általi lövésekhez, legyen-e számított légellenállás és szélhatás Allow MK6 Computer @@ -80,6 +83,7 @@ Erlaube MK6-Computer MK6 - Povolit počítač Permitir computador do MK6 + MK6 számítógép engedélyezése Show the Computer and Rangefinder (these NEED to be removed if you enable air resistance) @@ -88,6 +92,7 @@ Zeige den Computer und den Entfernungsmesser an (diese MÜSSEN entfernt werden, wenn der Luftwiderstand aktiviert ist) Zobrazit počítač a dálkoměr (toto MUSÍ být odstraněno pokud je zapnut odpor vzduchu) Mostra o computador e o medidor de distância (estes DEVEM ser removidos se você habilitar resistência do ar) + A távmérő és számítógép megjelenítése (ezeket el KELL távolítani ha a légellenállás engedélyezve van) Allow MK6 Compass @@ -96,6 +101,7 @@ Erlaube MK6-Kompass MK6 - Povolit kompas Permitir bússula do MK6 + MK6 iránytű engedélyezése Show the MK6 Digital Compass @@ -104,9 +110,9 @@ Zeige MK6-Digitaler-Kompass MK6 - Zobrazit digitální kompas Mostra a bússula digital do MK6 + Az MK6 digitális iránytű megjelenítése - Moduł ten pozwala dostosować ustawienia moździerza MK6. Dieses Modul erlaubt das Einstellen des MK6-Mörsers. Tento modul umožňuje nastavení minometu MK6. diff --git a/addons/mx2a/stringtable.xml b/addons/mx2a/stringtable.xml index e8df673866..0de9ce7ff6 100644 --- a/addons/mx2a/stringtable.xml +++ b/addons/mx2a/stringtable.xml @@ -8,6 +8,7 @@ MX-2A MX-2A MX-2A + MX-2A Thermal imaging device @@ -16,6 +17,7 @@ Dispositivo de imagen térmica Termální dalekohled Dispositivo de imagem térmica + Hőleképező készülék - + \ No newline at end of file diff --git a/addons/nametags/stringtable.xml b/addons/nametags/stringtable.xml index a0048c4076..bf80457ab7 100644 --- a/addons/nametags/stringtable.xml +++ b/addons/nametags/stringtable.xml @@ -116,6 +116,7 @@ Namensanzeigen Jmenovky Etiquetas de nome + Névcímkék Player Names View Dist. @@ -124,6 +125,7 @@ Spielernamen-Distanz Vzdálenost zobrazení jména hráčů Distância de visão dos nomes dos jogadores + Játékosok nevének látótávja Distance in meters at which player names are shown. Default: 5 @@ -132,6 +134,7 @@ Distanz in Metern bei der Spielernamen angezeigt werden. Standard: 5 Vzdálenost v metrech pro zobrazení jména. Výchozí: 5 Distância em metros que os nomes dos jogadores são mostrados. Padrão: 5 + Méterben megadott érték a játékosok nevének mutatására. Alapértelmezett: 5 Show name tags for AI? @@ -140,6 +143,7 @@ Zeige Namensanzeigen für KI? Zobrazit jmenovky pro AI? Mostrar nomes para IA? + Névcímkék megjelenítése AI-nál? Show the name and rank tags for friendly AI units? Default: Do not force @@ -148,6 +152,7 @@ Zeige den Namen und Rang für freundliche KI-Einheiten? Standard: nicht erwzingen Zobrazit jména a hodnosti pro spřátelené AI jednotky? Výchozí: Nevynucovat Mostra o nome e patente para unidades IA aliadas? Padrão: Não forçar + Mutassa-e a szövetséges AI egységek nevét és rangját? Alapértelmezett: Nincs felülbírálás Force Hide @@ -156,6 +161,7 @@ Verstecken erzwingen Vynuceno skrýt Ocultar forçado + Erőltetett rejtett Force Show @@ -164,6 +170,7 @@ Anzeigen erzwingen Vynuceno zobrazit Mostrar forçado + Erőltetett látható Show crew info? @@ -172,6 +179,7 @@ Zeige Besatzungsinfo? Zobrazit informace o posádce? Mostrar informação de tripulação? + Legénységi adatok megjelenítése? Show vehicle crew info, or by default allows players to choose it on their own. Default: Do Not Force @@ -180,6 +188,7 @@ Zeige Fahrzeugbesatzungsinfo oder erlaube Spielern es auszuwählen. Standard: nicht erzwingen. Zobrazit informace o posádce, nebo nechat aby si hráč vybral sám. Výchozí: Nevynucovat Mostrar informações de tripulação ou por padrão permitir a escolha dos jogadores. Padrão: Não forçar. + A legénységi adatok mutatása, alapértelmezett esetben a játékos által kiválasztható. Alapértelmezett: Nincs felülbírálás Show for Vehicles @@ -188,6 +197,7 @@ Zeige bei Fahrzeugen Zobrazit pro vozidla Mostrar para veículos + Mutatás járműveknél Show cursor NameTag for vehicle commander (only if client has name tags enabled)Default: No @@ -204,6 +214,7 @@ Este módulo permite personalizar la configuración y la distancia de las Etiquetas de nombre. Tento modul umožňuje si přizpůsobit nastavení a vzdálenost jmenovky. Este módulo permite que você personalize as configurações e distâncias de etiquetas de nome. + Ez a modul lehetővé teszi a névcímkék beállításainak testreszabását. Only on Cursor @@ -212,6 +223,7 @@ Nur bei Maus Pouze na kurzor Somente no cursor + Csak kurzorra Only on Keypress @@ -220,6 +232,7 @@ Nur bei Tastendruck Pouze na klávesu Somente em tecla ativada + Csak gombnyomásra Only on Cursor and Keypress @@ -228,6 +241,7 @@ Nur Maus und Tastendruck Pouze na kurzor a klávesu Somente em cursor ou tecla ativada + Csak kurzorra és gombnyomásra Force Show Only on Cursor @@ -236,6 +250,7 @@ Vynuceno zobrazit pouze na kurzor Erzwinge nur mit Mauszeiger anzuzeigen Forçar mostrar somente no cursor + Erőltetett látható, csak kurzorra Force Show Only on Keypress @@ -244,6 +259,7 @@ Vynuceno zobrazit pouze na klávesu Erzwinge nur mit Tastendruck anzuzeigen Forçar somente mostrar em tecla ativada + Erőltetett látható, csak gombnyomásra Force Show Only on Cursor and Keypress @@ -252,6 +268,7 @@ Vynuceno zobrazit pouze na kurzor a klávesu Erzwinge nur mit Mauszeiger und Tastendruck anzuzeigen Forçar mostrar somente em cursor e tecla ativada + Erőltetett látható, csak kurzorra és gombnyomásra Use Nametag settings @@ -260,6 +277,7 @@ Verwende Namenanzeigen Použít nastavení jmenovky Usar ajustes de etiquetas de nome + Névcímkék beállításának használata Always Show All @@ -268,6 +286,7 @@ Immer alle zeigen Vždy zobrazit vše Sempre mostrar tudo + Mindig minden mutatása Show player names and set their activation. Default: Enabled @@ -276,6 +295,7 @@ Zobrazit jména hráčů a nastavit jejich aktivaci. Výchozí: Povoleno Erlaubt das Anzeigen von Spielernamen und stellt ein, ob sie standardmäßig aktiviert oder deaktiviert sind. Standard: aktiviert Mostrar os nomes dos jogadores e definir sua ativação. Padrão: Ativado + Mutassa a játékosok nevét és kezelje az aktivációjukat. Alapértelmezett: Engedélyezve Effect of sound waves above the heads of speaking players after holding the PTT key. This option works with TFAR and ACRE2. @@ -284,6 +304,7 @@ Efekt zvukových vln nad hlavami hráčů když mluví skrz PTT klávesu. Tato volba funguje s TFAR a ACRE2. Es wird ein Schallwellensymbol über den Köpfen von sprechenden Spielern angezeigt, die ihre Push-to-Talk-Taste drücken. Diese Option funktioniert mit TFAR und ACRE2. Efeito de ondas sonoras acima das cabeças dos jogadores que falam depois mantendo pressionada a tecla PTT. Esta opção funciona com TFAR e ACRE2. + Hanghullám-effekt a beszélő játékosok feje felett a PTT-gomb lenyomásakor. Ez a beállítás TFAR és ACRE2 alatt működik. Nametags Size @@ -292,6 +313,7 @@ Velikost jmenovky Namensschildgröße Tamanho das etiquetas de nome + Névcímkék mérete Text and Icon Size Scaling @@ -300,6 +322,7 @@ Velikost textu a ikon Text- und Symbolgrößen Escala de tamanho dos ícones e textos + Szöveg és ikon méretének skálázása diff --git a/addons/optics/CfgEventHandlers.hpp b/addons/optics/CfgEventHandlers.hpp index 6c6e824b16..68962af2c4 100644 --- a/addons/optics/CfgEventHandlers.hpp +++ b/addons/optics/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); diff --git a/addons/optics/CfgJointRails.hpp b/addons/optics/CfgJointRails.hpp new file mode 100644 index 0000000000..86c962afe5 --- /dev/null +++ b/addons/optics/CfgJointRails.hpp @@ -0,0 +1,15 @@ +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/addons/optics/CfgOpticsEffect.hpp b/addons/optics/CfgOpticsEffect.hpp index a1bf62d6e3..8638277732 100644 --- a/addons/optics/CfgOpticsEffect.hpp +++ b/addons/optics/CfgOpticsEffect.hpp @@ -1,4 +1,3 @@ - class CfgOpticsEffect { class ACE_OpticsRadBlur1 { type = "radialblur"; diff --git a/addons/optics/CfgPreloadTextures.hpp b/addons/optics/CfgPreloadTextures.hpp index 57fa2cabf8..1354f91e18 100644 --- a/addons/optics/CfgPreloadTextures.hpp +++ b/addons/optics/CfgPreloadTextures.hpp @@ -1,4 +1,3 @@ - #define MACRO_PRELOAD \ GVAR(BodyDay) = "*"; \ GVAR(BodyNight) = "*"; \ diff --git a/addons/optics/CfgRscTitles.hpp b/addons/optics/CfgRscTitles.hpp index b7d2005d77..3bbd6b62bc 100644 --- a/addons/optics/CfgRscTitles.hpp +++ b/addons/optics/CfgRscTitles.hpp @@ -1,4 +1,3 @@ - class RscOpticsValue; class RscMapControl; class RscText; @@ -111,7 +110,7 @@ class RscInGameUI { idc = 1713011; x = "safeZoneXAbs + safeZoneWAbs - (safezoneX - safeZoneXABS) * ((getResolution select 4)/(16/3))"; colorBackground[] = {0,0,0,1}; - }; + }; }; class ACE_RscWeapon_Hamr: ACE_RscWeapon_base { diff --git a/addons/optics/CfgVehicles.hpp b/addons/optics/CfgVehicles.hpp index 92abeac04f..eda9a3d930 100644 --- a/addons/optics/CfgVehicles.hpp +++ b/addons/optics/CfgVehicles.hpp @@ -1,4 +1,3 @@ - class CfgVehicles { class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { diff --git a/addons/optics/CfgWeapons.hpp b/addons/optics/CfgWeapons.hpp index 11fdb1f427..1be66d3aa2 100644 --- a/addons/optics/CfgWeapons.hpp +++ b/addons/optics/CfgWeapons.hpp @@ -1,18 +1,17 @@ - class CfgWeapons { class ItemCore; class InventoryOpticsItem_Base_F; 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 + modelOptics = "\z\ace\addons\optics\models\NWD_M22_5x"; // 7 degrees 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..? + minRange = 500; //500 = seem almost never use it..? minRangeProbab = 0.001; midRange = 1000; midRangeProbab = 0.01; diff --git a/addons/optics/XEH_postInit.sqf b/addons/optics/XEH_postInit.sqf index df6d0ae486..64226fcf3d 100644 --- a/addons/optics/XEH_postInit.sqf +++ b/addons/optics/XEH_postInit.sqf @@ -3,16 +3,22 @@ if (!hasInterface) exitWith {}; +GVAR(camera) = objNull; + 0 = 0 spawn { waituntil {!isNull ACE_player}; + waituntil {sleep 1; {_x != GVAR(camera)} count allMissionObjects "camera" == 0}; + + GVAR(camera) cameraEffect ["TERMINATE", "BACK"]; + camDestroy GVAR(camera); // PiP technique by BadBenson - GVAR(camera) = "camera" camCreate positioncameratoworld [0,0,0]; + 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]]; + "ace_optics_rendertarget0" setPiPEffect [0]; GVAR(camera) cameraEffect ["INTERNAL", "BACK", "ace_optics_rendertarget0"]; }; @@ -23,18 +29,19 @@ if (!hasInterface) exitWith {}; }; }] call EFUNC(common,addEventHandler); -// camera has to be re-created every ACE_time another camera is created. Otherwise r2t is either black or transparent. @todo Add popular custom cameras to the event in ACE_common. +// 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); + GVAR(camera) cameraEffect ["TERMINATE", "BACK"]; + camDestroy GVAR(camera); // PiP technique by BadBenson - GVAR(camera) = "camera" camCreate positioncameratoworld [0,0,0]; + 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]]; + "ace_optics_rendertarget0" setPiPEffect [0]; GVAR(camera) cameraEffect ["INTERNAL", "BACK", "ace_optics_rendertarget0"]; }; }] call EFUNC(common,addEventHandler); diff --git a/addons/optics/config.cpp b/addons/optics/config.cpp index 224410cdec..79f71842ee 100644 --- a/addons/optics/config.cpp +++ b/addons/optics/config.cpp @@ -30,5 +30,6 @@ class CfgPatches { #include "CfgRscTitles.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" +#include "CfgJointRails.hpp" #include "CfgPreloadTextures.hpp" diff --git a/addons/optics/functions/fnc_onDrawScope2D.sqf b/addons/optics/functions/fnc_onDrawScope2D.sqf index 7abee8f122..9ea038f877 100644 --- a/addons/optics/functions/fnc_onDrawScope2D.sqf +++ b/addons/optics/functions/fnc_onDrawScope2D.sqf @@ -22,8 +22,8 @@ _optic = (primaryWeaponItems ACE_player) select 2; _isPIP = (getText (configFile >> "CfgWeapons" >> _optic >> "ItemInfo" >> "modelOptics")) == QUOTE(PATHTOF(models\ace_optics_pip.p3d)); if (_isPIP) then { - GVAR(camera) setposATL positioncameratoworld [0,0,0.4]; - GVAR(camera) camPrepareTarget positioncameratoworld [0,0,50]; + GVAR(camera) setPosATL positionCameraToWorld [0,0,0.4]; + GVAR(camera) camPrepareTarget positionCameraToWorld [0,0,50]; GVAR(camera) camCommitPrepared 0; // @todo, check if that needs to be done at all diff --git a/addons/optionsmenu/functions/fnc_exportSettings.sqf b/addons/optionsmenu/functions/fnc_exportSettings.sqf index 9d6437495d..172a95808e 100644 --- a/addons/optionsmenu/functions/fnc_exportSettings.sqf +++ b/addons/optionsmenu/functions/fnc_exportSettings.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_value", "_compiledConfigEntry"]; +private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_value", "_compiledConfigEntry", "_formatedValue"]; { /*_settingData = [ @@ -40,25 +40,39 @@ private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localize if (GVAR(ClientSettingsExportIncluded) || !_isClientSetable) then { _value = missionNamespace getvariable [_name, _defaultValue]; - if (_typeName == "STRING") then { - _value = format['"%1"', _value]; - }; - if (_typeName == "BOOL") then { - _value = if (typeName _value == "BOOL" && {_value}) then {1} else {0}; + _formatedValue = switch (toLower _typeName) do { + case ("scalar"): { + format['value = %1;', _value]; + }; + case ("string"): { + format['value = "%1";', _value]; + }; + case ("bool"): { + if (typeName _value != "BOOL") then {ERROR("weird bool typename??");}; + _value = if (((typeName _value) == "BOOL") && {_value}) then {1} else {0}; + format ['value = %1;', _value]; + }; + case ("color"): { + _value params [["_r",1], ["_b",0], ["_g",1], ["_a",1]]; + format ["value[] = {%1, %2, %3, %4};", _r, _b, _g, _a]; + }; + default { + ERROR("unknown typeName"); + "" + }; + }; _compiledConfigEntry = format [" class %1 { - value = %2; + %2 typeName = %3; force = 1; -};", _name, _value, format['"%1"', _typeName]]; +};", _name, _formatedValue, format['"%1"', _typeName]]; "ace_clipboard" callExtension _compiledConfigEntry; }; } forEach EGVAR(common,settings); - "ace_clipboard" callExtension "--COMPLETE--"; +"ace_clipboard" callExtension "--COMPLETE--"; [LSTRING(settingsExported)] call EFUNC(common,displayTextStructured); - - diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index f368ef79b4..07975fcb0a 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -224,6 +224,7 @@ Erlaube Config-Export [ACE] Povolit export natavení [ACE] [ACE] Permitir exportação de configurações + Konfiguráció-exportálás engedélyezése [ACE] Allow @@ -232,6 +233,7 @@ Erlaube Povolit Permitir + Engedélyezés Allow export of all settings to a server config formatted. @@ -240,6 +242,7 @@ Erlaube alle Einstellungen in einer Server-Config zu exportieren. Povolit exportovat všechna nastavení do formátu server configu. Permitir exportação de todas as configurações para uma configuração formatada de servidor. + Az összes beállítás szerver-konfigurációba való exportálásának engedélyezése. When allowed, you have access to the settings modification and export in SP. Clicking export will place the formated config on your clipboard. @@ -248,6 +251,7 @@ Wenn erlaubt, können die Einstellungsmodifikationen angezeigt und im SP exportiert werden. Wenn auf "Exportieren" geklickt wird, wird eine formatierte Config-Datei in der Zwischenablage abgespeichert. Pokud je povoleno, budete mít přístup k modifikaci nastavení a exportování v SP. Kliknutím na export umístníte formátovaný config do vaší schránky. Quando permitido, você tem acesso à modificação de definições e exportação em SP. Clicando em exportação colocará a configuração formatada em sua área de transferência. + Engedélyezéskor hozzáférést kapsz a beállítások módosításához és exportálásához egyjátékos módban. Exportáláskor a formázott konfiguráció a vágólapra kerül. Hide @@ -256,6 +260,7 @@ Verstecken Skrýt Ocultar + Elrejtés Top right, downwards @@ -264,6 +269,7 @@ Open rechts, nach unten Vpravo nahoře, dolů Superior direito, para baixo + Jobb felül, lefele Top right, to the left @@ -272,6 +278,7 @@ Von rechts nach links Vpravo nahoře, do leva Superior direito, à esquerda + Jobb felül, balra Top left, downwards @@ -280,6 +287,7 @@ Von links, nach unten Vlevo nahoře, dolů Superior esquerdo, para baixo + Bal felül, lefele Top left, to the right @@ -288,6 +296,7 @@ Oben links nach rechts Vlevo nahoře, do prava Superior esquerdo, para a direita + Bal felül, jobbra Top @@ -296,6 +305,7 @@ Oben Nahoře Acima + Fent Bottom @@ -304,6 +314,7 @@ Unten Dole Abaixo + Alul Debug To Clipboard @@ -312,6 +323,7 @@ Debug do schránky Debug in die Zwischenablage Depuração para área de transferência + Debug a vágólapra Sends debug information to RPT and clipboard. @@ -320,14 +332,17 @@ Pošle debug informace do RPT a schránky. Protokolliert Debug-Informationen im RPT und speichert sie in der Zwischenablage. Envia informação de depuração para RPT e área de transferência. + Debug információt küld az RPT-be és a vágólapra. Headbug Fix Fix Headbug + "Fejhiba" fix Resets your animation state. Resetuje aktualną animację. + Visszaállítja az animációs állapotodat. ACE News @@ -336,6 +351,7 @@ Notícias do ACE Wiadomości ACE ACE Novinky + ACE hírek Show News on Main Menu @@ -344,6 +360,7 @@ Mostrar notícias no menu principal Pokazuj wiadomości ACE w menu głównym Zobrazit novinky v hlavním menu + Hírek mutatása a főmenüben All Categories @@ -354,4 +371,4 @@ Logistyka - \ No newline at end of file + diff --git a/addons/overheating/CfgWeapons.hpp b/addons/overheating/CfgWeapons.hpp index 025fa5e280..5c9717dbcf 100644 --- a/addons/overheating/CfgWeapons.hpp +++ b/addons/overheating/CfgWeapons.hpp @@ -9,7 +9,7 @@ class CfgWeapons { picture = QUOTE(PATHTOF(UI\spare_barrel_ca.paa)); scope = 2; class ItemInfo: InventoryItem_Base_F { - mass = 50; + mass = 30; }; }; diff --git a/addons/parachute/stringtable.xml b/addons/parachute/stringtable.xml index 8a4b2d766c..c21c55ba9e 100644 --- a/addons/parachute/stringtable.xml +++ b/addons/parachute/stringtable.xml @@ -53,11 +53,13 @@ Cut Parachute Fallschirm abschneiden Odetnij spadochron + Ejtőernyő elvágása Reserve Parachute Reserve Fallschirm Spadochron awaryjny + Tartalék ejtőernyő - \ No newline at end of file + diff --git a/addons/protection/FixUniforms.hpp b/addons/protection/FixUniforms.hpp index 24c02b79aa..e69de29bb2 100644 --- a/addons/protection/FixUniforms.hpp +++ b/addons/protection/FixUniforms.hpp @@ -1,569 +0,0 @@ - -class Man; -class CAManBase: Man { - class HitPoints { - class HitHead { - /*armor = 1; - passThrough = 1; - radius = 0.1; - explosionShielding = 0.5; - minimalHit = 0;*/ - }; - - class HitBody { - /*armor = 1; - passThrough = 1; - radius = 0.15; - explosionShielding = 10; - minimalHit = 0;*/ - }; - - class HitHands { - /*armor = 1; - passThrough = 1; - radius = 0.08; - explosionShielding = 1; - minimalHit = 0;*/ - }; - - class HitLegs { - /*armor = 1; - passThrough = 1; - radius = 0.1; - explosionShielding = 1; - minimalHit = 0;*/ - }; - }; - - /*armor = 2; - armorStructural = 5;*/ -}; - -class Civilian: CAManBase { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; - - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 2; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - };*/ -}; - -/*class Civilian_F: Civilian {}; -class C_man_1: Civilian_F {};*/ - -class SoldierWB: CAManBase {}; -class SoldierEB: CAManBase {}; -class SoldierGB: CAManBase {}; - -class B_Soldier_base_F: SoldierWB { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; - - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 2; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - }; - - armor = 2; - armorStructural = 5;*/ -}; - -class B_Soldier_02_f: B_Soldier_base_F { // t-shirt - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; - - class HitBody: HitBody { - armor = 1; - }; - - class HitHands: HitHands { - armor = 1; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - };*/ - - armorStructural = 5; //7; -}; - -class B_Soldier_03_f: B_Soldier_base_F { // sleeves - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; - - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 1; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - };*/ - - armorStructural = 5; //7; -}; - -class B_Soldier_04_f: B_Soldier_base_F { // heli pilot - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; - - class HitBody: HitBody { - /*armor = 2;*/ - passThrough = 1; //0.5; - /*explosionShielding = 2.4;*/ - }; - - class HitHands: HitHands { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1.2;*/ - }; - - class HitLegs: HitLegs { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1.2;*/ - }; - }; -}; - -class B_Soldier_05_f: B_Soldier_base_F { // cas pilot - armorStructural = 5; //3; - - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; - - class HitBody: HitBody { - armor = 3; //2; - passThrough = 1; //0.5; - /*explosionShielding = 2.4;*/ - }; - - class HitHands: HitHands { - armor = 3; //8; - /*passThrough = 1; - explosionShielding = 1.2;*/ - }; - - class HitLegs: HitLegs { - armor = 3; //8; - /*passThrough = 1; - explosionShielding = 1.2;*/ - }; - }; -}; - -class B_Soldier_diver_base_F: B_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 2; - }; - - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 2; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - };*/ -}; - -// these appear to be broken, remnants from A2? -/*class C_man_p_fugitive_F: C_man_1 { - class HitPoints: HitPoints { - class HitBody: HitBody { - armor = "0.3*10"; - }; - - class HitLegs: HitLegs { - armor = "0.3*5"; - }; - }; -}; - -class C_man_w_worker_F: C_man_1 { - class HitPoints: HitPoints { - class HitBody: HitBody { - armor = "0.6*10"; - }; - - class HitHands: HitHands { - armor = "0.5*5"; - }; - - class HitLegs: HitLegs { - armor = "0.5*5"; - }; - }; -}; - -class C_man_hunter_1_F: C_man_1 { - class HitPoints: HitPoints { - class HitBody: HitBody { - armor = "0.6*10"; - }; - - class HitHands: HitHands { - armor = "0.5*5"; - }; - - class HitLegs: HitLegs { - armor = "0.5*5"; - }; - }; -}; - -class C_man_p_shorts_1_F: C_man_1 { - class HitPoints: HitPoints { - class HitLegs: HitLegs { - armor = "0.3*5"; - }; - }; -}; - -class C_man_pilot_F: C_man_1 { - class HitPoints: HitPoints { - class HitBody: HitBody { - armor = "0.6*10"; - }; - - class HitHands: HitHands { - armor = "0.5*5"; - }; - - class HitLegs: HitLegs { - armor = "0.5*5"; - }; - }; -};*/ - -class I_Soldier_base_F: SoldierGB { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; - - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 2; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - };*/ - - /*armor = 2;*/ - armorStructural = 5; //7; -}; - -class I_Soldier_02_F: I_Soldier_base_F { // sleeves - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; - - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 1; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - };*/ -}; - -class I_Soldier_03_F: I_Soldier_base_F { // heli pilot - /*armorStructural = 5;*/ - - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; - - class HitBody: HitBody { - /*armor = 2;*/ - passThrough = 1; //0.5; - /*explosionShielding = 2.4;*/ - }; - - class HitHands: HitHands { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1.2;*/ - }; - - class HitLegs: HitLegs { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1.2;*/ - }; - }; -}; - -class I_Soldier_04_F: I_Soldier_base_F { // cas pilot - armorStructural = 5; //3; - - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; - - class HitBody: HitBody { - armor = 3; //2; - passThrough = 1; //0.5; - /*explosionShielding = 2.4;*/ - }; - - class HitHands: HitHands { - armor = 3; //8; - /*passThrough = 1; - explosionShielding = 1.2;*/ - }; - - class HitLegs: HitLegs { - armor = 3; //8; - /*passThrough = 1; - explosionShielding = 1.2;*/ - }; - }; -}; - -class I_Soldier_diver_base_F: I_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 2; - }; - - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 2; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - };*/ -}; - -class O_Soldier_base_F: SoldierEB { - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; - - class HitBody: HitBody { - armor = 4; //6; - passThrough = 0.85; //0.5; - /*explosionShielding = 1.5;*/ - }; - - class HitHands: HitHands { - armor = 4; //8; - passThrough = 0.85; //0.5; - /*explosionShielding = 0.8;*/ - }; - - class HitLegs: HitLegs { - armor = 4; //8; - passThrough = 0.85; //0.5; - /*explosionShielding = 0.8;*/ - }; - }; - - /*armor = 2; - armorStructural = 5;*/ -}; - -class O_officer_F: O_Soldier_base_F { - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; - - class HitBody: HitBody { - /*armor = 2; - passThrough = 1; - explosionShielding = 10;*/ - }; - - class HitHands: HitHands { - /*armor = 2; - passThrough = 1; - explosionShielding = 1;*/ - }; - - class HitLegs: HitLegs { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1;*/ - }; - }; -}; - -class O_Soldier_02_F: O_Soldier_base_F { // crew ? - armorStructural = 5; //3; - - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; - - class HitBody: HitBody { - armor = 4; //6; - passThrough = 0.85; //0.5; - /*explosionShielding = 1.5;*/ - }; - - class HitHands: HitHands { - armor = 4; //8; - passThrough = 0.85; //1; - /*explosionShielding = 0.8;*/ - }; - - class HitLegs: HitLegs { - armor = 4; //8; - passThrough = 0.85; //1; - /*explosionShielding = 0.8;*/ - }; - }; -}; - -class O_Soldier_diver_base_F: O_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 2; - }; - - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 2; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - };*/ -}; - -class O_Soldier_VR_F: O_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - passThrough = 1; - explosionShielding = 0.5; - }; - - class HitBody: HitBody { - armor = 2; - passThrough = 1; - explosionShielding = 10; - }; - - class HitHands: HitHands { - armor = 2; - passThrough = 1; - explosionShielding = 1; - }; - - class HitLegs: HitLegs { - armor = 2; - passThrough = 1; - explosionShielding = 1; - }; - };*/ -}; - -class O_Protagonist_VR_F: O_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - passThrough = 1; - explosionShielding = 0.5; - }; - - class HitBody: HitBody { - armor = 2; - passThrough = 1; - explosionShielding = 10; - }; - - class HitHands: HitHands { - armor = 2; - passThrough = 1; - explosionShielding = 1; - }; - - class HitLegs: HitLegs { - armor = 2; - passThrough = 1; - explosionShielding = 1; - }; - };*/ -}; diff --git a/addons/rangecard/stringtable.xml b/addons/rangecard/stringtable.xml index 7e93df20d5..213c903f60 100644 --- a/addons/rangecard/stringtable.xml +++ b/addons/rangecard/stringtable.xml @@ -9,6 +9,7 @@ Entfernungsspinne Tabela de distâncias Table de tir + Távolsági kártya 50 METER increments -- MRAD/MRAD (reticle/turrets) @@ -18,6 +19,7 @@ 50-Meter-Schritte MRAD/MRAD (Fadenkreuz/Geschützturm) Incrementos de 50 METROS - MRAD/MRAD (retícula/torres) Intervalle 50 mètres -- millième/millième (réticule/tambours) + 50 MÉTERES lépések - MRAD/MRAD (célzó/lövegek) Open Range Card @@ -27,6 +29,7 @@ Öffne Entfernungsspinne Abrir tabela de distâncias Afficher table de tir + Távolsági kártya kinyitása Open Range Card Copy @@ -36,6 +39,7 @@ Öffne Kopie der Entfernungsspinne Abrir cópia da tabela de distâncias Afficher table de tir copiée + Távolsági kártya-másolat kinyitása Open Range Card @@ -45,6 +49,7 @@ Öffne Entfernungsspinne Abrir tabela de distäncias Afficher table de tir + Távolsági kártya kinyitása Open Range Card Copy @@ -54,6 +59,7 @@ Öffne Kopie der Entfernungsspinne Abrir cópia da tabela de distâncias Afficher table de tir copiée + Távolsági kártya-másolat kinyitása Copy Range Card @@ -63,6 +69,7 @@ Kopiere Entfernungsspinne Copiar tabela de distäncias Copier table de tir + Távolsági kártya másolása - \ No newline at end of file + diff --git a/addons/realisticnames/CfgVehicles.hpp b/addons/realisticnames/CfgVehicles.hpp index aef52578e2..c3288815dd 100644 --- a/addons/realisticnames/CfgVehicles.hpp +++ b/addons/realisticnames/CfgVehicles.hpp @@ -633,4 +633,12 @@ class CfgVehicles { class Weapon_MMG_02_sand_F: Weapon_Base_F { displayName = CSTRING(MMG_02_sand); };*/ + + //attachments + + class Item_Base_F; + + class Item_acc_flashlight: Item_Base_F { + displayName="UTG Defender 126"; + }; }; diff --git a/addons/realisticnames/CfgWeapons.hpp b/addons/realisticnames/CfgWeapons.hpp index 0a83239047..83534a1083 100644 --- a/addons/realisticnames/CfgWeapons.hpp +++ b/addons/realisticnames/CfgWeapons.hpp @@ -1,4 +1,4 @@ - +class Mode_SemiAuto; class Mode_FullAuto; class CfgWeapons { @@ -510,14 +510,14 @@ class CfgWeapons { class player: player {}; }; - class cannon_105mm: cannon_120mm { + class cannon_105mm: CannonCore { displayName = "M68"; - class player: player { + class player: Mode_SemiAuto { displayName = "M68"; }; }; - class cannon_125mm: cannon_120mm { + class cannon_125mm: CannonCore { displayName = "2A46"; }; @@ -568,4 +568,12 @@ class CfgWeapons { displayName = "L21A1 RARDEN"; }; }; + + //attachments + + class Itemcore; + + class acc_flashlight: ItemCore { + displayName = "UTG Defender 126"; + }; }; diff --git a/addons/repair/ACE_Repair.hpp b/addons/repair/ACE_Repair.hpp index c12566d5b1..219945003d 100644 --- a/addons/repair/ACE_Repair.hpp +++ b/addons/repair/ACE_Repair.hpp @@ -31,7 +31,7 @@ class ACE_Repair { class MiscRepair: ReplaceWheel { displayName = CSTRING(Repairing); // let's make empty string an auto generated string displayNameProgress = CSTRING(RepairingHitPoint); - condition = QUOTE((_target getHitPointDamage _hitPoint) > ([_caller] call FUNC(getPostRepairDamage))); + condition = QUOTE(call FUNC(canMiscRepair)); requiredEngineer = 0; repairingTime = 15; callbackSuccess = QUOTE(call FUNC(doRepair)); @@ -63,7 +63,7 @@ class ACE_Repair { requiredEngineer = QGVAR(engineerSetting_fullRepair); repairLocations[] = {QGVAR(fullRepairLocation)}; repairingTime = 30; - condition = "damage (_this select 1) > 0"; + condition = "damage _target > 0"; callbackSuccess = QUOTE(call FUNC(doFullRepair)); }; }; diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp index 7c465f50ce..27e8890dbc 100644 --- a/addons/repair/CfgVehicles.hpp +++ b/addons/repair/CfgVehicles.hpp @@ -10,6 +10,7 @@ priority = 2; \ icon = "\A3\ui_f\data\igui\cfg\actions\repair_ca.paa"; \ distance = 4; \ + exceptions[] = {"isNotOnLadder"}; \ }; \ }; \ }; @@ -285,7 +286,10 @@ class CfgVehicles { transportRepair = 0; }; - class Heli_Transport_04_base_F; + class Helicopter_Base_H; + class Heli_Transport_04_base_F: Helicopter_Base_H { + GVAR(hitpointGroups[]) = { {"HitEngine", {"HitEngine1", "HitEngine2"}}, {"Glass_1_hitpoint", {"Glass_2_hitpoint", "Glass_3_hitpoint", "Glass_4_hitpoint", "Glass_5_hitpoint", "Glass_6_hitpoint", "Glass_7_hitpoint", "Glass_8_hitpoint", "Glass_9_hitpoint", "Glass_10_hitpoint", "Glass_11_hitpoint", "Glass_12_hitpoint", "Glass_13_hitpoint", "Glass_14_hitpoint", "Glass_15_hitpoint", "Glass_16_hitpoint", "Glass_17_hitpoint", "Glass_18_hitpoint", "Glass_19_hitpoint", "Glass_20_hitpoint"}} }; + }; class O_Heli_Transport_04_repair_F: Heli_Transport_04_base_F { GVAR(canRepair) = 1; transportRepair = 0; @@ -303,12 +307,19 @@ class CfgVehicles { transportRepair = 0; }; - class Offroad_01_base_F; + class Car_F; + class Offroad_01_base_F: Car_F { + GVAR(hitpointGroups[]) = { {"HitGlass1", {"HitGlass2"}} }; + }; class Offroad_01_repair_base_F: Offroad_01_base_F { GVAR(canRepair) = 1; transportRepair = 0; }; + class MRAP_01_base_F: Car_F { + GVAR(hitpointGroups[]) = { {"HitGlass1", {"HitGlass2", "HitGlass3", "HitGlass4", "HitGlass5", "HitGlass6"}} }; + }; + class B_Truck_01_mover_F; class B_Truck_01_Repair_F: B_Truck_01_mover_F { GVAR(canRepair) = 1; @@ -334,4 +345,9 @@ class CfgVehicles { GVAR(canRepair) = 1; transportRepair = 0; }; + + class Quadbike_01_base_F; + class B_Quadbike_01_F: Quadbike_01_base_F { + GVAR(hitpointPositions[]) = { {"HitEngine", {0, 0.5, -0.7}}, {"HitFuel", {0, 0, -0.5}} }; + }; }; diff --git a/addons/repair/XEH_preInit.sqf b/addons/repair/XEH_preInit.sqf index ebf4c87537..8d2f1d8497 100644 --- a/addons/repair/XEH_preInit.sqf +++ b/addons/repair/XEH_preInit.sqf @@ -3,6 +3,7 @@ ADDON = false; PREP(addRepairActions); +PREP(canMiscRepair); PREP(canRemove); PREP(canRepair); PREP(canRepairTrack); @@ -15,6 +16,7 @@ PREP(doRepair); PREP(doRepairTrack); PREP(doReplaceTrack); PREP(doReplaceWheel); +PREP(getHitPointString); PREP(getPostRepairDamage); PREP(getWheelHitPointsWithSelections); PREP(hasItems); diff --git a/addons/repair/functions/fnc_addRepairActions.sqf b/addons/repair/functions/fnc_addRepairActions.sqf index 3503dff3f0..b76f027bb0 100644 --- a/addons/repair/functions/fnc_addRepairActions.sqf +++ b/addons/repair/functions/fnc_addRepairActions.sqf @@ -14,7 +14,6 @@ * Public: No */ #include "script_component.hpp" -#define TRACK_HITPOINTS ["HitLTrack", "HitRTrack"] params ["_vehicle"]; TRACE_1("params", _vehicle); @@ -27,17 +26,18 @@ _initializedClasses = GETMVAR(GVAR(initializedClasses),[]); // do nothing if the class is already initialized if (_type in _initializedClasses) exitWith {}; -// get all hitpoints -private "_hitPoints"; -_hitPoints = [_vehicle] call EFUNC(common,getHitPointsWithSelections) select 0; + +// get all hitpoints and selections +([_vehicle] call EFUNC(common,getHitPointsWithSelections)) params ["_hitPoints", "_hitPointsSelections"]; // get hitpoints of wheels with their selections -private ["_wheelHitPointsWithSelections", "_wheelHitPoints", "_wheelHitPointSelections"]; +([_vehicle] call FUNC(getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitPointSelections"]; -_wheelHitPointsWithSelections = [_vehicle] call FUNC(getWheelHitPointsWithSelections); -_wheelHitPoints = _wheelHitPointsWithSelections select 0; -_wheelHitPointSelections = _wheelHitPointsWithSelections select 1; +private ["_hitPointsAddedNames", "_hitPointsAddedStrings", "_hitPointsAddedAmount"]; +_hitPointsAddedNames = []; +_hitPointsAddedStrings = []; +_hitPointsAddedAmount = []; // add repair events to this vehicle class { @@ -55,7 +55,7 @@ _wheelHitPointSelections = _wheelHitPointsWithSelections select 1; // remove wheel action _name = format ["Remove_%1", _x]; - _text = localize "STR_ACE_Repair_RemoveWheel"; + _text = localize LSTRING(RemoveWheel); _condition = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(canRepair)}; _statement = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(repair)}; @@ -78,25 +78,69 @@ _wheelHitPointSelections = _wheelHitPointsWithSelections select 1; // exit if the hitpoint is in the blacklist, e.g. glasses if (_x in IGNORED_HITPOINTS) exitWith {}; + private ["_hitpointGroupConfig", "_inHitpointSubGroup", "_currentHitpoint"]; + + // Get hitpoint groups if available + _hitpointGroupConfig = configFile >> "CfgVehicles" >> _type >> QGVAR(hitpointGroups); + _inHitpointSubGroup = false; + if (isArray _hitpointGroupConfig) then { + // Set variable if current hitpoint is in a sub-group (to be excluded from adding action) + _currentHitpoint = _x; + { + { + if (_x == _currentHitpoint) exitWith { + _inHitpointSubGroup = true; + }; + } forEach (_x select 1); + } forEach (getArray _hitpointGroupConfig); + }; + + // Exit if current hitpoint is in sub-group (only main hitpoints get actions) + if (_inHitpointSubGroup) exitWith {}; + // exit if the hitpoint is virtual if (isText (configFile >> "CfgVehicles" >> _type >> "HitPoints" >> _x >> "depends")) exitWith {}; // add misc repair action - - private ["_name", "_text", "_icon", "_selection", "_condition", "_statement"]; + private ["_name", "_icon", "_selection", "_condition", "_statement"]; _name = format ["Repair_%1", _x]; - _text = format ["STR_ACE_Repair_%1", _x]; - - if (isLocalized _text) then { - _text = format [localize LSTRING(RepairHitpoint), localize _text]; - } else { - _text = format [localize LSTRING(RepairHitpoint), _x]; - }; + // Find localized string and track those added for numerization + ([_x, "%1", _x, [_hitPointsAddedNames, _hitPointsAddedStrings, _hitPointsAddedAmount]] call FUNC(getHitPointString)) params ["_text", "_trackArray"]; + _hitPointsAddedNames = _trackArray select 0; + _hitPointsAddedStrings = _trackArray select 1; + _hitPointsAddedAmount = _trackArray select 2; _icon = "A3\ui_f\data\igui\cfg\actions\repair_ca.paa"; + _selection = ""; + + // Get custom position if available + _customSelectionsConfig = configFile >> "CfgVehicles" >> _type >> QGVAR(hitpointPositions); + if (isArray _customSelectionsConfig) then { + // Loop through custom hitpoint positions array + _currentHitpoint = _x; + { + _x params ["_hitpoint", "_position"]; + // Exit with supplied custom position when same hitpoint name found or print RPT error if it's invalid + if (_hitpoint == _currentHitpoint) exitWith { + if (typeName _position == "ARRAY") exitWith { + _selection = _position; // Position in model space + }; + if (typeName _position == "STRING") exitWith { + _selection = _vehicle selectionPosition _position; // Selection name + }; + diag_log text format ["[ACE] ERROR: Invalid custom position %1 of hitpoint %2 in vehicle %3", _position, _hitpoint, _vehicle]; + }; + } forEach (getArray _customSelectionsConfig); + }; + + // If position still empty (not a position array or selection name) try extracting from model + if (typeName _selection == "STRING" && {_selection == ""}) then { + _selection = _vehicle selectionPosition (_hitPointsSelections select (_hitPoints find _x)); + }; + _condition = {[_this select 1, _this select 0, _this select 2 select 0, _this select 2 select 1] call DFUNC(canRepair)}; _statement = {[_this select 1, _this select 0, _this select 2 select 0, _this select 2 select 1] call DFUNC(repair)}; @@ -112,7 +156,12 @@ _wheelHitPointSelections = _wheelHitPointsWithSelections select 1; } else { private "_action"; _action = [_name, _text, _icon, _statement, _condition, {}, [_x, "MiscRepair"], _selection, 4] call EFUNC(interact_menu,createAction); - [_type, 0, ["ACE_MainActions", QGVAR(Repair)], _action] call EFUNC(interact_menu,addActionToClass); + // Put inside main actions if no other position was found above + if (_selection isEqualTo [0, 0, 0]) then { + [_type, 0, ["ACE_MainActions", QGVAR(Repair)], _action] call EFUNC(interact_menu,addActionToClass); + } else { + [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); + }; }; }; } forEach _hitPoints; diff --git a/addons/repair/functions/fnc_canMiscRepair.sqf b/addons/repair/functions/fnc_canMiscRepair.sqf new file mode 100644 index 0000000000..c60e59c840 --- /dev/null +++ b/addons/repair/functions/fnc_canMiscRepair.sqf @@ -0,0 +1,54 @@ +/* + * Author: Jonpas + * Check if misc repair action can be done, called from callbackSuccess. + * + * Arguments: + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 2: Selected hitpoint + * + * Return Value: + * Can Misc Repair + * + * Example: + * [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_canMiscRepair + * + * Public: No + */ +#include "script_component.hpp" + +private ["_hitpointGroupConfig", "_hitpointGroup", "_postRepairDamage", "_return"]; +params ["_caller", "_target", "_hitPoint"]; + +// Get hitpoint groups if available +_hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hitpointGroups); +_hitpointGroup = []; +if (isArray _hitpointGroupConfig) then { + // Retrieve hitpoint subgroup if current hitpoint is main hitpoint of a group + { + // Exit using found hitpoint group if this hitpoint is leader of any + if (_x select 0 == _hitPoint) exitWith { + _hitpointGroup = _x select 1; + }; + } forEach (getArray _hitpointGroupConfig); +}; + +// Add current hitpoint to the group +_hitpointGroup pushBack _hitPoint; + +// Get post repair damage +_postRepairDamage = [_caller] call FUNC(getPostRepairDamage); + +// Return true if damage can be repaired on any hitpoint in the group, else false +_return = false; +{ + if ((_target getHitPointDamage _x) > _postRepairDamage) exitWith { + _return = true; + }; +} forEach _hitpointGroup; + +if (typeOf _target == "B_MRAP_01_F") then { + diag_log format ["%1 - %2", _hitPoint, _hitpointGroup]; +}; + +_return diff --git a/addons/repair/functions/fnc_canRepairTrack.sqf b/addons/repair/functions/fnc_canRepairTrack.sqf index 34165068d7..806fa14b2e 100644 --- a/addons/repair/functions/fnc_canRepairTrack.sqf +++ b/addons/repair/functions/fnc_canRepairTrack.sqf @@ -30,7 +30,7 @@ if (typeName _wheel == "OBJECT") then { _wheel = objNull; { - if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { _wheel = _x; }; } forEach nearestObjects [_unit, ["ACE_Track"], 5]; diff --git a/addons/repair/functions/fnc_canReplaceTrack.sqf b/addons/repair/functions/fnc_canReplaceTrack.sqf index 94a62a5289..3f4ae77581 100644 --- a/addons/repair/functions/fnc_canReplaceTrack.sqf +++ b/addons/repair/functions/fnc_canReplaceTrack.sqf @@ -31,7 +31,7 @@ if (typeName _track == "OBJECT") then { _track = objNull; { - if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { _track = _x; }; } forEach nearestObjects [_unit, ["ACE_Track"], 5]; diff --git a/addons/repair/functions/fnc_canReplaceWheel.sqf b/addons/repair/functions/fnc_canReplaceWheel.sqf index 9497504370..e0a2fbbed2 100644 --- a/addons/repair/functions/fnc_canReplaceWheel.sqf +++ b/addons/repair/functions/fnc_canReplaceWheel.sqf @@ -37,7 +37,7 @@ if (typeName _wheel == "OBJECT") then { _wheel = objNull; { - if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { _wheel = _x; }; } forEach nearestObjects [_unit, ["ACE_Wheel"], 5]; diff --git a/addons/repair/functions/fnc_doRepair.sqf b/addons/repair/functions/fnc_doRepair.sqf index dfc21830c9..1cf3f77bca 100644 --- a/addons/repair/functions/fnc_doRepair.sqf +++ b/addons/repair/functions/fnc_doRepair.sqf @@ -17,11 +17,11 @@ */ #include "script_component.hpp" +private ["_hitPointDamage", "_text", "_hitpointGroup"]; params ["_unit", "_vehicle", "_hitPoint"]; TRACE_3("params",_unit,_vehicle,_hitPoint); // get current hitpoint damage -private "_hitPointDamage"; _hitPointDamage = _vehicle getHitPointDamage _hitPoint; _hitPointDamage = _hitPointDamage - 0.5; @@ -31,16 +31,36 @@ _hitPointDamage = _hitPointDamage max ([_unit] call FUNC(getPostRepairDamage)); // raise event to set the new hitpoint damage ["setVehicleHitPointDamage", _vehicle, [_vehicle, _hitPoint, _hitPointDamage]] call EFUNC(common,targetEvent); +// Get hitpoint groups if available +_hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(hitpointGroups); +_hitpointGroup = []; +if (isArray _hitpointGroupConfig) then { + // Retrieve group if current hitpoint is leader of any + { + if (_x select 0 == _hitPoint) exitWith { + ([_vehicle] call EFUNC(common,getHitPointsWithSelections)) params ["_hitpoints"]; + // Set all sub-group hitpoints' damage to 0, if a hitpoint is invalid print RPT error + { + if (_x in _hitpoints) then { + ["setVehicleHitPointDamage", _vehicle, [_vehicle, _x, 0]] call EFUNC(common,targetEvent); + } else { + diag_log text format ["[ACE] ERROR: Invalid hitpoint %1 in hitpointGroups of %2", _x, _vehicle]; + }; + + } forEach (_x select 1); + }; + } forEach (getArray _hitpointGroupConfig); +}; + // display text message if enabled if (GVAR(DisplayTextOnRepair)) then { - private "_text"; - _text = format ["STR_ACE_Repair_%1", _hitPoint]; + private ["_textLocalized", "_textDefault"]; - if (isLocalized _text) then { - _text = format [localize ([LSTRING(RepairedHitPointFully), LSTRING(RepairedHitPointPartially)] select (_hitPointDamage > 0)), localize _text]; - } else { - _text = localize ([LSTRING(RepairedFully), LSTRING(RepairedPartially)] select (_hitPointDamage > 0)); - }; + // Find localized string + _textLocalized = localize ([LSTRING(RepairedHitPointFully), LSTRING(RepairedHitPointPartially)] select (_hitPointDamage > 0)); + _textDefault = localize ([LSTRING(RepairedFully), LSTRING(RepairedPartially)] select (_hitPointDamage > 0)); + ([_hitPoint, _textLocalized, _textDefault] call FUNC(getHitPointString)) params ["_text"]; + // Display text [_text] call EFUNC(common,displayTextStructured); }; diff --git a/addons/repair/functions/fnc_doRepairTrack.sqf b/addons/repair/functions/fnc_doRepairTrack.sqf index 4803518e3d..de04e71920 100644 --- a/addons/repair/functions/fnc_doRepairTrack.sqf +++ b/addons/repair/functions/fnc_doRepairTrack.sqf @@ -27,7 +27,7 @@ private ["_hitPointDamage", "_newDamage", "_wheel"]; _wheel = objNull; { - if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { _wheel = _x; }; } forEach nearestObjects [_unit, ["ACE_Track"], 5]; diff --git a/addons/repair/functions/fnc_doReplaceTrack.sqf b/addons/repair/functions/fnc_doReplaceTrack.sqf index 13e53b3f3a..a95a669159 100644 --- a/addons/repair/functions/fnc_doReplaceTrack.sqf +++ b/addons/repair/functions/fnc_doReplaceTrack.sqf @@ -27,7 +27,7 @@ private["_hitPointDamage", "_wheel"]; _wheel = objNull; { - if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { _wheel = _x; }; } forEach nearestObjects [_unit, ["ACE_Track"], 5]; diff --git a/addons/repair/functions/fnc_doReplaceWheel.sqf b/addons/repair/functions/fnc_doReplaceWheel.sqf index 62db39aa6d..f10712d65d 100644 --- a/addons/repair/functions/fnc_doReplaceWheel.sqf +++ b/addons/repair/functions/fnc_doReplaceWheel.sqf @@ -27,7 +27,7 @@ private ["_hitPointDamage", "_wheel"]; _wheel = objNull; { - if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { _wheel = _x; }; } forEach nearestObjects [_unit, ["ACE_Wheel"], 5]; diff --git a/addons/repair/functions/fnc_getHitPointString.sqf b/addons/repair/functions/fnc_getHitPointString.sqf new file mode 100644 index 0000000000..1358e99595 --- /dev/null +++ b/addons/repair/functions/fnc_getHitPointString.sqf @@ -0,0 +1,89 @@ +/* + * Author: Jonpas + * Finds the localized string of the given hitpoint name or uses default text if none found. + * + * Arguments: + * 0: Hitpoint + * 1: Localized Text + * 2: Default Text + * 3: Track Added Hitpoints (default: false) + * + * Return Value: + * 0: Text + * 1: Added Hitpoint (default: []) + * + * Example: + * [unit, vehicle, "hitpoint"] call ace_repair_fnc_getHitPointString + * + * Public: No + */ +#include "script_component.hpp" + +private ["_track", "_trackNames", "_trackStrings", "_trackAmount", "_text", "_toFind", "_trackIndex", "_combinedString"]; +params ["_hitPoint", "_textLocalized", "_textDefault", ["_trackArray", []]]; + +_track = if (count _trackArray > 0) then {true} else {false}; +_trackNames = []; +_trackStrings = []; +_trackAmount = []; + +if (_track) then { + _trackNames = _trackArray select 0; + _trackStrings = _trackArray select 1; + _trackAmount = _trackArray select 2; +}; + +// Prepare first part of the string from stringtable +_text = LSTRING(Hit); + +// Remove "Hit" from hitpoint name if one exists +_toFind = if (_hitPoint find "Hit" == 0) then { + [_hitPoint, 3] call CBA_fnc_substr +} else { + _hitPoint +}; + +// Loop through always shorter part of the hitpoint name to find the string from stringtable +for "_i" from 0 to (count _hitPoint) do { + if (_track) then { + // Loop through already added hitpoints and save index + _trackIndex = -1; + { + if (_x == _toFind) exitWith { + _trackIndex = _forEachIndex; + }; + } forEach _trackNames; + + // Use already added hitpoint if one found above and numerize + if (_trackIndex != -1) exitWith { + _text = localize (_trackStrings select _trackIndex) + " " + str(_trackAmount select _trackIndex); + _trackAmount set [_trackIndex, (_trackAmount select _trackIndex) + 1]; // Set amount + TRACE_2("Same hitpoint found",_toFind,_trackNames); + }; + }; + + + // Localize if localization found + _combinedString = _text + _toFind; + if (isLocalized _combinedString) exitWith { + _text = format [_textLocalized, localize _combinedString]; + TRACE_1("Hitpoint localized",_toFind); + + if (_track) then { + // Add hitpoint to the list + _trackNames pushBack _toFind; + _trackStrings pushBack _combinedString; + _trackAmount pushBack 2; + }; + }; + + // Cut off one character + _toFind = [_toFind, 0, count _toFind - 1] call CBA_fnc_substr; +}; + +// Don't display part name if no string is found in stringtable +if (_text == LSTRING(Hit)) then { + _text = _textDefault; +}; + +[_text, [_trackNames, _trackStrings, _trackAmount]] diff --git a/addons/repair/functions/fnc_repair.sqf b/addons/repair/functions/fnc_repair.sqf index 92af5df80e..4fa1c2d903 100644 --- a/addons/repair/functions/fnc_repair.sqf +++ b/addons/repair/functions/fnc_repair.sqf @@ -164,14 +164,10 @@ _repairTime = if (isNumber (_config >> "repairingTime")) then { 0; }; -private ["_text", "_processText"]; +private ["_processText"]; +// Find localized string _processText = getText (_config >> "displayNameProgress"); -_text = format ["STR_ACE_Repair_%1", _hitPoint]; -if (isLocalized _text) then { - _text = format [_processText, localize _text]; -} else { - _text = _processText; -}; +([_hitPoint, _processText, _processText] call FUNC(getHitPointString)) params ["_text"]; // Start repair [ @@ -181,7 +177,7 @@ if (isLocalized _text) then { DFUNC(repair_failure), _text, _callbackProgress, - [] + ["isNotOnLadder"] ] call EFUNC(common,progressBar); // Display Icon diff --git a/addons/repair/script_component.hpp b/addons/repair/script_component.hpp index 23c52bdec8..89983dd0e8 100644 --- a/addons/repair/script_component.hpp +++ b/addons/repair/script_component.hpp @@ -12,5 +12,5 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define IGNORED_HITPOINTS ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitGlass7","HitGlass8","HitGlass9","HitGlass10","HitGlass11","HitGlass12","HitGlass13","HitGlass14","HitGlass15","HitRGlass","HitLGlass"] -// #define TRACK_HITPOINTS ["HitLTrack", "HitRTrack"]; +#define IGNORED_HITPOINTS ["HitGlass1", "HitGlass2", "HitGlass3", "HitGlass4", "HitGlass5", "HitGlass6", "HitGlass7", "HitGlass8", "HitGlass9", "HitGlass10", "HitGlass11", "HitGlass12", "HitGlass13", "HitGlass14", "HitGlass15", "HitRGlass", "HitLGlass", "Glass_1_hitpoint", "Glass_2_hitpoint", "Glass_3_hitpoint", "Glass_4_hitpoint", "Glass_5_hitpoint", "Glass_6_hitpoint", "Glass_7_hitpoint", "Glass_8_hitpoint", "Glass_9_hitpoint", "Glass_10_hitpoint", "Glass_11_hitpoint", "Glass_12_hitpoint", "Glass_13_hitpoint", "Glass_14_hitpoint", "Glass_15_hitpoint", "Glass_16_hitpoint", "Glass_17_hitpoint", "Glass_18_hitpoint", "Glass_19_hitpoint", "Glass_20_hitpoint"] +#define TRACK_HITPOINTS ["HitLTrack", "HitRTrack"] diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index 48a40f5b49..09759344f8 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -118,18 +118,6 @@ Who can perform a full repair on a vehicle? Kto może przeprowadzić pełną naprawę pojazdu? - - Repair %1 - Reparieren %1 - Reparación %1 - Réparer %1 - Napraw %1 - Opravit %1 - Reparar %1 - Ripara %1 - Szerelés %1 - Ремонт %1 - Repair >> Reparieren >> @@ -242,6 +230,15 @@ Motor Двигатель + + Left Horizontal Stabilizer + + + Right Horizontal Stabilizer + + + Vertical Stabilizer + Fuel Tank Tank @@ -254,15 +251,36 @@ Üzemanyagtank Топливный бак + + Transmission + + + Gear + + + Starter + + + Tail + + + Pilot Tube + + + Static Port + + + Ammo + - Main Turret + Turret Turm - Torreta príncipal + Torreta Tourelle Wieżyczka - Hlavní Věž - Torre principal - Torretta principale + Věž + Torre + Torretta Lövegtorony Башню @@ -278,6 +296,9 @@ Ágyú Пушку + + Missiles + Left Track Linke Kette @@ -463,77 +484,17 @@ Bal szélvédő Стекло (слава) - - Glass 1 - Scheibe 1 - Ventana 1 - Vitre 1 - Szyba 1 - Sklo 1 - Vidro 1 - Vetro 1 - Üveg 1 - Стекло 1 - - - Glass 2 - Scheibe 2 - Ventana 2 - Vitre 2 - Szyba 2 - Sklo 2 - Vidro 2 - Vetro 2 - Üveg 2 - Стекло 2 - - - Glass 3 - Scheibe 3 - Ventana 3 - Vitre 3 - Szyba 3 - Sklo 3 - Vidro 3 - Vetro 3 - Üveg 3 - Стекло 3 - - - Glass 4 - Scheibe 4 - Ventana 4 - Vitre 4 - Szyba 4 - Sklo 4 - Vidro 4 - Vetro 4 - Üveg 4 - Стекло 4 - - - Glass 5 - Scheibe 5 - Ventana 5 - Vitre 5 - Szyba 5 - Sklo 5 - Vidro 5 - Vetro 5 - Üveg 5 - Стекло 5 - - - Glass 6 - Scheibe 6 - Ventana 6 - Vitre 6 - Szyba 6 - Sklo 6 - Vidro 6 - Vetro 6 - Üveg 6 - Стекло 6 + + Glass + Scheibe + Ventana + Vitre + Szyba + Sklo + Vidro + Vetro + Üveg + Стекло Repair Settings @@ -696,4 +657,4 @@ Przydziel klasę budynku naprawczego do jednego lub kilku budynków. - \ No newline at end of file + diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml index 4b649173f0..99d189ca50 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -152,6 +152,7 @@ Respawn-System Systém znovuzrození Sistema de Renascimento + Respawn-rendszer Save Gear? @@ -160,6 +161,7 @@ Ausrüstung speichern? Uložit výbavu? Salvar equipamento? + Felszerelés elmentése? Respawn with the gear a soldier had just before his death? @@ -168,6 +170,7 @@ Mit der Ausrüstung, die ein Soldat vor seinem Tod hatte, respawnen? Znovuubjevit s výbavou kterou měl voják před smrtí? Renascer com o equipamento que um soldado tinha antes de sua morte? + Az egység halála előtti felszerelésével való respawnolása? Remove bodies? @@ -176,6 +179,7 @@ Körper entfernen? Odstranit těla? Remover corpos? + Holttestek eltávolítása? Remove player bodies after disconnect? @@ -184,9 +188,9 @@ Entferne Spielerkörper nach dem Trennen einer Verbindung? Odstranit hráčova těla po odpojení? Remover corpos dos jogadores depois de desconectar? + Játékosi testek eltávolítása távozás után? - Moduł ten pozwala dostosować ustawienia odrodzenia (respawnu). Dieses Modul erlaubt es die Respawn-Einstellungen anzupassen. Tento modul umožňuje nastavení znovuzrození (spawn). @@ -199,9 +203,9 @@ Freundbeschuss-Nachrichten Upozornění na přátelskou střelbu Mensagens de fogo amigo + Baráti tűz üzenetek - Użycie tego modułu na misji spowoduje wyświetlenie wiadomości na czacie w przypadku, kiedy zostanie popełniony friendly fire - wyświetlona zostanie wtedy wiadomość kto kogo zabił. Zobrazí zprávu v chatu v případě, když budete střílet na vlastní jednotky. Ve zprávě se zobrazí kdo na koho střílel, popř. kdo koho zabil. Usando este módulo em uma missão para exibir mensagens chat, no caso de quando você faz um fogo amigo - então a mensagem será exibida mostrando quem matou quem. @@ -213,9 +217,9 @@ Rallypoint-System Systém shromáždění Sistema de ponto de encontro + Gyülekezőpont-rendszer - Moduł ten pozwala zastosować na misji "punkt zbiórki", do którego można szybko przeteleportować się z "bazy". Wymaga postawienia odpowiednich obiektów na mapie - bazy oraz flagi. Obydwa dostępne są w kategorii Puste -> ACE Odrodzenie. Tento modul umožňuje určit místo shromaždiště, kam se mohou jednokty rychle teleportovat ze "základny". Toto vyžaduje vhodné objekty v mapě - základna a vlajka. Oba dva můžete najít v kategorii Prázdné -> ACE Oživení. Este módulo permite que você aplique em uma missão "pontos de encontro", que pode rapidamente se teletransportar para a "base". Ele requer colocar objetos apropriados no mapa - base e bandeiras. Ambos estão disponíveis na categoria em branco -> ACE Revival. @@ -227,6 +231,7 @@ Bewege Rallypoint Přesun na shromaždiště Mover para ponto de encontro + Gyülekezőpont mozgatása ACE Respawn @@ -235,6 +240,7 @@ ACE-Respawn ACE Znovuzrození ACE Respawn + ACE Respawn \ No newline at end of file diff --git a/addons/sitting/CfgMoves.hpp b/addons/sitting/CfgMoves.hpp index fc902032e2..5cef0fbc6d 100644 --- a/addons/sitting/CfgMoves.hpp +++ b/addons/sitting/CfgMoves.hpp @@ -1,6 +1,9 @@ // Enable visual head movement while free-looking #define MACRO_ANIMATION \ - head = "headDefault"; + head = "headDefault"; \ + aimingBody = "aimingNo"; \ + forceAim = 1; \ + static = 1; class CfgMovesBasic; class CfgMovesMaleSdr: CfgMovesBasic { diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index 0c6825ed58..e0692af951 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -private ["_configFile", "_sitDirection", "_sitPosition", "_sitRotation", "_sitDirectionVisual"]; +private ["_actionID", "_configFile", "_sitDirection", "_sitPosition", "_sitRotation", "_sitDirectionVisual"]; params ["_seat", "_player"]; @@ -26,6 +26,26 @@ GVAR(seat) = _seat; // Overwrite weird position, because Arma decides to set it differently based on current animation/stance... _player switchMove "amovpknlmstpsraswrfldnon"; +// add scrollwheel action to release object +_actionID = _player getVariable [QGVAR(StandUpActionID), -1]; + +if (_actionID != -1) then { + _player removeAction _actionID; +}; + +_actionID = _player addAction [ + format ["%1", localize LSTRING(Stand)], + QUOTE((_this select 0) call FUNC(stand)), + nil, + 20, + false, + true, + "GetOut", + QUOTE(_this call FUNC(canStand)) +]; + +_player setVariable [QGVAR(StandUpActionID), _actionID]; + // Read config _configFile = configFile >> "CfgVehicles" >> typeOf _seat; _sitDirection = (getDir _seat) + getNumber (_configFile >> QGVAR(sitDirection)); diff --git a/addons/sitting/functions/fnc_stand.sqf b/addons/sitting/functions/fnc_stand.sqf index 978bcaf279..ef19d5f586 100644 --- a/addons/sitting/functions/fnc_stand.sqf +++ b/addons/sitting/functions/fnc_stand.sqf @@ -17,8 +17,19 @@ params ["_player"]; +// remove scroll wheel action +_player removeAction (_player getVariable [QGVAR(StandUpActionID), -1]); + // Restore animation -[_player, "", 2] call EFUNC(common,doAnimation); +private "_animation"; +_animation = switch (currentWeapon _player) do { + case "": {"amovpercmstpsnonwnondnon"}; + case (primaryWeapon _player): {"amovpercmstpslowwrfldnon"}; + case (handgunWeapon _player): {"amovpercmstpslowwpstdnon"}; + default {"amovpercmstpsnonwnondnon"}; +}; + +[_player, _animation, 2] call EFUNC(common,doAnimation); // Set variables to nil _player setVariable [QGVAR(isSitting), nil]; diff --git a/addons/sitting/stringtable.xml b/addons/sitting/stringtable.xml index 443c34c360..e26c2b36f0 100644 --- a/addons/sitting/stringtable.xml +++ b/addons/sitting/stringtable.xml @@ -7,6 +7,7 @@ Sentar Sednout si Sentarse + Leülés Stand Up @@ -14,6 +15,7 @@ Levantar Vstát Levantarse + Felállás Enable Sitting @@ -21,6 +23,7 @@ Aktywuj siadanie Povolit sezení Acivar asiento + Ülés engedélyezése Sitting @@ -28,6 +31,7 @@ Siadanie Sedící Sentarse + Ülés This module allows you to disable the ability to sit on chairs and toilets. @@ -35,6 +39,7 @@ Moduł ten pozwala na włączenie lub wyłączenie możliwości siadania na krzesłach i toaletach. Tento modul dovoluje zakázat možnost sedět na židlých a toaletách. Este módulo te permite desactivar la capacidad de sentarte en sillas y aseos. + Ez a modul lehetővé teszi a székekre és toalettekre való leülés letiltását. \ No newline at end of file diff --git a/addons/slideshow/functions/fnc_addSlideActions.sqf b/addons/slideshow/functions/fnc_addSlideActions.sqf index 1ebba306b4..a18249a4f8 100644 --- a/addons/slideshow/functions/fnc_addSlideActions.sqf +++ b/addons/slideshow/functions/fnc_addSlideActions.sqf @@ -20,7 +20,6 @@ #include "script_component.hpp" private "_actions"; - params ["_objects", "_images", "_names", "_controller", "_currentSlideshow"]; _actions = []; diff --git a/addons/slideshow/functions/fnc_autoTransition.sqf b/addons/slideshow/functions/fnc_autoTransition.sqf index c8b03a707a..4c31c4ff6a 100644 --- a/addons/slideshow/functions/fnc_autoTransition.sqf +++ b/addons/slideshow/functions/fnc_autoTransition.sqf @@ -19,7 +19,6 @@ #include "script_component.hpp" private "_currentSlide"; - params ["_objects", "_images", "_varString", "_duration"]; // Get current slide number of this slideshow diff --git a/addons/slideshow/functions/fnc_createSlideshow.sqf b/addons/slideshow/functions/fnc_createSlideshow.sqf index 665b954496..369593dd16 100644 --- a/addons/slideshow/functions/fnc_createSlideshow.sqf +++ b/addons/slideshow/functions/fnc_createSlideshow.sqf @@ -19,8 +19,7 @@ */ #include "script_component.hpp" -private ["_currentSlideshow", "_actionsObject", "_actionsClass", "_mainAction", "_slidesAction", "_varString"]; - +private ["_currentSlideshow", "_slidesAction", "_varString"]; params ["_objects", "_controllers", "_images", "_names", "_duration"]; // Verify data diff --git a/addons/slideshow/functions/fnc_moduleInit.sqf b/addons/slideshow/functions/fnc_moduleInit.sqf index e4f7fbb56c..641ce282cb 100644 --- a/addons/slideshow/functions/fnc_moduleInit.sqf +++ b/addons/slideshow/functions/fnc_moduleInit.sqf @@ -18,7 +18,6 @@ if (!hasInterface && !isDedicated) exitWith {}; private ["_objects", "_controllers", "_images", "_names", "_duration"]; - params [["_logic", objNull, [objNull]], "_units", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/slideshow/stringtable.xml b/addons/slideshow/stringtable.xml index fa10700ffb..843554061d 100644 --- a/addons/slideshow/stringtable.xml +++ b/addons/slideshow/stringtable.xml @@ -4,54 +4,80 @@ Slideshow Pokaz slajdów + Vetítés + Apresentação de Slides This module allows you to set up slide-shows on different objects. One module per image list. Only objects with hiddenSelection 0 are supported. Ten moduł pozwala skonfigurować pokaz slajdów na różnych obiektach. Jeden moduł na jedną liste slajdów. Tylko obiekty z hiddenSelection 0 są wspierane. + Ez a modul lehetővé teszi a különböző objektumokon való vetítést. Egy modul/képlista. Csak "hiddenSelection 0"-t tartalmazó objektumok felelnek meg. + Este módulo permite que você monte apresentações de slides em diferentes objetos. Um módulo por lista de imagem. Somente objetos com hiddenSelection 0 são suportados. Objects Obiekty + Objektumok + Objetos Object names (can also be synchronized objects) slide-show will be displayed on, separated by commas if multiple. Reference INFO for object support. Nazwy obiektów (mogą to też być zsynchronizowane obiekty) na których pokaz slajdów zostanie pokazany, oddzielony przecinkiem jeżeli jest ich więcej niż 1. Sprawdź opis modułu aby dowiedzieć się jakie obiekty są wspierane przez moduł. + Objektum nevek (szinkronizált is lehet) amik a vetítésen megjelennek, több darab esetén vesszővel elválasztva. Objektumtámogatásért az INFO-t tekintsd meg. + Nomes dos objetos (também podem ser objetos sincronizados) em que a apresentação de slides será mostrada, separado por vírgulas se for mais de um. Referência INFO para suporte do objeto. Controllers Kontroler + Vezérlők + Controles Controller object names, separated by commas if multiple. Nazwa obiektu - kontrolera, oddzielona przecinkami jeżeli jest ich więcej niż 1. + Vezérlő objektum nevek, vesszővel elválasztva több darab esetén. + Nome dos objetos de controle, separado por vírgula se mais de um. Images Obrazy + Képek + Imagens List of images that will be used for the slide-show, separated by commas, with full path correctly formatted (eg. images\image.paa). Lista obrazów, które zostaną użyte do pokazu slajdów, oddzielone przecinkiem, z poprawnym pełnym formatem ścieżki do obrazka (np. slajdy\obrazek.paa). + A képek listája amit a vetítés használni fog, vesszővel elválasztva, megfelelően formázott teljes útvonallal (pl. képek\kép.paa) + Lista das imagens que serão utilizadas na apresentação de slides, separadas por vírgula, com o caminho completo corretamente formatado (ex: imagens\imagem.paa). Interaction Names Nazwy interakcji + Interakciós nevek + Nomes de Interação List of names that will be used for interaction entries, separated by commas, in order of images. Lista nazw, które zostaną użyte do nazwania wpisów interakcji, oddzielone przecinkiem, w kolejności obrazów. + Olyan nevek listája, melyek interakciós célra kellenek, vesszővel elválasztva, kép szerinti sorrendben. + Lista dos nomes que serão usados para entradas de interação, separados por vírgulas, na ordem das imagens. Slide Duration Czas trwania slajdów + Dia időtartam + Duração do Slide Duration of each slide. Default: 0 (Automatic Transitions Disabled) Czas trwania poszczególnych slajdów. Domyślnie: 0 (Automatyczne przejścia wyłączone) + A diák időtartama. Alapértelmezett: 0 (Automatikus váltás letiltva) + Duração de cada slide. Padrão: 0 (Transição automática desabilitada) Slides Slajdy + Diák + Slides - \ No newline at end of file + diff --git a/addons/spectator/$PBOPREFIX$ b/addons/spectator/$PBOPREFIX$ new file mode 100644 index 0000000000..42fe4034e9 --- /dev/null +++ b/addons/spectator/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\spectator \ No newline at end of file diff --git a/addons/spectator/ACE_Settings.hpp b/addons/spectator/ACE_Settings.hpp new file mode 100644 index 0000000000..78402cff23 --- /dev/null +++ b/addons/spectator/ACE_Settings.hpp @@ -0,0 +1,22 @@ +class ACE_Settings { + class GVAR(filterUnits) { + typeName = "SCALAR"; + value = 2; + values[] = {CSTRING(units_none), CSTRING(units_players), CSTRING(units_playable), CSTRING(units_all)}; + }; + class GVAR(filterSides) { + typeName = "SCALAR"; + value = 0; + values[] = {CSTRING(sides_player), CSTRING(sides_friendly), CSTRING(sides_hostile), CSTRING(sides_all)}; + }; + class GVAR(restrictModes) { + typeName = "SCALAR"; + value = 0; + values[] = {CSTRING(modes_all), CSTRING(modes_unit), CSTRING(modes_free), CSTRING(modes_internal), CSTRING(modes_external)}; + }; + class GVAR(restrictVisions) { + typeName = "SCALAR"; + value = 0; + values[] = {CSTRING(modes_all), CSTRING(visions_nv), CSTRING(visions_ti), "$STR_Special_None"}; + }; +}; diff --git a/addons/spectator/CfgEventHandlers.hpp b/addons/spectator/CfgEventHandlers.hpp new file mode 100644 index 0000000000..e75956f440 --- /dev/null +++ b/addons/spectator/CfgEventHandlers.hpp @@ -0,0 +1,11 @@ +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)); + }; +}; diff --git a/addons/spectator/CfgVehicles.hpp b/addons/spectator/CfgVehicles.hpp new file mode 100644 index 0000000000..f6869462ac --- /dev/null +++ b/addons/spectator/CfgVehicles.hpp @@ -0,0 +1,117 @@ +class CfgVehicles { + class ACE_Module; + class GVAR(moduleSettings): ACE_Module { + scope = 2; + displayName = CSTRING(Settings_DisplayName); + icon = PATHTOF(UI\Icon_Module_Spectator_ca.paa); + category = "ACE"; + function = QFUNC(moduleSpectatorSettings); + isGlobal = 1; + author = ECSTRING(common,ACETeam); + class Arguments { + class unitsFilter { + displayName = CSTRING(units_DisplayName); + description = CSTRING(units_Description); + typeName = "NUMBER"; + class values { + class none { + name = CSTRING(units_none); + value = 0; + }; + class players { + name = CSTRING(units_players); + value = 1; + }; + class playable { + name = CSTRING(units_playable); + value = 2; + default = 1; + }; + class all { + name = CSTRING(units_all); + value = 3; + }; + }; + }; + class sidesFilter { + displayName = CSTRING(sides_DisplayName); + description = CSTRING(sides_Description); + typeName = "NUMBER"; + class values { + class player { + name = CSTRING(sides_player); + value = 0; + default = 1; + }; + class friendly { + name = CSTRING(sides_friendly); + value = 1; + }; + class hostile { + name = CSTRING(sides_hostile); + value = 2; + }; + class all { + name = CSTRING(sides_all); + value = 3; + }; + }; + }; + class cameraModes { + displayName = CSTRING(modes_DisplayName); + description = CSTRING(modes_Description); + typeName = "NUMBER"; + class values { + class all { + name = CSTRING(modes_all); + value = 0; + default = 1; + }; + class unit { + name = CSTRING(modes_unit); + value = 1; + }; + class free { + name = CSTRING(modes_free); + value = 2; + }; + class internal { + name = CSTRING(modes_internal); + value = 3; + }; + class external { + name = CSTRING(modes_external); + value = 4; + }; + }; + }; + class visionModes { + displayName = CSTRING(visions_DisplayName); + description = CSTRING(visions_Description); + typeName = "NUMBER"; + class values { + class all { + name = CSTRING(modes_all); + value = 0; + default = 1; + }; + class nv { + name = CSTRING(visions_nv); + value = 1; + }; + class ti { + name = CSTRING(visions_ti); + value = 2; + }; + class none { + name = "$STR_Special_None"; + value = 3; + }; + }; + }; + }; + class ModuleDescription { + description = CSTRING(Settings_Description); + }; + }; +}; diff --git a/addons/spectator/README.md b/addons/spectator/README.md new file mode 100644 index 0000000000..b827bdcc49 --- /dev/null +++ b/addons/spectator/README.md @@ -0,0 +1,14 @@ +ace_spectator +======= + +A flexible spectator framework for mission makers to use. + +Includes a public API for integration into custom respawn frameworks and a template for use with the vanilla respawn framework. + +For more information, see: http://ace3mod.com/wiki/feature/spectator.html + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [SilentSpike](https://github.com/SilentSpike) diff --git a/addons/spectator/UI/Icon_Module_Spectator_ca.paa b/addons/spectator/UI/Icon_Module_Spectator_ca.paa new file mode 100644 index 0000000000..97258bb0d0 Binary files /dev/null and b/addons/spectator/UI/Icon_Module_Spectator_ca.paa differ diff --git a/addons/spectator/UI/interface.hpp b/addons/spectator/UI/interface.hpp new file mode 100644 index 0000000000..e8bc6c210f --- /dev/null +++ b/addons/spectator/UI/interface.hpp @@ -0,0 +1,255 @@ +// Temporary fix until BI take care of it +class RscFrame { + x = 0; + y = 0; + w = 0; + h = 0; +}; + + +class RscButtonMenu; +class RscControlsGroupNoScrollbars; +//class RscFrame; +class RscListBox; +class RscMapControl; +class RscPicture; +class RscText; +class RscTree; + +class GVAR(interface) { + idd = 12249; + enableSimulation = 1; + movingEnable = 0; + onLoad = QUOTE([ARR_2('onLoad',_this)] call FUNC(handleInterface)); + onUnload = QUOTE([ARR_2('onUnload',_this)] call FUNC(handleInterface)); + onKeyDown = QUOTE([ARR_2('onKeyDown',_this)] call FUNC(handleInterface)); + onKeyUp = QUOTE([ARR_2('onKeyUp',_this)] call FUNC(handleInterface)); + class controlsBackground { + class mouseHandler: RscControlsGroupNoScrollbars { + x = safeZoneXAbs; + y = safeZoneY; + w = safeZoneWAbs; + h = safeZoneH; + onMouseButtonDown = QUOTE([ARR_2('onMouseButtonDown',_this)] call FUNC(handleInterface)); + onMouseButtonUp = QUOTE([ARR_2('onMouseButtonUp',_this)] call FUNC(handleInterface)); + onMouseZChanged = QUOTE([ARR_2('onMouseZChanged',_this)] call FUNC(handleInterface)); + onMouseMoving = QUOTE([ARR_2('onMouseMoving',_this)] call FUNC(handleInterface)); + onMouseHolding = QUOTE([ARR_2('onMouseMoving',_this)] call FUNC(handleInterface)); + }; + }; + class controls { + class compass: RscControlsGroupNoScrollbars { + idc = IDC_COMP; + x = COMPASS_X; + y = safeZoneY; + w = COMPASS_W; + h = TOOL_H; + class controls { + class compassBack: RscText { + x = 0; + y = 0; + w = COMPASS_W; + h = TOOL_H; + colorBackground[] = {COL_BACK}; + }; + class compass0_90: RscPicture { + idc = IDC_COMP_0; + x = COMPASS_W * 0.5; + y = 0; + w = COMPASS_W * 0.5; + h = TOOL_H; + text = "A3\UI_F_Curator\Data\CfgIngameUI\compass\texture180_ca.paa"; + }; + class compass90_180: compass0_90 { + idc = IDC_COMP_90; + x = COMPASS_W; + text = "A3\UI_F_Curator\Data\CfgIngameUI\compass\texture270_ca.paa"; + }; + class compass180_270: compass0_90 { + idc = IDC_COMP_180; + x = 0; + text = "A3\UI_F_Curator\Data\CfgIngameUI\compass\texture0_ca.paa"; + }; + class compass270_0: compass0_90 { + idc = IDC_COMP_270; + x = COMPASS_W * -0.5; + text = "A3\UI_F_Curator\Data\CfgIngameUI\compass\texture90_ca.paa"; + }; + class compassCaret: RscFrame { + x = COMPASS_W * 0.5; + y = 0; + w = 0; + h = TOOL_H; + colorText[] = {COL_FORE}; + }; + class compassFrame: compassBack { + style = 64; + shadow=2; + colorText[] = {COL_FORE}; + }; + }; + }; + class toolbar: RscControlsGroupNoScrollbars { + idc = IDC_TOOL; + x = safeZoneX; + y = safeZoneY + safeZoneH - TOOL_H; + w = safeZoneW; + h = TOOL_H; + class controls { + class nameTool: RscText { + idc = IDC_TOOL_NAME; + style = 2; + x = 0; + y = 0; + w = TOOL_W * 2; + h = TOOL_H; + shadow = 2; + colorText[]={COL_FORE}; + colorBackground[] = {COL_BACK}; + sizeEx = H_PART(1); + }; + class nameFrame: nameTool { + idc = -1; + style = 64; + }; + class viewTool: nameTool { + idc = IDC_TOOL_VIEW; + x = TOOL_W * 2 + MARGIN; + w = TOOL_W; + }; + class viewFrame: viewTool { + idc = -1; + style = 64; + }; + class visionTool: viewTool { + idc = IDC_TOOL_VISION; + x = TOOL_W * 3 + MARGIN * 2; + }; + class visionFrame: visionTool { + idc = -1; + style = 64; + }; + class clockTool: viewTool { + idc = IDC_TOOL_CLOCK; + x = safeZoneW - TOOL_W * 3 - MARGIN * 2; + }; + class clockFrame: clockTool { + idc = -1; + style = 64; + }; + class zoomTool: viewTool { + idc = IDC_TOOL_FOV; + x = safeZoneW - TOOL_W * 2 - MARGIN; + }; + class zoomFrame: zoomTool { + idc = -1; + style = 64; + }; + class speedTool: viewTool { + idc = IDC_TOOL_SPEED; + x = safeZoneW - TOOL_W; + }; + class speedFrame: speedTool { + idc = -1; + style = 64; + }; + }; + }; + class unitWindow: RscControlsGroupNoScrollbars { + idc = IDC_UNIT; + x = safeZoneX; + y = safeZoneY + TOOL_H * 6; + w = TOOL_W * 2; + h = safeZoneH - TOOL_H * 13; + class controls { + class unitTitle: RscText { + x = 0; + y = 0; + w = TOOL_W * 2; + h = H_PART(1); + style = 2; + colorText[] = {COL_FORE}; + colorBackground[] = {COL_FORE_D}; + sizeEx = H_PART(1); + text = CSTRING(UnitTitle); + }; + class unitTree: RscTree { + idc = IDC_UNIT_TREE; + x = 0; + y = H_PART(1); + w = TOOL_W * 2; + h = safeZoneH - TOOL_H * 14; + sizeEx = H_PART(0.8); + colorText[] = {COL_FORE}; + colorBorder[] = {0,0,0,0}; + colorBackground[] = {COL_BACK}; + colorSelect[] = { + "profilenamespace getvariable ['GUI_BCG_RGB_R',0.77]", + "profilenamespace getvariable ['GUI_BCG_RGB_G',0.51]", + "profilenamespace getvariable ['GUI_BCG_RGB_B',0.08]", + 1 + }; + multiselectEnabled = 0; + onTreeDblClick = QUOTE([ARR_2('onTreeDblClick',_this)] call FUNC(handleInterface)); + onTreeSelChanged = QUOTE([ARR_2('onTreeSelChanged',_this)] call FUNC(handleInterface)); + }; + class unitFrame: RscFrame { + x = 0; + y = 0; + w = TOOL_W * 2; + h = safeZoneH - TOOL_H * 13; + shadow = 2; + colorText[] = {COL_FORE}; + }; + }; + }; + class helpWindow: RscControlsGroupNoScrollbars { + idc = IDC_HELP; + x = safeZoneX + safeZoneW - TOOL_W * 2; + y = safeZoneY + TOOL_H * 6; + w = TOOL_W * 2; + h = safeZoneH - TOOL_H * 13; + class controls { + class helpTitle: RscText { + x = 0; + y = 0; + w = TOOL_W * 2; + h = H_PART(1); + style = 2; + colorText[] = {COL_FORE}; + colorBackground[] = {COL_FORE_D}; + sizeEx = H_PART(1); + text = CSTRING(HelpTitle); + }; + class helpContent: RscListBox { + idc = IDC_HELP_LIST; + x = 0; + y = H_PART(1); + w = TOOL_W * 2; + h = safeZoneH - TOOL_H * 14; + colorBackground[] = {COL_BACK}; + sizeEx = H_PART(0.8); + default = 1; + }; + class helpFrame: RscFrame { + x = 0; + y = 0; + w = TOOL_W * 2; + h = safeZoneH - TOOL_H * 13; + shadow = 2; + colorText[] = {COL_FORE}; + }; + }; + }; + class mapOverlay: RscMapControl { + idc = IDC_MAP; + type = 100; + x = safeZoneX; + y = safeZoneY; + w = safeZoneW; + h = safeZoneH; + onMouseButtonDown = QUOTE([ARR_2('onMapClick',_this)] call FUNC(handleInterface)); + onDraw = QUOTE(_this call FUNC(handleMap)); + }; + }; +}; diff --git a/addons/spectator/XEH_postInit.sqf b/addons/spectator/XEH_postInit.sqf new file mode 100644 index 0000000000..35b463837f --- /dev/null +++ b/addons/spectator/XEH_postInit.sqf @@ -0,0 +1,10 @@ +#include "script_component.hpp" +//#include "initKeybinds.sqf"; + +// Add interaction menu exception +["isNotSpectating", {!(GETVAR((_this select 0),GVAR(isStaged),false))}] call EFUNC(common,addCanInteractWithCondition); + +["SettingsInitialized", { + GVAR(availableModes) = [[0,1,2], [1,2], [0], [1], [2]] select GVAR(restrictModes); + GVAR(availableVisions) = [[-2,-1,0,1], [-2,-1], [-2,0,1], [-2]] select GVAR(restrictVisions); +}] call EFUNC(common,addEventHandler); diff --git a/addons/spectator/XEH_preInit.sqf b/addons/spectator/XEH_preInit.sqf new file mode 100644 index 0000000000..d1bf48d106 --- /dev/null +++ b/addons/spectator/XEH_preInit.sqf @@ -0,0 +1,59 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(cacheUnitInfo); +PREP(cycleCamera); +PREP(handleCamera); +PREP(handleCompass); +PREP(handleIcons); +PREP(handleInterface); +PREP(handleMap); +PREP(handleMouse); +PREP(handleToolbar); +PREP(handleUnits); +PREP(interrupt); +PREP(moduleSpectatorSettings); +PREP(respawnTemplate); +PREP(setCameraAttributes); +PREP(setSpectator); +PREP(stageSpectator); +PREP(transitionCamera); +PREP(toggleInterface); +PREP(updateCameraModes); +PREP(updateSpectatableSides); +PREP(updateUnits); +PREP(updateVisionModes); + +// Permanent variables +GVAR(availableModes) = [0,1,2]; +GVAR(availableSides) = [west,east,resistance,civilian]; +GVAR(availableVisions) = [-2,-1,0,1]; + +GVAR(camAgent) = objNull; +GVAR(camMode) = 0; +GVAR(camPan) = 0; +GVAR(camPos) = ATLtoASL [worldSize * 0.5, worldSize * 0.5, 20]; +GVAR(camSpeed) = 2.5; +GVAR(camTilt) = -10; +GVAR(camUnit) = objNull; +GVAR(camVision) = -2; +GVAR(camZoom) = 1.25; + +GVAR(interrupts) = []; +GVAR(isSet) = false; + +GVAR(showComp) = true; +GVAR(showHelp) = true; +GVAR(showIcons) = true; +GVAR(showInterface) = true; +GVAR(showMap) = false; +GVAR(showTool) = true; +GVAR(showUnit) = true; + +GVAR(unitList) = []; +GVAR(unitBlacklist) = []; +GVAR(unitWhitelist) = []; +GVAR(groupList) = []; + +ADDON = true; diff --git a/addons/spectator/config.cpp b/addons/spectator/config.cpp new file mode 100644 index 0000000000..6e32ed0413 --- /dev/null +++ b/addons/spectator/config.cpp @@ -0,0 +1,25 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"F3 Project","Head","SilentSpike","voiper"}; + authorUrl = "https://github.com/acemod"; + VERSION_CONFIG; + }; +}; + +#include "ACE_Settings.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "ui\interface.hpp" + +class CfgRespawnTemplates { + class ADDON { + onPlayerKilled = QFUNC(respawnTemplate); + onPlayerRespawn = QFUNC(respawnTemplate); + }; +}; diff --git a/addons/spectator/functions/fnc_cacheUnitInfo.sqf b/addons/spectator/functions/fnc_cacheUnitInfo.sqf new file mode 100644 index 0000000000..9f40651748 --- /dev/null +++ b/addons/spectator/functions/fnc_cacheUnitInfo.sqf @@ -0,0 +1,38 @@ +/* + * Author: SilentSpike + * Caches the units information for quick retrevial in spectator interface PFHs + * + * Arguments: + * 0: Unit to have info cached for + * + * Return Value: + * None + * + * Example: + * [vehicle player] call ace_spectator_fnc_cacheUnitInfo + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_unit"]; +private ["_color","_icon","_name"]; + +// Group info only needs to be cached once (groups can't change) +if (isNil { GETVAR((group _unit),GVAR(gColor),nil) }) then { + _color = [side group _unit] call BIS_fnc_sideColor; + SETVAR((group _unit),GVAR(gColor),_color); +}; + +// Unit info should be updated each time +_icon = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "Icon"); +_name = [_unit,false] call EFUNC(common,getName); + +// Handle CfgVehicleIcons +if (isText (configFile >> "CfgVehicleIcons" >> _icon)) then { + _icon = getText (configFile >> "CfgVehicleIcons" >> _icon); +}; + +SETVAR(_unit,GVAR(uIcon),_icon); +SETVAR(_unit,GVAR(uName),_name); diff --git a/addons/spectator/functions/fnc_cycleCamera.sqf b/addons/spectator/functions/fnc_cycleCamera.sqf new file mode 100644 index 0000000000..474d25cd0c --- /dev/null +++ b/addons/spectator/functions/fnc_cycleCamera.sqf @@ -0,0 +1,58 @@ +/* + * Author: SilentSpike + * Cycle through the spectator camera vision/view/units in steps + * + * Arguments: + * 0: Camera mode steps + * 1: Camera unit steps + * 2: Vision mode steps + * + * Return Value: + * None + * + * Example: + * [0, -1] call ace_spectator_fnc_cycleCamera + * + * Public: No + */ + +#include "script_component.hpp" + +params [["_stepMode",0], ["_stepUnit",0], ["_stepVision",0]]; +private ["_modes","_visions","_iMode","_iVision","_countModes","_countVisions","_newMode","_newVision","_newUnit"]; + +_modes = GVAR(availableModes); +_units = GVAR(unitList); +_visions = GVAR(availableVisions); + +// Get current index +_iMode = (_modes find GVAR(camMode)) max 0; +_iUnit = (_units find GVAR(camUnit)) max 0; +_iVision = (_visions find GVAR(camVision)) max 0; + +_countModes = count _modes; +_countUnits = count _units; +_countVisions = count _visions; + +// Step index by step number (loop at ends) +if (_countModes != 0) then { + _iMode = (_iMode + _stepMode) % _countModes; + if (_iMode < 0) then { _iMode = _countModes + _iMode; }; +}; + +if (_countUnits != 0) then { + _iUnit = (_iUnit + _stepUnit) % _countUnits; + if (_iUnit < 0) then { _iUnit = _countUnits + _iUnit; }; +}; + +if (_countVisions != 0) then { + _iVision = (_iVision + _stepVision) % _countVisions; + if (_iVision < 0) then { _iVision = _countVisions + _iVision; }; +}; + +// Get value at new index +_newMode = _modes select _iMode; +_newUnit = _units select _iUnit; +_newVision = _visions select _iVision; + +[_newMode, _newUnit, _newVision] call FUNC(transitionCamera); diff --git a/addons/spectator/functions/fnc_handleCamera.sqf b/addons/spectator/functions/fnc_handleCamera.sqf new file mode 100644 index 0000000000..db196c8504 --- /dev/null +++ b/addons/spectator/functions/fnc_handleCamera.sqf @@ -0,0 +1,48 @@ +/* + * Author: F3 Project, Head, SilentSpike + * Handles free camera manipulation according to input + * + * Arguments: + * 0: Parameters + * 1: PFH handle + * + * Return Value: + * None + * + * Example: + * [ace_spectator_fnc_handleCamera, 0] call CBA_fnc_addPerFrameHandler; + * + * Public: No + */ + +#include "script_component.hpp" + +// Kill PFH when not in free cam (or display is closed) +if (isNil QGVAR(camHandler)) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; + +private ["_camera","_oldPos","_altMod","_zoomMod","_mX","_mY","_mZ","_pan","_x","_y","_z"]; + +_camera = GVAR(camera); +_oldPos = getPosASL _camera; + +// Dolly/Boom amount should be influnced by zoom level (it should really be exponential) +// Dollying should also slow as the camera gets close to the ground +_zoomMod = (GVAR(camZoom) * 0.8) max 1; +_altMod = ((((getPos _camera) select 2) * 0.05) max 0.1) min 1; + +_mX = (GVAR(camDolly) select 0) * _altMod / _zoomMod; +_mY = (GVAR(camDolly) select 1) * _altMod / _zoomMod; +_mZ = GVAR(camBoom) / _zoomMod; + +_pan = (GVAR(camPan) + 360) % 360; +_x = (_oldPos select 0) + (_mX * cos(_pan)) + (_mY * sin(_pan)); +_y = (_oldPos select 1) - (_mX * sin(_pan)) + (_mY * cos(_pan)); +_z = (_oldPos select 2) + _mZ; + +// Prevent camera going under terrain +GVAR(camPos) = [_x,_y,_z max (getTerrainHeightASL [_x,_y])]; + +// Update camera position and rotation +_camera setPosASL GVAR(camPos); +_camera setDir GVAR(camPan); +[_camera, GVAR(camTilt), 0] call BIS_fnc_setPitchBank; diff --git a/addons/spectator/functions/fnc_handleCompass.sqf b/addons/spectator/functions/fnc_handleCompass.sqf new file mode 100644 index 0000000000..a65cc9ddce --- /dev/null +++ b/addons/spectator/functions/fnc_handleCompass.sqf @@ -0,0 +1,67 @@ +/* + * Author: SilentSpike, voiper + * Handles the spectator UI compass + * + * Arguments: + * 0: Parameters + * 1: PFH handle + * + * Return Value: + * None + * + * Example: + * [ace_spectator_fnc_handleCompass, 0, _display] call CBA_fnc_addPerFrameHandler; + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_display"]; + +// Kill PFH when compass hidden (or display is closed) +if (isNil QGVAR(compHandler)) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; + +private ["_compass","_NE","_ES","_SW","_WN","_compassW","_degree","_heading","_offset","_positions","_sequence"]; + +_compass = _display displayCtrl IDC_COMP; + +_NE = _compass controlsGroupCtrl IDC_COMP_0; +_ES = _compass controlsGroupCtrl IDC_COMP_90; +_SW = _compass controlsGroupCtrl IDC_COMP_180; +_WN = _compass controlsGroupCtrl IDC_COMP_270; + +_compassW = (ctrlPosition _compass) select 2; +_degree = _compassW / 180; + +// Get direction of screen rather than object (accounts for unit freelook) +_heading = (positionCameraToWorld [0,0,1]) vectorDiff (positionCameraToWorld [0,0,0]); +_heading = (((_heading select 0) atan2 (_heading select 1)) + 360) % 360; +_offset = -(_heading % 90) * _degree; + +_positions = [ + [_compassW * -0.5 + _offset, 0], + [_offset, 0], + [_compassW * 0.5 + _offset, 0], + [_compassW + _offset, 0] +]; + +_sequence = if (_heading < 90) then { + [_SW, _WN, _NE, _ES] +} else { + if (_heading < 180) then { + [_WN, _NE, _ES, _SW] + } else { + if (_heading < 270) then { + [_NE, _ES, _SW, _WN] + } else { + [_ES, _SW, _WN, _NE] + }; + }; +}; + + +{ + _x ctrlSetPosition (_positions select _forEachIndex); + _x ctrlCommit 0; +} forEach _sequence; diff --git a/addons/spectator/functions/fnc_handleIcons.sqf b/addons/spectator/functions/fnc_handleIcons.sqf new file mode 100644 index 0000000000..72c0d7dee6 --- /dev/null +++ b/addons/spectator/functions/fnc_handleIcons.sqf @@ -0,0 +1,46 @@ +/* + * Author: Head, SilentSpike + * Handles rendering the spectator 3D unit icons + * + * Arguments: + * 0: Parameters + * 1: PFH handle + * + * Return Value: + * None + * + * Example: + * [ace_spectator_fnc_handleIcons, 0] call CBA_fnc_addPerFrameHandler; + * + * Public: No + */ + +#include "script_component.hpp" + +if !(GVAR(showIcons)) exitWith {}; +private ["_refPoint","_drawVehicles","_leader","_color","_txt","_unit"]; + +// Draw groups unless leader is within distance +_refPoint = [GVAR(camera),GVAR(camUnit)] select (GVAR(camMode) > 0); +_drawVehicles = []; +{ + _leader = leader _x; + if ((_leader distanceSqr _refPoint) > 40000) then { + _color = GETVAR(_x,GVAR(gColor),[ARR_4(0,0,0,0)]); + _txt = groupID _x; + + drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_inf.paa", _color, _leader modelToWorldVisual [0,0,30], 1, 1, 0, _txt, 2, 0.02]; + } else { + _drawVehicles append (units _x); + }; + false +} count GVAR(groupList); + +// Draw units for groups within distance +{ + _color = GETVAR((group _x),GVAR(gColor),[ARR_4(0,0,0,0)]); + _txt = ["", GETVAR(_x,GVAR(uName),"")] select (isPlayer _x); + + drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", _color, _x modelToWorldVisual [0,0,3], 0.7, 0.7, 0, _txt, 1, 0.02]; + false +} count (_drawVehicles arrayIntersect GVAR(unitList)); diff --git a/addons/spectator/functions/fnc_handleInterface.sqf b/addons/spectator/functions/fnc_handleInterface.sqf new file mode 100644 index 0000000000..93c6ca3ddd --- /dev/null +++ b/addons/spectator/functions/fnc_handleInterface.sqf @@ -0,0 +1,493 @@ +/* + * Author: SilentSpike + * Handles spectator interface events + * + * Arguments: + * 0: Event name + * 1: Event arguments + * + * Return Value: + * None + * + * Example: + * ["onLoad",_this] call ace_spectator_fnc_handleInterface + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_mode",["_args",[]]]; + +switch (toLower _mode) do { + case "onload": { + _args params ["_display"]; + + // Always show interface and hide map upon opening + [_display,nil,nil,!GVAR(showInterface),GVAR(showMap)] call FUNC(toggleInterface); + + // Keep unit list and tree up to date + [FUNC(handleUnits), 21, _display] call CBA_fnc_addPerFrameHandler; + + // Handle 3D unit icons + GVAR(iconHandler) = addMissionEventHandler ["Draw3D",FUNC(handleIcons)]; + + // Populate the help window + private "_help"; + _help = (_display displayCtrl IDC_HELP) controlsGroupCtrl IDC_HELP_LIST; + { + _i = _help lbAdd (_x select 0); + if ((_x select 1) == "") then { + _help lbSetPicture [_i,"\A3\ui_f\data\map\markers\military\dot_CA.paa"]; + _help lbSetPictureColor [_i,[COL_FORE]]; + } else { + _help lbSetTooltip [_i,_x select 1]; + }; + } forEach [ + [localize LSTRING(uiControls),""], + [localize LSTRING(uiToggleUnits),"1"], + [localize LSTRING(uiToggleHelp),"2"], + [localize LSTRING(uiToggleTools),"3"], + [localize LSTRING(uiToggleCompass),"4"], + [localize LSTRING(uiToggleIcons),"5"], + [localize LSTRING(uiToggleMap),"M"], + [localize LSTRING(uiToggleInterface),"Backspace"], + [localize LSTRING(freeCamControls),""], + [localize LSTRING(freeCamForward),"W"], + [localize LSTRING(freeCamBackward),"S"], + [localize LSTRING(freeCamLeft),"A"], + [localize LSTRING(freeCamRight),"D"], + [localize LSTRING(freeCamUp),"Q"], + [localize LSTRING(freeCamDown),"Z"], + [localize LSTRING(freeCamPan),"RMB (Hold)"], + [localize LSTRING(freeCamDolly),"LMB (Hold)"], + [localize LSTRING(freeCamBoost),"Shift (Hold)"], + [localize LSTRING(freeCamFocus),"F"], + [localize LSTRING(attributeControls),""], + [localize LSTRING(nextCam),"Up Arrow"], + [localize LSTRING(prevCam),"Down Arrow"], + [localize LSTRING(nextUnit),"Right Arrow"], + [localize LSTRING(prevUnit),"Left Arrow"], + [localize LSTRING(nextVis),"N"], + [localize LSTRING(prevVis),"Ctrl + N"], + [localize LSTRING(adjZoom),"Scrollwheel"], + [localize LSTRING(adjSpeed),"Ctrl + Scrollwheel"], + [localize LSTRING(incZoom),"Num-/Num+"], + [localize LSTRING(incSpeed),"Ctrl + Num-/Num+"], + [localize LSTRING(reZoom),"Alt + Num-"], + [localize LSTRING(reSpeed),"Alt + Num+"] + ]; + + // Handle support for BI's respawn counter + [{ + if !(isNull (GETUVAR(RscRespawnCounter,displayNull))) then { + disableSerialization; + private ["_counter","_title","_back","_timer","_frame","_x","_y"]; + _counter = GETUVAR(RscRespawnCounter,displayNull); + _title = _counter displayCtrl 1001; + _back = _counter displayCtrl 1002; + _timer = _counter displayCtrl 1003; + _frame = _counter ctrlCreate ["RscFrame",1008]; + + _x = safeZoneX + safeZoneW - TOOL_W * 4 - MARGIN * 3; + _y = safeZoneY + safeZoneH - TOOL_H; + + // Timer + _title ctrlSetPosition [_x,_y,TOOL_W,TOOL_H]; + _back ctrlSetPosition [_x,_y,TOOL_W,TOOL_H]; + _timer ctrlSetPosition [_x,_y,TOOL_W,TOOL_H]; + _frame ctrlSetPosition [_x,_y,TOOL_W,TOOL_H]; + + _title ctrlSetBackgroundColor [0,0,0,0]; + _back ctrlSetBackgroundColor [COL_BACK]; + _timer ctrlSetFontHeight TOOL_H; + _frame ctrlSetTextColor [COL_FORE]; + + _title ctrlCommit 0; + _back ctrlCommit 0; + _timer ctrlCommit 0; + _frame ctrlCommit 0; + }; + },[],0.5] call EFUNC(common,waitAndExecute); + }; + case "onunload": { + // Kill GUI PFHs + removeMissionEventHandler ["Draw3D",GVAR(iconHandler)]; + GVAR(camHandler) = nil; + GVAR(compHandler) = nil; + GVAR(iconHandler) = nil; + GVAR(toolHandler) = nil; + + // Reset variables + GVAR(camBoom) = 0; + GVAR(camDolly) = [0,0]; + GVAR(ctrlKey) = false; + GVAR(heldKeys) = []; + GVAR(heldKeys) resize 255; + GVAR(mouse) = [false,false]; + GVAR(mousePos) = [0.5,0.5]; + GVAR(treeSel) = objNull; + }; + // Mouse events + case "onmousebuttondown": { + _args params ["_ctrl","_button"]; + GVAR(mouse) set [_button,true]; + + // Detect right click + if ((_button == 1) && (GVAR(camMode) == 1)) then { + // In first person toggle sights mode + GVAR(camGun) = !GVAR(camGun); + [] call FUNC(transitionCamera); + }; + }; + case "onmousebuttonup": { + _args params ["_ctrl","_button"]; + + GVAR(mouse) set [_button,false]; + if (_button == 0) then { GVAR(camDolly) = [0,0]; }; + }; + case "onmousezchanged": { + _args params ["_ctrl","_zChange"]; + + // Scroll to change speed, modifier for zoom + if (GVAR(ctrlKey)) then { + [nil,nil,nil,nil,nil,nil,nil, GVAR(camSpeed) + _zChange * 0.2] call FUNC(setCameraAttributes); + } else { + [nil,nil,nil,nil,nil,nil, GVAR(camZoom) + _zChange * 0.1] call FUNC(setCameraAttributes); + }; + }; + case "onmousemoving": { + _args params ["_ctrl","_x","_y"]; + + [_x,_y] call FUNC(handleMouse); + }; + // Keyboard events + case "onkeydown": { + _args params ["_display","_dik","_shift","_ctrl","_alt"]; + + if ((alive player) && {_dik in (actionKeys "curatorInterface")} && {!isNull (getAssignedCuratorLogic player)}) exitWith { + [QGVAR(zeus)] call FUNC(interrupt); + ["zeus"] call FUNC(handleInterface); + }; + if ((isServer || {serverCommandAvailable "#kick"}) && {_dik in (actionKeys "Chat" + actionKeys "PrevChannel" + actionKeys "NextChannel")}) exitWith { + false + }; + + // Handle held keys (prevent repeat calling) + if (GVAR(heldKeys) param [_dik,false]) exitwith {}; + // Exclude movement/adjustment keys so that speed can be adjusted on fly + if !(_dik in [16,17,30,31,32,44,74,78]) then { + GVAR(heldKeys) set [_dik,true]; + }; + + switch (_dik) do { + case 1: { // Esc + [QGVAR(escape)] call FUNC(interrupt); + ["escape"] call FUNC(handleInterface); + }; + case 2: { // 1 + [_display,nil,nil,nil,nil,nil,true] call FUNC(toggleInterface); + }; + case 3: { // 2 + [_display,nil,true] call FUNC(toggleInterface); + }; + case 4: { // 3 + [_display,nil,nil,nil,nil,true] call FUNC(toggleInterface); + }; + case 5: { // 4 + [_display,true] call FUNC(toggleInterface); + }; + case 6: { // 5 + GVAR(showIcons) = !GVAR(showIcons); + }; + case 14: { // Backspace + [_display,nil,nil,true] call FUNC(toggleInterface); + }; + case 16: { // Q + GVAR(camBoom) = 0.5 * GVAR(camSpeed) * ([1, 2] select _shift); + }; + case 17: { // W + GVAR(camDolly) set [1, GVAR(camSpeed) * ([1, 2] select _shift)]; + }; + case 29: { // Ctrl + GVAR(ctrlKey) = true; + }; + case 30: { // A + GVAR(camDolly) set [0, -GVAR(camSpeed) * ([1, 2] select _shift)]; + }; + case 31: { // S + GVAR(camDolly) set [1, -GVAR(camSpeed) * ([1, 2] select _shift)]; + }; + case 32: { // D + GVAR(camDolly) set [0, GVAR(camSpeed) * ([1, 2] select _shift)]; + }; + case 33: { // F + private ["_sel","_vector"]; + _sel = GVAR(treeSel); + if ((GVAR(camMode) == 0) && {!isNull _sel} && {_sel in GVAR(unitList)}) then { + _vector = (positionCameraToWorld [0,0,0]) vectorDiff (positionCameraToWorld [0,0,25]); + [nil,nil,nil,(getPosATL _sel) vectorAdd _vector] call FUNC(setCameraAttributes); + }; + }; + case 44: { // Z + GVAR(camBoom) = -0.5 * GVAR(camSpeed) * ([1, 2] select _shift); + }; + case 49: { // N + if (GVAR(camMode) == 0) then { + if (_ctrl) then { + [nil,nil,-1] call FUNC(cycleCamera); + } else { + [nil,nil,1] call FUNC(cycleCamera); + }; + }; + }; + case 50: { // M + [_display,nil,nil,nil,true] call FUNC(toggleInterface); + }; + case 57: { // Spacebar + // Freecam attachment here, if in external then set cam pos and attach + }; + case 74: { // Num - + if (_alt) exitWith { [nil,nil,nil,nil,nil,nil, 1.25] call FUNC(setCameraAttributes); }; + if (_ctrl) then { + [nil,nil,nil,nil,nil,nil,nil, GVAR(camSpeed) - 0.05] call FUNC(setCameraAttributes); + } else { + [nil,nil,nil,nil,nil,nil, GVAR(camZoom) - 0.01] call FUNC(setCameraAttributes); + }; + }; + case 78: { // Num + + if (_alt) exitWith { [nil,nil,nil,nil,nil,nil,nil, 2.5] call FUNC(setCameraAttributes); }; + if (_ctrl) then { + [nil,nil,nil,nil,nil,nil,nil, GVAR(camSpeed) + 0.05] call FUNC(setCameraAttributes); + } else { + [nil,nil,nil,nil,nil,nil, GVAR(camZoom) + 0.01] call FUNC(setCameraAttributes); + }; + }; + case 200: { // Up arrow + [-1] call FUNC(cycleCamera); + }; + case 203: { // Left arrow + [nil,1] call FUNC(cycleCamera); + }; + case 205: { // Right arrow + [nil,-1] call FUNC(cycleCamera); + }; + case 208: { // Down arrow + [1] call FUNC(cycleCamera); + }; + }; + + true + }; + case "onkeyup": { + _args params ["_display","_dik","_shift","_ctrl","_alt"]; + + // No longer being held + GVAR(heldKeys) set [_dik,nil]; + + switch (_dik) do { + case 16: { // Q + GVAR(camBoom) = 0; + }; + case 17: { // W + GVAR(camDolly) set [1, 0]; + }; + case 29: { // Ctrl + GVAR(ctrlKey) = false; + }; + case 30: { // A + GVAR(camDolly) set [0, 0]; + }; + case 31: { // S + GVAR(camDolly) set [1, 0]; + }; + case 32: { // D + GVAR(camDolly) set [0, 0]; + }; + case 44: { // Z + GVAR(camBoom) = 0; + }; + }; + + true + }; + // Tree events + case "ontreedblclick": { + // Update camera view when listbox unit is double clicked on + _args params ["_tree","_sel"]; + + // Ensure a unit was selected + if (count _sel == 3) then { + private ["_netID","_newUnit","_newMode"]; + _netID = (_args select 0) tvData _sel; + _newUnit = objectFromNetId _netID; + + // When unit is reselected, toggle camera mode + if (_newUnit == GVAR(camUnit) || GVAR(camMode) == 0) then { + _newMode = [2,2,1] select GVAR(camMode); + }; + + [_newMode,_newUnit] call FUNC(transitionCamera); + }; + }; + case "ontreeselchanged": { + _args params ["_tree","_sel"]; + + if (count _sel == 3) then { + GVAR(treeSel) = objectFromNetId (_tree tvData _sel); + } else { + GVAR(treeSel) = objNull; + }; + }; + case "onunitsupdate": { + _args params ["_tree"]; + private ["_cachedUnits","_cachedGrps","_cachedSides","_s","_g","_grp","_u","_unit","_side"]; + + // Cache existing group and side nodes and cull removed data + _cachedUnits = []; + _cachedGrps = []; + _cachedSides = []; + for "_s" from 0 to ((_tree tvCount []) - 1) do { + for "_g" from 0 to ((_tree tvCount [_s]) - 1) do { + _grp = groupFromNetID (_tree tvData [_s,_g]); + + if (_grp in GVAR(groupList)) then { + _cachedGrps pushBack _grp; + _cachedGrps pushBack _g; + + for "_u" from 0 to ((_tree tvCount [_s,_g])) do { + _unit = objectFromNetId (_tree tvData [_s,_g,_u]); + + if (_unit in GVAR(unitList)) then { + _cachedUnits pushBack _unit; + } else { + _tree tvDelete [_s,_g,_u]; + }; + }; + } else { + _tree tvDelete [_s,_g]; + }; + }; + + if ((_tree tvCount [_s]) > 0) then { + _cachedSides pushBack (_tree tvText [_s]); + _cachedSides pushBack _s; + } else { + _tree tvDelete [_s]; + }; + }; + + // Update the tree from the unit list + { + _grp = group _x; + _side = [side _grp] call BIS_fnc_sideName; + + // Use correct side node + if !(_side in _cachedSides) then { + // Add side node + _s = _tree tvAdd [[], _side]; + _tree tvExpand [_s]; + + _cachedSides pushBack _side; + _cachedSides pushBack _s; + } else { + // If side already processed, use existing node + _s = _cachedSides select ((_cachedSides find _side) + 1); + }; + + // Use correct group node + if !(_grp in _cachedGrps) then { + // Add group node + _g = _tree tvAdd [[_s], groupID _grp]; + _tree tvSetData [[_s,_g], netID _grp]; + + _cachedGrps pushBack _grp; + _cachedGrps pushBack _g; + } else { + // If group already processed, use existing node + _g = _cachedGrps select ((_cachedGrps find _grp) + 1); + }; + + _u = _tree tvAdd [[_s,_g], GETVAR(_x,GVAR(uName),"")]; + _tree tvSetData [[_s,_g,_u], netID _x]; + _tree tvSetPicture [[_s,_g,_u], GETVAR(_x,GVAR(uIcon),"")]; + _tree tvSetPictureColor [[_s,_g,_u], GETVAR(_grp,GVAR(gColor),[ARR_4(1,1,1,1)])]; + + _tree tvSort [[_s,_g],false]; + } forEach (GVAR(unitList) - _cachedUnits); + + _tree tvSort [[],false]; + + if ((_tree tvCount []) <= 0) then { + _tree tvAdd [[], localize LSTRING(units_none)]; + }; + }; + // Map events + case "onmapclick": { + _args params ["_map","_button","_x","_y","_shift","_ctrl","_alt"]; + private ["_newPos","_oldZ"]; + + if ((GVAR(camMode) == 0) && (_button == 0)) then { + _newPos = _map ctrlMapScreenToWorld [_x,_y]; + _oldZ = (ASLtoATL GVAR(camPos)) select 2; + _newPos set [2, _oldZ]; + [nil,nil,nil, _newPos] call FUNC(setCameraAttributes); + }; + }; + // Interrupt events + case "escape": { + private "_dlg"; + + createDialog (["RscDisplayInterrupt", "RscDisplayMPInterrupt"] select isMultiplayer); + + disableSerialization; + _dlg = finddisplay 49; + _dlg displayAddEventHandler ["KeyDown", { + _key = _this select 1; + !(_key == 1) + }]; + + // Disable save, respawn, options & manual buttons + (_dlg displayCtrl 103) ctrlEnable false; + if !(alive player) then { + (_dlg displayCtrl 1010) ctrlEnable false; + }; + (_dlg displayCtrl 101) ctrlEnable false; + (_dlg displayCtrl 122) ctrlEnable false; + + // Initalize abort button (the "spawn" is a necessary evil) + (_dlg displayCtrl 104) ctrlAddEventHandler ["ButtonClick",{_this spawn { + disableSerialization; + _display = ctrlparent (_this select 0); + _abort = [localize "str_msg_confirm_return_lobby",nil,localize "str_disp_xbox_hint_yes",localize "str_disp_xbox_hint_no",_display,nil,true] call BIS_fnc_guiMessage; + if (_abort) then {_display closeDisplay 2; failMission "loser"}; + }}]; + + // PFH to re-open display when menu closes + [{ + if !(isNull (findDisplay 49)) exitWith {}; + + // If still a spectator then re-enter the interface + [QGVAR(escape),false] call FUNC(interrupt); + + [_this select 1] call CBA_fnc_removePerFrameHandler; + },0] call CBA_fnc_addPerFrameHandler; + }; + case "zeus": { + openCuratorInterface; + + [{ + // PFH to re-open display when menu closes + [{ + if !((isNull curatorCamera) && {isNull (GETMVAR(bis_fnc_moduleRemoteControl_unit,objNull))}) exitWith {}; + + // If still a spectator then re-enter the interface + [QGVAR(zeus),false] call FUNC(interrupt); + + [_this select 1] call CBA_fnc_removePerFrameHandler; + },0] call CBA_fnc_addPerFrameHandler; + },[],5] call EFUNC(common,waitAndExecute); + + true + }; +}; diff --git a/addons/spectator/functions/fnc_handleMap.sqf b/addons/spectator/functions/fnc_handleMap.sqf new file mode 100644 index 0000000000..4eeb5fd7e1 --- /dev/null +++ b/addons/spectator/functions/fnc_handleMap.sqf @@ -0,0 +1,47 @@ +/* + * Author: Head, SilentSpike + * Handles rendering the spectator map icons + * + * Arguments: + * 0: Parameters + * 1: PFH handle + * + * Return Value: + * None + * + * Example: + * [ace_spectator_fnc_handleIcons, 0] call CBA_fnc_addPerFrameHandler; + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_map"]; +private ["_cachedVehicles","_unit","_color","_icon","_txt"]; + +if (GVAR(camMode) == 0) then { + _map drawIcon ["\A3\UI_F\Data\GUI\Rsc\RscDisplayMissionEditor\iconcamera_ca.paa",[0,0,0,1],GVAR(camera),20,20,GVAR(camPan)]; +}; + +_cachedVehicles = []; +{ + _unit = vehicle _x; + + if !(_unit in _cachedVehicles) then { + _cachedVehicles pushBack _unit; + + // Use previously cached info where possible + if (GETVAR(_unit,GVAR(uIcon),"") == "") then { + [_unit] call FUNC(cacheUnitInfo); + }; + + // Function has caching built in + _color = [side effectiveCommander _unit] call BIS_fnc_sideColor; + _icon = GETVAR(_unit,GVAR(uIcon),""); + _txt = ["", GETVAR(_x,GVAR(uName),"")] select (isPlayer _x); + + _map drawIcon [_icon, _color, _unit, 19, 19, getDir _unit, _txt, 1, 0.03]; + }; + false +} count GVAR(unitList); diff --git a/addons/spectator/functions/fnc_handleMouse.sqf b/addons/spectator/functions/fnc_handleMouse.sqf new file mode 100644 index 0000000000..1c2b62798c --- /dev/null +++ b/addons/spectator/functions/fnc_handleMouse.sqf @@ -0,0 +1,46 @@ +/* + * Author: F3 Project, Head, SilentSpike + * Processes the change in mouse position for the spectator camera + * + * Arguments: + * 0: Mouse x coord + * 1: Mouse y coord + * + * Return Value: + * None + * + * Example: + * [0.5, 0.5] call ace_spectator_fnc_handleMouse; + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_x","_y"]; +private ["_leftButton","_rightButton","_oldX","_oldY","_deltaX","_deltaY","_zoomMod"]; + +_leftButton = GVAR(mouse) select 0; +_rightButton = GVAR(mouse) select 1; + +_oldX = GVAR(mousePos) select 0; +_oldY = GVAR(mousePos) select 1; + +// Get change in pos +_deltaX = _oldX - _x; +_deltaY = _oldY - _y; + +if (_leftButton) then { + GVAR(camDolly) set [0, _deltaX * -100 * GVAR(camSpeed)]; + GVAR(camDolly) set [1, _deltaY * 100 * GVAR(camSpeed)]; +} else { + if (_rightButton) then { + // Pan/Tilt amount should be influnced by zoom level (it should really be exponential) + _zoomMod = (GVAR(camZoom) * 0.8) max 1; + + GVAR(camPan) = GVAR(camPan) - ((_deltaX * 360) / _zoomMod); + GVAR(camTilt) = ((GVAR(camTilt) + ((_deltaY * 180) / _zoomMod)) min 89) max -89; + }; +}; + +GVAR(mousePos) = [_x,_y]; diff --git a/addons/spectator/functions/fnc_handleToolbar.sqf b/addons/spectator/functions/fnc_handleToolbar.sqf new file mode 100644 index 0000000000..878f3e46de --- /dev/null +++ b/addons/spectator/functions/fnc_handleToolbar.sqf @@ -0,0 +1,54 @@ +/* + * Author: Karel Moricky, SilentSpike + * Handles the spectator UI toolbar values + * + * Arguments: + * 0: Parameters + * 1: PFH handle + * + * Return Value: + * None + * + * Example: + * [ace_spectator_fnc_handleToolbar, 0, _display] call CBA_fnc_addPerFrameHandler; + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_display"]; + +// Kill PFH when toolbar hidden (or display is closed) +if (isNil QGVAR(toolHandler)) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; + +private ["_name","_vision","_fov","_speed","_mode","_time","_toolbar"]; +_toolbar = _display displayCtrl IDC_TOOL; + +// Find all tool values +if (GVAR(camMode) == 0) then { + _vision = if (GVAR(camVision) >= 0) then {localize LSTRING(VisionThermal)} else { [localize LSTRING(VisionNight), localize LSTRING(VisionNormal)] select (GVAR(camVision) < -1) }; + _fov = format ["%1x", floor(GVAR(camZoom) * 100) * 0.01]; + _speed = format ["%1 m/s", floor(GVAR(camSpeed) * 100) * 0.01]; +} else { + _vision = [side group GVAR(camUnit)] call BIS_fnc_sideName; + _fov = format ["%1 m", floor(getPosASL GVAR(camUnit) select 2)]; + _speed = format ["%1 km/h", floor(speed GVAR(camUnit)) max 0]; +}; + +if (alive GVAR(camUnit)) then { + _name = GETVAR(GVAR(camUnit),GVAR(uName),""); +} else { + _name = localize "STR_Special_None"; +}; + +_mode = [localize LSTRING(ViewFree),localize LSTRING(ViewInternal),localize LSTRING(ViewExternal)] select GVAR(camMode); +_time = [daytime,"HH:MM"] call BIS_fnc_timeToString; + +// Update the UI tools +(_toolbar controlsGroupCtrl IDC_TOOL_CLOCK) ctrlSetText _time; +(_toolbar controlsGroupCtrl IDC_TOOL_VISION) ctrlSetText _vision; +(_toolbar controlsGroupCtrl IDC_TOOL_FOV) ctrlSetText _fov; +(_toolbar controlsGroupCtrl IDC_TOOL_NAME) ctrlSetText _name; +(_toolbar controlsGroupCtrl IDC_TOOL_SPEED) ctrlSetText _speed; +(_toolbar controlsGroupCtrl IDC_TOOL_VIEW) ctrlSetText _mode; diff --git a/addons/spectator/functions/fnc_handleUnits.sqf b/addons/spectator/functions/fnc_handleUnits.sqf new file mode 100644 index 0000000000..c32961024c --- /dev/null +++ b/addons/spectator/functions/fnc_handleUnits.sqf @@ -0,0 +1,40 @@ +/* + * Author: SilentSpike + * Maintains the spectatable unit list and updates the unit tree accordingly + * Also updates current camera unit when status changes + * + * Arguments: + * 0: Parameters + * 1: PFH handle + * + * Return Value: + * None + * + * Example: + * [ace_spectator_fnc_handleUnits, 10, _display] call CBA_fnc_addPerFrameHandler; + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_display"]; + +// Kill PFH when display is closed +if (isNull _display) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; + +// Remove all dead and null units from the list +[] call FUNC(updateUnits); + +// Camera shouldn't stay on unit that isn't in the list (unless dead) +if !(GVAR(camUnit) in GVAR(unitList)) then { + if (alive GVAR(camUnit) || isNull GVAR(camUnit)) then { + [nil,1] call FUNC(cycleCamera); + }; +}; + +// Reduce overhead when unit tree is hidden +if (ctrlShown (_display displayCtrl IDC_UNIT)) then { + // Reduce overhead by spreading across frames + [FUNC(handleInterface),["onUnitsUpdate",[(_display displayCtrl IDC_UNIT) controlsGroupCtrl IDC_UNIT_TREE]],1] call EFUNC(common,waitAndExecute); +}; diff --git a/addons/spectator/functions/fnc_interrupt.sqf b/addons/spectator/functions/fnc_interrupt.sqf new file mode 100644 index 0000000000..48cca7d102 --- /dev/null +++ b/addons/spectator/functions/fnc_interrupt.sqf @@ -0,0 +1,44 @@ +/* + * Author: SilentSpike + * Interrupts the spectator interface for external systems + * + * Arguments: + * 0: Reason + * 1: Interrupting + * + * Return Value: + * None + * + * Example: + * ["mySystem"] call ace_spectator_fnc_interrupt + * + * Public: Yes + */ +#include "script_component.hpp" + +params [["_reason", "", [""]], ["_interrupt", true, [true]]]; + +// Nothing to do when spectator is closed +if !(GVAR(isSet)) exitWith {}; + +if (_reason == "") exitWith { ERROR("Invalid Reason"); }; +if (_interrupt) then { + GVAR(interrupts) pushBack _reason; +} else { + GVAR(interrupts) = GVAR(interrupts) - [_reason]; +}; + +if (GVAR(interrupts) isEqualTo []) then { + if (isNull (findDisplay 12249)) then { + createDialog QGVAR(interface); + [] call FUNC(transitionCamera); + }; +} else { + if !(isNull (findDisplay 12249)) then { + while {dialog} do { + closeDialog 0; + }; + + (findDisplay 12249) closeDisplay 0; + }; +}; diff --git a/addons/spectator/functions/fnc_moduleSpectatorSettings.sqf b/addons/spectator/functions/fnc_moduleSpectatorSettings.sqf new file mode 100644 index 0000000000..52b6e5d8fa --- /dev/null +++ b/addons/spectator/functions/fnc_moduleSpectatorSettings.sqf @@ -0,0 +1,25 @@ +/* + * Author: SilentSpike + * Read spectator settings from module + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; + +if !(_activated) exitWith {}; + +[_logic, QGVAR(filterUnits), "unitsFilter"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(filterSides), "sidesFilter"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(restrictModes), "cameraModes"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(restrictVisions), "visionModes"] call EFUNC(common,readSettingFromModule); diff --git a/addons/spectator/functions/fnc_respawnTemplate.sqf b/addons/spectator/functions/fnc_respawnTemplate.sqf new file mode 100644 index 0000000000..b808c43eab --- /dev/null +++ b/addons/spectator/functions/fnc_respawnTemplate.sqf @@ -0,0 +1,44 @@ +/* + * Author: SilentSpike + * The ace_spectator respawn template, handles killed + respawn + * Can be used via BI's respawn framework, see: + * https://community.bistudio.com/wiki/Arma_3_Respawn + * + * Arguments: + * 0: Corpse/New Unit + * 1: Killer/Old Unit + * 2: Respawn Type + * 3: Respawn Delay + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +params [["_unit",objNull,[objNull]], ["_killer",objNull,[objNull]], ["_respawn",0,[0]], ["_respawnDelay",0,[0]]]; +private ["_vision","_pos"]; + +// End mission when all are dead with respawn type "None" +if ((_respawn == 0) && {{alive _x} count allPlayers <= 0}) exitWith { + [["endDeath",false],"BIS_fnc_endMission"] call EFUNC(common,execRemoteFnc); +}; + +if (isNull _killer) then {_killer = _unit}; +_vision = [-2,-1] select (sunOrMoon < 1); +_pos = (getPosATL _unit) vectorAdd [0,0,5]; + +if (alive _unit) then { + if (_respawn == 1) then { + [_unit,QGVAR(isSeagull)] call EFUNC(common,hideUnit); + [2,_killer,_vision,_pos,getDir _unit] call FUNC(setCameraAttributes); + [true] call FUNC(setSpectator); + } else { + [false] call FUNC(setSpectator); + }; +} else { + [2,_killer,_vision,_pos,getDir _unit] call FUNC(setCameraAttributes); + [true] call FUNC(setSpectator); +}; diff --git a/addons/spectator/functions/fnc_setCameraAttributes.sqf b/addons/spectator/functions/fnc_setCameraAttributes.sqf new file mode 100644 index 0000000000..8eb6fe51ac --- /dev/null +++ b/addons/spectator/functions/fnc_setCameraAttributes.sqf @@ -0,0 +1,67 @@ +/* + * Author: SilentSpike + * Sets the spectator camera attributes as desired + * + * Arguments: + * 0: Camera mode + * - 0: Free + * - 1: Internal + * - 2: External + * 1: Camera unit (objNull for random) + * 2: Camera vision + * - -2: Normal + * - -1: Night vision + * - 0: Thermal white hot + * - 1: Thermal black hot + * 3: Camera position (ATL) + * 4: Camera pan (0 - 360) + * 5: Camera tilt (-90 - 90) + * 6: Camera zoom (0.01 - 2) + * 7: Camera speed in m/s (0.05 - 10) + * + * Return Value: + * None + * + * Example: + * [1, objNull] call ace_spectator_fnc_setCameraAttributes + * + * Public: Yes + */ + +#include "script_component.hpp" + +params [ + ["_mode",GVAR(camMode),[0]], + ["_unit",GVAR(camUnit),[objNull]], + ["_vision",GVAR(camVision),[0]], + ["_position",ASLtoATL GVAR(camPos),[[]],3], + ["_heading",GVAR(camPan),[0]], + ["_tilt",GVAR(camTilt),[0]], + ["_zoom",GVAR(camZoom),[0]], + ["_speed",GVAR(camSpeed),[0]] +]; + +// Normalize input +if !(_mode in GVAR(availableModes)) then { + _mode = GVAR(availableModes) select ((GVAR(availableModes) find GVAR(camMode)) max 0); +}; + +if !(_vision in GVAR(availableVisions)) then { + _vision = GVAR(availableVisions) select ((GVAR(availableVisions) find GVAR(camVision)) max 0); +}; + +GVAR(camPan) = _heading % 360; +GVAR(camSpeed) = (_speed max 0.05) min 10; +GVAR(camTilt) = (_tilt max -89) min 89; +GVAR(camUnit) = _unit; +GVAR(camVision) = _vision; +GVAR(camZoom) = (_zoom min 2) max 0.01; + +// Apply if camera exists +if (isNil QGVAR(camera)) then { + GVAR(camMode) = _mode; + GVAR(camPos) = (ATLtoASL _position); +} else { + [_mode,_unit,_vision] call FUNC(transitionCamera); + GVAR(camera) setPosATL _position; +}; diff --git a/addons/spectator/functions/fnc_setSpectator.sqf b/addons/spectator/functions/fnc_setSpectator.sqf new file mode 100644 index 0000000000..621100a5ba --- /dev/null +++ b/addons/spectator/functions/fnc_setSpectator.sqf @@ -0,0 +1,126 @@ +/* + * Author: SilentSpike + * Sets local client to the given spectator state (virtually) + * To physically handle a spectator see ace_spectator_fnc_stageSpectator + * + * Client will be able to communicate in ACRE/TFAR as appropriate + * The spectator interface will be opened/closed + * + * Arguments: + * 0: Spectator state of local client + * + * Return Value: + * None + * + * Example: + * [true] call ace_spectator_fnc_setSpectator + * + * Public: Yes + */ + +#include "script_component.hpp" + +params [["_set",true,[true]]]; + +// Only clients can be spectators +if !(hasInterface) exitWith {}; + +// Exit if no change +if (_set isEqualTo GVAR(isSet)) exitwith {}; + +// Handle common addon audio +if (["ace_hearing"] call EFUNC(common,isModLoaded)) then {EGVAR(hearing,disableVolumeUpdate) = _set}; +if (["acre_sys_radio"] call EFUNC(common,isModLoaded)) then {[_set] call acre_api_fnc_setSpectator}; +if (["task_force_radio"] call EFUNC(common,isModLoaded)) then {[player, _set] call TFAR_fnc_forceSpectator}; + +if (_set) then { + // Initalize camera variables + GVAR(camBoom) = 0; + GVAR(camDolly) = [0,0]; + GVAR(camGun) = false; + + // Initalize display variables + GVAR(ctrlKey) = false; + GVAR(heldKeys) = []; + GVAR(heldKeys) resize 255; + GVAR(mouse) = [false,false]; + GVAR(mousePos) = [0.5,0.5]; + GVAR(treeSel) = objNull; + + // Update units before opening to support pre-set camera unit + [] call FUNC(updateUnits); + + // Initalize the camera view + GVAR(camera) = "Camera" camCreate (ASLtoATL GVAR(camPos)); + [] call FUNC(transitionCamera); + + // Close map and clear radio + openMap [false,false]; + clearRadio; + + // Disable BI damage effects + BIS_fnc_feedback_allowPP = false; + + // Close any open dialogs + while {dialog} do { + closeDialog 0; + }; + + // Create the display + (findDisplay 46) createDisplay QGVAR(interface); + + // Cache and disable nametag settings + if (["ace_nametags"] call EFUNC(common,isModLoaded)) then { + GVAR(nametagSettingCache) = [EGVAR(nametags,showPlayerNames), EGVAR(nametags,showNamesForAI)]; + EGVAR(nametags,showPlayerNames) = 0; + EGVAR(nametags,showNamesForAI) = false; + }; +} else { + // Close any open dialogs (could be interrupts) + while {dialog} do { + closeDialog 0; + }; + + // Kill the display + (findDisplay 12249) closeDisplay 0; + + // Terminate camera + GVAR(camera) cameraEffect ["terminate", "back"]; + camDestroy GVAR(camera); + + clearRadio; + + // Return to player view + player switchCamera "internal"; + + // Enable BI damage effects + BIS_fnc_feedback_allowPP = true; + + // Cleanup camera variables + GVAR(camera) = nil; + GVAR(camBoom) = nil; + GVAR(camDolly) = nil; + GVAR(camGun) = nil; + + // Cleanup display variables + GVAR(ctrlKey) = nil; + GVAR(heldKeys) = nil; + GVAR(mouse) = nil; + GVAR(mousePos) = nil; + GVAR(treeSel) = nil; + + // Reset nametag settings + if (["ace_nametags"] call EFUNC(common,isModLoaded)) then { + EGVAR(nametags,showPlayerNames) = GVAR(nametagSettingCache) select 0; + EGVAR(nametags,showNamesForAI) = GVAR(nametagSettingCache) select 1; + GVAR(nametagSettingCache) = nil; + }; +}; + +// Reset interruptions +GVAR(interrupts) = []; + +// Mark spectator state for reference +GVAR(isSet) = _set; + +["spectatorSet",[_set]] call EFUNC(common,localEvent); diff --git a/addons/spectator/functions/fnc_stageSpectator.sqf b/addons/spectator/functions/fnc_stageSpectator.sqf new file mode 100644 index 0000000000..7f0d862719 --- /dev/null +++ b/addons/spectator/functions/fnc_stageSpectator.sqf @@ -0,0 +1,68 @@ +/* + * Author: SilentSpike + * Sets target unit to the given spectator state (physically) + * To virtually handle a spectator see ace_spectator_fnc_setSpectator + * + * Units will be gathered at marker ace_spectator_respawn (or [0,0,0] by default) + * Upon unstage, units will be moved to the position they were in upon staging + * + * Arguments: + * 0: Unit to put into spectator stage + * 1: Spectator stage + * + * Return Value: + * None + * + * Example: + * [player, false] call ace_spectator_fnc_stageSpectator + * + * Public: Yes + */ + +#include "script_component.hpp" + +params [["_unit",player,[objNull]], ["_set",true,[true]]]; + +// No change, no service (but allow spectators to be reset) +if !(_set || (GETVAR(_unit,GVAR(isStaged),false))) exitWith {}; + +if !(local _unit) exitwith { + [[_unit, _set], QFUNC(stageSpectator), _unit] call EFUNC(common,execRemoteFnc); +}; + +// Prevent unit falling into water +_unit enableSimulation !_set; + +// Move to/from group as appropriate +[_unit, _set, QGVAR(isStaged), side group _unit] call EFUNC(common,switchToGroupSide); + +if (_set) then { + // Position should only be saved on first entry + if !(GETVAR(_unit,GVAR(isStaged),false)) then { + GVAR(oldPos) = getPosATL _unit; + }; + + // Ghosts can't talk + [_unit, QGVAR(isStaged)] call EFUNC(common,hideUnit); + [_unit, QGVAR(isStaged)] call EFUNC(common,muteUnit); + + _unit setPos (markerPos QGVAR(respawn)); +} else { + // Physical beings can talk + [_unit, QGVAR(isStaged)] call EFUNC(common,unhideUnit); + [_unit, QGVAR(isStaged)] call EFUNC(common,unmuteUnit); + + _unit setPosATL GVAR(oldPos); +}; + +// Spectators ignore damage (vanilla and ace_medical) +_unit allowDamage !_set; +_unit setVariable [QEGVAR(medical,allowDamage), !_set]; + +// No theoretical change if an existing spectator was reset +if !(_set isEqualTo (GETVAR(_unit,GVAR(isStaged),false))) then { + // Mark spectator state for reference + _unit setVariable [QGVAR(isStaged), _set, true]; + + ["spectatorStaged",[_set]] call EFUNC(common,localEvent); +}; diff --git a/addons/spectator/functions/fnc_toggleInterface.sqf b/addons/spectator/functions/fnc_toggleInterface.sqf new file mode 100644 index 0000000000..4a03de4271 --- /dev/null +++ b/addons/spectator/functions/fnc_toggleInterface.sqf @@ -0,0 +1,82 @@ +/* + * Author: SilentSpike + * Correctly handles toggling of spectator interface elements for clean UX + * + * Arguments: + * 0: Display + * 1: Toogle compass + * 2: Toogle help + * 3: Toogle interface + * 4: Toogle map + * 5: Toogle toolbar + * 6: Toogle unit list + * + * Return Value: + * None + * + * Example: + * [_dsiplay, nil, true] call ace_spectator_fnc_toggleInterface + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_display", ["_toggleComp",false], ["_toggleHelp",false], ["_toggleInterface",false], ["_toggleMap",false], ["_toggleTool",false], ["_toggleUnit",false]]; + +private ["_comp","_help","_map","_tool","_unit"]; +_comp = _display displayCtrl IDC_COMP; +_help = _display displayCtrl IDC_HELP; +_map = _display displayCtrl IDC_MAP; +_tool = _display displayCtrl IDC_TOOL; +_unit = _display displayCtrl IDC_UNIT; + +// Map operates outside of interface +GVAR(showMap) = [GVAR(showMap), !GVAR(showMap)] select _toggleMap; +_map ctrlShow GVAR(showMap); + +if (GVAR(showMap)) then { + // When map is shown, temporarily hide interface to stop overlapping + { + _x ctrlShow false; + } forEach [_comp,_help,_tool,_unit]; + + // Centre map on camera/unit upon opening + if (_toggleMap) then { + _map ctrlMapAnimAdd [0, 0.5, [GVAR(camUnit),GVAR(camera)] select (GVAR(camMode) == 0)]; + ctrlMapAnimCommit _map; + }; +} else { + // Can only toggle interface with map minimised + GVAR(showInterface) = [GVAR(showInterface), !GVAR(showInterface)] select _toggleInterface; + + if (GVAR(showInterface)) then { + // Can only toggle interface elements with interface shown + GVAR(showComp) = [GVAR(showComp), !GVAR(showComp)] select _toggleComp; + GVAR(showHelp) = [GVAR(showHelp), !GVAR(showHelp)] select _toggleHelp; + GVAR(showTool) = [GVAR(showTool), !GVAR(showTool)] select _toggleTool; + GVAR(showUnit) = [GVAR(showUnit), !GVAR(showUnit)] select _toggleUnit; + + _comp ctrlShow GVAR(showComp); + _help ctrlShow GVAR(showHelp); + _tool ctrlShow GVAR(showTool); + _unit ctrlShow GVAR(showUnit); + } else { + { + _x ctrlShow false; + } forEach [_comp,_help,_tool,_unit]; + }; +}; + +// Only run PFHs when respective control is shown, otherwise kill +if (ctrlShown _comp) then { + if (isNil QGVAR(compHandler)) then { GVAR(compHandler) = [FUNC(handleCompass), 0, _display] call CBA_fnc_addPerFrameHandler; }; +} else { + GVAR(compHandler) = nil; +}; + +if (ctrlShown _tool) then { + if (isNil QGVAR(toolHandler)) then { GVAR(toolHandler) = [FUNC(handleToolbar), 0, _display] call CBA_fnc_addPerFrameHandler; }; +} else { + GVAR(toolHandler) = nil; +}; diff --git a/addons/spectator/functions/fnc_transitionCamera.sqf b/addons/spectator/functions/fnc_transitionCamera.sqf new file mode 100644 index 0000000000..72cb9f1a45 --- /dev/null +++ b/addons/spectator/functions/fnc_transitionCamera.sqf @@ -0,0 +1,111 @@ +/* + * Author: SilentSpike + * Transitions the spectator camera vision/view/unit + * + * Arguments: + * 0: Camera mode + * - 0: Free + * - 1: Internal + * - 2: External + * 1: Camera unit + * 2: Vision mode + * - -2: Normal + * - -1: NV + * - 0: White hot + * - 1: Black hot + * + * Return Value: + * None + * + * Example: + * [0,objNull] call ace_spectator_fnc_transitionCamera + * + * Public: No + */ + +#include "script_component.hpp" + +params [["_newMode",GVAR(camMode)], ["_newUnit",GVAR(camUnit)], ["_newVision",GVAR(camVision)]]; + +// If new mode isn't available then keep current (unless current also isn't) +if !(_newMode in GVAR(availableModes)) then { + _newMode = GVAR(availableModes) select ((GVAR(availableModes) find GVAR(camMode)) max 0); +}; + +// When no units available to spectate, exit to freecam +if ((GVAR(unitList) isEqualTo []) && (alive _newUnit || isNull _newUnit)) then { + _newMode = 0; + _newUnit = objNull; +}; + +// Reset gun cam if not internal +if (_newMode != 1) then { + GVAR(camGun) = false; +}; + +if (_newMode == 0) then { // Free + // Preserve camUnit value for consistency when manually changing view + GVAR(camera) cameraEffect ["internal", "back"]; + showCinemaBorder false; + cameraEffectEnableHUD true; + + // Apply the camera zoom + GVAR(camera) camSetFov -(linearConversion [0.01,2,GVAR(camZoom),-2,-0.01,true]); + GVAR(camera) camCommit 0; + + // Agent is switched to in free cam to hide death table and prevent AI chat while allowing icons to draw (also prevents systemChat and unit HUD) + // (Why is so much stuff tied into the current camera unit BI?!) + if (isNull GVAR(camAgent)) then { + GVAR(camAgent) = createAgent ["VirtualMan_F",markerPos QGVAR(respawn),[],0,""]; + }; + + GVAR(camAgent) switchCamera "internal"; + clearRadio; + + // If new vision isn't available then keep current (unless current also isn't) + if !(_newVision in GVAR(availableVisions)) then { + _newVision = GVAR(availableVisions) select ((GVAR(availableVisions) find GVAR(camVision)) max 0); + }; + + // Vision mode only applies to free cam + if (_newVision < 0) then { + false setCamUseTi 0; + camUseNVG (_newVision >= -1); + } else { + true setCamUseTi _newVision; + }; + GVAR(camVision) = _newVision; + + // Handle camera movement + if (isNil QGVAR(camHandler)) then { GVAR(camHandler) = [FUNC(handleCamera), 0] call CBA_fnc_addPerFrameHandler; }; +} else { + // When null unit is given choose random + if (isNull _newUnit) then { + _newUnit = GVAR(unitList) select floor(random(count GVAR(unitList))); + }; + + if (_newMode == 1) then { // Internal + // Handle gun cam + if (GVAR(camGun)) then { + _newUnit switchCamera "gunner"; + } else { + _newUnit switchCamera "internal"; + }; + } else { // External + _newUnit switchCamera "external"; + }; + + // Clear radio if group changed + if (group _newUnit != group GVAR(camUnit)) then { + clearRadio; + }; + + GVAR(camUnit) = _newUnit; + + // Terminate camera view + GVAR(camera) cameraEffect ["terminate", "back"]; + GVAR(camHandler) = nil; + cameraEffectEnableHUD true; +}; + +GVAR(camMode) = _newMode; diff --git a/addons/spectator/functions/fnc_updateCameraModes.sqf b/addons/spectator/functions/fnc_updateCameraModes.sqf new file mode 100644 index 0000000000..aef51b56c6 --- /dev/null +++ b/addons/spectator/functions/fnc_updateCameraModes.sqf @@ -0,0 +1,48 @@ +/* + * Author: SilentSpike + * Adds or removes spectator camera modes from the selection available to the local player. + * Possible camera modes are: + * - 0: Free + * - 1: Internal + * - 2: External + * + * Arguments: + * 0: Camera modes to add + * 1: Camera modes to remove + * + * Return Value: + * Available camera modes + * + * Example: + * [[0], [1,2]] call ace_spectator_fnc_updateCameraModes + * + * Public: Yes + */ + +#include "script_component.hpp" + +params [["_addModes",[],[[]]], ["_removeModes",[],[[]]]]; +private ["_newModes","_currentModes"]; + +_currentModes = GVAR(availableModes); + +// Restrict additions to only possible values +_newModes = _addModes arrayIntersect [0,1,2]; +_newModes append (_currentModes - _removeModes); + +_newModes = _newModes arrayIntersect _newModes; +_newModes sort true; + +// Can't become an empty array +if (_newModes isEqualTo []) then { + ["Cannot remove all camera modes (%1)", QFUNC(updateCameraModes)] call BIS_fnc_error; +} else { + GVAR(availableModes) = _newModes; +}; + +// Update camera in case of change +if !(isNil QGVAR(camera)) then { + [] call FUNC(transitionCamera); +}; + +_newModes diff --git a/addons/spectator/functions/fnc_updateSpectatableSides.sqf b/addons/spectator/functions/fnc_updateSpectatableSides.sqf new file mode 100644 index 0000000000..57f7756d54 --- /dev/null +++ b/addons/spectator/functions/fnc_updateSpectatableSides.sqf @@ -0,0 +1,33 @@ +/* + * Author: SilentSpike + * Adds or removes sides from the selection available to spectate by the local player. + * Note that the side filter setting is applied to the available sides dynamically. + * + * Default selection is [west,east,resistance,civilian] + * + * Arguments: + * 0: Sides to add + * 1: Sides to remove + * + * Return Value: + * Spectatable sides + * + * Example: + * [[west], [east,civilian]] call ace_spectator_fnc_updateSpectatableSides + * + * Public: Yes + */ + +#include "script_component.hpp" + +params [["_addSides",[],[[]]], ["_removeSides",[],[[]]]]; + +// Add and remove sides +_addSides append (GVAR(availableSides) - _removeSides); + +// Only need array of unique sides +_addSides = _addSides arrayIntersect _addSides; + +GVAR(availableSides) = _addSides; + +_addSides diff --git a/addons/spectator/functions/fnc_updateUnits.sqf b/addons/spectator/functions/fnc_updateUnits.sqf new file mode 100644 index 0000000000..50494cf499 --- /dev/null +++ b/addons/spectator/functions/fnc_updateUnits.sqf @@ -0,0 +1,75 @@ +/* + * Author: SilentSpike + * Adds units to spectator whitelist/blacklist and refreshes the filter units + * + * Arguments: + * 0: Units to add to the whitelist + * 1: Use blacklist + * + * Return Value: + * None + * + * Example: + * [allUnits,true] call ace_spectator_fnc_updateUnits + * + * Public: Yes + */ + +#include "script_component.hpp" + +params [["_newUnits",[],[[]]],["_blacklist",false,[false]]]; + +// Function only matters on player clients +if !(hasInterface) exitWith {}; + +// If adding to a list we can exit here, since it won't show up until the UI refreshes anyway +if !(_newUnits isEqualTo []) exitWith { + if (_blacklist) then { + GVAR(unitWhitelist) = GVAR(unitWhitelist) - _newUnits; + GVAR(unitBlacklist) append _newUnits; + } else { + GVAR(unitBlacklist) = GVAR(unitBlacklist) - _newUnits; + GVAR(unitWhitelist) append _newUnits; + }; +}; + +private ["_sides","_cond","_filteredUnits","_filteredGroups"]; + +// Unit setting filter +_newUnits = [[],allPlayers,playableUnits,allUnits] select GVAR(filterUnits); + +// Side setting filter +_sides = []; +_cond = [{_this == (side group player)},{(_this getFriend (side group player)) >= 0.6},{(_this getFriend (side group player)) < 0.6},{true}] select GVAR(filterSides); +{ + if (_x call _cond) then { + _sides pushBack _x; + }; +} forEach GVAR(availableSides); + +// Filter units and append to list +_filteredUnits = []; +{ + if ( + (alive _x) && + {(_x isKindOf "CAManBase")} && + {(side group _x) in _sides} && // Side filter + {simulationEnabled _x} && + {!(_x getVariable [QGVAR(isStaged), false])} // Who watches the watchmen? + ) then { + _filteredUnits pushBack _x; + }; +} forEach (_newUnits - GVAR(unitBlacklist)); +_filteredUnits append GVAR(unitWhitelist); + +// Cache icons and colour for drawing +_filteredGroups = []; +{ + // Intentionally re-applied to units in case their status changes + [_x] call FUNC(cacheUnitInfo); + _filteredGroups pushBack (group _x); +} forEach _filteredUnits; + +// Replace previous lists entirely (removes any no longer valid) +GVAR(unitList) = _filteredUnits arrayIntersect _filteredUnits; +GVAR(groupList) = _filteredGroups arrayIntersect _filteredGroups; diff --git a/addons/spectator/functions/fnc_updateVisionModes.sqf b/addons/spectator/functions/fnc_updateVisionModes.sqf new file mode 100644 index 0000000000..2a1e500f3f --- /dev/null +++ b/addons/spectator/functions/fnc_updateVisionModes.sqf @@ -0,0 +1,56 @@ +/* + * Author: SilentSpike + * Adds or removes spectator vision modes from the selection available to the local player. + * The default selection is [-2,-1,0,1]. + * Possible vision modes are: + * - -2: Normal + * - -1: Night vision + * - 0: White hot + * - 1: Black hot + * - 2: Light Green Hot / Darker Green cold + * - 3: Black Hot / Darker Green cold + * - 4: Light Red Hot / Darker Red Cold + * - 5: Black Hot / Darker Red Cold + * - 6: White Hot / Darker Red Cold + * - 7: Thermal (Shade of Red and Green, Bodies are white) + * + * Arguments: + * 0: Vision modes to add + * 1: Vision modes to remove + * + * Return Value: + * Available vision modes + * + * Example: + * [[0], [1,2]] call ace_spectator_fnc_updateVisionModes + * + * Public: Yes + */ + +#include "script_component.hpp" + +params [["_addModes",[],[[]]], ["_removeModes",[],[[]]]]; +private ["_newModes","_currentModes"]; + +_currentModes = GVAR(availableVisions); + +// Restrict additions to only possible values +_newModes = _addModes arrayIntersect [-2,-1,0,1,2,3,4,5,6,7]; +_newModes append (_currentModes - _removeModes); + +_newModes = _newModes arrayIntersect _newModes; +_newModes sort true; + +// Can't become an empty array +if (_newModes isEqualTo []) then { + ["Cannot remove all vision modes (%1)", QFUNC(updateVisionModes)] call BIS_fnc_error; +} else { + GVAR(availableVisions) = _newModes; +}; + +// Update camera in case of change +if !(isNil QGVAR(camera)) then { + [] call FUNC(transitionCamera); +}; + +_newModes diff --git a/addons/spectator/functions/script_component.hpp b/addons/spectator/functions/script_component.hpp new file mode 100644 index 0000000000..d5034cb39c --- /dev/null +++ b/addons/spectator/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\spectator\script_component.hpp" \ No newline at end of file diff --git a/addons/spectator/script_component.hpp b/addons/spectator/script_component.hpp new file mode 100644 index 0000000000..de2ee22363 --- /dev/null +++ b/addons/spectator/script_component.hpp @@ -0,0 +1,57 @@ +#define COMPONENT spectator +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_SPECTATOR + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_SPECTATOR + #define DEBUG_SETTINGS DEBUG_SETTINGS_SPECTATOR +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +// UI grid +#define SIZEX ((safezoneW / safezoneH) min 1.2) +#define SIZEY (SIZEX / 1.2) +#define W_PART(num) (num * (SIZEX / 40)) +#define H_PART(num) (num * (SIZEY / 25)) +#define X_PART(num) (W_PART(num) + (safezoneX + (safezoneW - SIZEX)/2)) +#define Y_PART(num) (H_PART(num) + (safezoneY + (safezoneH - SIZEY)/2)) + +// UI tools +#define TOOL_H H_PART(1) +#define TOOL_W W_PART(5) +#define MARGIN TOOL_W * 0.05 + +// UI compass +#define COMPASS_W (TOOL_W * 4) +#define COMPASS_X (safeZoneX + safeZoneW * 0.5 - COMPASS_W * 0.5) + +// UI IDCs +#define IDC_COMP 4490 +#define IDC_COMP_0 5000 +#define IDC_COMP_90 5090 +#define IDC_COMP_180 5180 +#define IDC_COMP_270 5270 + +#define IDC_HELP 7631 +#define IDC_HELP_LIST 7622 + +#define IDC_MAP 6791 + +#define IDC_TOOL 3000 +#define IDC_TOOL_CLOCK 3003 +#define IDC_TOOL_FOV 3005 +#define IDC_TOOL_NAME 3001 +#define IDC_TOOL_SPEED 3006 +#define IDC_TOOL_VIEW 3002 +#define IDC_TOOL_VISION 3004 + +#define IDC_UNIT 6002 +#define IDC_UNIT_TREE 6005 + +// UI colours +#define COL_BACK 0.1,0.1,0.1,0.7 +#define COL_FORE 1,1,1,1 +#define COL_FORE_D 0.1,0.1,0.1,0.8 diff --git a/addons/spectator/stringtable.xml b/addons/spectator/stringtable.xml new file mode 100644 index 0000000000..5c24224b72 --- /dev/null +++ b/addons/spectator/stringtable.xml @@ -0,0 +1,271 @@ + + + + + Spectator Settings + Ustawienia obserwatora + + + Configure how the spectator system will operate by default. + Skonfiguruj domyślne ustawienia obserwatora. + + + Unit filter + Filtr jednostek + + + Method of filtering spectatable units. + Wybierz jednostki, jakie będzie można obserwować po uruchomeniu obserwatora. + + + No units + Brak jednostek + + + Only players + Tylko gracze + + + Playable Units + Grywalne jednostki + + + All units + Wszystkie jednostki + + + Side filter + Filtr stron + + + Method of filtering spectatable sides. + Wybierz strony, jakie będzie można obserwować po uruchomeniu obserwatora. + + + Player side + Strona gracza + + + Friendly sides + Strony sojusznicze + + + Hostile sides + Strony wrogie + + + All sides + Wszystkie strony + + + Camera modes + Tryby kamery + + + Camera modes that can be used. + Tryby kamery, jakie mogą być używane. + + + All + Wszystkie + + + Free only + Tylko wolna + + + Internal only + Tylko wewnętrzna + + + External only + Tylko zewnętrzna + + + Internal and external + Wewnętrzna i zewnętrzna + + + Vision modes + Tryby wizji + + + Vision modes that can be used. + Tryby wizji, jakie mogą być używane. + + + Night vision + Noktowizja + + + Thermal imaging + Termowizja + + + + Spectator Units + Jednostki obserwatora + + + Spectator Controls + Sterowanie obserwatorem + + + Free + Wolna + + + Internal + Wewnętrzna + + + External + Zewnętrzna + + + Normal + Normalna + + + Night + Noc + + + Thermal + Termo + + + + Free Camera + Kamera swobodna + + + Camera Forward + Kamera naprzód + + + Camera Backward + Kamera w tył + + + Camera Left + Kamera w lewo + + + Camera Right + Kamera w prawo + + + Camera Up + Kamera w górę + + + Camera Down + Kamera w dół + + + Pan Camera + Panoramowanie + + + Dolly Camera + Płynna kamera + + + Lock Camera to Target + Zablokuj kamerę na celu + + + Speed Boost + Przyśpieszenie kamery + + + Focus on Unit + Skup na jednostce + + + Interface + Interfejs + + + Toggle Interface + Przełącz interfejs + + + Toggle Unit Icons + Przełącz ikony jednostek + + + Toggle Unit List + Przełącz listę jednostek + + + Toggle Toolbar + Przełącz pasek narzędzi + + + Toggle Compass + Przełącz kompas + + + Toggle Map + Przełącz mapę + + + Toggle Help + Przełącz pomoc + + + Camera Attributes + Atrybuty kamery + + + Next Camera + Następna kamera + + + Previous Camera + Poprzednia kamera + + + Next Unit + Następna jednostka + + + Previous Unit + Poprzednia jednostka + + + Next Vision Mode + Następny tryb wizji + + + Previous Vision Mode + Poprzedni tryb wizji + + + Adjust Zoom + Reguluj zoom + + + Adjust Speed + Reguluj prędkość + + + Increment Zoom + Reguluj zoom (krok) + + + Increment Speed + Reguluj prędkość (krok) + + + Reset Zoom + Resetuj zoom + + + Reset Speed + Resetuj prędkość + + + diff --git a/addons/spottingscope/CfgMoves.hpp b/addons/spottingscope/CfgMoves.hpp new file mode 100644 index 0000000000..c7436801ee --- /dev/null +++ b/addons/spottingscope/CfgMoves.hpp @@ -0,0 +1,28 @@ + +class CfgMovesBasic { + class DefaultDie; + + class ManActions { + ACE_SpottingScope = "ACE_SpottingScope"; + }; +}; + +class CfgMovesMaleSdr: CfgMovesBasic { + class States { + class ACE_KIA_SpottingScope: DefaultDie { + actions = "DeadActions"; + file = "\A3\anims_f\Data\Anim\Sdr\dth\pne\stp\ras\Rfl\AdthPpneMstpSrasWrflDnon_1"; + speed = 1; + looped = "false"; + terminal = 1; + soundEnabled = 0; + connectTo[] = {"Unconscious",0.1}; + }; + + class Crew; + class ACE_SpottingScope: Crew { + file = "\A3\anims_f\Data\Anim\Sdr\Mov\pne\stp\non\non\AmovPpneMstpSnonWnonDnon"; + interpolateTo[] = {"ACE_KIA_SpottingScope",1}; + }; + }; +}; diff --git a/addons/spottingscope/CfgVehicles.hpp b/addons/spottingscope/CfgVehicles.hpp index b0b8bf9c77..2c8159fbb1 100644 --- a/addons/spottingscope/CfgVehicles.hpp +++ b/addons/spottingscope/CfgVehicles.hpp @@ -77,7 +77,7 @@ class CfgVehicles { gunnerOpticsEffect[] = {"OpticsCHAbera1","OpticsBlur2"}; gunnerOutOpticsShowCursor = 0; gunnerOpticsShowCursor = 0; - gunnerAction = "gunner_static_low01"; + gunnerAction = "ACE_SpottingScope"; gunnerGetInAction = "GetInLow"; gunnerGetOutAction = "GetOutLow"; gunnerForceOptics = 0; diff --git a/addons/spottingscope/config.cpp b/addons/spottingscope/config.cpp index a615e5da79..157e430868 100644 --- a/addons/spottingscope/config.cpp +++ b/addons/spottingscope/config.cpp @@ -6,11 +6,12 @@ class CfgPatches { weapons[] = {"ACE_SpottingScope"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_apl", "ace_interaction"}; - author[] = {"Rocko", "Scubaman3D", "Ruthberg"}; + author[] = {"Rocko", "Scubaman3D", "Ruthberg", "commy2"}; VERSION_CONFIG; }; }; #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" -#include "CfgWeapons.hpp" \ No newline at end of file +#include "CfgWeapons.hpp" +#include "CfgMoves.hpp" diff --git a/addons/spottingscope/data/spottingscope.p3d b/addons/spottingscope/data/spottingscope.p3d index c4e0363dcf..fba9d66b91 100644 Binary files a/addons/spottingscope/data/spottingscope.p3d and b/addons/spottingscope/data/spottingscope.p3d differ diff --git a/addons/switchunits/functions/fnc_addMapFunction.sqf b/addons/switchunits/functions/fnc_addMapFunction.sqf index 7204e73d36..3a7b20601c 100644 --- a/addons/switchunits/functions/fnc_addMapFunction.sqf +++ b/addons/switchunits/functions/fnc_addMapFunction.sqf @@ -10,19 +10,18 @@ * None * * Example: - * [_unit, _sides] call FUNC(addMapFunction) + * [_unit, _sides] call ace_switchunits_fnc_addMapFunction * * Public: No */ - #include "script_component.hpp" -PARAMS_2(_unit,_sides); +params ["_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); }; - + }, [_unit, _sides]] call BIS_fnc_addStackedEventHandler; diff --git a/addons/switchunits/functions/fnc_handleMapClick.sqf b/addons/switchunits/functions/fnc_handleMapClick.sqf index e8efa2640f..03a94f81af 100644 --- a/addons/switchunits/functions/fnc_handleMapClick.sqf +++ b/addons/switchunits/functions/fnc_handleMapClick.sqf @@ -3,24 +3,25 @@ * Switches to a unit close to a clicked map position * * Arguments: - * 0: unit - * 1: sides > + * 0: Faction + * 0: unit + * 1: sides + * 1: Map Position * * Return Value: * None * * Example: - * [unit, _sides] call FUNC(handleMapClick) + * [[unit, _sides], [20, 30]] call ace_switchunits_fnc_handleMapClick * * Public: No */ - #include "script_component.hpp" -private ["_sides", "_pos", "_sideNearest"]; +private ["_sideNearest"]; -_sides = (_this select 0) select 1; -_pos = _this select 1; +params ["_faction", "_pos"]; +_faction params ["", "_sides"]; _sideNearest = []; @@ -28,7 +29,8 @@ _sideNearest = []; if ([_x] call FUNC(isValidAi) && (side group _x in _sides)) then { _sideNearest pushBack _x; }; -} forEach (nearestObjects [_pos, ["Man"], 15]); + nil +} count (nearestObjects [_pos, ["Man"], 15]); if (count _sideNearest > 0) then { [_sideNearest select 0] call FUNC(switchUnit); diff --git a/addons/switchunits/functions/fnc_initPlayer.sqf b/addons/switchunits/functions/fnc_initPlayer.sqf index 67669c071c..80388a9d2b 100644 --- a/addons/switchunits/functions/fnc_initPlayer.sqf +++ b/addons/switchunits/functions/fnc_initPlayer.sqf @@ -10,24 +10,21 @@ * None * * Example: - * [player, [west]] call FUNC(initPlayer) + * [player, [west]] call ace_switchunits_fnc_initPlayer * * Public: No */ - #include "script_component.hpp" -PARAMS_2(_playerUnit,_sides); +params ["_playerUnit", "_sides"]; if (vehicle _playerUnit == _playerUnit) then { - [_sides] call FUNC(markAiOnMap); _playerUnit setVariable [QGVAR(IsPlayerUnit), true]; _playerUnit allowDamage false; GVAR(OriginalUnit) = _playerUnit; - //GVAR(OriginalName) = [_playerUnit] call EFUNC(common,getName); GVAR(OriginalName) = name _playerUnit; GVAR(OriginalGroup) = group _playerUnit; diff --git a/addons/switchunits/functions/fnc_isValidAi.sqf b/addons/switchunits/functions/fnc_isValidAi.sqf index 61c2401da9..0b6a35c257 100644 --- a/addons/switchunits/functions/fnc_isValidAi.sqf +++ b/addons/switchunits/functions/fnc_isValidAi.sqf @@ -6,22 +6,19 @@ * 0: unit * * Return Value: - * Boolean + * Valid AI * * Example: - * [_unit] call FUNC(isValidAi) + * [_unit] call ace_switchunits_fnc_isValidAi * * Public: Yes */ - #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +params ["_unit"]; !([_unit] call EFUNC(common,isPlayer) || {_unit in playableUnits} -|| {vehicle _unit != _unit} -|| {_unit getVariable [QGVAR(IsPlayerUnit), false]} -|| {_unit getVariable [QGVAR(IsPlayerControlled), false]}) +|| {vehicle _unit != _unit} +|| {_unit getVariable [QGVAR(IsPlayerUnit), false]} +|| {_unit getVariable [QGVAR(IsPlayerControlled), false]}) // return diff --git a/addons/switchunits/functions/fnc_markAiOnMap.sqf b/addons/switchunits/functions/fnc_markAiOnMap.sqf index 620b805cb9..db43c58f43 100644 --- a/addons/switchunits/functions/fnc_markAiOnMap.sqf +++ b/addons/switchunits/functions/fnc_markAiOnMap.sqf @@ -1,7 +1,7 @@ /* * Author: bux578 * Creates markers for AI units for given sides. - * Marks players in a different colour. + * Marks players in a different colour. * * Arguments: * 0: side @@ -10,28 +10,24 @@ * None * * Example: - * [[west, east]] call FUNC(markAiOnMap) + * [[west, east]] call ace_switchunits_fnc_markAiOnMap * * Public: No */ - #include "script_component.hpp" -private "_sidesToShow"; -_sidesToShow = _this select 0; +params ["_sidesToShow"]; GVAR(AllMarkerNames) = []; -DFUNC(pfhMarkAiOnMap) = { - private ["_args", "_sides"]; - _args = _this select 0; - _sides = _args select 0; - +[{ + params ["_args"]; + _args params ["_sides"]; // delete markers { - deleteMarkerLocal _x; - } forEach GVAR(AllMarkerNames); + deleteMarkerLocal _x; + } count GVAR(AllMarkerNames); // reset the array GVAR(AllMarkerNames) = []; @@ -48,7 +44,7 @@ DFUNC(pfhMarkAiOnMap) = { _marker = createMarkerLocal [_markerName, position _x]; _markerName setMarkerTypeLocal "mil_triangle"; _markerName setMarkerShapeLocal "ICON"; - _markerName setMarkerSizeLocal [0.5,0.7]; + _markerName setMarkerSizeLocal [0.5, 0.7]; _markerName setMarkerDirLocal getDir _x; // commy's one liner magic @@ -63,9 +59,8 @@ DFUNC(pfhMarkAiOnMap) = { }; GVAR(AllMarkerNames) pushBack _markerName; + nil }; - } forEach allUnits; + } count allUnits; }; -}; - -[FUNC(pfhMarkAiOnMap), 1.5, [_sidesToShow]] call CBA_fnc_addPerFrameHandler; +}, 1.5, [_sidesToShow]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/switchunits/functions/fnc_module.sqf b/addons/switchunits/functions/fnc_module.sqf index 9563dea71f..ec9164a866 100644 --- a/addons/switchunits/functions/fnc_module.sqf +++ b/addons/switchunits/functions/fnc_module.sqf @@ -15,12 +15,11 @@ * * Public: No */ - #include "script_component.hpp" if !(isServer) exitWith {}; -EXPLODE_3_PVT(_this,_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/switchunits/functions/fnc_nearestPlayers.sqf b/addons/switchunits/functions/fnc_nearestPlayers.sqf index 987c4e3528..64e347d7da 100644 --- a/addons/switchunits/functions/fnc_nearestPlayers.sqf +++ b/addons/switchunits/functions/fnc_nearestPlayers.sqf @@ -10,7 +10,7 @@ * Player units > * * Example: - * [[300,300,0], 100] call FUNC(nearestPlayers) + * [[300,300,0], 100] call ace_switchunits_fnc_nearestPlayers * * Public: Yes */ @@ -18,10 +18,7 @@ private ["_nearestPlayers"]; -PARAMS_2(_position,_radius); - -_position = _this select 0; -_radius = _this select 1; +params ["_position", "_radius"]; _nearestPlayers = []; diff --git a/addons/switchunits/functions/fnc_startSwitchUnits.sqf b/addons/switchunits/functions/fnc_startSwitchUnits.sqf index 7985bfa094..481b04d2cd 100644 --- a/addons/switchunits/functions/fnc_startSwitchUnits.sqf +++ b/addons/switchunits/functions/fnc_startSwitchUnits.sqf @@ -9,14 +9,14 @@ * None * * Example: - * [_player] call FUNC(startSwitchUnits) + * [_player] call ace_switchunits_fnc_startSwitchUnits * * Public: No */ #include "script_component.hpp" -PARAMS_1(_player); +params ["_player"]; if (GVAR(EnableSwitchUnits)) then { private "_sides"; diff --git a/addons/switchunits/functions/fnc_switchBack.sqf b/addons/switchunits/functions/fnc_switchBack.sqf index c9ca731427..c3cb99588a 100644 --- a/addons/switchunits/functions/fnc_switchBack.sqf +++ b/addons/switchunits/functions/fnc_switchBack.sqf @@ -10,20 +10,19 @@ * None * * Example: - * [_originalPlayerUnit, _currentUnit] call FUNC(switchBack) + * [_originalPlayerUnit, _currentUnit] call ace_switchunits_fnc_switchBack * * Public: Yes */ - #include "script_component.hpp" -PARAMS_1(_originalPlayerUnit); +params ["_originalPlayerUnit"]; [_originalPlayerUnit] joinSilent GVAR(OriginalGroup); -DFUNC(pfhSwitchBack) = { - PARAMS_2(_args,_pfID); - EXPLODE_2_PVT(_args,_originalPlayerUnit,_currentUnit); +[{ + params ["_args", "_pfhId"]; + _args params ["_originalPlayerUnit", "_currentUnit"]; if (local _originalPlayerUnit) exitWith { selectPlayer _originalPlayerUnit; @@ -33,8 +32,6 @@ DFUNC(pfhSwitchBack) = { _layer = "BIS_fnc_respawnCounter" call bis_fnc_rscLayer; _layer cuttext ["","plain"]; - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [_pfhId] call cba_fnc_removePerFrameHandler; }; -}; - -[FUNC(pfhSwitchBack), 0.2, _this] call CBA_fnc_addPerFrameHandler; +}, 0.2, _this] call CBA_fnc_addPerFrameHandler; diff --git a/addons/switchunits/functions/fnc_switchUnit.sqf b/addons/switchunits/functions/fnc_switchUnit.sqf index c57012afdb..793e72bb71 100644 --- a/addons/switchunits/functions/fnc_switchUnit.sqf +++ b/addons/switchunits/functions/fnc_switchUnit.sqf @@ -3,24 +3,21 @@ * Switches to the new given player unit * * Arguments: - * 0: current unit - * 1: the unit to switch to + * 0: the unit to switch to * * Return Value: * None * * Example: - * [_unit] call FUNC(switchUnit) + * [_unit] call ace_switchunits_fnc_switchUnit * * Public: Yes */ - - #include "script_component.hpp" private ["_nearestEnemyPlayers", "_allNearestPlayers", "_oldUnit", "_leave"]; -PARAMS_1(_unit); +params ["_unit"]; // don't switch to original player units if (!([_unit] call FUNC(isValidAi))) exitWith {}; @@ -29,14 +26,12 @@ if (!([_unit] call FUNC(isValidAi))) exitWith {}; _leave = false; if (GVAR(EnableSafeZone)) then { - _allNearestPlayers = [position _unit, GVAR(SafeZoneRadius)] call FUNC(nearestPlayers); _nearestEnemyPlayers = [_allNearestPlayers, {((side GVAR(OriginalGroup)) getFriend (side _this) < 0.6) && !(_this getVariable [QGVAR(IsPlayerControlled), false])}] call EFUNC(common,filter); if (count _nearestEnemyPlayers > 0) exitWith { _leave = true; }; - }; // exitWith doesn't exit past the "if(EnableSafeZone)" block @@ -49,21 +44,12 @@ if (_leave) exitWith { //[_unit] joinSilent group player; [[_unit, player], QUOTE({(_this select 0) setVariable [ARR_3(QUOTE(QGVAR(OriginalOwner)), owner (_this select 0), true)]; (_this select 0) setOwner owner (_this select 1)}), 1] call EFUNC(common,execRemoteFnc); -_oldUnit = player; - - -DFUNC(pfhSwitchUnit) = { - - private ["_args", "_unit", "_oldUnit", "_respawnEhId", "_oldOwner"]; - _args = _this select 0; - - _unit = _args select 0; - _oldUnit = _args select 1; - - +[{ + private ["_respawnEhId", "_oldOwner"]; + params ["_args", "_pfhId"]; + _args params ["_unit", "_oldUnit"]; if (local _unit) exitWith { - _oldUnit setVariable [QGVAR(IsPlayerControlled), false, true]; _oldUnit setVariable [QGVAR(PlayerControlledName), "", true]; @@ -90,9 +76,6 @@ DFUNC(pfhSwitchUnit) = { [localize LSTRING(SwitchedUnit)] call EFUNC(common,displayTextStructured); - [(_this select 1)] call cba_fnc_removePerFrameHandler; - + [_pfhId] call cba_fnc_removePerFrameHandler; }; -}; - -[FUNC(pfhSwitchUnit), 0.2, [_unit, _oldUnit]] call CBA_fnc_addPerFrameHandler; +}, 0.2, [_unit, player]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/switchunits/stringtable.xml b/addons/switchunits/stringtable.xml index 2d0bc91314..71ef5a9704 100644 --- a/addons/switchunits/stringtable.xml +++ b/addons/switchunits/stringtable.xml @@ -32,6 +32,7 @@ Einheiten-Switch-System? Systém výměny stran Sistema de troca de unidades + Egységváltó-rendszer Switch to West? @@ -40,6 +41,7 @@ Nach BLUFOR wechseln? Přesunout k BLUFOR? Trocar para Oeste? + Átváltás BLUFOR-ra? Allow switching to west units? @@ -48,6 +50,7 @@ Erlaube das Wechseln zu BLUFOR-Einheiten? Povolit přesun k BLUFOR? Permitir troca de unidades para o Oeste? + Nyugat-fakciós egységekre való váltás engedélyezése? Switch to East? @@ -56,6 +59,7 @@ Nach OPFOR wechseln? Přesunout k OPFOR? Trocar para Leste? + Átváltás OPFOR-ra? Allow switching to east units? @@ -64,6 +68,7 @@ Erlaube das Wechseln zu OPFOR-Einheiten? Povolit přesun k OPFOR? Permitir troca de unidades para o Leste? + Kelet-fakciós egységekre való váltás engedélyezése? Switch to Independent? @@ -72,6 +77,7 @@ Nach INDFOR wechseln? Přesunout k INDFOR? Trocar para Indenpendente + Átváltás INDFOR-ra? Allow switching to independent units? @@ -80,6 +86,7 @@ Erlaube das Wechseln zu INDFOR-Einheiten? Povolit přesun k INDFOR? Permitir troca de unidades para o Indenpendente? + Független egységekre való váltás engedélyezése? Switch to Civilian? @@ -88,6 +95,7 @@ Nach CIVILIAN wechseln? Přesunout k CIVILISTŮM? Trocar para Civis? + Átváltás civilre? Allow switching to civilian units? @@ -96,6 +104,7 @@ Erlaube das Wechseln zu CIVILIAN-Einheiten? Povolit přesun k CIVILISTŮM? Permitir troca de unidades para o Civil? + Civil egységekre való váltás engedélyezése? Enable Safe Zone? @@ -104,6 +113,7 @@ Aktiviere Sicherheitszone? Povolit bezpečné oblasti? Habilitar zona segura? + Biztonságos zóna engedélyezése? Enable a safe zone around enemy units? Players can't switch to units inside of the safe zone. @@ -112,6 +122,7 @@ Aktiviere eine Sicherheitszone um feindliche Einheiten? Spieler können nicht zu Einheiten in der Sicherheitszone wechseln. Povolit bezpečnou zónu kolem nepřátelských jednotek? Hráči se nemohou změnit strany/jednotky uvnitř bezpečné zóny. Habilitar uma zona segur ao redor das unidades inimigas? Jogadores não conseguirão trocar para unidades dentro dessa zona segura. + Engedélyezve legyen-e egy biztonságos zóna az ellenségek körül? A játékosok nem tudnak a biztonságos zónán belüli egységekre váltani. Safe Zone Radius @@ -120,6 +131,7 @@ Sicherheitszonenradius Oblast bezpečné zóny Raio da zona segura + Biztonságos zóna hatóköre The safe zone around players from a different team. Default: 200 @@ -128,9 +140,9 @@ Die Sicherheitszone um Spieler von einem anderen Team. Standard: 200 Bezpečná zóna kolem hráče z jiných týmu. Výchozí: 200 A zona segura ao redor dos jogadores de diferentes equipes. Padrão: 200 + A biztonságos zóna más csapatból lévő játékosok körül. Alapértelmezett: 200 - Moduł ten pozwala na zmianę strony w trakcie gry. Tento modul umožňuje přepínání mazi dostupnými stranami. Este módulo permite mudar o lado à disposição dos jogadores. diff --git a/addons/tacticalladder/data/ace_tacticalladder.p3d b/addons/tacticalladder/data/ace_tacticalladder.p3d index a331f24084..7bb924ff46 100644 Binary files a/addons/tacticalladder/data/ace_tacticalladder.p3d and b/addons/tacticalladder/data/ace_tacticalladder.p3d differ diff --git a/addons/tacticalladder/data/model.cfg b/addons/tacticalladder/data/model.cfg index 1fc8840d4f..ba19d58c65 100644 --- a/addons/tacticalladder/data/model.cfg +++ b/addons/tacticalladder/data/model.cfg @@ -1,4 +1,4 @@ -class CfgSkeletons { +class CfgSkeletons { class Default { isDiscrete = 1; skeletonInherit = ""; @@ -21,7 +21,7 @@ class CfgSkeletons { "10","9", "11","10", "step","11" - }; + }; }; class OFP2_ManSkeleton { isDiscrete = 0; @@ -180,7 +180,7 @@ class CfgModels { class ace_tacticalladder { skeletonName = "ace_tacticalladder_skeleton"; sections[] = { "roadway" }; - sectionsInherit = ""; + sectionsInherit = ""; class Animations { class rotate { type = "rotation"; @@ -192,7 +192,7 @@ class CfgModels { maxValue = 90; angle0="rad 0"; angle1="rad +90"; - }; + }; class extract_1 { type = "translation"; source = ""; @@ -280,4 +280,4 @@ class CfgModels { }; class ace_tacticalladder_pack: ArmaMan { }; -}; \ No newline at end of file +}; diff --git a/addons/tacticalladder/stringtable.xml b/addons/tacticalladder/stringtable.xml index 4342ac5408..53a6935484 100644 --- a/addons/tacticalladder/stringtable.xml +++ b/addons/tacticalladder/stringtable.xml @@ -10,7 +10,7 @@ Telescopic Ladder Teleskopický žebřík Telescopic Ladder - Telescopic Ladder + Teleszkopikus létra Escada telescópica @@ -22,7 +22,7 @@ Deploy ladder Rozložit žebřík Deploy ladder - Deploy ladder + Létra lerakása Implantar escada @@ -34,7 +34,7 @@ Drop ladder Položit žebřík Drop ladder - Drop ladder + Létra eldobása Derrubar escada @@ -44,6 +44,7 @@ Upravit žebřík Ajustar escalera Ajustar escada + Létra állítása Position ladder @@ -54,7 +55,7 @@ Position ladder Umístit žebřík Position ladder - Position ladder + Létra elhelyezése Posicionar escada @@ -66,7 +67,7 @@ Pickup ladder Vzít žebřík Pickup ladder - Pickup ladder + Létra felvétele Pegar escada diff --git a/addons/tripod/stringtable.xml b/addons/tripod/stringtable.xml index caddca415f..fc74ed8b92 100644 --- a/addons/tripod/stringtable.xml +++ b/addons/tripod/stringtable.xml @@ -10,7 +10,7 @@ SSWT Kit SSWT souprava SSWT Kit - SSWT Kit + SSWT Készlet Kit SSWT @@ -22,7 +22,7 @@ Place SSWT Kit Rozlož souprava SSWT Place SSWT Kit - Place SSWT Kit + SSWT készlet elhelyezése Colocar kit SSWT @@ -32,6 +32,7 @@ Zvednout SSWT soupravu SSWT-Werkzeug aufheben Pegar kit SSWT + SSWT készlet felvétele Adjust SSWT Kit @@ -40,6 +41,7 @@ Regulovat SSWT soupravu SSWT-Werkzeug anpassen Ajustar kit SSWT + SSWT készlet állítása Done @@ -48,6 +50,7 @@ Hotovo Fertig Feito + Kész + Modifier, adjust @@ -56,6 +59,7 @@ + Modifikátor, regulace + Modifikator, anpassen + Modificador, ajuste + + Módosító, szabályzás - + \ No newline at end of file diff --git a/addons/vehiclelock/stringtable.xml b/addons/vehiclelock/stringtable.xml index 89a64faf8a..c190117fd0 100644 --- a/addons/vehiclelock/stringtable.xml +++ b/addons/vehiclelock/stringtable.xml @@ -140,6 +140,7 @@ Fahrzeugsperreinstellungen Nastavení zámku vozidla Configuração de fechadura do veículo + Jármű-zár beállítás Lock Vehicle Inventory @@ -148,6 +149,7 @@ Sperre Fahrzeuginventar Inventář zamčeného vozidla Bloquear inventário do veículo + Jármű rakodótér zárás Locks the inventory of locked vehicles @@ -156,6 +158,7 @@ Sperrt das Inventar von gesperrten Fahrzeugen Zamknout inventář u zamčených vozidel Bloqueia o inventário de veículos fechados + Bezárja a zárt járművek rakterét is Vehicle Starting Lock State @@ -164,6 +167,7 @@ Fahrzeuge spawnen gesperrt Počáteční stav zámku vozidla Estado inicial da fechadura dos veículos + Jármű kezdő zár-állapot Set lock state for all vehicles (removes ambiguous lock states) @@ -172,6 +176,7 @@ Setze Sperrstatus für alle Fahrzeuge (entfernt unklare Sperrzustände) Nastavit stav zámku u všech vozidel (odstraňuje nejednoznačné stavy zámků) Definir estados de fechadura para todos os veículos (remove estados de fechadura ambíguos) + Beállítja a zár-állapotot az összes járműhöz (eltávolítja az azonosíthatatlan zárállapotokat) As Is @@ -180,6 +185,7 @@ Unverändert Jak je Como está + Úgy-ahogy Locked @@ -188,6 +194,7 @@ Gesperrt Zamčeno Fechado + Zárva Unlocked @@ -196,6 +203,7 @@ Offen Odemčeno Aberto + Nyitva Default Lockpick Strength @@ -204,6 +212,7 @@ Standard-Pick-Stärke Výchozí síla páčidla Durabilidade padrão da chave micha + Alapértelmezett zártörő-erősség Default Time to lockpick (in seconds). Default: 10 @@ -212,6 +221,7 @@ Standardzeit um ein Schloss zu knacken (in Sekunden). Standard: 10 Čas k vypáčení zámku (v sekundách). Výchozí: 10 Tempo padrão para forçar a fechadura (em segundos). Padrão: 10 + Alapértelmezett idő a zárfeltöréshez (másodpercben). Alapértelmezett: 10 Settings for lockpick strength and initial vehicle lock state. Removes ambiguous lock states.<br />Source: vehiclelock.pbo @@ -220,6 +230,7 @@ Einstellungen für Pick-Stärke und anfänglichen Fahrzeugsperrzustand. Entfernt unklare Sperrzustände.<br />Quelle: vehiclelock.pbo Nastavení síly vypáčení a počáteční stav zámku vozidla. Odstraňuje nejednoznačné stavy zámků.<br />Zdroj: vehiclelock.pbo Definições para a durabilidade da chave micha e estado inicial da fechadura do veículo. Remove estados de fechadura ambíguas <br /> Fonte: Vehiclelock.pbo + Beállítások a zártörő erősségére és alapértelmezett zár-állapotra a járműveken. Eltávolítja az azonosíthatatlan zár-állapotokat. <br />Forrás: vehiclelock.pbo Vehicle Key Assign @@ -228,6 +239,7 @@ Fahrzeugschlüsselzuweisung Přidělení klíče k vozidlu Atribuição de chave de veículo + Járműkulcs-osztás Sync with vehicles and players. Will handout custom keys to players for every synced vehicle. Only valid for objects present at mission start.<br />Source: vehiclelock.pbo @@ -236,6 +248,7 @@ Synchronisiere mit Fahrzeugen und Spielern. Wird eigene Schlüssel an Spieler für jedes synchronisierte Fahrzeuge aushändigen. Nur gültig für am Missionsstart existierende Fahrzeuge.<br />Quelle: vehiclelock.pbo Synchronizuj s vozidly a hráči. Hráč dostane klíč ke každému synchonizovanému vozidlu. Platné pouze pro objekty přítomné na začátku mise.<br />Zdroj: vehiclelock.pbo Sincronizar com veículos e jogadores. Irá distribuir chaves personalizadas para os jogadores para cada veículo sincronizado. Só é válido para objetos presentes no início da missão <br /> Fonte: vehiclelock.pbo + Szinkronizál a járművekkel és játékosokkal. Egyedi kulcsokat oszt ki a játékosoknak minden szinkronizált járműhöz. Csak a küldetés indításakor jelenlévő járművekhez érvényes. <br />Forrás: vehiclelock.pbo \ No newline at end of file diff --git a/addons/vehicles/CfgVehicles.hpp b/addons/vehicles/CfgVehicles.hpp index fa60a72961..a07781a413 100644 --- a/addons/vehicles/CfgVehicles.hpp +++ b/addons/vehicles/CfgVehicles.hpp @@ -331,4 +331,97 @@ class CfgVehicles { }; }; }; + + // static mgs shouldn't use 500 rnd mags. + class StaticWeapon: LandVehicle { + class Turrets { + class MainTurret; //: NewTurret {}; + }; + }; + + class StaticMGWeapon: StaticWeapon {}; + + class HMG_01_base_F: StaticMGWeapon { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag","100Rnd_127x99_mag","100Rnd_127x99_mag","100Rnd_127x99_mag","100Rnd_127x99_mag"}; + }; + }; + }; + + class B_HMG_01_F: HMG_01_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red"}; + }; + }; + }; + + class O_HMG_01_F: HMG_01_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green"}; + }; + }; + }; + + class I_HMG_01_F: HMG_01_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow"}; + }; + }; + }; + + class HMG_01_high_base_F: HMG_01_base_F {}; + + class B_HMG_01_high_F: HMG_01_high_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red"}; + }; + }; + }; + + class O_HMG_01_high_F: HMG_01_high_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green"}; + }; + }; + }; + + class I_HMG_01_high_F: HMG_01_high_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow"}; + }; + }; + }; + + class HMG_01_A_base_F: HMG_01_base_F {}; + + class B_HMG_01_A_F: HMG_01_A_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red"}; + }; + }; + }; + + class O_HMG_01_A_F: HMG_01_A_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green"}; + }; + }; + }; + + class I_HMG_01_A_F: HMG_01_A_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow"}; + }; + }; + }; }; diff --git a/addons/vehicles/CfgWeapons.hpp b/addons/vehicles/CfgWeapons.hpp index 2eee38643f..76feb1818a 100644 --- a/addons/vehicles/CfgWeapons.hpp +++ b/addons/vehicles/CfgWeapons.hpp @@ -62,4 +62,9 @@ class CfgWeapons { muzzles[] = {"AP"}; }; + + // make static weapons compatible with 100rnd mag variants + class HMG_static: HMG_01 { + magazines[] = {"500Rnd_127x99_mag","500Rnd_127x99_mag_Tracer_Red","500Rnd_127x99_mag_Tracer_Green","500Rnd_127x99_mag_Tracer_Yellow","200Rnd_127x99_mag","200Rnd_127x99_mag_Tracer_Red","200Rnd_127x99_mag_Tracer_Green","200Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Yellow"}; + }; }; diff --git a/addons/viewdistance/stringtable.xml b/addons/viewdistance/stringtable.xml index bdf96f35a0..f5757a55cc 100644 --- a/addons/viewdistance/stringtable.xml +++ b/addons/viewdistance/stringtable.xml @@ -8,6 +8,7 @@ Omezovač dohlednosti Sichtweitenbegrenzung Limitador de distância de visão + Látótáv-korlátozó Allows limiting maximum view distance that can be set by players. @@ -16,6 +17,7 @@ Umožňuje určit maximální dohlednost, kterou si může hráč nastavit Erlaubt das Einschränken der maximalen Sichtweite, welche von Spielern eingestellt werden kann. Permite limitar a distância máxima de visão que pode ser definida pelos jogadores. + Lehetővé teszi a játékosok által a látótávolság maximumának korlátozását. Enable ACE viewdistance @@ -24,6 +26,7 @@ Povolit ACE dohlednost Aktiviere ACE-Sichtweite Habilitar distância de visão ACE + ACE látótávolság engedélyezése Enables ACE viewdistance @@ -32,6 +35,7 @@ Povolit ACE dohlednost Aktiviert ACE-Sichtweite Habilita a distância de visão ACE + Engedélyezi az ACE látótávolságot View Distance Limit @@ -40,6 +44,7 @@ Limit dohlednosti Sichtweitengrenze Limite da distância de visão + Látótáv-korlát Sets the limit for how high clients can raise their view distance (up to 10000) @@ -48,6 +53,7 @@ Stanoví limit jak daleko si může client zvýšit dohlednost (do 10000) Setze die Grenze fest, wie weit Spieler ihre Sichtweite erhöhen können (bis 10000) Estabelecer um limite de quão alto os clientes podem aumentar sua distância de visão (até 10000) + Korlátozza, mekkora látótávolságot állíthatnak be a kliensek (maximum 10000-ig) Limit for client's view distance set here and can overridden by module @@ -56,6 +62,7 @@ Limit dohlednoti pro klienty se nastavuje zde a může být potlačeno pomocí modulu. Stellt die Grenze für die Sichtweite des Spielers ein. Das kann von einem Modul überschrieben werden. Permite limitar a distância de visão máxima que pode ser definida por jogadores. Pode ser substituído por módulo. + A kliens látótávolsága itt állítható be, és felülbírálható modulok által Client View Distance (On Foot) @@ -64,6 +71,7 @@ Dohlednost (Pěšák) Spielersichtweite (zu Fuß) Distância de visão do cliente (A pé) + Kliens látótáv (gyalog) Changes in game view distance when the player is on foot. @@ -72,6 +80,7 @@ Změna dohlednosti pro hráče pokud jde po svých. Verändert die Sichtweite, wenn ein Spieler zu Fuß unterwegs ist. Muda a distância de visão do jogador dentro do jogo quando ele está a pé. + Megváltoztatja a játékon belüli látótávolságot, amennyiben a játékos gyalogosan van. Client View Distance (Land Vehicle) @@ -80,6 +89,7 @@ Dohlednost (Pozemní technika) Spielersichtweite (Landfahrzeuge) Distância de visão do cliente (Veículo terrestre) + Kliens látótáv (szárazföldi jármű) Changes in game view distance when the player is in a land vehicle. @@ -88,6 +98,7 @@ Změna dohlednosti pro hráče pokud je v pozemní technice. Verändert die Sichtweite, wenn ein Spieler in einem Landfahrzeug ist. Muda a distância de visão do jogador dentro do jogo quando ele está dentro de um veículo terrestre. + Megváltoztatja a játékon belüli látótávolságot, amennyiben a játékos szárazföldi járműben van. Client View Distance (Air Vehicle) @@ -96,6 +107,7 @@ Dohlednost (Vzdušná technika) Spielersichtweite (Luftfahrzeuge) Distância de visão do cliente (Veículo aéreo) + Kliens látótáv (légi jármű) Changes in game view distance when the player is in an air vehicle. @@ -104,6 +116,7 @@ Změna dohlednosti pro hráče pokud je ve vzdušné technice. Verändert die Sichtweite wenn ein Spieler in einem Luftfahrzeug ist. Muda a distância de visão do jogador dentro do jogo quando ele está dentro de um veículo aéreo. + Megváltoztatja a játékon belüli látótávolságot, amennyiben a játékos légi járműben van. Dynamic Object View Distance @@ -112,6 +125,7 @@ Dynamická dohlednost objektů Dynamische Objektsichtweite Distância de visão dinâmica dos objetos + Dinamikus objektum-látótáv Sets the object view distance as a coefficient of the view distance. @@ -120,6 +134,7 @@ Nastaví objekt dohlednosti jako koeficient dohlednosti. Passt die Objektsichtweite dynamisch der Sichtweite an. Estabelece a distância de visão dos objetos com um coeficiente da distância de visão. + Beállítja az objektum-látótávot a megadott látótáv koefficienseként. Off @@ -128,6 +143,7 @@ Vypnout Aus Desligado + Kikapcsolva Very Low @@ -136,6 +152,7 @@ Velmi málo Sehr niedrig Muito baixo + Minimális Low @@ -144,6 +161,7 @@ Málo Niedrig Baixo + Alacsony Medium @@ -152,6 +170,7 @@ Středně Mittel Médio + Közepes High @@ -160,6 +179,7 @@ Hodně Hoch Alto + Magas Very High @@ -168,6 +188,7 @@ Velmi hodně Sehr hoch Muito alto + Maximális View Distance: @@ -176,6 +197,7 @@ Dohlednost: Sichtweite: Distância de visão: + Látótávolság: Object View Distance is @@ -184,6 +206,7 @@ Dohlednost objektů je Objektsichtweite ist Distância de visão do objeto é + Az objektum-látótávolság: That option is invalid! The limit is @@ -192,6 +215,7 @@ Tato volba je neplatná! Limit je Diese Option ist ungültig! Die Grenze ist Essa opção é inválida. O limte é + Ez a beállítás érvénytelen! A maximum mennyiség Video Settings @@ -200,6 +224,7 @@ Nastavení videa Grafikeinstellungen Ajustes de vídeo + Videobeállítások - + \ No newline at end of file diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index dfb70f4f71..d2bfb55236 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -7,7 +7,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(SelectPistolNew), localize LSTRING(SelectPistol), { // Conditions: canInteract - if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -21,7 +21,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(SelectRifleNew), localize LSTRING(SelectRifle), { // Conditions: canInteract - if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -35,7 +35,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(SelectRifleMuzzleNew), localize LSTRING(SelectRifleMuzzle), { // Conditions: canInteract - if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -49,7 +49,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(SelectLauncherNew), localize LSTRING(SelectLauncher), { // Conditions: canInteract - if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -63,7 +63,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(SelectBinocularNew), localize LSTRING(SelectBinocular), { // Conditions: canInteract - if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -77,7 +77,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(SelectGrenadeFrag), localize LSTRING(SelectGrenadeFrag), { // Conditions: canInteract - if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -91,7 +91,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(SelectGrenadeOther), localize LSTRING(SelectGrenadeOther), { // Conditions: canInteract - if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -105,7 +105,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(HolsterWeapon), localize LSTRING(HolsterWeapon), { // Conditions: canInteract - if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -130,12 +130,12 @@ if !(hasInterface) exitWith {}; ["ACE3 Vehicles", QGVAR(EngineOn), localize LSTRING(EngineOn), { // Conditions: canInteract - if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !((ACE_player != vehicle ACE_player) && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false}; // Statement - (vehicle ACE_player) engineOn true; + vehicle ACE_player engineOn true; true }, {false}, @@ -144,12 +144,12 @@ if !(hasInterface) exitWith {}; ["ACE3 Vehicles", QGVAR(EngineOff), localize LSTRING(EngineOff), { // Conditions: canInteract - if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {isEngineOn vehicle ACE_player}) exitWith {false}; // Statement - (vehicle ACE_player) engineOn false; + vehicle ACE_player engineOn false; true }, {false}, @@ -158,7 +158,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Vehicles", QGVAR(SelectMainGunNew), localize LSTRING(SelectMainGun), { // Conditions: canInteract - if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player) exitWith {false}; @@ -172,7 +172,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Vehicles", QGVAR(SelectMachineGunNew), localize LSTRING(SelectMachineGun), { // Conditions: canInteract - if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player) exitWith {false}; @@ -186,7 +186,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Vehicles", QGVAR(SelectMissilesNew), localize LSTRING(SelectMissiles), { // Conditions: canInteract - if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player) exitWith {false}; @@ -200,7 +200,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Vehicles", QGVAR(FireSmokeLauncher), localize LSTRING(FireSmokeLauncher), { // Conditions: canInteract - if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player && {ACE_player == commander vehicle ACE_player}) exitWith {false}; diff --git a/addons/weather/stringtable.xml b/addons/weather/stringtable.xml index 69e2d4a792..aa6243b519 100644 --- a/addons/weather/stringtable.xml +++ b/addons/weather/stringtable.xml @@ -20,6 +20,7 @@ Wetter Počasí Clima + Időjárás Multiplayer synchronized ACE weather module @@ -28,6 +29,7 @@ ACE-Wettermodul (synchron im Multiplayer) Synchronizovat ACE počasí v multiplayeru Módulo climático ACE para sincronismo multiplayer + Többjátékos szinkronizált ACE időjárás modul Weather propagation @@ -36,6 +38,7 @@ Wetterübertragung Změny počasí Propagação do clima + Időjárás-változás Enables server side weather propagation @@ -44,6 +47,7 @@ Aktiviere serverseitige Wetterübertragung Aktivuje změny počasí na straně serveru Ativa propagação de clima via server + Engedélyezi a szerveroldali időjárás-változást ACE Weather @@ -52,6 +56,7 @@ ACE-Wetter ACE počasí Clima ACE + ACE Időjárás Overrides the default weather (editor, mission settings) with ACE weather (map based) @@ -60,6 +65,7 @@ Überschreibt das Standardwetter (Editor, Missionseinstellungen) mit dem ACE-Wetter (kartenbasiert) Přepíše výchozí počasí (editor, nastavení mise) s ACE počasím (podle mapy) Sobreescreve o clima padrão (editor, ajustes de missão) pelo sistema de clima ACE (baseado por mapa) + Felülbírálja az alapértelmezett időjárást (editor, küldetésbeállítások) az ACE időjárással (térkép-alapú) Sync Rain @@ -68,6 +74,7 @@ Regen synchronisieren Synchronizuj déšť Sincronizar chuva + Eső szinkronizálása Synchronizes rain @@ -76,6 +83,7 @@ Synchronisiert den Regen Synchronizace deště Sincroniza a chuva + Szinkronizálja az esőt Sync Wind @@ -84,6 +92,7 @@ Wind synchronisieren Synchronizuj vítr Sincronizar vento + Szél szinkronizálása Synchronizes wind @@ -92,6 +101,7 @@ Synchronisiert den Wind Synchronizace větru Sincroniza o vento + Szinkronizálja a szelet Sync Misc @@ -100,6 +110,7 @@ Sonstiges synchronisieren Synchronizuj různé Sincronizar outros + Egyéb szinkronizálása Synchronizes lightnings, rainbow, fog, ... @@ -108,6 +119,7 @@ Synchronisiert Blitze, Regenbögen, Nebel, ... Synchronizace blesků, duhy, mlhy, ... Sincroniza relâmpagos, arco-íris, neblina... + Szinkronizálja a villámokat, szivárványokat, ködöt, ... Update Interval @@ -116,6 +128,7 @@ Aktualisierungsintervall Interval aktualizace Intervalo de atualização + Frissítési intervallum Defines the interval (seconds) between weather updates @@ -124,6 +137,7 @@ Definiert das Intervall (in Sekunden) zwischen Wetteraktualisierungen Určit interval (v sekundách) mezi aktualizacemi počasí Defina o intervalo (em segundos) entre as atualizações de clima + Megadja az intervallumot (másodpercben) az időjárás-frissítések között \ No newline at end of file diff --git a/addons/winddeflection/config.cpp b/addons/winddeflection/config.cpp index df2b55d221..a7bedbb9ef 100644 --- a/addons/winddeflection/config.cpp +++ b/addons/winddeflection/config.cpp @@ -6,7 +6,6 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_weather"}; - versionDesc = "ACE Wind Deflection"; author[] = {ECSTRING(common,ACETeam), "Glowbal", "Ruthberg"}; authorUrl = "http://ace3mod.com/"; VERSION_CONFIG; diff --git a/addons/winddeflection/stringtable.xml b/addons/winddeflection/stringtable.xml index f7b4324233..dd96760310 100644 --- a/addons/winddeflection/stringtable.xml +++ b/addons/winddeflection/stringtable.xml @@ -68,6 +68,7 @@ Účinky větru Windablenkung Desvio de vento + Szél-hárítás Wind Deflection @@ -76,6 +77,7 @@ Windablenkung Účinky větru Desvio de vento + Szél-hárítás Enables wind deflection @@ -84,6 +86,7 @@ Aktiviert Windablenkung Umožňit vliv větru Ativa o desvio de vento + Engedélyezi a szél-hárítást Vehicle Enabled @@ -92,6 +95,7 @@ Fahrzeuge aktiviert Vozidla povolena Ativado em veículos + Jármű engedélyezve Enables wind deflection for static/vehicle gunners @@ -100,6 +104,7 @@ Aktiviere Windablenkung für statische oder Fahrzeugschützen Umožnit vliv větru pro střelce z vozidla/statiky Ativa o desvio de vento para atiradores de estáticas e veículos + Engedélyezi a szél-hárítást a statikus/jármű-lövészeknél Simulation Interval @@ -108,6 +113,7 @@ Simulationsintervall Interval simulace Intervalo de simulação + Szimulációs intervallum Defines the interval between every calculation step @@ -116,6 +122,7 @@ Definiert das Intervall zwischen jedem Berechnungsschritt Určuje interval mezi každým výpočtem Define o intervalo entre cada cálculo + Megszabja a számítási lépések közötti intervallumot Simulation Radius @@ -124,6 +131,7 @@ Simulationsradius Oblast simulace Radio da Simulação + Szimulációs hatókör Defines the radius around the player (in meters) at which projectiles are wind deflected @@ -132,6 +140,7 @@ Gibt den Radius (in Metern) um den Spieler an, in dem Projektile vom Wind beeinflusst werden Definuje oblast kolem hráče (v metrech) v které je projektil ovlivněn větrem Define o raio ao redor do jogador (em metros) em qual os projéteis são desviados pelo vento + Meghatározza a játékos körüli hatókört (méterben), ahol a lövedékeket háríthatja a szél Wind influence on projectiles trajectory @@ -140,6 +149,7 @@ Windeinfluss auf die Geschossbahnen Vítr ovlivňuje trajektorii projektilu Influência do vento na trajetória dos projéteis + Szél hatása a lövedékek röppályájára - + \ No newline at end of file diff --git a/addons/yardage450/stringtable.xml b/addons/yardage450/stringtable.xml index 30887673e7..7a3a6bdef2 100644 --- a/addons/yardage450/stringtable.xml +++ b/addons/yardage450/stringtable.xml @@ -8,6 +8,7 @@ Yardage 450 Yardage 450 Yardage 450 + Yardage 450 Laser Rangefinder @@ -16,6 +17,7 @@ Telémetro láser Laserový dálkoměr Medidor de Distância a laser + Lézeres távolságmérő Yardage 450 - Power Button @@ -24,6 +26,7 @@ Yardage 450 - Botón de encendido Yardage 450 - Tlačítko napájení Yardage 450 - Botão de energia + Yardage 450 - Főkapcsoló gomb - + \ No newline at end of file diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 42bf72d3d1..97bf5f40c7 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -8,6 +8,7 @@ Nastavení Zeuse Zeus-Einstellungen Ajustes do Zeus + Zeus beállítások Provides control over various aspects of Zeus. @@ -16,6 +17,7 @@ Poskytuje kontrolu na různými aspekty Zeuse. Bietet die Steuerung verschiedener Zeus-Optionen an. Proporciona controle sobre diversos aspectos do Zeus. + Különböző beállítási lehetőségeket biztosít a Zeus részeihez. Ascension Messages @@ -24,6 +26,7 @@ Zpráva o novém Zeusovi Aufstiegsnachrichten Mensagens de ascensão + Felemelkedési üzenetek Display global popup messages when a player is assigned as Zeus. @@ -32,6 +35,7 @@ Zobrazit globální zprávu když je hráč přiřazen jako Zeus. Zeige globale Popup-Nachrichten wenn ein Spieler zu Zeus wird. Mostra uma mensagem popup quando um jogador é atribuido ao Zeus. + Globális üzeneteket jelez ki, ha egy játékos Zeus-nak lesz beosztva. Zeus Eagle @@ -40,6 +44,7 @@ Orel Zeuse Zeus-Adler Águia do Zeus + Zeus sas Spawn an eagle that follows the Zeus camera. @@ -48,6 +53,7 @@ Vytvoří orla, který následuje kameru Zeuse. Erstelle einen Adler, der der Zeus-Kamera folgt. Cria uma águia que segue a câmera do Zeus + Lerak egy sast, ami követi a Zeus kamerát. Wind Sounds @@ -56,6 +62,7 @@ Zvuky větru Windgeräusche Sons de vento + Szélhangok Play wind sounds when Zeus remote controls a unit. @@ -64,6 +71,7 @@ Přehrát varování (vítr) když Zeus převezmě kontrolu nad jednotkou. Spiele Windgeräusche ab, wenn Zeus eine Einheit steuert. Reproduz sons de vento quando uma unidade é remotamente controlada pelo Zeus. + Szélhangokat játszik le, ha a Zeus távvezérel egy egységet. Ordnance Warning @@ -72,6 +80,7 @@ Varování před dělostřelectvem Artilleriewarnung Aviso de explosivos + Tüzérségi figyelmeztetés Play a radio warning when Zeus uses ordnance. @@ -80,6 +89,7 @@ Přehrát varování (rádio) když Zeus použije dělostřelectvo. Spiele eine Radiowarnung ab, wenn Zeus Artillerie verwendet. Reproduz uma aviso via rádio quando o Zeus usa um explosivo. + Rádiós figyelmeztetés kiadása, ha a Zeus tüzérséget használ. Reveal Mines @@ -88,6 +98,7 @@ Odhalit miny Enthülle Minen Revelar minas + Aknák feltárása Reveal mines to allies and place map markers. @@ -96,6 +107,7 @@ Odhalí miny pro spojence a umístnit jejich značku na mapu. Enthülle Minen gegenüber Verbündeten und platziere Kartenmarkierungen. Revelar minas para aliados e colocar marcadores no mapa. + Feltárja az aknákat a szövetségeseknek, és jelölőket helyez el a térképen. Reveal to Allies @@ -104,6 +116,7 @@ Odhalit pro spojence An Verbündete weitergeben Revelar para aliados + Feltárás a szövetségeseknek Allies + Map Markers @@ -112,6 +125,7 @@ Spojenci + Značky na mapě Verbündete + Kartenmarkierungen Aliados + Marcadores no mapa + Szövetségesek + térkép jelölők Toggle Captive @@ -120,6 +134,7 @@ Přepnout - Vězeň Gefangennahme umschalten Alternar prisioneiro + Elfogott állapot váltása Toggle Surrender @@ -128,6 +143,7 @@ Přepnout - Vzdávání Aufgabe umschalten Alternar rendição + Kapituláló állapot váltása Toggle Unconscious @@ -136,6 +152,7 @@ Přepnout - Bezvědomí Bewusstlosigkeit umschalten Alternar inconsciência + Eszméletlen állapot váltása Assign Medic @@ -188,6 +205,7 @@ Jednotka nemí být vězeň Einheit darf nicht gefangen sein Unidade não pode ser prisioneira + Csak elfogatlan egységeken használni Place on a unit @@ -208,6 +226,7 @@ Vyžaduje addon, který není přítomen Benötigt ein Addon, das nicht vorhanden ist Requer um addon que não está presente + Egy jelenleg hiányzó bővítményt igényel Add Objects to Curator diff --git a/documentation/README_DE.md b/documentation/README_DE.md index 0b5ca4d0ef..23d54f9e35 100644 --- a/documentation/README_DE.md +++ b/documentation/README_DE.md @@ -1,48 +1,53 @@

- +

- ACE version + ACE3 Version - - ACE download + + ACE3 Download - ACE issues + ACE3 Issues + + + BIF Thread - ACE license + ACE3 License

-

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

+

Benötigt die aktuellste Version von CBA A3. Besucht uns auf Facebook | YouTube | Twitter | Reddit

**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. +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...*** +- 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). +Du hast ACE3 installiert, hast aber keine Ahnung was und wie alles funktioniert und wo sich was befindet? +- [Erste Schritte](http://ace3mod.com/wiki/user/getting-started.html). #### 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. +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`](https://github.com/acemod/ACE3/blob/master/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). +Um einen Fehler oder ein Feature zu melden bzw. ein bereits Bestehendes zu ändern - nutze unseren [Issue Tracker](https://github.com/acemod/ACE3/issues). Besuche auch: +- [Wie kann ich ein Problem melden](http://ace3mod.com/wiki/user/how-to-report-an-issue.html) +- [Wie kann ich ein Feature Request erstellen](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html) #### 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). +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](https://help.github.com/articles/fetching-a-remote/) - 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 ACE3 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 index 4d4c36a619..3fbeb31664 100644 --- a/documentation/README_PL.md +++ b/documentation/README_PL.md @@ -1,83 +1,77 @@

- +

- ACE wersja + ACE3 Wersja - - ACE pobierz + + ACE3 Pobierz - ACE zagadnienia + ACE3 Zagadnienia - - Temat BIF + + Temat BIF - ACE licencja + ACE3 Licencja

-

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

+

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. +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ę ACE3 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 +- 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
+- 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) +- [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. +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 ACE3, 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) +- [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. +- [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ę ACE3 do celów testowych. diff --git a/documentation/development/arma-3-issues.md b/documentation/development/arma-3-issues.md index 16f9988409..c28dc2f118 100644 --- a/documentation/development/arma-3-issues.md +++ b/documentation/development/arma-3-issues.md @@ -18,6 +18,7 @@ Keeping track of Arma 3 issues that need to be fixed. If you want to support us * [bux578: 0022000: Add/Alter script command to add perfectly configured weapons to cargo](http://feedback.arma3.com/view.php?id=22000) * [commy2: 0021443: Unexpected behavior of += array in configs](http://feedback.arma3.com/view.php?id=21443) * [commy2: 0022671: setVariable is not always JIP persistent](http://feedback.arma3.com/view.php?id=22671) +* [commy2: 0025404: splitString scripting command causes game crash] (http://feedback.arma3.com/view.php?id=25404) * [CorruptedHeart: 0022318: Can no longer use "MenuBack" shortcut in AddAction](http://feedback.arma3.com/view.php?id=22318) * [James2464: 0023725: All Environment Rocks Should Have PhysX LODs](http://feedback.arma3.com/view.php?id=23725) * [Jaynus: 0023679: Display event handler return values for mouse buttons should be respected](http://feedback.arma3.com/view.php?id=23679) diff --git a/optionals/compat_asdg/$PBOPREFIX$ b/optionals/compat_asdg/$PBOPREFIX$ deleted file mode 100644 index 0ba5166c16..0000000000 --- a/optionals/compat_asdg/$PBOPREFIX$ +++ /dev/null @@ -1 +0,0 @@ -z\ace\addons\compat_asdg \ No newline at end of file diff --git a/optionals/compat_asdg/config.cpp b/optionals/compat_asdg/config.cpp deleted file mode 100644 index 40dae32051..0000000000 --- a/optionals/compat_asdg/config.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#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; - ACE_acc_pointer_green_IR = 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 deleted file mode 100644 index e67bf3b9e4..0000000000 --- a/optionals/compat_asdg/script_component.hpp +++ /dev/null @@ -1,5 +0,0 @@ -#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_bwa3/$PBOPREFIX$ b/optionals/compat_bwa3/$PBOPREFIX$ deleted file mode 100644 index 7331009959..0000000000 --- a/optionals/compat_bwa3/$PBOPREFIX$ +++ /dev/null @@ -1 +0,0 @@ -z\ace\addons\compat_bwa3 \ No newline at end of file diff --git a/optionals/compat_bwa3/CfgAmmo.hpp b/optionals/compat_bwa3/CfgAmmo.hpp deleted file mode 100644 index c19e00819a..0000000000 --- a/optionals/compat_bwa3/CfgAmmo.hpp +++ /dev/null @@ -1,142 +0,0 @@ -class CfgAmmo { - class B_9x21_Ball; - class B_556x45_Ball_Tracer_Red; - class B_762x51_Tracer_Red; - class B_127x99_Ball_Tracer_Red; - class GrenadeHand; - class BWA3_B_556x45_Ball: B_556x45_Ball_Tracer_Red { - ACE_caliber=5.69; - ACE_bulletLength=23.012; - ACE_bulletMass=4.0176; - 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[]={210.82, 238.76, 269.24, 299.72, 330.2, 360.68, 391.16, 419.1, 449.58, 480.06, 508.0, 609.6}; - }; - class BWA3_B_556x45_Ball_SD: BWA3_B_556x45_Ball { - // Reference? - ACE_ballisticCoefficients[]={}; - ACE_velocityBoundaries[]={}; - ACE_muzzleVelocities[]={}; - ACE_barrelLengths[]={}; - }; - class BWA3_B_556x45_Ball_AP: BWA3_B_556x45_Ball { - ACE_caliber=5.69; - ACE_bulletLength=23.012; - ACE_bulletMass=4.5359237; - 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="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={820, 865, 880}; - ACE_barrelLengths[]={254.0, 393.7, 508.0}; - }; - class BWA3_B_762x51_Ball: B_762x51_Tracer_Red { - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=9.4608; - 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[]={254.0, 406.4, 508.0, 609.6, 660.4}; - }; - class BWA3_B_762x51_Ball_SD: BWA3_B_762x51_Ball { - ACE_caliber=7.823; - ACE_bulletLength=34.036; - ACE_bulletMass=12.96; - 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[]={406.4, 508.0, 609.6, 660.4}; - }; - class BWA3_B_762x51_Ball_AP: BWA3_B_762x51_Ball { - ACE_caliber=7.823; - ACE_bulletLength=31.496; - ACE_bulletMass=8.22946157; - 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.359}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={875, 910, 930}; - ACE_barrelLengths[]={330.2, 406.4, 508.0}; - }; - class BWA3_B_762x51_Ball_LR: BWA3_B_762x51_Ball { - ACE_caliber=7.823; - ACE_bulletLength=31.496; - ACE_bulletMass=11.34; - 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[]={406.4, 508.0, 609.6, 660.4}; - }; - class BWA3_B_127x99_Ball: B_127x99_Ball_Tracer_Red { - ACE_caliber=12.954; - ACE_bulletLength=58.674; - ACE_bulletMass=41.9256; - 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[]={736.6}; - }; - class BWA3_B_127x99_Ball_SD: BWA3_B_127x99_Ball { - // Reference? - ACE_ballisticCoefficients[]={}; - ACE_velocityBoundaries[]={}; - ACE_muzzleVelocities[]={}; - ACE_barrelLengths[]={}; - }; - class BWA3_B_127x99_Ball_AP: BWA3_B_127x99_Ball { - ACE_caliber=12.954; - ACE_bulletLength=58.674; - ACE_bulletMass=41.9904; - 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[]={736.6}; - }; - class BWA3_B_46x30_Ball: B_9x21_Ball { - ACE_caliber=4.902; - ACE_bulletLength=13.005; - ACE_bulletMass=2.0088; - 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[]={101.6, 177.8, 228.6, 304.8}; - }; - class BWA3_B_46x30_Ball_SD: BWA3_B_46x30_Ball { - // Reference? - ACE_ballisticCoefficients[]={}; - ACE_velocityBoundaries[]={}; - ACE_muzzleVelocities[]={}; - ACE_barrelLengths[]={}; - }; - class BWA3_G_DM51A1: GrenadeHand { - ace_frag_metal = 296; - ace_frag_charge = 180; - ace_frag_gurney_c = 2930; // Gurney velocity constant for PETN - ace_frag_gurney_k = 1/2; // shape factor for a cylinder - }; -}; \ No newline at end of file diff --git a/optionals/compat_bwa3/CfgMagazines.hpp b/optionals/compat_bwa3/CfgMagazines.hpp deleted file mode 100644 index bf43af6426..0000000000 --- a/optionals/compat_bwa3/CfgMagazines.hpp +++ /dev/null @@ -1,9 +0,0 @@ -class CfgMagazines { - class CA_Magazine; - class BWA3_200Rnd_556x45: CA_Magazine { - ACE_isBelt = 1; - }; - class BWA3_120Rnd_762x51: CA_Magazine { - ACE_isBelt = 1; - }; -}; \ No newline at end of file diff --git a/optionals/compat_bwa3/CfgWeapons.hpp b/optionals/compat_bwa3/CfgWeapons.hpp deleted file mode 100644 index c0acea9912..0000000000 --- a/optionals/compat_bwa3/CfgWeapons.hpp +++ /dev/null @@ -1,173 +0,0 @@ -class CfgWeapons { - class Pistol_Base_F; - class Rifle_Base_F; - class Rifle_Long_Base_F; - class UGL_F; - class BWA3_P8: Pistol_Base_F { - ACE_barrelTwist=248.92; - ACE_barrelLength=108; - }; - class BWA3_MP7: Pistol_Base_F { - ACE_barrelTwist=160.02; - ACE_barrelLength=180; - }; - class BWA3_G36: Rifle_Base_F { - ACE_barrelTwist=177.8; - ACE_barrelLength=480; - }; - class BWA3_G36K: BWA3_G36 { - ACE_barrelTwist=177.8; - ACE_barrelLength=318; - }; - class BWA3_G28_Standard: Rifle_Long_Base_F { - ACE_barrelTwist=304.8; - ACE_barrelLength=421; - }; - class BWA3_G28_Assault: BWA3_G28_Standard { - ACE_barrelTwist=304.8; - ACE_barrelLength=421; - }; - class BWA3_G27: BWA3_G28_Standard { - ACE_barrelTwist=304.8; - ACE_barrelLength=406; - }; - class BWA3_G27_AG: BWA3_G27 { - class AG40: UGL_F { - magazines[] += { - "ACE_HuntIR_M203" - }; - }; - }; - class BWA3_MG4: Rifle_Long_Base_F { - ACE_barrelTwist=177.8; - ACE_barrelLength=480; - }; - class BWA3_MG5: Rifle_Long_Base_F { - ACE_barrelTwist=304.8; - ACE_barrelLength=550; - }; - class BWA3_G82: Rifle_Long_Base_F { - ACE_barrelTwist=381.0; - ACE_barrelLength=736.7; - }; - class AG40: UGL_F { - magazines[] += { - "ACE_HuntIR_M203" - }; - }; - class optic_Hamr; - class InventoryOpticsItem_Base_F; - - class BWA3_optic_ZO4x30 : optic_Hamr { - ACE_ScopeAdjust_Vertical[] = { -10, 10 }; - ACE_ScopeAdjust_Horizontal[] = { -10, 10 }; - ACE_ScopeAdjust_VerticalIncrement = 0.2; - ACE_ScopeAdjust_HorizontalIncrement = 0.2; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class Scope { - discreteDistance[] = { 200 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class BWA3_optic_ZO4x30_NSV : optic_Hamr { - ACE_ScopeAdjust_Vertical[] = { -10, 10 }; - ACE_ScopeAdjust_Horizontal[] = { -10, 10 }; - ACE_ScopeAdjust_VerticalIncrement = 0.2; - ACE_ScopeAdjust_HorizontalIncrement = 0.2; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class Scope { - discreteDistance[] = { 200 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class BWA3_optic_ZO4x30_IRV : optic_Hamr { - ACE_ScopeAdjust_Vertical[] = { -10, 10 }; - ACE_ScopeAdjust_Horizontal[] = { -10, 10 }; - ACE_ScopeAdjust_VerticalIncrement = 0.2; - ACE_ScopeAdjust_HorizontalIncrement = 0.2; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class Scope { - discreteDistance[] = { 200 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class BWA3_optic_Shortdot : optic_Hamr { - ACE_ScopeAdjust_Vertical[] = { -0.1, 10.1 }; - ACE_ScopeAdjust_Horizontal[] = { -5.1, 5.1 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class Scope { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class BWA3_optic_20x50 : optic_Hamr { - ACE_ScopeAdjust_Vertical[] = { 0, 26 }; - ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class Scope { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class BWA3_optic_20x50_NSV : BWA3_optic_20x50 { - ACE_ScopeAdjust_Vertical[] = { 0, 26 }; - ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class Scope { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class BWA3_optic_24x72 : optic_Hamr { - ACE_ScopeAdjust_Vertical[] = { 0, 16 }; - ACE_ScopeAdjust_Horizontal[] = { -7, 7 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class Scope { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class BWA3_optic_24x72_NSV : BWA3_optic_20x50 { - ACE_ScopeAdjust_Vertical[] = { 0, 16 }; - ACE_ScopeAdjust_Horizontal[] = { -7, 7 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class Scope { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; -}; diff --git a/optionals/compat_bwa3/config.cpp b/optionals/compat_bwa3/config.cpp deleted file mode 100644 index efdebaf616..0000000000 --- a/optionals/compat_bwa3/config.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "script_component.hpp" - -class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"BWA3_Weapons"}; - author[]={"Ruthberg"}; - VERSION_CONFIG; - }; -}; - -#include "CfgAmmo.hpp" -#include "CfgWeapons.hpp" -#include "CfgMagazines.hpp" diff --git a/optionals/compat_bwa3/script_component.hpp b/optionals/compat_bwa3/script_component.hpp deleted file mode 100644 index 86bb669119..0000000000 --- a/optionals/compat_bwa3/script_component.hpp +++ /dev/null @@ -1,5 +0,0 @@ -#define COMPONENT BWA3_Weapons_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 deleted file mode 100644 index f5ba34fc7e..0000000000 --- a/optionals/compat_cup/CfgAmmo.hpp +++ /dev/null @@ -1,434 +0,0 @@ -class CfgAmmo -{ - class BulletBase; - class B_762x51_Ball; - class B_127x99_Ball; - class CUP_B_545x39_Ball: BulletBase { - airFriction=-0.0011204; - ACE_caliber=5.588; - ACE_bulletLength=21.59; - ACE_bulletMass=3.42792; - 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[]={254.0, 414.02, 508.0}; - }; - class CUP_B_545x39_Ball_Tracer_Green: CUP_B_545x39_Ball { - airFriction=-0.0011204; - ACE_caliber=5.588; - ACE_bulletLength=21.59; - ACE_bulletMass=3.22704; - 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[]={254.0, 414.02, 508.0}; - }; - class CUP_B_545x39_Ball_Tracer_Red: BulletBase { - airFriction=-0.0011204; - ACE_caliber=5.588; - ACE_bulletLength=21.59; - ACE_bulletMass=3.22704; - 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[]={254.0, 414.02, 508.0}; - }; - class CUP_B_545x39_Ball_Tracer_White: BulletBase { - airFriction=-0.0011204; - ACE_caliber=5.588; - ACE_bulletLength=21.59; - ACE_bulletMass=3.22704; - 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[]={254.0, 414.02, 508.0}; - }; - class CUP_B_545x39_Ball_Tracer_Yellow: BulletBase { - airFriction=-0.0011204; - ACE_caliber=5.588; - ACE_bulletLength=21.59; - ACE_bulletMass=3.22704; - 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[]={254.0, 414.02, 508.0}; - }; - class CUP_B_762x39_Ball: BulletBase { - airFriction=-0.00150173; - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=7.9704; - 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[]={254.0, 414.02, 508.0}; - }; - class CUP_B_762x39_Ball_Tracer_Green: BulletBase { - airFriction=-0.00150173; - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=7.5816; - 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[]={254.0, 414.02, 508.0}; - }; - class B_762x39mm_KLT: BulletBase { - airFriction=-0.00150173; - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=7.5816; - 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[]={254.0, 414.02, 508.0}; - }; - class CUP_B_9x18_Ball: BulletBase { - airFriction=-0.00180193; - ACE_caliber=9.271; - ACE_bulletLength=15.494; - ACE_bulletMass=6.00048; - 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[]={96.52, 127.0, 228.6}; - }; - class CUP_B_9x18_Ball_Tracer_Green: BulletBase { - airFriction=-0.00180193; - ACE_caliber=9.271; - ACE_bulletLength=15.494; - ACE_bulletMass=6.00048; - 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[]={96.52, 127.0, 228.6}; - }; - class CUP_B_9x18_Ball_Tracer_Red: BulletBase { - airFriction=-0.00180193; - ACE_caliber=9.271; - ACE_bulletLength=15.494; - ACE_bulletMass=6.00048; - 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[]={96.52, 127.0, 228.6}; - }; - class CUP_B_9x18_Ball_Tracer_Yellow: BulletBase { - airFriction=-0.00180193; - ACE_caliber=9.271; - ACE_bulletLength=15.494; - ACE_bulletMass=6.00048; - 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[]={96.52, 127.0, 228.6}; - }; - class CUP_B_9x18_Ball_White_Tracer: BulletBase { - airFriction=-0.00180193; - ACE_caliber=9.271; - ACE_bulletLength=15.494; - ACE_bulletMass=6.00048; - 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[]={96.52, 127.0, 228.6}; - }; - class CUP_B_9x19_Ball: BulletBase { - airFriction=-0.00205726; - ACE_caliber=9.017; - ACE_bulletLength=15.494; - ACE_bulletMass=8.0352; - 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[]={101.6, 127.0, 228.6}; - }; - class CUP_B_762x51_noTracer: B_762x51_Ball { - airFriction=-0.00099036; - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=9.4608; - 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[]={254.0, 406.4, 508.0, 609.6, 660.4}; - }; - class CUP_B_303_Ball: BulletBase { - airFriction=-0.00082199; - ACE_caliber=7.899; - ACE_bulletLength=31.166; - ACE_bulletMass=11.2752; - 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[]={508.0, 609.6, 660.4}; - }; - class CUP_B_127x107_Ball_Green_Tracer: BulletBase { - airFriction=-0.00062618; - ACE_caliber=12.979; - ACE_bulletLength=64.008; - ACE_bulletMass=48.276; - 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[]={728.98}; - }; - class CUP_B_127x108_Ball_Green_Tracer: BulletBase { - airFriction=-0.00062618; - ACE_caliber=12.979; - ACE_bulletLength=64.008; - ACE_bulletMass=48.276; - 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[]={728.98}; - }; - class CUP_B_762x54_Ball_White_Tracer: BulletBase { - airFriction=-0.00101742; - ACE_caliber=7.925; - ACE_bulletLength=28.956; - ACE_bulletMass=9.6552; - 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[]={406.4, 508.0, 609.6, 660.4}; - }; - class CUP_B_762x54_Ball_Red_Tracer: BulletBase { - airFriction=-0.00101742; - ACE_caliber=7.925; - ACE_bulletLength=28.956; - ACE_bulletMass=9.6552; - 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[]={406.4, 508.0, 609.6, 660.4}; - }; - class CUP_B_762x54_Ball_Green_Tracer: BulletBase { - airFriction=-0.00101742; - ACE_caliber=7.925; - ACE_bulletLength=28.956; - ACE_bulletMass=9.6552; - 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[]={406.4, 508.0, 609.6, 660.4}; - }; - class CUP_B_762x54_Ball_Yellow_Tracer: BulletBase { - airFriction=-0.00101742; - ACE_caliber=7.925; - ACE_bulletLength=28.956; - ACE_bulletMass=9.6552; - 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[]={406.4, 508.0, 609.6, 660.4}; - }; - class CUP_B_9x39_SP5: BulletBase { - airFriction=-0.00075274; - ACE_caliber=9.246; - ACE_bulletLength=31.496; - ACE_bulletMass=16.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.275}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={280, 300, 320}; - ACE_barrelLengths[]={254.0, 414.02, 508.0}; - }; - class CUP_B_762x51_Tracer_Green: BulletBase { - airFriction=-0.00099036; - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=9.4608; - 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[]={254.0, 406.4, 508.0, 609.6, 660.4}; - }; - class CUP_B_762x51_Tracer_Red: BulletBase { - airFriction=-0.00099036; - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=9.4608; - 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[]={254.0, 406.4, 508.0, 609.6, 660.4}; - }; - class CUP_B_762x51_Tracer_Yellow: BulletBase { - airFriction=-0.00099036; - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=9.4608; - 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[]={254.0, 406.4, 508.0, 609.6, 660.4}; - }; - class CUP_B_762x51_Tracer_White: BulletBase { - airFriction=-0.00099036; - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=9.4608; - 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[]={254.0, 406.4, 508.0, 609.6, 660.4}; - }; - class B_127x107_Ball: BulletBase { - ACE_caliber=12.979; - ACE_bulletLength=64.008; - ACE_bulletMass=48.276; - 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[]={728.98}; - }; - class CUP_B_9x18_SD: BulletBase { - airFriction=-0.00180193; - ACE_caliber=9.271; - ACE_bulletLength=15.494; - ACE_bulletMass=6.00048; - 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[]={96.52, 127.0, 228.6}; - }; - class CUP_B_765x17_Ball: BulletBase { - airFriction=-0.00173452; - ACE_caliber=7.938; - ACE_bulletLength=15.494; - ACE_bulletMass=4.212; - 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[]={101.6, 127.0, 228.6}; - }; - class CUP_B_145x115_AP_Green_Tracer: BulletBase { - airFriction=-0.00059041; - ACE_caliber=14.884; - ACE_bulletLength=50.8; - ACE_bulletMass=65.448; - 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[]={1346.2}; - }; - class CUP_B_127x99_Ball_White_Tracer: B_127x99_Ball { - airFriction=-0.00057503; - ACE_caliber=12.954; - ACE_bulletLength=58.674; - ACE_bulletMass=41.9256; - 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[]={736.6}; - }; - class CUP_B_86x70_Ball_noTracer: BulletBase { - airFriction=-0.0005788; - ACE_caliber=8.585; - ACE_bulletLength=39.573; - ACE_bulletMass=16.2; - 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[]={508.0, 660.4, 711.2}; - }; -}; \ No newline at end of file diff --git a/optionals/compat_cup/CfgMagazines.hpp b/optionals/compat_cup/CfgMagazines.hpp index 469476734c..b05b0c3efd 100644 --- a/optionals/compat_cup/CfgMagazines.hpp +++ b/optionals/compat_cup/CfgMagazines.hpp @@ -45,223 +45,4 @@ class CfgMagazines { modelSpecial = ""; mass = 0; }; - - class CA_Magazine; - class 30Rnd_556x45_Stanag; - class CUP_30Rnd_545x39_AK_M: CA_Magazine { - initSpeed = 880; - }; - class CUP_30Rnd_TE1_Green_Tracer_545x39_AK_M: CA_Magazine { - initSpeed = 880; - }; - class CUP_30Rnd_TE1_Red_Tracer_545x39_AK_M: CA_Magazine { - initSpeed = 880; - }; - class CUP_30Rnd_TE1_White_Tracer_545x39_AK_M: CA_Magazine { - initSpeed = 880; - }; - class CUP_30Rnd_TE1_Yellow_Tracer_545x39_AK_M: CA_Magazine { - initSpeed = 880; - }; - class CUP_75Rnd_TE4_LRT4_Green_Tracer_545x39_RPK_M: CA_Magazine { - initSpeed = 880; - }; - class CUP_30Rnd_762x39_AK47_M: CA_Magazine { - initSpeed = 750; - }; - class CUP_64Rnd_9x19_Bizon_M: CA_Magazine { - initSpeed = 350; - }; - class CUP_64Rnd_Green_Tracer_9x19_Bizon_M: CA_Magazine { - initSpeed = 350; - }; - class CUP_64Rnd_Red_Tracer_9x19_Bizon_M: CA_Magazine { - initSpeed = 350; - }; - class CUP_64Rnd_White_Tracer_9x19_Bizon_M: CA_Magazine { - initSpeed = 350; - }; - class CUP_64Rnd_Yellow_Tracer_9x19_Bizon_M: CA_Magazine { - initSpeed = 350; - }; - class CUP_5x_22_LR_17_HMR_M: CA_Magazine { - initSpeed = 830; - }; - class CUP_10x_303_M: CA_Magazine { - initSpeed = 765; - }; - class CUP_20Rnd_762x51_FNFAL_M: CA_Magazine { - initSpeed = 833; - }; - class CUP_5Rnd_127x108_KSVK_M: CA_Magazine { - initSpeed = 820; - }; - class CUP_100Rnd_TE4_LRT4_White_Tracer_762x51_Belt_M: CA_Magazine { - initSpeed = 833; - }; - class CUP_100Rnd_TE4_LRT4_Red_Tracer_762x51_Belt_M: CUP_100Rnd_TE4_LRT4_White_Tracer_762x51_Belt_M { - initSpeed = 833; - }; - class CUP_200Rnd_TE4_LRT4_White_Tracer_762x51_Belt_M: CA_Magazine { - initSpeed = 833; - }; - class CUP_200Rnd_TE4_LRT4_Red_Tracer_762x51_Belt_M: CA_Magazine { - initSpeed = 833; - }; - class CUP_100Rnd_TE4_LRT4_762x54_PK_Tracer_Green_M: CA_Magazine { - initSpeed = 800; - }; - class CUP_10Rnd_762x54_SVD_M: CA_Magazine { - initSpeed = 800; - }; - class CUP_10Rnd_9x39_SP5_VSS_M: CA_Magazine { - initSpeed = 300; - }; - class CUP_20Rnd_9x39_SP5_VSS_M: CA_Magazine { - initSpeed = 300; - }; - class CUP_5Rnd_127x99_as50_M: CA_Magazine { - initSpeed = 900; - }; - class CUP_20Rnd_762x51_DMR: CA_Magazine { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Yellow_Tracer_762x51_DMR: CUP_20Rnd_762x51_DMR { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Red_Tracer_762x51_DMR: CUP_20Rnd_762x51_DMR { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Green_Tracer_762x51_DMR: CUP_20Rnd_762x51_DMR { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_White_Tracer_762x51_DMR: CUP_20Rnd_762x51_DMR { - initSpeed = 833; - }; - class CUP_20Rnd_762x51_B_SCAR: CA_Magazine { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Yellow_Tracer_762x51_SCAR: CUP_20Rnd_762x51_B_SCAR { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Red_Tracer_762x51_SCAR: CUP_20Rnd_762x51_B_SCAR { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Green_Tracer_762x51_SCAR: CUP_20Rnd_762x51_B_SCAR { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_White_Tracer_762x51_SCAR: CUP_20Rnd_762x51_B_SCAR { - initSpeed = 833; - }; - class CUP_20Rnd_762x51_B_M110: CA_Magazine { - initSpeed = 833; - }; - class CUP_5Rnd_762x51_M24: CA_Magazine { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Yellow_Tracer_762x51_M110: CUP_20Rnd_762x51_B_M110 { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Red_Tracer_762x51_M110: CUP_20Rnd_762x51_B_M110 { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Green_Tracer_762x51_M110: CUP_20Rnd_762x51_B_M110 { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_White_Tracer_762x51_M110: CUP_20Rnd_762x51_B_M110 { - initSpeed = 833; - }; - class CUP_30Rnd_556x45_G36: 30Rnd_556x45_Stanag { - initSpeed = 920; - }; - class CUP_30Rnd_TE1_Red_Tracer_556x45_G36: CUP_30Rnd_556x45_G36 { - initSpeed = 920; - }; - class CUP_30Rnd_TE1_Green_Tracer_556x45_G36: CUP_30Rnd_556x45_G36 { - initSpeed = 920; - }; - class CUP_30Rnd_TE1_Yellow_Tracer_556x45_G36: CUP_30Rnd_556x45_G36 { - initSpeed = 920; - }; - class CUP_100Rnd_556x45_BetaCMag: 30Rnd_556x45_Stanag { - initSpeed = 920; - }; - class CUP_100Rnd_TE1_Red_Tracer_556x45_BetaCMag: CUP_100Rnd_556x45_BetaCMag { - initSpeed = 920; - }; - class CUP_100Rnd_TE1_Green_Tracer_556x45_BetaCMag: CUP_100Rnd_556x45_BetaCMag { - initSpeed = 920; - }; - class CUP_100Rnd_TE1_Yellow_Tracer_556x45_BetaCMag: CUP_100Rnd_556x45_BetaCMag { - initSpeed = 920; - }; - class CUP_200Rnd_TE4_Green_Tracer_556x45_M249: CA_Magazine { - initSpeed = 920; - }; - class CUP_200Rnd_TE4_Red_Tracer_556x45_M249: CUP_200Rnd_TE4_Green_Tracer_556x45_M249 { - initSpeed = 920; - }; - class CUP_200Rnd_TE4_Yellow_Tracer_556x45_M249: CUP_200Rnd_TE4_Green_Tracer_556x45_M249 { - initSpeed = 920; - }; - class CUP_200Rnd_TE1_Red_Tracer_556x45_M249: CUP_200Rnd_TE4_Red_Tracer_556x45_M249 { - initSpeed = 920; - }; - class CUP_100Rnd_TE4_Green_Tracer_556x45_M249: CA_Magazine { - initSpeed = 920; - }; - class CUP_100Rnd_TE4_Red_Tracer_556x45_M249: CUP_100Rnd_TE4_Green_Tracer_556x45_M249 { - initSpeed = 920; - }; - class CUP_100Rnd_TE4_Yellow_Tracer_556x45_M249: CUP_100Rnd_TE4_Green_Tracer_556x45_M249 { - initSpeed = 920; - }; - class CUP_200Rnd_TE4_Green_Tracer_556x45_L110A1: CUP_200Rnd_TE4_Green_Tracer_556x45_M249 { - initSpeed = 920; - }; - class CUP_200Rnd_TE4_Red_Tracer_556x45_L110A1: CUP_200Rnd_TE4_Red_Tracer_556x45_M249 { - initSpeed = 920; - }; - class CUP_200Rnd_TE4_Yellow_Tracer_556x45_L110A1: CUP_200Rnd_TE4_Yellow_Tracer_556x45_M249 { - initSpeed = 920; - }; - class CUP_30Rnd_556x45_Stanag: CA_Magazine { - initSpeed = 920; - }; - class CUP_20Rnd_556x45_Stanag: CUP_30Rnd_556x45_Stanag { - initSpeed = 920; - }; - class CUP_10Rnd_127x99_M107: CA_Magazine { - initSpeed = 900; - }; - class CUP_10Rnd_762x51_CZ750: CA_Magazine { - initSpeed = 833; - }; - class CUP_10Rnd_762x51_CZ750_Tracer: CUP_10Rnd_762x51_CZ750 { - initSpeed = 833; - }; - class CUP_50Rnd_UK59_762x54R_Tracer: CA_Magazine { - initSpeed = 800; - }; - class CUP_8Rnd_9x18_Makarov_M: CA_Magazine { - initSpeed = 300; - }; - class CUP_8Rnd_9x18_MakarovSD_M: CUP_8Rnd_9x18_Makarov_M { - initSpeed = 300; - }; - class CUP_6Rnd_45ACP_M: CA_Magazine { - initSpeed = 250; - }; - class CUP_17Rnd_9x19_glock17: CA_Magazine { - initSpeed = 370; - }; - class CUP_5Rnd_86x70_L115A1: CA_Magazine { - initSpeed = 915; - }; - class CUP_20Rnd_B_765x17_Ball_M: CA_Magazine { - initSpeed = 290; - }; - class CUP_30Rnd_9x19_MP5: CA_Magazine { - initSpeed = 400; - }; }; \ No newline at end of file diff --git a/optionals/compat_cup/CfgWeapons.hpp b/optionals/compat_cup/CfgWeapons.hpp index 76d442ee53..bbd49548da 100644 --- a/optionals/compat_cup/CfgWeapons.hpp +++ b/optionals/compat_cup/CfgWeapons.hpp @@ -1,432 +1,6 @@ class CfgWeapons { - class Pistol_Base_F; - class Rifle_Base_F; - class Rifle_Long_Base_F; class Launcher_Base_F; - class CUP_hgun_Colt1911 : Pistol_Base_F { - initSpeed=-1.04; - ACE_barrelTwist=406.4; - ACE_barrelLength=127.0; - }; - class CUP_sgun_AA12 : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=0.0; - ACE_twistDirection=0; - ACE_barrelLength=457.2; - }; - class CUP_arifle_AK_Base : Rifle_Base_F { - initSpeed=-0.95467; - ACE_barrelTwist=240.03; - ACE_barrelLength=414.02; - }; - class CUP_arifle_AK107_Base : CUP_arifle_AK_Base { - initSpeed=-1.0; - ACE_barrelTwist=199.898; - ACE_barrelLength=414.02; - }; - class CUP_arifle_AKS_Base : CUP_arifle_AK_Base { - initSpeed=-0.95467; - ACE_barrelTwist=199.898; - ACE_barrelLength=414.02; - }; - class CUP_arifle_AKS74U : CUP_arifle_AK_Base { - initSpeed=-0.88636; - ACE_barrelTwist=160.02; - ACE_barrelLength=210.82; - }; - class CUP_arifle_AK74; - class CUP_arifle_RPK74 : CUP_arifle_AK74 { - initSpeed=-1.0; - ACE_barrelTwist=195.072; - ACE_barrelLength=589.28; - }; - class CUP_srifle_AS50 : Rifle_Long_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=381.0; - ACE_barrelLength=736.6; - }; - class CUP_srifle_AWM_Base : Rifle_Long_Base_F { - initSpeed=-1.00547; - ACE_barrelTwist=279.4; - ACE_barrelLength=685.8; - }; - class CUP_smg_bizon : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=231.14; - }; - class CUP_hgun_Compact : Pistol_Base_F { - initSpeed=-0.97778; - ACE_barrelTwist=248.92; - ACE_barrelLength=94.996; - }; - class CUP_srifle_CZ750 : Rifle_Long_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=304.8; - ACE_barrelLength=660.4; - }; - class CUP_arifle_CZ805_Base : Rifle_Base_F { - initSpeed=-0.87283; - ACE_barrelTwist=304.8; - ACE_barrelLength=355.6; - }; - class CUP_arifle_CZ805_A1 : CUP_arifle_CZ805_Base { - initSpeed=-0.93696; - ACE_barrelTwist=304.8; - ACE_barrelLength=355.6; - }; - class CUP_arifle_CZ805_A2 : CUP_arifle_CZ805_Base { - initSpeed=-0.87283; - ACE_barrelTwist=304.8; - ACE_barrelLength=276.86; - }; - class CUP_srifle_DMR : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=304.8; - ACE_barrelLength=558.8; - }; - class CUP_hgun_Duty : Pistol_Base_F { - initSpeed=-0.97778; - ACE_barrelTwist=248.92; - ACE_barrelLength=94.996; - }; - class CUP_arifle_FNFAL : Rifle_Base_F { - initSpeed=-0.98796; - ACE_barrelTwist=304.8; - ACE_barrelLength=533.4; - }; - class CUP_arifle_G36_Base; - class CUP_arifle_G36A : CUP_arifle_G36_Base { - initSpeed=-0.99357; - ACE_barrelTwist=177.8; - ACE_barrelLength=480; - }; - class CUP_arifle_G36K : CUP_arifle_G36A { - initSpeed=-0.90761; - ACE_barrelTwist=177.8; - ACE_barrelLength=318; - }; - class CUP_arifle_G36C : Rifle_Base_F { - initSpeed=-0.81522; - ACE_barrelTwist=177.8; - ACE_barrelLength=228; - }; - class CUP_arifle_MG36 : CUP_arifle_G36C { - initSpeed=-0.99457; - ACE_barrelTwist=177.8; - ACE_barrelLength=480; - }; - class CUP_hgun_Glock17 : Pistol_Base_F { - initSpeed=-0.9595; - ACE_barrelTwist=248.92; - ACE_barrelLength=114.046; - }; - class CUP_srifle_CZ550 : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=304.8; - ACE_barrelLength=599.999; - }; - class CUP_srifle_ksvk : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=457.2; - ACE_barrelLength=999.998; - }; - class CUP_lmg_L7A2 : Rifle_Long_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=304.8; - ACE_barrelLength=629.92; - }; - class CUP_arifle_L85A2_Base : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=177.8; - ACE_barrelLength=518.16; - }; - class CUP_arifle_L86A2_Base: Rifle_Base_F { - initSpeed=-0.97826; - ACE_barrelTwist=177.8; - ACE_barrelLength=646; - }; - class CUP_lmg_L110A1 : Rifle_Long_Base_F { - initSpeed=-0.93044; - ACE_barrelTwist=177.8; - ACE_barrelLength=347.98; - }; - class CUP_srifle_LeeEnfield : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=254.0; - ACE_barrelLength=640.08; - }; - class CUP_hgun_M9 : Pistol_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=248.92; - ACE_barrelLength=124.46; - }; - class CUP_srifle_M14 : Rifle_Base_F { - initSpeed=-0.99160; - ACE_barrelTwist=304.8; - ACE_barrelLength=558.8; - }; - class CUP_arifle_M16_Base : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=355.6; - ACE_barrelLength=508.0; - }; - class CUP_arifle_M16A4_Base; - class CUP_arifle_M4_Base : CUP_arifle_M16A4_Base { - initSpeed=-0.94565; - ACE_barrelTwist=177.8; - ACE_barrelLength=368.3; - }; - class CUP_arifle_M4A1; - class CUP_srifle_Mk12SPR : CUP_arifle_M4A1 { - initSpeed=-0.98696; - ACE_barrelTwist=177.8; - ACE_barrelLength=457.2; - }; - class CUP_srifle_M24_des : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=285.75; - ACE_barrelLength=609.6; - }; - class CUP_lmg_M60A4 : Rifle_Long_Base_F { - initSpeed=-0.96639; - ACE_barrelTwist=304.8; - ACE_barrelLength=431.8; - }; - class CUP_srifle_M107_Base : Rifle_Long_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=381.0; - ACE_barrelLength=736.6; - }; - class CUP_srifle_M110 : Rifle_Base_F { - initSpeed=-0.98558; - ACE_barrelTwist=279.4; - ACE_barrelLength=508.0; - }; - class CUP_lmg_M240 : Rifle_Long_Base_F { - initSpeed=-1.00600; - ACE_barrelTwist=304.8; - ACE_barrelLength=629.92; - }; - class CUP_lmg_M249_para : Rifle_Long_Base_F { - initSpeed=-0.96739; - ACE_barrelTwist=177.8; - ACE_barrelLength=414.02; - }; - class CUP_lmg_M249 : Rifle_Long_Base_F { - initSpeed=-0.98696; - ACE_barrelTwist=177.8; - ACE_barrelLength=457.2; - }; - class CUP_sgun_M1014 : Rifle_Base_F { - ACE_twistDirection=0; - ACE_barrelTwist=0.0; - ACE_barrelLength=469.9; - }; - class CUP_hgun_Makarov : Pistol_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=93.472; - }; - class CUP_hgun_MicroUzi : Pistol_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=248.92; - ACE_barrelLength=127.0; - }; - class CUP_lmg_Mk48_Base : Rifle_Long_Base_F { - initSpeed=-0.98558; - ACE_barrelTwist=304.8; - ACE_barrelLength=501.65; - }; - class CUP_smg_MP5SD6 : Rifle_Base_F { - initSpeed=-0.9375; - ACE_barrelTwist=254.0; - ACE_barrelLength=144.78; - }; - class CUP_smg_MP5A5 : CUP_smg_MP5SD6 { - initSpeed=-1.0; - ACE_barrelTwist=254.0; - ACE_barrelLength=226.06; - }; - class CUP_smg_EVO : Rifle_Base_F { - initSpeed=-0.975; - ACE_barrelTwist=254.0; - ACE_barrelLength=195.58; - }; - class CUP_hgun_PB6P9 : Pistol_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=104.14; - }; - class CUP_hgun_Phantom : Pistol_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=246.38; - ACE_barrelLength=119.38; - }; - class CUP_lmg_PKM : Rifle_Long_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=645.16; - }; - class CUP_lmg_Pecheneg : CUP_lmg_PKM { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=657.86; - }; - class CUP_hgun_TaurusTracker455 : Pistol_Base_F { - initSpeed=-0.92; - ACE_barrelTwist=304.8; - ACE_barrelLength=101.6; - }; - class CUP_arifle_Sa58_base; - class CUP_arifle_Sa58P : CUP_arifle_Sa58_base { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=391.16; - }; - class CUP_arifle_Sa58V : CUP_arifle_Sa58P { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=391.16; - }; - class CUP_arifle_Sa58RIS1 : CUP_arifle_Sa58_base { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=391.16; - }; - class CUP_hgun_SA61 : Pistol_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=406.4; - ACE_barrelLength=114.3; - }; - class CUP_sgun_Saiga12K: Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=0.0; - ACE_twistDirection=0; - ACE_barrelLength=429.26; - }; - class CUP_arifle_SCAR_L_Base; - class CUP_arifle_Mk16_CQC : CUP_arifle_SCAR_L_Base { - initSpeed=-0.84783; - ACE_barrelTwist=177.8; - ACE_barrelLength=254.0; - }; - class CUP_arifle_Mk16_STD : CUP_arifle_SCAR_L_Base { - initSpeed=-0.93696; - ACE_barrelTwist=177.8; - ACE_barrelLength=355.6; - }; - class CUP_arifle_Mk16_SV : CUP_arifle_SCAR_L_Base { - initSpeed=-0.98696; - ACE_barrelTwist=177.8; - ACE_barrelLength=457.2; - }; - class CUP_arifle_Mk17_Base; - class CUP_arifle_Mk17_CQC : CUP_arifle_Mk17_Base { - initSpeed=-0.90144; - ACE_barrelTwist=304.8; - ACE_barrelLength=330.2; - }; - class CUP_arifle_Mk17_STD : CUP_arifle_Mk17_Base { - initSpeed=-0.96154; - ACE_barrelTwist=304.8; - ACE_barrelLength=406.4; - }; - class CUP_arifle_Mk20 : CUP_arifle_Mk17_Base { - initSpeed=-0.98558; - ACE_barrelTwist=304.8; - ACE_barrelLength=508.0; - }; - class CUP_srifle_SVD : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=238.76; - ACE_barrelLength=619.76; - }; - class CUP_lmg_UK59 : Rifle_Long_Base_F { - initSpeed=-0.9625; - ACE_barrelTwist=381.0; - ACE_barrelLength=551.18; - }; - class MGun; - class CUP_DSHKM_W : MGun { - initSpeed=-1.0; - ACE_barrelTwist=381.0; - ACE_barrelLength=1069.34; - }; - class CUP_KPVT_W : MGun { - initSpeed=-1.0; - ACE_barrelTwist=454.914; - ACE_barrelLength=1346.2; - }; - class CUP_M242_W; - class CUP_KPVB_W : CUP_M242_W { - initSpeed=-1.0; - ACE_barrelTwist=454.914; - ACE_barrelLength=1346.2; - }; - class MGunCore; - class CUP_M134 : MGunCore { - initSpeed=-1.0; - ACE_barrelTwist=304.8; - ACE_barrelLength=558.8; - }; - class CUP_M240_veh_W : Rifle_Long_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=304.8; - ACE_barrelLength=629.92; - }; - class CUP_PKT_W : MGun { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=722.122; - }; - class CUP_srifle_VSSVintorez : Rifle_Base_F { - initSpeed=-0.93334; - ACE_barrelTwist=210.82; - ACE_barrelLength=200.66; - }; - class CUP_arifle_XM8_Base : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=177.8; - ACE_barrelLength=317.5; - }; - class CUP_arifle_XM8_Carbine : CUP_arifle_XM8_Base { - initSpeed=-0.90760; - ACE_barrelTwist=177.8; - ACE_barrelLength=317.5; - }; - class CUP_arifle_xm8_sharpshooter : CUP_arifle_XM8_Base { - initSpeed=-1.0; - ACE_barrelTwist=177.8; - ACE_barrelLength=508.0; - }; - class CUP_arifle_xm8_SAW : CUP_arifle_XM8_Base { - initSpeed=-1.0; - ACE_barrelTwist=177.8; - ACE_barrelLength=508.0; - }; - class CUP_arifle_XM8_Compact : CUP_arifle_XM8_Base { - initSpeed=-0.81522; - ACE_barrelTwist=177.8; - ACE_barrelLength=228.6; - }; - class CUP_arifle_XM8_Railed_Base : Rifle_Base_F { - initSpeed=-0.90760; - ACE_barrelTwist=177.8; - ACE_barrelLength=317.5; - }; - class CUP_arifle_XM8_Carbine_FG : CUP_arifle_XM8_Base { - initSpeed=-0.90870; - ACE_barrelTwist=177.8; - ACE_barrelLength=317.5; - }; - class CUP_arifle_XM8_Carbine_GL : CUP_arifle_XM8_Base { - initSpeed=-0.90870; - ACE_barrelTwist=177.8; - ACE_barrelLength=317.5; - }; - class ItemCore; class InventoryOpticsItem_Base_F; diff --git a/optionals/compat_cup/config.cpp b/optionals/compat_cup/config.cpp index d013c9034a..20ae5d6911 100644 --- a/optionals/compat_cup/config.cpp +++ b/optionals/compat_cup/config.cpp @@ -11,6 +11,5 @@ class CfgPatches { }; }; -#include "CfgAmmo.hpp" #include "CfgWeapons.hpp" #include "CfgMagazines.hpp" \ No newline at end of file diff --git a/tools/cba/addons/main/script_macros_common.hpp b/tools/cba/addons/main/script_macros_common.hpp index 1385d7b389..78893db662 100644 --- a/tools/cba/addons/main/script_macros_common.hpp +++ b/tools/cba/addons/main/script_macros_common.hpp @@ -1,11 +1,11 @@ /* - Header: script_macros_common.hpp + Header: script_macros_common.hpp - Description: - A general set of useful macro functions for use by CBA itself or by any module that uses CBA. + Description: + A general set of useful macro functions for use by CBA itself or by any module that uses CBA. - Authors: - Sickboy and Spooner + Authors: + Sickboy and Spooner */ /* **************************************************** @@ -40,27 +40,27 @@ */ #ifndef MAINPREFIX - #define MAINPREFIX x + #define MAINPREFIX x #endif #ifndef SUBPREFIX - #define SUBPREFIX addons + #define SUBPREFIX addons #endif #ifndef MAINLOGIC - #define MAINLOGIC main + #define MAINLOGIC main #endif #ifndef VERSION - #define VERSION 0 + #define VERSION 0 #endif #ifndef VERSION_AR - #define VERSION_AR VERSION + #define VERSION_AR VERSION #endif #ifndef VERSION_CONFIG - #define VERSION_CONFIG version = VERSION; versionStr = QUOTE(VERSION); versionAr[] = {VERSION_AR} + #define VERSION_CONFIG version = VERSION; versionStr = QUOTE(VERSION); versionAr[] = {VERSION_AR} #endif #define ADDON DOUBLES(PREFIX,COMPONENT) @@ -72,50 +72,50 @@ Group: Debugging /* ------------------------------------------- Macros: DEBUG_MODE_x - Managing debugging based on debug level. + Managing debugging based on debug level. - According to the *highest* level of debugging that has been defined *before* script_macros_common.hpp is included, - only the appropriate debugging commands will be functional. With no level explicitely defined, assume DEBUG_MODE_NORMAL. + According to the *highest* level of debugging that has been defined *before* script_macros_common.hpp is included, + only the appropriate debugging commands will be functional. With no level explicitely defined, assume DEBUG_MODE_NORMAL. - DEBUG_MODE_FULL - Full debugging output. - DEBUG_MODE_NORMAL - All debugging except and (Default setting if none specified). - DEBUG_MODE_MINIMAL - Only and enabled. + DEBUG_MODE_FULL - Full debugging output. + DEBUG_MODE_NORMAL - All debugging except and (Default setting if none specified). + DEBUG_MODE_MINIMAL - Only and enabled. Examples: - In order to turn on full debugging for a single file, - (begin example) - // Top of individual script file. - #define DEBUG_MODE_FULL - #include "script_component.hpp" - (end) + In order to turn on full debugging for a single file, + (begin example) + // Top of individual script file. + #define DEBUG_MODE_FULL + #include "script_component.hpp" + (end) - In order to force minimal debugging for a single component, - (begin example) - // Top of addons\\script_component.hpp - // Ensure that any FULL and NORMAL setting from the individual files are undefined and MINIMAL is set. - #ifdef DEBUG_MODE_FULL - #undef DEBUG_MODE_FULL - #endif - #ifdef DEBUG_MODE_NORMAL - #undef DEBUG_MODE_NORMAL - #endif - #ifndef DEBUG_MODE_MINIMAL - #define DEBUG_MODE_MINIMAL - #endif - #include "script_macros.hpp" - (end) + In order to force minimal debugging for a single component, + (begin example) + // Top of addons\\script_component.hpp + // Ensure that any FULL and NORMAL setting from the individual files are undefined and MINIMAL is set. + #ifdef DEBUG_MODE_FULL + #undef DEBUG_MODE_FULL + #endif + #ifdef DEBUG_MODE_NORMAL + #undef DEBUG_MODE_NORMAL + #endif + #ifndef DEBUG_MODE_MINIMAL + #define DEBUG_MODE_MINIMAL + #endif + #include "script_macros.hpp" + (end) - In order to turn on full debugging for a whole addon, - (begin example) - // Top of addons\main\script_macros.hpp - #ifndef DEBUG_MODE_FULL - #define DEBUG_MODE_FULL - #endif - #include "\x\cba\addons\main\script_macros_common.hpp" - (end) + In order to turn on full debugging for a whole addon, + (begin example) + // Top of addons\main\script_macros.hpp + #ifndef DEBUG_MODE_FULL + #define DEBUG_MODE_FULL + #endif + #include "\x\cba\addons\main\script_macros_common.hpp" + (end) Author: - Spooner + Spooner ------------------------------------------- */ // If DEBUG_MODE_FULL, then also enable DEBUG_MODE_NORMAL. @@ -142,20 +142,20 @@ Author: /* ------------------------------------------- Macro: LOG() - Log a timestamped message into the RPT log. + Log a timestamped message into the RPT log. - Only run if or higher is defined. + Only run if or higher is defined. Parameters: - MESSAGE - Message to record [String] + MESSAGE - Message to record [String] Example: - (begin example) - LOG("Initiated clog-dancing simulator."); - (end) + (begin example) + LOG("Initiated clog-dancing simulator."); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #ifdef DEBUG_MODE_FULL #define LOG(MESSAGE) [THIS_FILE_, __LINE__, MESSAGE] call CBA_fnc_log @@ -165,20 +165,20 @@ Author: /* ------------------------------------------- Macro: WARNING() - Record a timestamped, non-critical error in the RPT log. + Record a timestamped, non-critical error in the RPT log. - Only run if or higher is defined. + Only run if or higher is defined. Parameters: - MESSAGE - Message to record [String] + MESSAGE - Message to record [String] Example: - (begin example) - WARNING("This function has been deprecated. Please don't use it in future!"); - (end) + (begin example) + WARNING("This function has been deprecated. Please don't use it in future!"); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #ifdef DEBUG_MODE_NORMAL #define WARNING(MESSAGE) [THIS_FILE_, __LINE__, ('WARNING: ' + MESSAGE)] call CBA_fnc_log @@ -188,152 +188,171 @@ Author: /* ------------------------------------------- Macro: ERROR() - Record a timestamped, critical error in the RPT log. + Record a timestamped, critical error in the RPT log. - The heading is "ERROR" (use for a specific title). + The heading is "ERROR" (use for a specific title). - TODO: Popup an error dialog & throw an exception. + TODO: Popup an error dialog & throw an exception. Parameters: - MESSAGE - Message to record [String] + MESSAGE - Message to record [String] Example: - (begin example) - ERROR("Value not found","value of frog not found in config ...yada...yada..."); - (end) + (begin example) + ERROR("Value not found","value of frog not found in config ...yada...yada..."); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define ERROR(MESSAGE) \ - [THIS_FILE_, __LINE__, "ERROR", MESSAGE] call CBA_fnc_error; + [THIS_FILE_, __LINE__, "ERROR", MESSAGE] call CBA_fnc_error; /* ------------------------------------------- Macro: ERROR_WITH_TITLE() - Record a timestamped, critical error in the RPT log. + Record a timestamped, critical error in the RPT log. - The title can be specified (in the heading is always just "ERROR") - Newlines (\n) in the MESSAGE will be put on separate lines. + The title can be specified (in the heading is always just "ERROR") + Newlines (\n) in the MESSAGE will be put on separate lines. - TODO: Popup an error dialog & throw an exception. + TODO: Popup an error dialog & throw an exception. Parameters: - TITLE - Title of error message [String] - MESSAGE - Body of error message [String] + TITLE - Title of error message [String] + MESSAGE - Body of error message [String] Example: - (begin example) - ERROR_WITH_TITLE("Value not found","Value of frog not found in config ...yada...yada..."); - (end) + (begin example) + ERROR_WITH_TITLE("Value not found","Value of frog not found in config ...yada...yada..."); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define ERROR_WITH_TITLE(TITLE,MESSAGE) \ - [THIS_FILE_, __LINE__, TITLE, MESSAGE] call CBA_fnc_error; + [THIS_FILE_, __LINE__, TITLE, MESSAGE] call CBA_fnc_error; + +/* ------------------------------------------- +Macro: MESSAGE_WITH_TITLE() + Record a single line, timestamped log entry in the RPT log. + +Parameters: + TITLE - Title of log message [String] + MESSAGE - Body of message [String] + +Example: + (begin example) + MESSAGE_WITH_TITLE("Value found","Value of frog found in config "); + (end) + +Author: + Killswitch +------------------------------------------- */ +#define MESSAGE_WITH_TITLE(TITLE,MESSAGE) \ + [THIS_FILE_, __LINE__, TITLE + ': ' + (MESSAGE)] call CBA_fnc_log; /* ------------------------------------------- Macro: RETNIL() - If a variable is undefined, return the value nil. Otherwise, return the - variable itself. + If a variable is undefined, return the value nil. Otherwise, return the + variable itself. Parameters: - VARIABLE - the variable to check + VARIABLE - the variable to check Example: - (begin example) - // _var is undefined - hintSilent format ["_var=%1", RETNIL(_var) ]; // "_var=any" - (end example) + (begin example) + // _var is undefined + hintSilent format ["_var=%1", RETNIL(_var) ]; // "_var=any" + (end example) Author: - Alef (see CBA issue #8514) + Alef (see CBA issue #8514) ------------------------------------------- */ #define RETNIL(VARIABLE) if (isNil{VARIABLE}) then {nil} else {VARIABLE} /* ------------------------------------------- Macros: TRACE_n() - Log a message and 1-8 variables to the RPT log. + Log a message and 1-8 variables to the RPT log. - Only run if is defined. + Only run if is defined. - TRACE_1(MESSAGE,A) - Log 1 variable. - TRACE_2(MESSAGE,A,B) - Log 2 variables. - TRACE_3(MESSAGE,A,B,C) - Log 3 variables. - TRACE_4(MESSAGE,A,B,C,D) - Log 4 variables. - TRACE_5(MESSAGE,A,B,C,D,E) - Log 5 variables. - TRACE_6(MESSAGE,A,B,C,D,E,F) - Log 6 variables. - TRACE_7(MESSAGE,A,B,C,D,E,F,G) - Log 7 variables. - TRACE_8(MESSAGE,A,B,C,D,E,F,G,H) - Log 8 variables. - TRACE_9(MESSAGE,A,B,C,D,E,F,G,H,I) - Log 9 variables. + TRACE_1(MESSAGE,A) - Log 1 variable. + TRACE_2(MESSAGE,A,B) - Log 2 variables. + TRACE_3(MESSAGE,A,B,C) - Log 3 variables. + TRACE_4(MESSAGE,A,B,C,D) - Log 4 variables. + TRACE_5(MESSAGE,A,B,C,D,E) - Log 5 variables. + TRACE_6(MESSAGE,A,B,C,D,E,F) - Log 6 variables. + TRACE_7(MESSAGE,A,B,C,D,E,F,G) - Log 7 variables. + TRACE_8(MESSAGE,A,B,C,D,E,F,G,H) - Log 8 variables. + TRACE_9(MESSAGE,A,B,C,D,E,F,G,H,I) - Log 9 variables. Parameters: - MESSAGE - Message to add to the trace [String] - A..H - Variable names to log values of [Any] + MESSAGE - Message to add to the trace [String] + A..H - Variable names to log values of [Any] Example: - (begin example) - TRACE_3("After takeoff",_vehicle player,getPos (_vehicle player), getPosASL (_vehicle player)); - (end) + (begin example) + TRACE_3("After takeoff",_vehicle player,getPos (_vehicle player), getPosASL (_vehicle player)); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define PFORMAT_1(MESSAGE,A) \ - format ['%1: A=%2', MESSAGE, RETNIL(A)] + format ['%1: A=%2', MESSAGE, RETNIL(A)] #define PFORMAT_2(MESSAGE,A,B) \ - format ['%1: A=%2, B=%3', MESSAGE, RETNIL(A), RETNIL(B)] + format ['%1: A=%2, B=%3', MESSAGE, RETNIL(A), RETNIL(B)] #define PFORMAT_3(MESSAGE,A,B,C) \ - format ['%1: A=%2, B=%3, C=%4', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C)] + format ['%1: A=%2, B=%3, C=%4', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C)] #define PFORMAT_4(MESSAGE,A,B,C,D) \ - format ['%1: A=%2, B=%3, C=%4, D=%5', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D)] + format ['%1: A=%2, B=%3, C=%4, D=%5', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D)] #define PFORMAT_5(MESSAGE,A,B,C,D,E) \ - format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E)] + format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E)] #define PFORMAT_6(MESSAGE,A,B,C,D,E,F) \ - format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F)] + format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F)] #define PFORMAT_7(MESSAGE,A,B,C,D,E,F,G) \ - format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G)] + format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G)] #define PFORMAT_8(MESSAGE,A,B,C,D,E,F,G,H) \ - format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8, H=%9', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G), RETNIL(H)] + format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8, H=%9', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G), RETNIL(H)] #define PFORMAT_9(MESSAGE,A,B,C,D,E,F,G,H,I) \ - format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8, H=%9, I=%10', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G), RETNIL(H), RETNIL(I)] + format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8, H=%9, I=%10', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G), RETNIL(H), RETNIL(I)] #ifdef DEBUG_MODE_FULL #define TRACE_1(MESSAGE,A) \ - [THIS_FILE_, __LINE__, PFORMAT_1(MESSAGE,A)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_1(MESSAGE,A)] call CBA_fnc_log #define TRACE_2(MESSAGE,A,B) \ - [THIS_FILE_, __LINE__, PFORMAT_2(MESSAGE,A,B)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_2(MESSAGE,A,B)] call CBA_fnc_log #define TRACE_3(MESSAGE,A,B,C) \ - [THIS_FILE_, __LINE__, PFORMAT_3(MESSAGE,A,B,C)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_3(MESSAGE,A,B,C)] call CBA_fnc_log #define TRACE_4(MESSAGE,A,B,C,D) \ - [THIS_FILE_, __LINE__, PFORMAT_4(MESSAGE,A,B,C,D)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_4(MESSAGE,A,B,C,D)] call CBA_fnc_log #define TRACE_5(MESSAGE,A,B,C,D,E) \ - [THIS_FILE_, __LINE__, PFORMAT_5(MESSAGE,A,B,C,D,E)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_5(MESSAGE,A,B,C,D,E)] call CBA_fnc_log #define TRACE_6(MESSAGE,A,B,C,D,E,F) \ - [THIS_FILE_, __LINE__, PFORMAT_6(MESSAGE,A,B,C,D,E,F)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_6(MESSAGE,A,B,C,D,E,F)] call CBA_fnc_log #define TRACE_7(MESSAGE,A,B,C,D,E,F,G) \ - [THIS_FILE_, __LINE__, PFORMAT_7(MESSAGE,A,B,C,D,E,F,G)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_7(MESSAGE,A,B,C,D,E,F,G)] call CBA_fnc_log #define TRACE_8(MESSAGE,A,B,C,D,E,F,G,H) \ - [THIS_FILE_, __LINE__, PFORMAT_8(MESSAGE,A,B,C,D,E,F,G,H)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_8(MESSAGE,A,B,C,D,E,F,G,H)] call CBA_fnc_log #define TRACE_9(MESSAGE,A,B,C,D,E,F,G,H,I) \ - [THIS_FILE_, __LINE__, PFORMAT_9(MESSAGE,A,B,C,D,E,F,G,H,I)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_9(MESSAGE,A,B,C,D,E,F,G,H,I)] call CBA_fnc_log #else @@ -360,37 +379,37 @@ Group: General #define QUOTE(var1) #var1 #ifdef MODULAR - #define COMPONENT_T DOUBLES(t,COMPONENT) - #define COMPONENT_M DOUBLES(m,COMPONENT) - #define COMPONENT_S DOUBLES(s,COMPONENT) - #define COMPONENT_C DOUBLES(c,COMPONENT) - #define COMPONENT_F COMPONENT_C + #define COMPONENT_T DOUBLES(t,COMPONENT) + #define COMPONENT_M DOUBLES(m,COMPONENT) + #define COMPONENT_S DOUBLES(s,COMPONENT) + #define COMPONENT_C DOUBLES(c,COMPONENT) + #define COMPONENT_F COMPONENT_C #else - #define COMPONENT_T COMPONENT - #define COMPONENT_M COMPONENT - #define COMPONENT_S COMPONENT - #define COMPONENT_F COMPONENT - #define COMPONENT_C COMPONENT + #define COMPONENT_T COMPONENT + #define COMPONENT_M COMPONENT + #define COMPONENT_S COMPONENT + #define COMPONENT_F COMPONENT + #define COMPONENT_C COMPONENT #endif /* ------------------------------------------- Macro: INC() Description: - Increase a number by one. + Increase a number by one. Parameters: - VAR - Variable to increment [Number] + VAR - Variable to increment [Number] Example: - (begin example) - _counter = 0; - INC(_counter); - // _counter => 1 - (end) + (begin example) + _counter = 0; + INC(_counter); + // _counter => 1 + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define INC(var) var = (var) + 1 @@ -398,20 +417,20 @@ Author: Macro: DEC() Description: - Decrease a number by one. + Decrease a number by one. Parameters: - VAR - Variable to decrement [Number] + VAR - Variable to decrement [Number] Example: - (begin example) - _counter = 99; - DEC(_counter); - // _counter => 98 - (end) + (begin example) + _counter = 99; + DEC(_counter); + // _counter => 98 + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define DEC(var) var = (var) - 1 @@ -419,27 +438,27 @@ Author: Macro: ADD() Description: - Add a value to a variable. Variable and value should be both Numbers or both Strings. + Add a value to a variable. Variable and value should be both Numbers or both Strings. Parameters: - VAR - Variable to add to [Number or String] - VALUE - Value to add [Number or String] + VAR - Variable to add to [Number or String] + VALUE - Value to add [Number or String] Examples: - (begin example) - _counter = 2; - ADD(_counter,3); - // _counter => 5 - (end) - (begin example) - _str = "hello"; - ADD(_str," "); - ADD(_str,"Fred"); - // _str => "hello Fred" - (end) + (begin example) + _counter = 2; + ADD(_counter,3); + // _counter => 5 + (end) + (begin example) + _str = "hello"; + ADD(_str," "); + ADD(_str,"Fred"); + // _str => "hello Fred" + (end) Author: - Sickboy + Sickboy ------------------------------------------- */ #define ADD(var1,var2) var1 = (var1) + (var2) @@ -447,18 +466,18 @@ Author: Macro: SUB() Description: - Subtract a value from a number variable. VAR and VALUE should both be Numbers. + Subtract a value from a number variable. VAR and VALUE should both be Numbers. Parameters: - VAR - Variable to subtract from [Number] - VALUE - Value to subtract [Number] + VAR - Variable to subtract from [Number] + VALUE - Value to subtract [Number] Examples: - (begin example) - _numChickens = 2; - SUB(_numChickens,3); - // _numChickens => -1 - (end) + (begin example) + _numChickens = 2; + SUB(_numChickens,3); + // _numChickens => -1 + (end) ------------------------------------------- */ #define SUB(var1,var2) var1 = (var1) - (var2) @@ -466,24 +485,24 @@ Examples: Macro: REM() Description: - Remove an element from an array each time it occurs. + Remove an element from an array each time it occurs. - This recreates the entire array, so use BIS_fnc_removeIndex if modification of the original array is required - or if only one of the elements that matches ELEMENT needs to be removed. + This recreates the entire array, so use BIS_fnc_removeIndex if modification of the original array is required + or if only one of the elements that matches ELEMENT needs to be removed. Parameters: - ARRAY - Array to modify [Array] - ELEMENT - Element to remove [Any] + ARRAY - Array to modify [Array] + ELEMENT - Element to remove [Any] Examples: - (begin example) - _array = [1, 2, 3, 4, 3, 8]; - REM(_array,3); - // _array = [1, 2, 4, 8]; - (end) + (begin example) + _array = [1, 2, 3, 4, 3, 8]; + REM(_array,3); + // _array = [1, 2, 4, 8]; + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define REM(var1,var2) SUB(var1,[var2]) @@ -491,21 +510,21 @@ Author: Macro: PUSH() Description: - Appends a single value onto the end of an ARRAY. Change is made to the ARRAY itself, not creating a new array. + Appends a single value onto the end of an ARRAY. Change is made to the ARRAY itself, not creating a new array. Parameters: - ARRAY - Array to push element onto [Array] - ELEMENT - Element to push [Any] + ARRAY - Array to push element onto [Array] + ELEMENT - Element to push [Any] Examples: - (begin example) - _fish = ["blue", "green", "smelly"]; - PUSH(_fish,"monkey-flavoured"); - // _fish => ["blue", "green", "smelly", "monkey-flavoured"] - (end) + (begin example) + _fish = ["blue", "green", "smelly"]; + PUSH(_fish,"monkey-flavoured"); + // _fish => ["blue", "green", "smelly", "monkey-flavoured"] + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define PUSH(var1,var2) (var1) pushBack (var2) @@ -513,27 +532,27 @@ Author: Macro: ISNILS() Description: - Sets a variable with a value, but only if it is undefined. + Sets a variable with a value, but only if it is undefined. Parameters: - VARIABLE - Variable to set [Any, not nil] - DEFAULT_VALUE - Value to set VARIABLE to if it is undefined [Any, not nil] + VARIABLE - Variable to set [Any, not nil] + DEFAULT_VALUE - Value to set VARIABLE to if it is undefined [Any, not nil] Examples: - (begin example) - // _fish is undefined - ISNILS(_fish,0); - // _fish => 0 - (end) - (begin example) - _fish = 12; - // ...later... - ISNILS(_fish,0); - // _fish => 12 - (end) + (begin example) + // _fish is undefined + ISNILS(_fish,0); + // _fish => 0 + (end) + (begin example) + _fish = 12; + // ...later... + ISNILS(_fish,0); + // _fish => 12 + (end) Author: - Sickboy + Sickboy ------------------------------------------- */ #define ISNILS(VARIABLE,DEFAULT_VALUE) if (isNil #VARIABLE) then { ##VARIABLE = ##DEFAULT_VALUE } #define ISNILS2(var1,var2,var3,var4) ISNILS(TRIPLES(var1,var2,var3),var4) @@ -550,14 +569,14 @@ Author: #define GETVARMAINS(var1,var2) GETVARS(var1,MAINLOGIC,var2) #ifndef PATHTO_SYS - #define PATHTO_SYS(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\##var2\##var3.sqf + #define PATHTO_SYS(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\##var2\##var3.sqf #endif #ifndef PATHTOF_SYS - #define PATHTOF_SYS(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\##var2\##var3 + #define PATHTOF_SYS(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\##var2\##var3 #endif #ifndef PATHTOF2_SYS - #define PATHTOF2_SYS(var1,var2,var3) MAINPREFIX\##var1\SUBPREFIX\##var2\##var3 + #define PATHTOF2_SYS(var1,var2,var3) MAINPREFIX\##var1\SUBPREFIX\##var2\##var3 #endif #define PATHTO_R(var1) PATHTOF2_SYS(PREFIX,COMPONENT_C,var1) @@ -606,7 +625,7 @@ Author: #define CACHE_DIS(var1) (!isNil "CBA_RECOMPILE" || CACHE_DIS_SYS(configFile,var1) || CACHE_DIS_SYS(missionConfigFile,var1)) #ifndef DEBUG_SETTINGS - #define DEBUG_SETTINGS [false, true, false] + #define DEBUG_SETTINGS [false, true, false] #endif #define MSG_INIT QUOTE(Initializing: ADDON version: VERSION) @@ -625,34 +644,34 @@ Author: #define VERSIONING_SYS(var1) class CfgSettings \ { \ - class CBA \ - { \ - class Versioning \ - { \ - class var1 \ - { \ - }; \ - }; \ - }; \ + class CBA \ + { \ + class Versioning \ + { \ + class var1 \ + { \ + }; \ + }; \ + }; \ }; #define VERSIONING VERSIONING_SYS(PREFIX) /* ------------------------------------------- Macro: GVAR() - Get full variable identifier for a global variable owned by this component. + Get full variable identifier for a global variable owned by this component. Parameters: - VARIABLE - Partial name of global variable owned by this component [Any]. + VARIABLE - Partial name of global variable owned by this component [Any]. Example: - (begin example) - GVAR(frog) = 12; - // In SPON_FrogDancing component, equivalent to SPON_FrogDancing_frog = 12 - (end) + (begin example) + GVAR(frog) = 12; + // In SPON_FrogDancing component, equivalent to SPON_FrogDancing_frog = 12 + (end) Author: - Sickboy + Sickboy ------------------------------------------- */ #define GVAR(var1) DOUBLES(ADDON,var1) #define EGVAR(var1,var2) DOUBLES(DOUBLES(PREFIX,var1),var2) @@ -660,19 +679,19 @@ Author: /* ------------------------------------------- Macro: GVARMAIN() - Get full variable identifier for a global variable owned by this addon. + Get full variable identifier for a global variable owned by this addon. Parameters: - VARIABLE - Partial name of global variable owned by this addon [Any]. + VARIABLE - Partial name of global variable owned by this addon [Any]. Example: - (begin example) - GVARMAIN(frog) = 12; - // In SPON_FrogDancing component, equivalent to SPON_frog = 12 - (end) + (begin example) + GVARMAIN(frog) = 12; + // In SPON_FrogDancing component, equivalent to SPON_frog = 12 + (end) Author: - Sickboy + Sickboy ------------------------------------------- */ #define GVARMAIN(var1) GVARMAINS(PREFIX,var1) // TODO: What's this? @@ -693,7 +712,7 @@ Author: #define PREP(var1) TRIPLES(ADDON,fnc,var1) = compile preProcessFileLineNumbers 'PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))' #define PREPMAIN(var1) TRIPLES(PREFIX,fnc,var1) = compile preProcessFileLineNumbers 'PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))' #else - #define PREP(var1) ['PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))', 'TRIPLES(ADDON,fnc,var1)'] call SLX_XEH_COMPILE_NEW + #define PREP(var1) ['PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))', 'TRIPLES(ADDON,fnc,var1)'] call SLX_XEH_COMPILE_NEW #define PREPMAIN(var1) ['PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))', 'TRIPLES(PREFIX,fnc,var1)'] call SLX_XEH_COMPILE_NEW #endif @@ -703,27 +722,27 @@ Author: #define EFUNC(var1,var2) FUNC_INNER(var1,var2) #ifndef PRELOAD_ADDONS - #define PRELOAD_ADDONS class CfgAddons \ + #define PRELOAD_ADDONS class CfgAddons \ { \ - class PreloadAddons \ - { \ - class ADDON \ - { \ - list[]={ QUOTE(ADDON) }; \ - }; \ - }; \ + class PreloadAddons \ + { \ + class ADDON \ + { \ + list[]={ QUOTE(ADDON) }; \ + }; \ + }; \ } #endif /* ------------------------------------------- Macros: ARG_#() - Select from list of array arguments + Select from list of array arguments Parameters: - VARIABLE(1-8) - elements for the list + VARIABLE(1-8) - elements for the list Author: - Rommel + Rommel ------------------------------------------- */ #define ARG_1(A,B) ((A) select (B)) #define ARG_2(A,B,C) (ARG_1(ARG_1(A,B),C)) @@ -736,14 +755,14 @@ Author: /* ------------------------------------------- Macros: ARR_#() - Create list from arguments. Useful for working around , in macro parameters. - 1-8 arguments possible. + Create list from arguments. Useful for working around , in macro parameters. + 1-8 arguments possible. Parameters: - VARIABLE(1-8) - elements for the list + VARIABLE(1-8) - elements for the list Author: - Nou + Nou ------------------------------------------- */ #define ARR_1(ARG1) ARG1 #define ARR_2(ARG1,ARG2) ARG1, ARG2 @@ -756,15 +775,15 @@ Author: /* ------------------------------------------- Macros: FORMAT_#(STR, ARG1) - Format - Useful for working around , in macro parameters. - 1-8 arguments possible. + Format - Useful for working around , in macro parameters. + 1-8 arguments possible. Parameters: - STRING - string used by format - VARIABLE(1-8) - elements for usage in format + STRING - string used by format + VARIABLE(1-8) - elements for usage in format Author: - Nou & Sickboy + Nou & Sickboy ------------------------------------------- */ #define FORMAT_1(STR,ARG1) format[STR, ARG1] #define FORMAT_2(STR,ARG1,ARG2) format[STR, ARG1, ARG2] @@ -781,32 +800,32 @@ Author: /* ------------------------------------------- Macros: IS_x() - Checking the data types of variables. + Checking the data types of variables. - IS_ARRAY() - Array - IS_BOOL() - Boolean - IS_BOOLEAN() - UI display handle(synonym for ) - IS_CODE() - Code block (i.e a compiled function) - IS_CONFIG() - Configuration - IS_CONTROL() - UI control handle. - IS_DISPLAY() - UI display handle. - IS_FUNCTION() - A compiled function (synonym for ) - IS_GROUP() - Group. - IS_INTEGER() - Is a number a whole number? - IS_LOCATION() - World location. - IS_NUMBER() - A floating point number (synonym for ) - IS_OBJECT() - World object. - IS_SCALAR() - Floating point number. - IS_SCRIPT() - A script handle (as returned by execVM and spawn commands). - IS_SIDE() - Game side. - IS_STRING() - World object. - IS_TEXT() - Structured text. + IS_ARRAY() - Array + IS_BOOL() - Boolean + IS_BOOLEAN() - UI display handle(synonym for ) + IS_CODE() - Code block (i.e a compiled function) + IS_CONFIG() - Configuration + IS_CONTROL() - UI control handle. + IS_DISPLAY() - UI display handle. + IS_FUNCTION() - A compiled function (synonym for ) + IS_GROUP() - Group. + IS_INTEGER() - Is a number a whole number? + IS_LOCATION() - World location. + IS_NUMBER() - A floating point number (synonym for ) + IS_OBJECT() - World object. + IS_SCALAR() - Floating point number. + IS_SCRIPT() - A script handle (as returned by execVM and spawn commands). + IS_SIDE() - Game side. + IS_STRING() - World object. + IS_TEXT() - Structured text. Parameters: - VARIABLE - Variable to check if it is of a particular type [Any, not nil] + VARIABLE - Variable to check if it is of a particular type [Any, not nil] Author: - Spooner + Spooner ------------------------------------------- */ #define IS_META_SYS(VAR,TYPE) (if (isNil {VAR}) then { false } else { (typeName (VAR)) == TYPE }) #define IS_ARRAY(VAR) IS_META_SYS(VAR,"ARRAY") @@ -829,107 +848,120 @@ Author: #define IS_INTEGER(VAR) if ( IS_SCALAR(VAR) ) then { (floor(VAR) == (VAR)) } else { false } #define IS_NUMBER(VAR) IS_SCALAR(VAR) +#define FLOAT_TO_STRING(num) (str parseNumber (str (_this%_this) + str floor abs _this) + "." + (str (abs _this-floor abs _this) select [2]) + "0") + /* ------------------------------------------- Macro: SCRIPT() - Sets name of script (relies on PREFIX and COMPONENT values being #defined). + Sets name of script (relies on PREFIX and COMPONENT values being #defined). Parameters: - NAME - Name of script [Indentifier] + NAME - Name of script [Indentifier] Example: - (begin example) - SCRIPT(eradicateMuppets); - (end) + (begin example) + SCRIPT(eradicateMuppets); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define SCRIPT(NAME) \ - scriptName 'PREFIX\COMPONENT\NAME' + scriptName 'PREFIX\COMPONENT\NAME' /* ------------------------------------------- Macros: EXPLODE_n() - Splitting an ARRAY into a number of variables (A, B, C, etc). + DEPRECATED - Use param/params commands added in Arma 3 1.48 - Note that this NOT does make the created variables private. - _PVT variants do. + Splitting an ARRAY into a number of variables (A, B, C, etc). - EXPLODE_1(ARRAY,A,B) - Split a 1-element array into separate variable. - EXPLODE_2(ARRAY,A,B) - Split a 2-element array into separate variables. - EXPLODE_3(ARRAY,A,B,C) - Split a 3-element array into separate variables. - EXPLODE_4(ARRAY,A,B,C,D) - Split a 4-element array into separate variables. - EXPLODE_5(ARRAY,A,B,C,D,E) - Split a 5-element array into separate variables. - EXPLODE_6(ARRAY,A,B,C,D,E,F) - Split a 6-element array into separate variables. - EXPLODE_7(ARRAY,A,B,C,D,E,F,G) - Split a 7-element array into separate variables. - EXPLODE_8(ARRAY,A,B,C,D,E,F,G,H) - Split a 8-element array into separate variables. - EXPLODE_9(ARRAY,A,B,C,D,E,F,G,H,I) - Split a 9-element array into separate variables. + Note that this NOT does make the created variables private. + _PVT variants do. + + EXPLODE_1(ARRAY,A,B) - Split a 1-element array into separate variable. + EXPLODE_2(ARRAY,A,B) - Split a 2-element array into separate variables. + EXPLODE_3(ARRAY,A,B,C) - Split a 3-element array into separate variables. + EXPLODE_4(ARRAY,A,B,C,D) - Split a 4-element array into separate variables. + EXPLODE_5(ARRAY,A,B,C,D,E) - Split a 5-element array into separate variables. + EXPLODE_6(ARRAY,A,B,C,D,E,F) - Split a 6-element array into separate variables. + EXPLODE_7(ARRAY,A,B,C,D,E,F,G) - Split a 7-element array into separate variables. + EXPLODE_8(ARRAY,A,B,C,D,E,F,G,H) - Split a 8-element array into separate variables. + EXPLODE_9(ARRAY,A,B,C,D,E,F,G,H,I) - Split a 9-element array into separate variables. Parameters: - ARRAY - Array to read from [Array] - A..H - Names of variables to set from array [Identifier] + ARRAY - Array to read from [Array] + A..H - Names of variables to set from array [Identifier] Example: - (begin example) - _array = ["fred", 156.8, 120.9]; - EXPLODE_3(_array,_name_height,_weight); - (end) + (begin example) + _array = ["fred", 156.8, 120.9]; + EXPLODE_3(_array,_name,_height,_weight); + (end) Author: - Spooner + Spooner ------------------------------------------- */ -#define EXPLODE_1_SYS(ARRAY,A) A = if (IS_ARRAY((ARRAY))) then { (ARRAY) select 0 } else { ARRAY } +#define EXPLODE_1_SYS(ARRAY,A) A = ARRAY param [0] #define EXPLODE_1(ARRAY,A) EXPLODE_1_SYS(ARRAY,A); TRACE_1("EXPLODE_1, " + QUOTE(ARRAY),A) -#define EXPLODE_1_PVT(ARRAY,A) \ - private #A; \ - EXPLODE_1(ARRAY,A) +#define EXPLODE_1_PVT(ARRAY,A) ARRAY params [#A]; TRACE_1("EXPLODE_1, " + QUOTE(ARRAY),A) -#define EXPLODE_2_SYS(ARRAY,A,B) EXPLODE_1_SYS(ARRAY,A); B = (ARRAY) select 1 +#define EXPLODE_2_SYS(ARRAY,A,B) EXPLODE_1_SYS(ARRAY,A); B = ARRAY param [1] #define EXPLODE_2(ARRAY,A,B) EXPLODE_2_SYS(ARRAY,A,B); TRACE_2("EXPLODE_2, " + QUOTE(ARRAY),A,B) -#define EXPLODE_2_PVT(ARRAY,A,B) \ - private [#A,#B]; \ - EXPLODE_2(ARRAY,A,B) +#define EXPLODE_2_PVT(ARRAY,A,B) ARRAY params [#A,#B]; TRACE_2("EXPLODE_2, " + QUOTE(ARRAY),A,B) -#define EXPLODE_3_SYS(ARRAY,A,B,C) EXPLODE_2_SYS(ARRAY,A,B); C = (ARRAY) select 2 +#define EXPLODE_3_SYS(ARRAY,A,B,C) EXPLODE_2_SYS(ARRAY,A,B); C = ARRAY param [2] #define EXPLODE_3(ARRAY,A,B,C) EXPLODE_3_SYS(ARRAY,A,B,C); TRACE_3("EXPLODE_3, " + QUOTE(ARRAY),A,B,C) -#define EXPLODE_3_PVT(ARRAY,A,B,C) \ - private [#A,#B,#C]; \ - EXPLODE_3(ARRAY,A,B,C) - -#define EXPLODE_4_SYS(ARRAY,A,B,C,D) EXPLODE_3_SYS(ARRAY,A,B,C); D = (ARRAY) select 3 +#define EXPLODE_3_PVT(ARRAY,A,B,C) ARRAY params [#A,#B,#C]; TRACE_3("EXPLODE_3, " + QUOTE(ARRAY),A,B,C) + +#define EXPLODE_4_SYS(ARRAY,A,B,C,D) EXPLODE_3_SYS(ARRAY,A,B,C); D = ARRAY param [3] #define EXPLODE_4(ARRAY,A,B,C,D) EXPLODE_4_SYS(ARRAY,A,B,C,D); TRACE_4("EXPLODE_4, " + QUOTE(ARRAY),A,B,C,D) -#define EXPLODE_4_PVT(ARRAY,A,B,C,D) \ - private [#A,#B,#C,#D]; \ - EXPLODE_4(ARRAY,A,B,C,D) +#define EXPLODE_4_PVT(ARRAY,A,B,C,D) ARRAY params [#A,#B,#C,#D]; TRACE_4("EXPLODE_4, " + QUOTE(ARRAY),A,B,C,D) -#define EXPLODE_5_SYS(ARRAY,A,B,C,D,E) EXPLODE_4_SYS(ARRAY,A,B,C,D); E = (ARRAY) select 4 +#define EXPLODE_5_SYS(ARRAY,A,B,C,D,E) EXPLODE_4_SYS(ARRAY,A,B,C,D); E = ARRAY param [4] #define EXPLODE_5(ARRAY,A,B,C,D,E) EXPLODE_5_SYS(ARRAY,A,B,C,D,E); TRACE_5("EXPLODE_5, " + QUOTE(ARRAY),A,B,C,D,E) -#define EXPLODE_5_PVT(ARRAY,A,B,C,D,E) \ - private [#A,#B,#C,#D,#E]; \ - EXPLODE_5(ARRAY,A,B,C,D,E) +#define EXPLODE_5_PVT(ARRAY,A,B,C,D,E) ARRAY params [#A,#B,#C,#D,#E]; TRACE_5("EXPLODE_5, " + QUOTE(ARRAY),A,B,C,D,E) -#define EXPLODE_6_SYS(ARRAY,A,B,C,D,E,F) EXPLODE_5_SYS(ARRAY,A,B,C,D,E); F = (ARRAY) select 5 +#define EXPLODE_6_SYS(ARRAY,A,B,C,D,E,F) EXPLODE_5_SYS(ARRAY,A,B,C,D,E); F = ARRAY param [5] #define EXPLODE_6(ARRAY,A,B,C,D,E,F) EXPLODE_6_SYS(ARRAY,A,B,C,D,E,F); TRACE_6("EXPLODE_6, " + QUOTE(ARRAY),A,B,C,D,E,F) -#define EXPLODE_6_PVT(ARRAY,A,B,C,D,E,F) \ - private [#A,#B,#C,#D,#E,#F]; \ - EXPLODE_6(ARRAY,A,B,C,D,E,F) +#define EXPLODE_6_PVT(ARRAY,A,B,C,D,E,F) ARRAY params [#A,#B,#C,#D,#E,#F]; TRACE_6("EXPLODE_6, " + QUOTE(ARRAY),A,B,C,D,E,F) -#define EXPLODE_7_SYS(ARRAY,A,B,C,D,E,F,G) EXPLODE_6_SYS(ARRAY,A,B,C,D,E,F); G = (ARRAY) select 6 +#define EXPLODE_7_SYS(ARRAY,A,B,C,D,E,F,G) EXPLODE_6_SYS(ARRAY,A,B,C,D,E,F); G = ARRAY param [6] #define EXPLODE_7(ARRAY,A,B,C,D,E,F,G) EXPLODE_7_SYS(ARRAY,A,B,C,D,E,F,G); TRACE_7("EXPLODE_7, " + QUOTE(ARRAY),A,B,C,D,E,F,G) -#define EXPLODE_7_PVT(ARRAY,A,B,C,D,E,F,G) \ - private [#A,#B,#C,#D,#E,#F,#G]; \ - EXPLODE_7(ARRAY,A,B,C,D,E,F,G) +#define EXPLODE_7_PVT(ARRAY,A,B,C,D,E,F,G) ARRAY params [#A,#B,#C,#D,#E,#F,#G]; TRACE_7("EXPLODE_7, " + QUOTE(ARRAY),A,B,C,D,E,F,G) -#define EXPLODE_8_SYS(ARRAY,A,B,C,D,E,F,G,H) EXPLODE_7_SYS(ARRAY,A,B,C,D,E,F,G); H = (ARRAY) select 7 +#define EXPLODE_8_SYS(ARRAY,A,B,C,D,E,F,G,H) EXPLODE_7_SYS(ARRAY,A,B,C,D,E,F,G); H = ARRAY param [7] #define EXPLODE_8(ARRAY,A,B,C,D,E,F,G,H) EXPLODE_8_SYS(ARRAY,A,B,C,D,E,F,G,H); TRACE_8("EXPLODE_8, " + QUOTE(ARRAY),A,B,C,D,E,F,G,H) -#define EXPLODE_8_PVT(ARRAY,A,B,C,D,E,F,G,H) \ - private [#A,#B,#C,#D,#E,#F,#G,#H]; \ - EXPLODE_8(ARRAY,A,B,C,D,E,F,G,H) +#define EXPLODE_8_PVT(ARRAY,A,B,C,D,E,F,G,H) ARRAY params [#A,#B,#C,#D,#E,#F,#G,#H]; TRACE_8("EXPLODE_8, " + QUOTE(ARRAY),A,B,C,D,E,F,G,H) -#define EXPLODE_9_SYS(ARRAY,A,B,C,D,E,F,G,H,I) EXPLODE_8_SYS(ARRAY,A,B,C,D,E,F,G,H); I = (ARRAY) select 8 +#define EXPLODE_9_SYS(ARRAY,A,B,C,D,E,F,G,H,I) EXPLODE_8_SYS(ARRAY,A,B,C,D,E,F,G,H); I = ARRAY param [8] #define EXPLODE_9(ARRAY,A,B,C,D,E,F,G,H,I) EXPLODE_9_SYS(ARRAY,A,B,C,D,E,F,G,H,I); TRACE_9("EXPLODE_9, " + QUOTE(ARRAY),A,B,C,D,E,F,G,H,I) -#define EXPLODE_9_PVT(ARRAY,A,B,C,D,E,F,G,H,I) \ - private [#A,#B,#C,#D,#E,#F,#G,#H,#I]; \ - EXPLODE_9(ARRAY,A,B,C,D,E,F,G,H,I) +#define EXPLODE_9_PVT(ARRAY,A,B,C,D,E,F,G,H,I) ARRAY params [#A,#B,#C,#D,#E,#F,#G,#H,#I]; TRACE_9("EXPLODE_9, " + QUOTE(ARRAY),A,B,C,D,E,F,G,H,I) + +/* ------------------------------------------- +Macro: xSTRING() + Get full string identifier from a stringtable owned by this component. + +Parameters: + VARIABLE - Partial name of global variable owned by this component [Any]. + +Example: + ADDON is CBA_Balls. + (begin example) + // Localized String (localize command must still be used with it) + LSTRING(Example); // STR_CBA_Balls_Example; + // Config String (note the $) + CSTRING(Example); // $STR_CBA_Balls_Example; + (end) + +Author: + Jonpas +------------------------------------------- */ +#ifndef STRING_MACROS_GUARD +#define STRING_MACROS_GUARD + #define LSTRING(var1) QUOTE(TRIPLES(STR,ADDON,var1)) + #define ELSTRING(var1,var2) QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2)) + #define CSTRING(var1) QUOTE(TRIPLES($STR,ADDON,var1)) + #define ECSTRING(var1,var2) QUOTE(TRIPLES($STR,DOUBLES(PREFIX,var1),var2)) +#endif /* ------------------------------------------- @@ -938,37 +970,39 @@ Group: Managing Function Parameters /* ------------------------------------------- Macros: PARAMS_n() - Setting variables based on parameters passed to a function. + DEPRECATED - Use param/params commands added in Arma 3 1.48 - Each parameter is defines as private and set to the appropriate value from _this. + Setting variables based on parameters passed to a function. - PARAMS_1(A) - Get 1 parameter from the _this array (or _this if it's not an array). - PARAMS_2(A,B) - Get 2 parameters from the _this array. - PARAMS_3(A,B,C) - Get 3 parameters from the _this array. - PARAMS_4(A,B,C,D) - Get 4 parameters from the _this array. - PARAMS_5(A,B,C,D,E) - Get 5 parameters from the _this array. - PARAMS_6(A,B,C,D,E,F) - Get 6 parameters from the _this array. - PARAMS_7(A,B,C,D,E,F,G) - Get 7 parameters from the _this array. - PARAMS_8(A,B,C,D,E,F,G,H) - Get 8 parameters from the _this array. + Each parameter is defines as private and set to the appropriate value from _this. + + PARAMS_1(A) - Get 1 parameter from the _this array (or _this if it's not an array). + PARAMS_2(A,B) - Get 2 parameters from the _this array. + PARAMS_3(A,B,C) - Get 3 parameters from the _this array. + PARAMS_4(A,B,C,D) - Get 4 parameters from the _this array. + PARAMS_5(A,B,C,D,E) - Get 5 parameters from the _this array. + PARAMS_6(A,B,C,D,E,F) - Get 6 parameters from the _this array. + PARAMS_7(A,B,C,D,E,F,G) - Get 7 parameters from the _this array. + PARAMS_8(A,B,C,D,E,F,G,H) - Get 8 parameters from the _this array. Parameters: - A..H - Name of variable to read from _this [Identifier] + A..H - Name of variable to read from _this [Identifier] Example: - A function called like this: - (begin example) - [_name,_address,_telephone] call recordPersonalDetails; - (end) - expects 3 parameters and those variables could be initialised at the start of the function definition with: - (begin example) - recordPersonalDetails = { - PARAMS_3(_name,_address,_telephone); - // Rest of function follows... - }; - (end) + A function called like this: + (begin example) + [_name,_address,_telephone] call recordPersonalDetails; + (end) + expects 3 parameters and those variables could be initialised at the start of the function definition with: + (begin example) + recordPersonalDetails = { + PARAMS_3(_name,_address,_telephone); + // Rest of function follows... + }; + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define PARAMS_1(A) EXPLODE_1_PVT(_this,A) #define PARAMS_2(A,B) EXPLODE_2_PVT(_this,A,B) @@ -982,59 +1016,62 @@ Author: /* ------------------------------------------- Macro: DEFAULT_PARAM() - Getting a default function parameter. This may be used together with to have a mix of required and - optional parameters. + DEPRECATED - Use param/params commands added in Arma 3 1.48 + + Getting a default function parameter. This may be used together with to have a mix of required and + optional parameters. Parameters: - INDEX - Index of parameter in _this [Integer, 0+] - NAME - Name of the variable to set [Identifier] - DEF_VALUE - Default value to use in case the array is too short or the value at INDEX is nil [Any] + INDEX - Index of parameter in _this [Integer, 0+] + NAME - Name of the variable to set [Identifier] + DEF_VALUE - Default value to use in case the array is too short or the value at INDEX is nil [Any] Example: - A function called with optional parameters: - (begin example) - [_name] call myFunction; - [_name, _numberOfLegs] call myFunction; - [_name, _numberOfLegs, _hasAHead] call myFunction; - (end) - 1 required parameter and 2 optional parameters. Those variables could be initialised at the start of the function - definition with: - (begin example) - myFunction = { - PARAMS_1(_name); - DEFAULT_PARAM(1,_numberOfLegs,2); - DEFAULT_PARAM(2,_hasAHead,true); - // Rest of function follows... - }; - (end) + A function called with optional parameters: + (begin example) + [_name] call myFunction; + [_name, _numberOfLegs] call myFunction; + [_name, _numberOfLegs, _hasAHead] call myFunction; + (end) + 1 required parameter and 2 optional parameters. Those variables could be initialised at the start of the function + definition with: + (begin example) + myFunction = { + PARAMS_1(_name); + DEFAULT_PARAM(1,_numberOfLegs,2); + DEFAULT_PARAM(2,_hasAHead,true); + // Rest of function follows... + }; + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define DEFAULT_PARAM(INDEX,NAME,DEF_VALUE) \ - private #NAME; \ - NAME = [RETNIL(_this), INDEX, DEF_VALUE] call CBA_fnc_defaultParam; \ - TRACE_3("DEFAULT_PARAM",INDEX,NAME,DEF_VALUE) + private [#NAME,"_this"]; \ + ISNILS(_this,[]); \ + NAME = _this param [INDEX, DEF_VALUE]; \ + TRACE_3("DEFAULT_PARAM",INDEX,NAME,DEF_VALUE) /* ------------------------------------------- Macro: KEY_PARAM() - Get value from key in _this list, return default when key is not included in list. + Get value from key in _this list, return default when key is not included in list. Parameters: - KEY - Key name [String] - NAME - Name of the variable to set [Identifier] - DEF_VALUE - Default value to use in case key not found [ANY] + KEY - Key name [String] + NAME - Name of the variable to set [Identifier] + DEF_VALUE - Default value to use in case key not found [ANY] Example: Author: - Muzzleflash + Muzzleflash ------------------------------------------- */ #define KEY_PARAM(KEY,NAME,DEF_VALUE) \ - private #NAME; \ - NAME = [toLower KEY, toUpper KEY, DEF_VALUE, RETNIL(_this)] call CBA_fnc_getArg; \ - TRACE_3("KEY_PARAM",KEY,NAME,DEF_VALUE) + private #NAME; \ + NAME = [toLower KEY, toUpper KEY, DEF_VALUE, RETNIL(_this)] call CBA_fnc_getArg; \ + TRACE_3("KEY_PARAM",KEY,NAME,DEF_VALUE) /* ------------------------------------------- Group: Assertions @@ -1044,94 +1081,210 @@ Group: Assertions /* ------------------------------------------- Macro: ASSERT_TRUE() - Asserts that a CONDITION is true. When an assertion fails, an error is raised with the given MESSAGE. + Asserts that a CONDITION is true. When an assertion fails, an error is raised with the given MESSAGE. Parameters: - CONDITION - Condition to assert as true [Boolean] - MESSSAGE - Message to display if (A OPERATOR B) is false [String] + CONDITION - Condition to assert as true [Boolean] + MESSSAGE - Message to display if (A OPERATOR B) is false [String] Example: - (begin example) - ASSERT_TRUE(_frogIsDead,"The frog is alive"); - (end) + (begin example) + ASSERT_TRUE(_frogIsDead,"The frog is alive"); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define ASSERT_TRUE(CONDITION,MESSAGE) \ - if (not (CONDITION)) then \ - { \ - ASSERTION_ERROR('Assertion (CONDITION) failed!\n\n' + (MESSAGE)); \ - } + if (not (CONDITION)) then \ + { \ + ASSERTION_ERROR('Assertion (CONDITION) failed!\n\n' + (MESSAGE)); \ + } /* ------------------------------------------- Macro: ASSERT_FALSE() - Asserts that a CONDITION is false. When an assertion fails, an error is raised with the given MESSAGE. + Asserts that a CONDITION is false. When an assertion fails, an error is raised with the given MESSAGE. Parameters: - CONDITION - Condition to assert as false [Boolean] - MESSSAGE - Message to display if (A OPERATOR B) is true [String] + CONDITION - Condition to assert as false [Boolean] + MESSSAGE - Message to display if (A OPERATOR B) is true [String] Example: - (begin example) - ASSERT_FALSE(_frogIsDead,"The frog died"); - (end) + (begin example) + ASSERT_FALSE(_frogIsDead,"The frog died"); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define ASSERT_FALSE(CONDITION,MESSAGE) \ - if (CONDITION) then \ - { \ - ASSERTION_ERROR('Assertion (not (CONDITION)) failed!\n\n' + (MESSAGE)) \ - } + if (CONDITION) then \ + { \ + ASSERTION_ERROR('Assertion (not (CONDITION)) failed!\n\n' + (MESSAGE)) \ + } /* ------------------------------------------- Macro: ASSERT_OP() - Asserts that (A OPERATOR B) is true. When an assertion fails, an error is raised with the given MESSAGE. + Asserts that (A OPERATOR B) is true. When an assertion fails, an error is raised with the given MESSAGE. Parameters: - A - First value [Any] - OPERATOR - Binary operator to use [Operator] - B - Second value [Any] - MESSSAGE - Message to display if (A OPERATOR B) is false. [String] + A - First value [Any] + OPERATOR - Binary operator to use [Operator] + B - Second value [Any] + MESSSAGE - Message to display if (A OPERATOR B) is false. [String] Example: - (begin example) - ASSERT_OP(_fish,>,5,"Too few fish!"); - (end) + (begin example) + ASSERT_OP(_fish,>,5,"Too few fish!"); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define ASSERT_OP(A,OPERATOR,B,MESSAGE) \ - if (not ((A) OPERATOR (B))) then \ - { \ - ASSERTION_ERROR('Assertion (A OPERATOR B) failed!\n' + 'A: ' + (str (A)) + '\n' + 'B: ' + (str (B)) + "\n\n" + (MESSAGE)); \ - } + if (not ((A) OPERATOR (B))) then \ + { \ + ASSERTION_ERROR('Assertion (A OPERATOR B) failed!\n' + 'A: ' + (str (A)) + '\n' + 'B: ' + (str (B)) + "\n\n" + (MESSAGE)); \ + } /* ------------------------------------------- Macro: ASSERT_DEFINED() - Asserts that a VARIABLE is defined. When an assertion fails, an error is raised with the given MESSAGE.. + Asserts that a VARIABLE is defined. When an assertion fails, an error is raised with the given MESSAGE.. Parameters: - VARIABLE - Variable to test if defined [String or Function]. - MESSAGE - Message to display if variable is undefined [String]. + VARIABLE - Variable to test if defined [String or Function]. + MESSAGE - Message to display if variable is undefined [String]. Examples: - (begin example) - ASSERT_DEFINED("_anUndefinedVar","Too few fish!"); - ASSERT_DEFINED({ obj getVariable "anUndefinedVar" },"Too many fish!"); - (end) + (begin example) + ASSERT_DEFINED("_anUndefinedVar","Too few fish!"); + ASSERT_DEFINED({ obj getVariable "anUndefinedVar" },"Too many fish!"); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define ASSERT_DEFINED(VARIABLE,MESSAGE) \ - if (isNil VARIABLE) then \ - { \ - ASSERTION_ERROR('Assertion (VARIABLE is defined) failed!\n\n' + (MESSAGE)); \ - } + if (isNil VARIABLE) then \ + { \ + ASSERTION_ERROR('Assertion (VARIABLE is defined) failed!\n\n' + (MESSAGE)); \ + } + +/* ------------------------------------------- +Group: Unit tests +------------------------------------------- */ +#define TEST_SUCCESS(MESSAGE) MESSAGE_WITH_TITLE("Test OK",MESSAGE) +#define TEST_FAIL(MESSAGE) ERROR_WITH_TITLE("Test FAIL",MESSAGE) + +/* ------------------------------------------- +Macro: TEST_TRUE() + Tests that a CONDITION is true. + If the condition is not true, an error is raised with the given MESSAGE. + +Parameters: + CONDITION - Condition to assert as true [Boolean] + MESSSAGE - Message to display if (A OPERATOR B) is false [String] + +Example: + (begin example) + TEST_TRUE(_frogIsDead,"The frog is alive"); + (end) + +Author: + Killswitch +------------------------------------------- */ +#define TEST_TRUE(CONDITION, MESSAGE) \ + if (CONDITION) then \ + { \ + TEST_SUCCESS('(CONDITION)'); \ + } \ + else \ + { \ + TEST_FAIL('(CONDITION) ' + (MESSAGE)); \ + } + +/* ------------------------------------------- +Macro: TEST_FALSE() + Tests that a CONDITION is false. + If the condition is not false, an error is raised with the given MESSAGE. + +Parameters: + CONDITION - Condition to test as false [Boolean] + MESSSAGE - Message to display if (A OPERATOR B) is true [String] + +Example: + (begin example) + TEST_FALSE(_frogIsDead,"The frog died"); + (end) + +Author: + Killswitch +------------------------------------------- */ +#define TEST_FALSE(CONDITION, MESSAGE) \ + if (not (CONDITION)) then \ + { \ + TEST_SUCCESS('(not (CONDITION))'); \ + } \ + else \ + { \ + TEST_FAIL('(not (CONDITION)) ' + (MESSAGE)); \ + } + +/* ------------------------------------------- +Macro: TEST_OP() + Tests that (A OPERATOR B) is true. + If the test fails, an error is raised with the given MESSAGE. + +Parameters: + A - First value [Any] + OPERATOR - Binary operator to use [Operator] + B - Second value [Any] + MESSSAGE - Message to display if (A OPERATOR B) is false. [String] + +Example: + (begin example) + TEST_OP(_fish,>,5,"Too few fish!"); + (end) + +Author: + Killswitch +------------------------------------------- */ +#define TEST_OP(A,OPERATOR,B,MESSAGE) \ + if ((A) OPERATOR (B)) then \ + { \ + TEST_SUCCESS('(A OPERATOR B)') \ + } \ + else \ + { \ + TEST_FAIL('(A OPERATOR B)') \ + }; + +/* ------------------------------------------- +Macro: TEST_DEFINED() + Tests that a VARIABLE is defined. + +Parameters: + VARIABLE - Variable to test if defined [String or Function]. + MESSAGE - Message to display if variable is undefined [String]. + +Examples: + (begin example) + TEST_DEFINED("_anUndefinedVar","Too few fish!"); + TEST_DEFINED({ obj getVariable "anUndefinedVar" },"Too many fish!"); + (end) + +Author: + Killswitch +------------------------------------------- */ +#define TEST_DEFINED(VARIABLE,MESSAGE) \ + if (not isNil VARIABLE) then \ + { \ + TEST_SUCCESS('(' + VARIABLE + ' is defined)'); \ + } \ + else \ + { \ + TEST_FAIL('(' + VARIABLE + ' is not defined)' + (MESSAGE)); \ + } /* ------------------------------------------- Group: Managing Deprecation @@ -1139,117 +1292,117 @@ Group: Managing Deprecation /* ------------------------------------------- Macro: DEPRECATE_SYS() - Allow deprecation of a function that has been renamed. + Allow deprecation of a function that has been renamed. - Replaces an old OLD_FUNCTION (which will have PREFIX_ prepended) with a NEW_FUNCTION - (PREFIX_ prepended) with the intention that the old function will be disabled in the future. + Replaces an old OLD_FUNCTION (which will have PREFIX_ prepended) with a NEW_FUNCTION + (PREFIX_ prepended) with the intention that the old function will be disabled in the future. - Shows a warning in RPT each time the deprecated function is used, but runs the new function. + Shows a warning in RPT each time the deprecated function is used, but runs the new function. Parameters: - OLD_FUNCTION - Full name of old function [Identifier for function that does not exist any more] - NEW_FUNCTION - Full name of new function [Function] + OLD_FUNCTION - Full name of old function [Identifier for function that does not exist any more] + NEW_FUNCTION - Full name of new function [Function] Example: - (begin example) - // After renaming CBA_fnc_frog as CBA_fnc_fish - DEPRECATE_SYS(CBA_fnc_frog,CBA_fnc_fish); - (end) + (begin example) + // After renaming CBA_fnc_frog as CBA_fnc_fish + DEPRECATE_SYS(CBA_fnc_frog,CBA_fnc_fish); + (end) Author: - Sickboy + Sickboy ------------------------------------------- */ #define DEPRECATE_SYS(OLD_FUNCTION,NEW_FUNCTION) \ - OLD_FUNCTION = { \ - WARNING('Deprecated function used: OLD_FUNCTION (new: NEW_FUNCTION) in ADDON'); \ - if (isNil "_this") then { call NEW_FUNCTION } else { _this call NEW_FUNCTION }; \ - } + OLD_FUNCTION = { \ + WARNING('Deprecated function used: OLD_FUNCTION (new: NEW_FUNCTION) in ADDON'); \ + if (isNil "_this") then { call NEW_FUNCTION } else { _this call NEW_FUNCTION }; \ + } /* ------------------------------------------- Macro: DEPRECATE() - Allow deprecation of a function, in the current component, that has been renamed. + Allow deprecation of a function, in the current component, that has been renamed. - Replaces an OLD_FUNCTION (which will have PREFIX_ prepended) with a NEW_FUNCTION - (PREFIX_ prepended) with the intention that the old function will be disabled in the future. + Replaces an OLD_FUNCTION (which will have PREFIX_ prepended) with a NEW_FUNCTION + (PREFIX_ prepended) with the intention that the old function will be disabled in the future. - Shows a warning in RPT each time the deprecated function is used, but runs the new function. + Shows a warning in RPT each time the deprecated function is used, but runs the new function. Parameters: - OLD_FUNCTION - Name of old function, assuming PREFIX [Identifier for function that does not exist any more] - NEW_FUNCTION - Name of new function, assuming PREFIX [Function] + OLD_FUNCTION - Name of old function, assuming PREFIX [Identifier for function that does not exist any more] + NEW_FUNCTION - Name of new function, assuming PREFIX [Function] Example: - (begin example) - // After renaming CBA_fnc_frog as CBA_fnc_fish - DEPRECATE(fnc_frog,fnc_fish); - (end) + (begin example) + // After renaming CBA_fnc_frog as CBA_fnc_fish + DEPRECATE(fnc_frog,fnc_fish); + (end) Author: - Sickboy + Sickboy ------------------------------------------- */ #define DEPRECATE(OLD_FUNCTION,NEW_FUNCTION) \ - DEPRECATE_SYS(DOUBLES(PREFIX,OLD_FUNCTION),DOUBLES(PREFIX,NEW_FUNCTION)) + DEPRECATE_SYS(DOUBLES(PREFIX,OLD_FUNCTION),DOUBLES(PREFIX,NEW_FUNCTION)) /* ------------------------------------------- Macro: OBSOLETE_SYS() - Replace a function that has become obsolete. + Replace a function that has become obsolete. - Replace an obsolete OLD_FUNCTION with a simple COMMAND_FUNCTION, with the intention that anyone - using the function should replace it with the simple command, since the function will be disabled in the future. + Replace an obsolete OLD_FUNCTION with a simple COMMAND_FUNCTION, with the intention that anyone + using the function should replace it with the simple command, since the function will be disabled in the future. - Shows a warning in RPT each time the deprecated function is used, and runs the command function. + Shows a warning in RPT each time the deprecated function is used, and runs the command function. Parameters: - OLD_FUNCTION - Full name of old function [Identifier for function that does not exist any more] - COMMAND_CODE - Code to replace the old function [Function] + OLD_FUNCTION - Full name of old function [Identifier for function that does not exist any more] + COMMAND_CODE - Code to replace the old function [Function] Example: - (begin example) - // In Arma2, currentWeapon command made the CBA_fMyWeapon function obsolete: - OBSOLETE_SYS(CBA_fMyWeapon,{ currentWeapon player }); - (end) + (begin example) + // In Arma2, currentWeapon command made the CBA_fMyWeapon function obsolete: + OBSOLETE_SYS(CBA_fMyWeapon,{ currentWeapon player }); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define OBSOLETE_SYS(OLD_FUNCTION,COMMAND_CODE) \ - OLD_FUNCTION = { \ - WARNING('Obsolete function used: (use: OLD_FUNCTION) in ADDON'); \ - if (isNil "_this") then { call COMMAND_CODE } else { _this call COMMAND_CODE }; \ - } + OLD_FUNCTION = { \ + WARNING('Obsolete function used: (use: OLD_FUNCTION) in ADDON'); \ + if (isNil "_this") then { call COMMAND_CODE } else { _this call COMMAND_CODE }; \ + } /* ------------------------------------------- Macro: OBSOLETE() - Replace a function, in the current component, that has become obsolete. + Replace a function, in the current component, that has become obsolete. - Replace an obsolete OLD_FUNCTION (which will have PREFIX_ prepended) with a simple - COMMAND_CODE, with the intention that anyone using the function should replace it with the simple - command. + Replace an obsolete OLD_FUNCTION (which will have PREFIX_ prepended) with a simple + COMMAND_CODE, with the intention that anyone using the function should replace it with the simple + command. - Shows a warning in RPT each time the deprecated function is used. + Shows a warning in RPT each time the deprecated function is used. Parameters: - OLD_FUNCTION - Name of old function, assuming PREFIX [Identifier for function that does not exist any more] - COMMAND_CODE - Code to replace the old function [Function] + OLD_FUNCTION - Name of old function, assuming PREFIX [Identifier for function that does not exist any more] + COMMAND_CODE - Code to replace the old function [Function] Example: - (begin example) - // In Arma2, currentWeapon command made the CBA_fMyWeapon function obsolete: - OBSOLETE(fMyWeapon,{ currentWeapon player }); - (end) + (begin example) + // In Arma2, currentWeapon command made the CBA_fMyWeapon function obsolete: + OBSOLETE(fMyWeapon,{ currentWeapon player }); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define OBSOLETE(OLD_FUNCTION,COMMAND_CODE) \ - OBSOLETE_SYS(DOUBLES(PREFIX,OLD_FUNCTION),COMMAND_CODE) + OBSOLETE_SYS(DOUBLES(PREFIX,OLD_FUNCTION),COMMAND_CODE) #define BWC_CONFIG(NAME) class NAME { \ - units[] = {}; \ - weapons[] = {}; \ - requiredVersion = REQUIRED_VERSION; \ - requiredAddons[] = {}; \ - version = VERSION; \ + units[] = {}; \ + weapons[] = {}; \ + requiredVersion = REQUIRED_VERSION; \ + requiredAddons[] = {}; \ + version = VERSION; \ } // XEH Specific diff --git a/tools/cba/addons/xeh/init_pre.sqf b/tools/cba/addons/xeh/init_pre.sqf index 8e6a31f8c8..44b4657aca 100644 --- a/tools/cba/addons/xeh/init_pre.sqf +++ b/tools/cba/addons/xeh/init_pre.sqf @@ -23,10 +23,10 @@ uiNamespace setVariable ["CBA_isCached", CBA_isCached]; if (isNil "SLX_XEH_RECOMPILE") then { SLX_XEH_RECOMPILE = CACHE_DIS(xeh) }; if (!isMultiplayer || {isDedicated} || {CBA_isCached == -1}) then { - uiNamespace setVariable ["SLX_XEH_CACHE_KEYS", []]; - uiNamespace setVariable ["SLX_XEH_CACHE_KEYS2", []]; - uiNamespace setVariable ["SLX_XEH_CACHE_KEYS3", []]; - uiNamespace setVariable ["CBA_CACHE_KEYS", []]; + uiNamespace setVariable ["SLX_XEH_CACHE_KEYS", []]; + uiNamespace setVariable ["SLX_XEH_CACHE_KEYS2", []]; + uiNamespace setVariable ["SLX_XEH_CACHE_KEYS3", []]; + uiNamespace setVariable ["CBA_CACHE_KEYS", []]; }; SLX_XEH_CACHE_KEYS = uiNamespace getVariable "SLX_XEH_CACHE_KEYS"; @@ -46,24 +46,24 @@ SLX_XEH_DisableLogging = isClass(configFile/"CfgPatches"/"Disable_XEH_Logging"); /* CBA_fnc_defaultParam = { - PARAMS_3(_params,_index,_defaultValue); - - private "_value"; - - if (!isNil "_defaultValue") then { - _value = _defaultValue; - }; - - if (!isNil "_params" && {(typeName _params) == "ARRAY"} && {count _params > _index} && {!isNil { _params select _index }}) then { - _value = _params select _index; - }; - - // Return. - if (isNil "_value") then { - nil; - } else { - _value; - }; + params ["_params","_index","_defaultValue"]; + + private "_value"; + + if (!isNil "_defaultValue") then { + _value = _defaultValue; + }; + + if (!isNil "_params" && {(typeName _params) == "ARRAY"} && {count _params > _index} && {!isNil { _params select _index }}) then { + _value = _params select _index; + }; + + // Return. + if (isNil "_value") then { + nil; + } else { + _value; + }; }; */ @@ -74,10 +74,10 @@ if (time > 0) then { XEH_LOG("XEH WARNING: Time > 0; This probably means there a _cfgRespawn = (missionConfigFile/"respawn"); _respawn = false; if ( isNumber(_cfgRespawn) ) then { - _respawn = !(getNumber(_cfgRespawn) in [0, 1, 4, 5]); + _respawn = !(getNumber(_cfgRespawn) in [0, 1, 4, 5]); }; if ( isText(_cfgRespawn) ) then { - _respawn = !(getText(_cfgRespawn) in ["none", "bird", "group", "side"]); + _respawn = !(getText(_cfgRespawn) in ["none", "bird", "group", "side"]); }; SLX_XEH_objects = []; // Temporary array, to track InitPosts at mission initialization @@ -90,81 +90,81 @@ _level = 0; // pre v1.60 // TODO: Improve v1.60 detection // TODO: Temporary disabled due to #28652 //if ((isNumber (configFile >> "CfgDifficulties" >> "recruit" >> "recoilCoef")) && (isNumber (configFile >> "CfgVehicles" >> "Car" >> "turnCoef"))) then { - //_level = 1; // v1.60 + //_level = 1; // v1.60 //}; FUNC(determineProductVersion) = { - private "_pv"; - _pv = call {productVersion}; + private "_pv"; + _pv = call {productVersion}; - // A2 (and OA pre 1.61beta, and TOH pre 1.05?) does not support productVersion so we deal with it manually - if (isNil "_pv") then { - _pv = if (isClass(configFile >> "CfgPatches" >> "A3_Map_Stratis")) then { - // A3 Backup - ["Arma 3 Alpha","Arma3Alpha", -1, -1]; //,5,102571] + // A2 (and OA pre 1.61beta, and TOH pre 1.05?) does not support productVersion so we deal with it manually + if (isNil "_pv") then { + _pv = if (isClass(configFile >> "CfgPatches" >> "A3_Map_Stratis")) then { + // A3 Backup + ["Arma 3 Alpha","Arma3Alpha", -1, -1]; //,5,102571] - } else { - if (isClass(configFile >> "CfgPatches" >> "United_States_H")) then { - // TOH Backup - ["TakeOn H", "TakeOnH", -1, -1]; - } else { - if (isClass(configFile >> "CfgPatches" >> "Takistan")) then { - // OA Backup - ["ArmA 2OA", "ArmA2OA", -1, -1]; - } else { - // A2 Backup - ["ArmA 2", "ArmA2", -1, -1]; - }; - }; - }; - }; + } else { + if (isClass(configFile >> "CfgPatches" >> "United_States_H")) then { + // TOH Backup + ["TakeOn H", "TakeOnH", -1, -1]; + } else { + if (isClass(configFile >> "CfgPatches" >> "Takistan")) then { + // OA Backup + ["ArmA 2OA", "ArmA2OA", -1, -1]; + } else { + // A2 Backup + ["ArmA 2", "ArmA2", -1, -1]; + }; + }; + }; + }; - _pv; + _pv; }; FUNC(determineGame) = { - // 0 = A2 - // 1 = OA - // 2 = TOH - // 3 = A3 :P - private "_pv"; - _pv = call FUNC(determineProductVersion); + // 0 = A2 + // 1 = OA + // 2 = TOH + // 3 = A3 :P + private "_pv"; + _pv = call FUNC(determineProductVersion); - switch (_pv select 1) do { - case "ArmA2": {0}; - case "ArmA2OA": {1}; - case "TakeOnH": {2}; - case "Arma3Alpha": {3}; - case "Arma3": {3}; - default {0}; - }; + switch (_pv select 1) do { + case "ArmA2": {0}; + case "ArmA2OA": {1}; + case "TakeOnH": {2}; + case "Arma3Alpha": {3}; + case "Arma3": {3}; + default {0}; + }; }; // System array with machine / mission / session information SLX_XEH_MACHINE = [ - !isDedicated, // 0 - isClient (and thus has player) - false, // 1 - isJip - !isServer, // 2 - isDedicatedClient (and thus not a Client-Server) - isServer, // 3 - isServer - isDedicated, // 4 - isDedicatedServer (and thus not a Client-Server) - false, // 5 - Player Check Finished - !isMultiplayer, // 6 - SP? - false, // 7 - StartInit Passed - false, // 8 - Postinit Passed - isMultiplayer && {_respawn}, // 9 - Multiplayer && respawn? - if (isDedicated) then { 0 } else { if (isServer) then { 1 } else { 2 } }, // 10 - Machine type (only 3 possible configurations) - _id, // 11 - SESSION_ID - _level, // 12 - LEVEL - Used for version determination - false, // 13 - TIMEOUT - PostInit timedOut - call FUNC(determineGame), // 14 - Game - call FUNC(determineProductVersion) // 15 - Product+Version + !isDedicated, // 0 - isClient (and thus has player) + false, // 1 - isJip + !isServer, // 2 - isDedicatedClient (and thus not a Client-Server) + isServer, // 3 - isServer + isDedicated, // 4 - isDedicatedServer (and thus not a Client-Server) + false, // 5 - Player Check Finished + !isMultiplayer, // 6 - SP? + false, // 7 - StartInit Passed + false, // 8 - Postinit Passed + isMultiplayer && {_respawn}, // 9 - Multiplayer && respawn? + if (isDedicated) then { 0 } else { if (isServer) then { 1 } else { 2 } }, // 10 - Machine type (only 3 possible configurations) + _id, // 11 - SESSION_ID + _level, // 12 - LEVEL - Used for version determination + false, // 13 - TIMEOUT - PostInit timedOut + call FUNC(determineGame), // 14 - Game + call FUNC(determineProductVersion) // 15 - Product+Version ]; SLX_XEH_DUMMY = switch (SLX_XEH_MACHINE select 14) do { - case 2: {"Helipad_Invisible_H" }; - case 3: {"Land_HelipadEmpty_F" }; - default { "HeliHEmpty" }; + case 2: {"Helipad_Invisible_H" }; + case 3: {"Land_HelipadEmpty_F" }; + default { "HeliHEmpty" }; }; SLX_XEH_STR = ""; // Empty string @@ -259,24 +259,24 @@ call COMPILE_FILE(init_eh); // All XEH Event functions GVAR(init_obj) = SLX_XEH_DUMMY createVehicleLocal [0, 0, 0]; GVAR(init_obj) addEventHandler ["killed", { - #ifdef DEBUG_MODE_FULL - XEH_LOG("XEH: VehicleCrewInit: "+str(count vehicles)); - #endif + #ifdef DEBUG_MODE_FULL + XEH_LOG("XEH: VehicleCrewInit: "+str(count vehicles)); + #endif - { - _sim = getText(configFile/"CfgVehicles"/(typeOf _x)/"simulation"); - _crew = crew _x; - /* - * If it's a vehicle then start event handlers for the crew. - * (Vehicles have crew and are neither humanoids nor game logics) - */ - if (count _crew > 0 && {{ _sim == _x }count["soldier", "invisible"] == 0}) then { - { if !(_x in SLX_XEH_INIT_MEN) then { [_x] call SLX_XEH_EH_Init } } forEach _crew; - }; - } forEach vehicles; - SLX_XEH_INIT_MEN = nil; - - deleteVehicle GVAR(init_obj);GVAR(init_obj) = nil + { + _sim = getText(configFile/"CfgVehicles"/(typeOf _x)/"simulation"); + _crew = crew _x; + /* + * If it's a vehicle then start event handlers for the crew. + * (Vehicles have crew and are neither humanoids nor game logics) + */ + if (count _crew > 0 && {{ _sim == _x }count["soldier", "invisible"] == 0}) then { + { if !(_x in SLX_XEH_INIT_MEN) then { [_x] call SLX_XEH_EH_Init } } forEach _crew; + }; + } forEach vehicles; + SLX_XEH_INIT_MEN = nil; + + deleteVehicle GVAR(init_obj);GVAR(init_obj) = nil }]; GVAR(init_obj) setDamage 1; // Schedule to run itsy bitsy later @@ -284,73 +284,75 @@ GVAR(init_obj) setDamage 1; // Schedule to run itsy bitsy later // Prepare postInit GVAR(init_obj2) = SLX_XEH_DUMMY createVehicleLocal [0, 0, 0]; GVAR(init_obj2) addEventHandler ["killed", { - call COMPILE_FILE(init_post); - deleteVehicle GVAR(init_obj2);GVAR(init_obj2) = nil; + call COMPILE_FILE(init_post); + deleteVehicle GVAR(init_obj2);GVAR(init_obj2) = nil; }]; // Schedule PostInit SLX_XEH_STR spawn { - // Warn if PostInit takes longer than 10 tickTime seconds - SLX_XEH_STR spawn { - private["_time2Wait"]; - _time2Wait = diag_ticktime + 10; - waituntil {diag_ticktime > _time2Wait}; - if !(SLX_XEH_MACHINE select 8) then { - XEH_LOG("WARNING: PostInit did not finish in a timely fashion"); - waitUntil {time > 0}; - // Consider there will be no player if neither PostInit-Ready, nor PlayerCheck-Ready - if !(SLX_XEH_MACHINE select 8 || {SLX_XEH_MACHINE select 5}) then { SLX_XEH_MACHINE set [13, true]; }; - }; - }; + // Warn if PostInit takes longer than 10 tickTime seconds + SLX_XEH_STR spawn { + private["_time2Wait"]; + _time2Wait = diag_ticktime + 10; + waituntil {diag_ticktime > _time2Wait}; + if !(SLX_XEH_MACHINE select 8) then { + XEH_LOG("WARNING: PostInit did not finish in a timely fashion"); + waitUntil {time > 0}; + // Consider there will be no player if neither PostInit-Ready, nor PlayerCheck-Ready + if !(SLX_XEH_MACHINE select 8 || {SLX_XEH_MACHINE select 5}) then { SLX_XEH_MACHINE set [13, true]; }; + }; + }; - // On Server + Non JIP Client, we are now after all objects have inited - // and at the briefing, still time == 0 - if (isNull player) then { - #ifdef DEBUG_MODE_FULL - "NULL PLAYER" call SLX_XEH_LOG; - #endif - if !((SLX_XEH_MACHINE select 4) || {(SLX_XEH_MACHINE select 6)}) then { // only if MultiPlayer and not dedicated - #ifdef DEBUG_MODE_FULL - "JIP" call SLX_XEH_LOG; - #endif - - SLX_XEH_MACHINE set [1, true]; // set JIP - // TEST for weird jip-is-server-issue :S - if (!(SLX_XEH_MACHINE select 2) || {SLX_XEH_MACHINE select 3} || {SLX_XEH_MACHINE select 4}) then { - str(["WARNING: JIP Client, yet wrong detection", SLX_XEH_MACHINE]) call SLX_XEH_LOG; - SLX_XEH_MACHINE set [2, true]; // set Dedicated client - SLX_XEH_MACHINE set [3, false]; // set server - SLX_XEH_MACHINE set [4, false]; // set dedicatedserver - }; - waitUntil { !(isNull player) || {SLX_XEH_MACHINE select 13} }; - if (SLX_XEH_MACHINE select 13) then { XEH_LOG("WARNING: TimedOut waiting for player object to be ready. Continueing PostInit without Player ready") }; - }; - }; - - if !(isNull player) then { - if (isNull (group player) && {player isKindOf "CAManBase"}) then { - // DEBUG TEST: Crashing due to JIP, or when going from briefing - // into game - #ifdef DEBUG_MODE_FULL - "NULLGROUP" call SLX_XEH_LOG; - #endif - waitUntil { !(isNull (group player)) }; - }; - waitUntil { local player }; - }; + // On Server + Non JIP Client, we are now after all objects have inited + // and at the briefing, still time == 0 + if (isNull player) then { + #ifdef DEBUG_MODE_FULL + "NULL PLAYER" call SLX_XEH_LOG; + #endif + if !((SLX_XEH_MACHINE select 4) || {(SLX_XEH_MACHINE select 6)}) then { // only if MultiPlayer and not dedicated + #ifdef DEBUG_MODE_FULL + "JIP" call SLX_XEH_LOG; + #endif - GVAR(init_obj2) setDamage 1; // Schedule to run itsy bitsy later + // TEST for weird jip-is-server-issue :S + if (!(SLX_XEH_MACHINE select 2) || {SLX_XEH_MACHINE select 3} || {SLX_XEH_MACHINE select 4}) then { + str(["WARNING: JIP Client, yet wrong detection", SLX_XEH_MACHINE]) call SLX_XEH_LOG; + SLX_XEH_MACHINE set [2, true]; // set Dedicated client + SLX_XEH_MACHINE set [3, false]; // set server + SLX_XEH_MACHINE set [4, false]; // set dedicatedserver + }; + waitUntil { !(isNull player) || {SLX_XEH_MACHINE select 13} }; + if (SLX_XEH_MACHINE select 13) then { XEH_LOG("WARNING: TimedOut waiting for player object to be ready. Continueing PostInit without Player ready") }; + }; + }; - SLX_XEH_MACHINE set [5, true]; // set player check = complete + if !(isNull player) then { + if (isNull (group player) && {player isKindOf "CAManBase"}) then { + // DEBUG TEST: Crashing due to JIP, or when going from briefing + // into game + #ifdef DEBUG_MODE_FULL + "NULLGROUP" call SLX_XEH_LOG; + #endif + waitUntil { !(isNull (group player)) }; + }; + waitUntil { local player }; + }; + + // set JIP + SLX_XEH_MACHINE set [1, !isDedicated && getClientState in ["BRIEFING SHOWN","BRIEFING READ","GAME FINISHED","DEBRIEFING READ"]]; + + GVAR(init_obj2) setDamage 1; // Schedule to run itsy bitsy later + + SLX_XEH_MACHINE set [5, true]; // set player check = complete }; // Load and call any "pre-init", run-once event handlers /* - Compile code strings in the Extended_PreInit_EventHandlers class and call - them. This is done once per mission and before any extended init event - handler code is run. An addon maker can put run-once initialisation code - in such a pre-init "EH" rather than in a normal XEH init EH which might be - called several times. + Compile code strings in the Extended_PreInit_EventHandlers class and call + them. This is done once per mission and before any extended init event + handler code is run. An addon maker can put run-once initialisation code + in such a pre-init "EH" rather than in a normal XEH init EH which might be + called several times. */ { (_x/SLX_XEH_STR_PreInit) call FUNC(init_once) } forEach SLX_XEH_CONFIG_FILES; diff --git a/tools/cba/addons/xeh/script_xeh.hpp b/tools/cba/addons/xeh/script_xeh.hpp index ec7a1d8b88..ba55dbc917 100644 --- a/tools/cba/addons/xeh/script_xeh.hpp +++ b/tools/cba/addons/xeh/script_xeh.hpp @@ -1,8 +1,14 @@ +/* + Header: script_xeh.hpp + + Description: + Used internally. +*/ ///////////////////////////////////////////////////////////////////////////////// // MACRO: EXTENDED_EVENTHANDLERS -// XEH uses all existing event handlers +// Add all XEH event handlers ///////////////////////////////////////////////////////////////////////////////// -#define EXTENDED_EVENTHANDLERS init = QUOTE(if(isNil'SLX_XEH_MACHINE')then{call compile preProcessFileLineNumbers '\x\cba\addons\xeh\init_pre.sqf'};_this call SLX_XEH_EH_Init); \ +#define EXTENDED_EVENTHANDLERS init = "_this call SLX_XEH_EH_Init"; \ fired = "_this call SLX_XEH_EH_Fired"; \ animChanged = "_this call SLX_XEH_EH_AnimChanged"; \ animDone = "_this call SLX_XEH_EH_AnimDone"; \ @@ -45,22 +51,25 @@ weaponDisAssembled = "_this call SLX_XEH_EH_WeaponDisassembled"; -///////////////////////////////////////////////////////////////////////////////// -// MACRO: DELETE_EVENTHANDLERS -// -// Example: -// -// class DefaultEventhandlers; -// class Car_F; -// class MRAP_01_base_F: Car_F { -// class EventHandlers; -// }; -// class B_MRAP_01_F: MRAP_01_base_F { -// class Eventhandlers: EventHandlers { -// DELETE_EVENTHANDLERS -// }; -// }; -///////////////////////////////////////////////////////////////////////////////// +/* + MACRO: DELETE_EVENTHANDLERS + + Removes all event handlers. + + Example: + (begin example) + class DefaultEventhandlers; + class Car_F; + class MRAP_01_base_F: Car_F { + class EventHandlers; + }; + class B_MRAP_01_F: MRAP_01_base_F { + class Eventhandlers: EventHandlers { + DELETE_EVENTHANDLERS + }; + }; + (end example) +*/ #define DELETE_EVENTHANDLERS delete init; \ delete fired; \ diff --git a/tools/make.py b/tools/make.py index 0420b2df92..f8a4c80886 100644 --- a/tools/make.py +++ b/tools/make.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python3 # vim: set fileencoding=utf-8 : # make.py @@ -30,7 +30,7 @@ ############################################################################### -__version__ = "0.6" +__version__ = "0.7" import sys @@ -59,7 +59,7 @@ if sys.platform == "win32": ######## GLOBALS ######### project = "@ace" -ACE_VERSION = "3.0.0" +project_version = "3.0.0" arma3tools_path = "" work_drive = "" module_root = "" @@ -130,7 +130,6 @@ def Fract_Sec(s): return d,h,m,sec #endef Fract_Sec - # Copyright (c) André Burgaud # http://www.burgaud.com/bring-colors-to-the-windows-console-with-python/ if sys.platform == "win32": @@ -387,6 +386,7 @@ def copy_optionals_for_building(mod,pbos): if (os.path.isfile(sig_path)): #print("Moving {} for processing.".format(sig_path)) shutil.move(sig_path, os.path.join(release_dir, project, "addons", sigFile_name)) + except: print_error("Error in moving") raise @@ -450,6 +450,9 @@ def cleanup_optionals(mod): continue shutil.rmtree(destination) + except FileNotFoundError: + print_yellow("{} file not found".format(file_name)) + except: print_error("Cleaning Optionals Failed") raise @@ -556,9 +559,9 @@ def addon_restore(modulePath): return True -def get_ace_version(): - global ACE_VERSION - versionStamp = ACE_VERSION +def get_project_version(): + global project_version + versionStamp = project_version #do the magic based on https://github.com/acemod/ACE3/issues/806#issuecomment-95639048 try: @@ -583,16 +586,16 @@ def get_ace_version(): raise FileNotFoundError("File Not Found: {}".format(scriptModPath)) except Exception as e: - print_error("Get_Ace_Version error: {}".format(e)) + print_error("Get_project_version error: {}".format(e)) print_error("Check the integrity of the file: {}".format(scriptModPath)) - versionStamp = ACE_VERSION + versionStamp = project_version print_error("Resetting to the default version stamp: {}".format(versionStamp)) input("Press Enter to continue...") print("Resuming build...") print_yellow("{} VERSION set to {}".format(project.lstrip("@").upper(),versionStamp)) - ACE_VERSION = versionStamp - return ACE_VERSION + project_version = versionStamp + return project_version def replace_file(filePath, oldSubstring, newSubstring): @@ -610,7 +613,7 @@ def replace_file(filePath, oldSubstring, newSubstring): def set_version_in_files(): - newVersion = ACE_VERSION # MAJOR.MINOR.PATCH.BUILD + newVersion = project_version # MAJOR.MINOR.PATCH.BUILD newVersionShort = newVersion[:-2] # MAJOR.MINOR.PATCH # Regex patterns @@ -692,7 +695,7 @@ def restore_version_files(): def get_private_keyname(commitID,module="main"): global pbo_name_prefix - aceVersion = get_ace_version() + aceVersion = get_project_version() keyName = str("{prefix}{version}-{commit_id}".format(prefix=pbo_name_prefix,version=aceVersion,commit_id=commitID)) return keyName @@ -769,7 +772,7 @@ def main(argv): """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{}".format(__version__)) - global ACE_VERSION + global project_version global arma3tools_path global work_drive global module_root @@ -855,7 +858,7 @@ See the make.cfg file for additional build options. argv.remove("release") else: make_release_zip = False - release_version = ACE_VERSION + release_version = project_version if "target" in argv: make_target = argv[argv.index("target") + 1]