diff --git a/.github/workflows/arma.yml b/.github/workflows/arma.yml index 3ddfefd63fa..1af2e7e0602 100644 --- a/.github/workflows/arma.yml +++ b/.github/workflows/arma.yml @@ -43,3 +43,4 @@ jobs: with: name: ace3-${{ github.sha }}-nobin path: .hemttout/@* + include-hidden-files: true # Because .hemttout is a hidden directory diff --git a/.github/workflows/extensions.yml b/.github/workflows/extensions.yml index 8cafd847e26..ce475e5a006 100644 --- a/.github/workflows/extensions.yml +++ b/.github/workflows/extensions.yml @@ -57,7 +57,7 @@ jobs: - name: Build run: cargo build --verbose - name: Upload - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.arrays.os.target }} path: target/debug/ace.dll diff --git a/.github/workflows/hemtt.yml b/.github/workflows/hemtt.yml index 23fad275602..79286fc45c3 100644 --- a/.github/workflows/hemtt.yml +++ b/.github/workflows/hemtt.yml @@ -44,3 +44,4 @@ jobs: with: name: ace3-${{ github.sha }} path: .hemttout/@* + include-hidden-files: true # Because .hemttout is a hidden directory diff --git a/.hemtt/launch.toml b/.hemtt/launch.toml new file mode 100644 index 00000000000..d0726cbdded --- /dev/null +++ b/.hemtt/launch.toml @@ -0,0 +1,31 @@ +[default] +workshop = [ + "450814997", # CBA_A3 +] + +[spe] +extends = "default" +dlc = [ + "Spearhead 1944" +] + +[vn] +extends = "default" +dlc = [ + "S.O.G. Prairie Fire", +] + +[ws] +extends = "default" +dlc = [ + "Western Sahara", +] + +[rhs] +extends = "default" +workshop = [ + "843425103", # RHS AFRF Workshop ID + "843577117", # RHS USAF Workshop ID + "843593391", # RHS GREF Workshop ID + "843632231", # RHS SAF Workshop ID +] diff --git a/.hemtt/lints.toml b/.hemtt/lints.toml new file mode 100644 index 00000000000..eac28147c00 --- /dev/null +++ b/.hemtt/lints.toml @@ -0,0 +1,5 @@ +[sqf.banned_commands] +options.ignore = [ + "addPublicVariableEventHandler", # Alt syntax is broken, we are using main syntax + "createSoundSource", # Greatly attenuated when in first person and in a vehicle +] diff --git a/.hemtt/project.toml b/.hemtt/project.toml index a9535dd2baa..6ab1c3a1afc 100644 --- a/.hemtt/project.toml +++ b/.hemtt/project.toml @@ -27,35 +27,3 @@ exclude = [ "common/functions/fnc_dummy.sqf", "zeus/functions/fnc_zeusAttributes.sqf", ] - -[hemtt.launch.default] -workshop = [ - "450814997", # CBA_A3 -] - -[hemtt.launch.spe] -extends = "default" -dlc = [ - "spe" -] - -[hemtt.launch.vn] -extends = "default" -dlc = [ - "S.O.G. Prairie Fire", -] - -[hemtt.launch.ws] -extends = "default" -dlc = [ - "Western Sahara", -] - -[hemtt.launch.rhs] -extends = "default" -workshop = [ - "843425103", # RHS AFRF Workshop ID - "843577117", # RHS USAF Workshop ID - "843593391", # RHS GREF Workshop ID - "843632231", # RHS SAF Workshop ID -] diff --git a/Cargo.lock b/Cargo.lock index f65334dd2a9..9ce88373eeb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -50,9 +50,9 @@ dependencies = [ [[package]] name = "arma-rs" -version = "1.10.5" +version = "1.11.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdda6c2cf1237405dd57f82875c77b4159d415445471b903a901d8a37a61b30c" +checksum = "e722ed20b6266ceccf4334d32a528fcef9a2dca341b8bbcceb99eb7152081239" dependencies = [ "arma-rs-proc", "crossbeam-channel", @@ -62,14 +62,15 @@ dependencies = [ "seq-macro", "state", "uuid", - "windows 0.51.1", + "winapi", + "windows 0.58.0", ] [[package]] name = "arma-rs-proc" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "517b1a9cc16bc93896216ffeed0c692df4af022ee55ec45e8fc31c90a201dcb4" +checksum = "936ed035ff4e775bd50ff94ccdb44f236d1ca012c376347b048fb6b9861833b7" dependencies = [ "proc-macro2", "quote", @@ -408,9 +409,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.157" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374af5f94e54fa97cf75e945cce8a6b201e88a1a07e688b47dfd2a59c66dbd86" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libgit2-sys" @@ -1169,21 +1170,66 @@ dependencies = [ [[package]] name = "windows" -version = "0.51.1" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" dependencies = [ "windows-core", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] name = "windows-core" -version = "0.51.1" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" dependencies = [ - "windows-targets 0.48.5", + "windows-implement", + "windows-interface", + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", ] [[package]] diff --git a/ace.dll b/ace.dll index a92360dd4ac..088ffda15ba 100644 Binary files a/ace.dll and b/ace.dll differ diff --git a/ace_x64.dll b/ace_x64.dll index d9d09835f29..98d675bde45 100644 Binary files a/ace_x64.dll and b/ace_x64.dll differ diff --git a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf index ceaef17badf..a426f6ba99a 100644 --- a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf +++ b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf @@ -50,7 +50,7 @@ GVAR(Protractor) = true; __ctrl1 ctrlSetTextColor [1, 1, 1, 1]; __ctrl2 ctrlSetScale 1; - __ctrl2 ctrlSetPosition [SafeZoneX + 0.001, SafeZoneY - 0.001 - 0.1074 * (-0.86 max ((ACE_player weaponDirection currentWeapon ACE_player) select 2) min 0.86), 0.2, 0.2 * 4/3]; + __ctrl2 ctrlSetPosition [safeZoneX + 0.001, safeZoneY - 0.001 - 0.1074 * (-0.86 max ((ACE_player weaponDirection currentWeapon ACE_player) select 2) min 0.86), 0.2, 0.2 * 4/3]; __ctrl2 ctrlCommit 0; __ctrl2 ctrlSetText QPATHTOF(UI\protractor_marker.paa); __ctrl2 ctrlSetTextColor [1, 1, 1, 1]; diff --git a/addons/advanced_fatigue/Dialog.hpp b/addons/advanced_fatigue/Dialog.hpp index df019f3800c..7b57e00ced9 100644 --- a/addons/advanced_fatigue/Dialog.hpp +++ b/addons/advanced_fatigue/Dialog.hpp @@ -2,18 +2,18 @@ class RscControlsGroupNoScrollbars; class RscPicture; class GVAR(StaminaBarContainer): RscControlsGroupNoScrollbars { - x = "(profilenamespace getvariable [""IGUI_GRID_STAMINA_X"", ((safezoneX + safezoneW) - (10 * (((safezoneW / safezoneH) min 1.2) / 40)) - 4.3 * (((safezoneW / safezoneH) min 1.2) / 40))])"; - y = "(profilenamespace getvariable [""IGUI_GRID_STAMINA_Y"", (safezoneY + 4.05 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])"; - w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "0.15 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "(profilenamespace getvariable [""IGUI_GRID_STAMINA_X"", ((safeZoneX + safeZoneW) - (10 * (((safeZoneW / safeZoneH) min 1.2) / 40)) - 4.3 * (((safeZoneW / safeZoneH) min 1.2) / 40))])"; + y = "(profilenamespace getvariable [""IGUI_GRID_STAMINA_Y"", (safeZoneY + 4.05 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25))])"; + w = "10 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "0.15 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; class Controls { class StaminaBar: RscPicture { idc = 10; x = 0; y = 0; - w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "0.15 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "10 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "0.15 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; text = "\A3\Ui_f\data\IGUI\RscIngameUI\RscUnitInfo\stamina_ca.paa"; }; }; diff --git a/addons/advanced_fatigue/XEH_preInit.sqf b/addons/advanced_fatigue/XEH_preInit.sqf index 643b7b0be00..ed1bd966229 100644 --- a/addons/advanced_fatigue/XEH_preInit.sqf +++ b/addons/advanced_fatigue/XEH_preInit.sqf @@ -8,7 +8,7 @@ PREP_RECOMPILE_END; #include "initSettings.inc.sqf" -GVAR(staminaBarWidth) = 10 * (((safezoneW / safezoneH) min 1.2) / 40); +GVAR(staminaBarWidth) = 10 * (((safeZoneW / safeZoneH) min 1.2) / 40); GVAR(dutyList) = createHashMap; GVAR(setAnimExclusions) = []; GVAR(inertia) = 0; diff --git a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf index 16d355a424d..e6327a3fa56 100644 --- a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf +++ b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf @@ -27,9 +27,18 @@ if (!alive ACE_player) exitWith { private _velocity = velocity ACE_player; private _normal = surfaceNormal (getPosWorld ACE_player); private _movementVector = vectorNormalized _velocity; -private _sideVector = vectorNormalized (_movementVector vectorCrossProduct _normal); private _fwdAngle = asin (_movementVector select 2); -private _sideAngle = asin (_sideVector select 2); +private _sideAngle = if ((getPosATL ACE_player) select 2 > 0.01) then { + 0 // ignore terrain normal if not touching it +} else { + private _sideVector = vectorNormalized (_movementVector vectorCrossProduct _normal); + asin (_sideVector select 2); +}; +if (GVAR(isSwimming)) then { // ignore when floating + _fwdAngle = 0; + _sideAngle = 0; +}; + private _currentWork = REE; private _currentSpeed = (vectorMagnitude _velocity) min 6; @@ -62,7 +71,7 @@ if (isNull objectParent ACE_player && {_currentSpeed > 0.1} && {isTouchingGround }; // Used to simulate the unevenness/roughness of the terrain - if ((getPosATL ACE_player) select 2 < 0.01) then { + if (_sideAngle != 0) then { private _sideGradient = abs (_sideAngle / 45) min 1; _terrainFactor = 1 + _sideGradient ^ 4; diff --git a/addons/advanced_throwing/functions/fnc_throw.sqf b/addons/advanced_throwing/functions/fnc_throw.sqf index d6b38a6a0c7..d1773373411 100644 --- a/addons/advanced_throwing/functions/fnc_throw.sqf +++ b/addons/advanced_throwing/functions/fnc_throw.sqf @@ -89,7 +89,7 @@ GVAR(flightPath) = []; GVAR(flightRotation) = []; (_unit getVariable QGVAR(activeThrowable)) spawn { while {!isNull _this && {(getPosATL _this) select 2 > 0.05}} do { - GVAR(flightPath) pushBack [ASLtoAGL (getPosASL _this), vectorUp _this]; + GVAR(flightPath) pushBack [ASLToAGL (getPosASL _this), vectorUp _this]; sleep 0.05; }; }; diff --git a/addons/ai/functions/fnc_drawCuratorGarrisonPathing.sqf b/addons/ai/functions/fnc_drawCuratorGarrisonPathing.sqf index 561c8748a65..739e6510d9c 100644 --- a/addons/ai/functions/fnc_drawCuratorGarrisonPathing.sqf +++ b/addons/ai/functions/fnc_drawCuratorGarrisonPathing.sqf @@ -19,7 +19,7 @@ if (isNull findDisplay 312) exitWith { removeMissionEventHandler ["Draw3D", _thisEventHandler]; }; -private _unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []]; +private _unitMoveList = missionNamespace getVariable [QGVAR(garrison_unitMoveList), []]; { _x params ["_unit", "_pos"]; @@ -27,9 +27,9 @@ private _unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveLis switch (true) do { case (surfaceIsWater (getPos _unit) && {surfaceIsWater _pos}) : { for "_i" from 0 to 3 do { - drawLine3D [_unit modelToWorldVisualWorld [0,0,1], (AGLtoASL _pos), [1,0,0,1]]; + drawLine3D [_unit modelToWorldVisualWorld [0,0,1], (AGLToASL _pos), [1,0,0,1]]; }; - drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], (AGLtoASL _pos), 0.75, 0.75, 0.75]; + drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], (AGLToASL _pos), 0.75, 0.75, 0.75]; }; case (!surfaceIsWater (getPos _unit) && {!surfaceIsWater _pos}) : { @@ -43,7 +43,7 @@ private _unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveLis for "_i" from 0 to 3 do { drawLine3D [_unit modelToWorldVisual [0,0,1], (AGLToASL _pos), [1,0,0,1]]; }; - drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], (AGLtoASL _pos), 0.75, 0.75, 0.75]; + drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], (AGLToASL _pos), 0.75, 0.75, 0.75]; }; case (surfaceIsWater (getPos _unit) && {!surfaceIsWater _pos}) : { diff --git a/addons/ai/functions/fnc_garrison.sqf b/addons/ai/functions/fnc_garrison.sqf index 4b8f84fce63..042c4fde3cb 100644 --- a/addons/ai/functions/fnc_garrison.sqf +++ b/addons/ai/functions/fnc_garrison.sqf @@ -26,7 +26,7 @@ params [["_startingPos",[0,0,0], [[]], 3], ["_buildingTypes", ["Building"], [[]] TRACE_6("fnc_garrison: Start",_startingPos,_buldingTypes,count _unitsArray,_fillingRadius,_fillingTYpe,_topDownFilling); _unitsArray = _unitsArray select {alive _x && {!isPlayer _x}}; -private _currentUnitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []]; +private _currentUnitMoveList = missionNamespace getVariable [QGVAR(garrison_unitMoveList), []]; if (_startingPos isEqualTo [0,0,0]) exitWith { TRACE_1("fnc_garrison: StartingPos error",_startingPos); @@ -57,38 +57,38 @@ if (_topDownFilling) then { // Those reverse are necessary, as dumb as it is there's no better way to sort those subarrays in sqf { reverse _x; - } foreach _buildingPos; + } forEach _buildingPos; _buildingPos sort false; { reverse _x; - } foreach _buildingPos; + } forEach _buildingPos; _buildingsIndex pushBack _buildingPos; - } foreach _buildings; + } forEach _buildings; } else { { _buildingsIndex pushBack (_x buildingPos -1); - } foreach _buildings; + } forEach _buildings; }; // Remove buildings without positions { _buildingsIndex deleteAt (_buildingsIndex find _x); -} foreach (_buildingsIndex select {count _x == 0}); +} forEach (_buildingsIndex select {count _x == 0}); //Remove positions units are already pathing to _buildingsIndex = _buildingsIndex apply { _x select { private _testedPos = _x; - ({(_x select 1) isEqualTo _testedPos} count (missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []])) == 0 + ({(_x select 1) isEqualTo _testedPos} count (missionNamespace getVariable [QGVAR(garrison_unitMoveList), []])) == 0 } }; // Warn the user that there's not enough positions to place all units private _count = 0; -{_count = _count + count _x} foreach _buildingsIndex; +{_count = _count + count _x} forEach _buildingsIndex; if ( (count _unitsArray) - _count > 0) then { TRACE_4("fnc_garrison: Not enough spots to place all units",_unitsArray,count _unitsArray,_count,((count _unitsArray) - _count > 0)); [LSTRING(GarrisonNotEnoughPos)] call EFUNC(common,displayTextStructured); @@ -104,7 +104,7 @@ private _fnc_comparePos = { params ["_nearestUnits", "_pos"]; ({ if (surfaceIsWater getPos _x) then { - floor ((getPosASL _x) select 2) == floor ((AGLtoASL _pos) select 2) + floor ((getPosASL _x) select 2) == floor ((AGLToASL _pos) select 2) } else { floor ((getPosATL _x) select 2) == floor (_pos select 2) }; @@ -141,7 +141,7 @@ switch (_fillingType) do { if (_teleport) then { doStop _unit; if (_posSurface) then { - _unit setPosASL (AGLtoASL _pos); + _unit setPosASL (AGLToASL _pos); } else { _unit setPosATL _pos; }; @@ -190,7 +190,7 @@ switch (_fillingType) do { if (_teleport) then { doStop _unit; if (_posSurface) then { - _unit setPosASL (AGLtoASL _pos); + _unit setPosASL (AGLToASL _pos); } else { _unit setPosATL _pos; }; @@ -237,7 +237,7 @@ switch (_fillingType) do { if (_teleport) then { doStop _unit; if (_posSurface) then { - _unit setPosASL (AGLtoASL _pos); + _unit setPosASL (AGLToASL _pos); } else { _unit setPosATL _pos; }; @@ -261,7 +261,7 @@ switch (_fillingType) do { TRACE_1(format [ARR_2("fnc_garrison: while loop ended | %1 units ready to be treated by PFH",count _unitMoveList)],_teleport); // Update the unit list and remove duplicate positions and units -private _garrison_unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []]; +private _garrison_unitMoveList = missionNamespace getVariable [QGVAR(garrison_unitMoveList), []]; _garrison_unitMoveList = _garrison_unitMoveList select { _x params ["_testedUnit", "_testedPos"]; @@ -270,7 +270,7 @@ _garrison_unitMoveList = _garrison_unitMoveList select { _garrison_unitMoveList append _unitMoveList; -missionNameSpace setVariable [QGVAR(garrison_unitMoveList), _garrison_unitMoveList, true]; +missionNamespace setVariable [QGVAR(garrison_unitMoveList), _garrison_unitMoveList, true]; if (_teleport) then { [QGVAR(AISection), [_placedUnits, ["PATH"], false], _placedUnits] call CBA_fnc_targetEvent; diff --git a/addons/ai/functions/fnc_garrisonMove.sqf b/addons/ai/functions/fnc_garrisonMove.sqf index 4d1c471a0ea..46313f12e38 100644 --- a/addons/ai/functions/fnc_garrisonMove.sqf +++ b/addons/ai/functions/fnc_garrisonMove.sqf @@ -31,21 +31,21 @@ private _unitMoveListUnits = (_unitMoveList apply {_x select 0}); { _x setVariable [QGVAR(garrisonMove_failSafe), nil, true]; _x setVariable [QGVAR(garrisonMove_unitPosMemory), nil, true]; -} foreach _unitMoveListUnits; +} forEach _unitMoveListUnits; // Avoid duplicate PFHs if (isNil QGVAR(garrison_moveUnitPFH)) then { - missionNameSpace setVariable [QGVAR(garrison_moveUnitPFH), true, true]; + missionNamespace setVariable [QGVAR(garrison_moveUnitPFH), true, true]; // PFH checking if the units have reached their destination [{ params ["_args", "_pfhID"]; - private _unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []]; + private _unitMoveList = missionNamespace getVariable [QGVAR(garrison_unitMoveList), []]; // End PFH if all units are placed / unable to reach position if (_unitMoveList isEqualTo []) then { - missionNameSpace setVariable [QGVAR(garrison_moveUnitPFH), nil, true]; + missionNamespace setVariable [QGVAR(garrison_moveUnitPFH), nil, true]; LOG("garrisonMove PFH: PFH finished it's job | deleting PFH"); _pfhID call CBA_fnc_removePerFrameHandler; @@ -91,7 +91,7 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then { } else { private _unitPos = getPos _unit; - if (surfaceisWater _unitPos) then { + if (surfaceIsWater _unitPos) then { _unitPos = getPosASL _unit; } else { _unitPos = getPosATL _unit; @@ -131,9 +131,9 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then { }; }; }; - } foreach _unitMoveList; + } forEach _unitMoveList; - missionNameSpace setVariable [QGVAR(garrison_unitMoveList), _unitMoveList, true]; + missionNamespace setVariable [QGVAR(garrison_unitMoveList), _unitMoveList, true]; }; }, 0.5, []] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/ai/functions/fnc_unGarrison.sqf b/addons/ai/functions/fnc_unGarrison.sqf index 09ebc3e63da..f17d9aa4ab7 100644 --- a/addons/ai/functions/fnc_unGarrison.sqf +++ b/addons/ai/functions/fnc_unGarrison.sqf @@ -32,7 +32,7 @@ _units = _units select {local _x}; _unit setVariable [QGVAR(garrisonned), false, true]; - private _unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []]; + private _unitMoveList = missionNamespace getVariable [QGVAR(garrison_unitMoveList), []]; _unitMoveList deleteAt (_unitMoveList findIf {_x select 0 == _unit}); if (_leader != _unit) then { @@ -43,9 +43,9 @@ _units = _units select {local _x}; _unit doMove ((nearestBuilding (getPos _unit)) buildingExit 0); }; - if ((units _unit) findif {(_x getVariable [QGVAR(garrisonned), false]) && !isPlayer _x} == -1) then { + if ((units _unit) findIf {(_x getVariable [QGVAR(garrisonned), false]) && !isPlayer _x} == -1) then { LOG("fnc_ungarrison: enableAttack true"); (group _unit) enableAttack true; }; }; -} foreach _units; +} forEach _units; diff --git a/addons/aircraft/functions/fnc_droneSetWaypoint.sqf b/addons/aircraft/functions/fnc_droneSetWaypoint.sqf index 953b99a357a..45c18c63da2 100644 --- a/addons/aircraft/functions/fnc_droneSetWaypoint.sqf +++ b/addons/aircraft/functions/fnc_droneSetWaypoint.sqf @@ -62,6 +62,8 @@ if (_type == "FOLLOW" && {["CAManBase", "LandVehicle", "Ship"] findIf {_target i _waypoint setWaypointPosition [getPosASL _target, -1]; }; }, 3, [_vehicle, _group, _waypoint, _target]] call CBA_fnc_addPerFrameHandler; +} else { + _waypoint setWaypointType _type; }; TRACE_3("",_currentHeight,_currentLoiterRadius,_currentLoiterType); diff --git a/addons/aircraft/stringtable.xml b/addons/aircraft/stringtable.xml index bcec121106e..a3abe94a810 100644 --- a/addons/aircraft/stringtable.xml +++ b/addons/aircraft/stringtable.xml @@ -184,6 +184,7 @@ 따라가는 거리 Distance de suivi 追跡距離 + Расстояние отслеживания Following unit within %1m @@ -192,6 +193,7 @@ %1m 이내로 유닛을 따라갑니다 Suivre l'unité jusqu'à %1m %1m 間隔で 目標を追跡します + Отслеживание в пределах %1m diff --git a/addons/arsenal/defines.hpp b/addons/arsenal/defines.hpp index cd6d937426a..ecd50f7a479 100644 --- a/addons/arsenal/defines.hpp +++ b/addons/arsenal/defines.hpp @@ -3,7 +3,7 @@ #define GRID_W (pixelW * pixelGridNoUIScale * pixelScale) #define GRID_H (pixelH * pixelGridNoUIScale * pixelScale) -#define WIDTH_TOTAL (safezoneW - 2 * (93 * GRID_W)) +#define WIDTH_TOTAL (safeZoneW - 2 * (93 * GRID_W)) #define WIDTH_GAP (WIDTH_TOTAL / 100) #define WIDTH_SINGLE ((WIDTH_TOTAL - 7 * WIDTH_GAP) / 6) @@ -154,6 +154,8 @@ #define IDC_statsPreviousPage 52 #define IDC_statsNextPage 53 #define IDC_statsCurrentPage 54 +#define IDC_statsBoxTitleBackground 55 +#define IDC_statsBoxBackground 56 #define IDC_actionsBox 90 #define IDC_actionsBackground1 90010 #define IDC_actionsBackground2 90011 @@ -360,10 +362,10 @@ _buttonCurrentMag2Ctrl ctrlCommit FADE_DELAY;\ {\ _x = _display displayCtrl _x;\ _x ctrlSetPosition [\ - safezoneX + safezoneW - 93 * GRID_W,\ - safezoneY + 14 * GRID_H,\ + safeZoneX + safeZoneW - 93 * GRID_W,\ + safeZoneY + 14 * GRID_H,\ 80 * GRID_W,\ - safezoneH - 28 * GRID_H\ + safeZoneH - 28 * GRID_H\ ];\ _x ctrlCommit 0;\ } forEach [\ @@ -406,10 +408,10 @@ _buttonCurrentMag2Ctrl ctrlCommit FADE_DELAY;\ {\ _x = _display displayCtrl _x;\ _x ctrlSetPosition [\ - safezoneX + safezoneW - 93 * GRID_W,\ - safezoneY + 14 * GRID_H,\ + safeZoneX + safeZoneW - 93 * GRID_W,\ + safeZoneY + 14 * GRID_H,\ 80 * GRID_W,\ - safezoneH - 34 * GRID_H\ + safeZoneH - 34 * GRID_H\ ];\ _x ctrlCommit 0;\ } forEach [\ @@ -426,16 +428,16 @@ if (!isNil QGVAR(customRightPanelButtons)) then {\ if (isNull (_display displayCtrl (60 + _plusId))) then {\ private _ctrl = _display ctrlCreate [QGVAR(customArsenalButton_Background), 60 + _plusId];\ _ctrl ctrlSetPosition [\ - safezoneW + safezoneX - 13 * GRID_W,\ - safezoneY + (88 + (10 * _forEachIndex)) * GRID_H\ + safeZoneW + safeZoneX - 13 * GRID_W,\ + safeZoneY + (88 + (10 * _forEachIndex)) * GRID_H\ ];\ _ctrl ctrlCommit 0;\ };\ if (isNull (_display displayCtrl (61 + _plusId))) then {\ _ctrl = _display ctrlCreate [QGVAR(customArsenalButton_Button), 61 + _plusId];\ _ctrl ctrlSetPosition [\ - safezoneW + safezoneX - 10 * GRID_W,\ - safezoneY + (88 + (10 * _forEachIndex)) * GRID_H\ + safeZoneW + safeZoneX - 10 * GRID_W,\ + safeZoneY + (88 + (10 * _forEachIndex)) * GRID_H\ ];\ _ctrl ctrlSetText _picture;\ _ctrl ctrlSetTooltip _tooltip;\ @@ -446,8 +448,8 @@ if (!isNil QGVAR(customRightPanelButtons)) then {\ {\ _x = _display displayCtrl _x;\ _x ctrlSetPosition [\ - safezoneW + safezoneX - (10 + (3 * _forEachIndex)) * GRID_W,\ - safezoneY + (88 + (10 * _miscOffset)) * GRID_H\ + safeZoneW + safeZoneX - (10 + (3 * _forEachIndex)) * GRID_W,\ + safeZoneY + (88 + (10 * _miscOffset)) * GRID_H\ ];\ _x ctrlCommit 0;\ } forEach [IDC_buttonMisc, IDC_iconBackgroundMisc];\ diff --git a/addons/arsenal/functions/fnc_baseAttachment.sqf b/addons/arsenal/functions/fnc_baseAttachment.sqf index 968fd05d9b8..1d6155c9ee2 100644 --- a/addons/arsenal/functions/fnc_baseAttachment.sqf +++ b/addons/arsenal/functions/fnc_baseAttachment.sqf @@ -22,7 +22,7 @@ TRACE_1("looking up base attachment",_item); private _switchableClasses = []; -private _cfgWeapons = configfile >> "CfgWeapons"; +private _cfgWeapons = configFile >> "CfgWeapons"; private _config = _cfgWeapons >> _item; _item = configName _config; diff --git a/addons/arsenal/functions/fnc_baseWeapon.sqf b/addons/arsenal/functions/fnc_baseWeapon.sqf index abeb0e0ab9b..2b1b219e65c 100644 --- a/addons/arsenal/functions/fnc_baseWeapon.sqf +++ b/addons/arsenal/functions/fnc_baseWeapon.sqf @@ -20,7 +20,7 @@ params [["_weapon", "", [""]]]; // Check if item is cached (uiNamespace getVariable QGVAR(baseWeaponNameCache)) getOrDefaultCall [toLowerANSI _weapon, { - private _cfgWeapons = configfile >> "CfgWeapons"; + private _cfgWeapons = configFile >> "CfgWeapons"; private _config = _cfgWeapons >> _weapon; // If class doesn't exist, exit diff --git a/addons/arsenal/functions/fnc_handleStats.sqf b/addons/arsenal/functions/fnc_handleStats.sqf index b5d435a101e..0511c05a25a 100644 --- a/addons/arsenal/functions/fnc_handleStats.sqf +++ b/addons/arsenal/functions/fnc_handleStats.sqf @@ -19,6 +19,8 @@ params ["_display", "_control", "_curSel", ["_itemCfg", configNull]]; private _statsBoxCtrl = _display displayCtrl IDC_statsBox; +private _statsBoxTitleBackgroundCtrl = _display displayCtrl IDC_statsBoxTitleBackground; +private _statsBoxBackgroundCtrl = _display displayCtrl IDC_statsBoxBackground; private _statsPreviousPageCtrl = _display displayCtrl IDC_statsPreviousPage; private _statsNextPageCtrl = _display displayCtrl IDC_statsNextPage; private _statsCurrentPageCtrl = _display displayCtrl IDC_statsCurrentPage; @@ -53,7 +55,7 @@ private _fnc_hideEverything = { // Hide the stats box _statsBoxCtrl ctrlSetPosition [ (0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP, - safezoneY + 1.8 * GRID_H, + safeZoneY + 1.8 * GRID_H, 0, 0 ]; @@ -62,7 +64,7 @@ private _fnc_hideEverything = { // Move action display private _ctrl = _display displayCtrl IDC_actionsBox; private _pos = ctrlPosition _ctrl; - _pos set [1, safezoneY + 1.8 * GRID_H]; + _pos set [1, safeZoneY + 1.8 * GRID_H]; _ctrl ctrlSetPosition _pos; _ctrl ctrlCommit 0; @@ -111,6 +113,7 @@ private _fnc_handleStats = { private _statsBarCtrl = controlNull; private _statsTextCtrl = controlNull; private _textStatementResult = ""; + private _lastCtrl = _statsBoxTitleBackgroundCtrl; { _x params ["", "_configEntry", "_title", "_bools", "_statements"]; @@ -127,6 +130,17 @@ private _fnc_handleStats = { _statsTitleCtrl ctrlSetText _title; _statsTitleCtrl ctrlSetFade 0; + // Vertical Position + ctrlPosition _lastCtrl params ["", "_lastPosY", "", "_lastPosH"]; + _statsTitleCtrl ctrlSetPositionY (_lastPosY + _lastPosH + GRID_H); + { + _x ctrlSetPositionY (_lastPosY + _lastPosH + GRID_H + (5 * GRID_H)); + } forEach [ + _statsBackgroundCtrl, + _statsBarCtrl, + _statsTextCtrl + ]; + // Handle bars if (_showBar) then { _statsBarCtrl progressSetPosition ([_configEntry, _itemCfg] call _barStatement); @@ -140,18 +154,39 @@ private _fnc_handleStats = { // Handle text entries if (_showText) then { _textStatementResult = [_configEntry, _itemCfg] call _textStatement; - - if !(_textStatementResult isEqualtype "") then { - _textStatementResult = str _textStatementResult; + if (_textStatementResult isEqualType []) then { + _textStatementResult = _textStatementResult joinString endl; + } else { + if !(_textStatementResult isEqualType "") then { + _textStatementResult = str _textStatementResult; + }; }; _statsTextCtrl ctrlSetText _textStatementResult; _statsTextCtrl ctrlSetTextColor ([[1, 1, 1, 1], [0, 0, 0, 1]] select (_showBar)); + + //Height based on Text lines + { + _x ctrlSetPositionH (ctrlTextHeight _statsTextCtrl); + } forEach [ + _statsBackgroundCtrl, + _statsBarCtrl, + _statsTextCtrl + ]; + _statsTextCtrl ctrlSetFade 0; } else { _statsTextCtrl ctrlSetFade 1; + //Ensure default height + { + _x ctrlSetPositionH (5 * GRID_H); + } forEach [ + _statsBackgroundCtrl, + _statsBarCtrl, + _statsTextCtrl + ]; }; - + { _x ctrlCommit 0; } forEach [ @@ -160,24 +195,29 @@ private _fnc_handleStats = { _statsBarCtrl, _statsTextCtrl ]; + + _lastCtrl = _statsTextCtrl; + } forEach _statsToDisplay; // Resize the window (5 - _statsCount) call _fnc_hideUnused; - private _height = 10 * _statsCount + 5; + ctrlPosition _lastCtrl params ["", "_lastPosY", "", "_lastPosH"]; _statsBoxCtrl ctrlSetPosition [ (0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP, - safezoneY + 1.8 * GRID_H, + safeZoneY + 1.8 * GRID_H, 47 * GRID_W, - _height * GRID_H + _lastPosY + _lastPosH + GRID_H ]; + _statsBoxBackgroundCtrl ctrlSetPositionH (_lastPosY + _lastPosH + GRID_H); + _statsBoxBackgroundCtrl ctrlCommit 0; _statsBoxCtrl ctrlCommit 0; // Move the actions box private _ctrl = _display displayCtrl IDC_actionsBox; private _pos = ctrlPosition _ctrl; - _pos set [1, safezoneY + (_height + 3.6) * GRID_H]; + _pos set [1, safeZoneY + (_lastPosY + _lastPosH + GRID_H + (3.6 * GRID_H))]; _ctrl ctrlSetPosition _pos; _ctrl ctrlCommit 0; diff --git a/addons/arsenal/functions/fnc_itemInfo.sqf b/addons/arsenal/functions/fnc_itemInfo.sqf index 676783a8b54..2662600aaee 100644 --- a/addons/arsenal/functions/fnc_itemInfo.sqf +++ b/addons/arsenal/functions/fnc_itemInfo.sqf @@ -32,11 +32,11 @@ if (isClass _itemCfg) then { (_display displayCtrl IDC_infoName) ctrlSetText ([_control lbText _curSel, _control lnbText [_curSel, 1]] select (ctrlType _control == CT_LISTNBOX)); private _itemAuthor = getText (_itemCfg >> "author"); - (_display displayctrl IDC_infoAuthor) ctrlSetText ([localize "STR_AUTHOR_UNKNOWN", format [localize "STR_FORMAT_AUTHOR_SCRIPTED", _itemAuthor]] select (_itemAuthor != "")); + (_display displayCtrl IDC_infoAuthor) ctrlSetText ([localize "STR_AUTHOR_UNKNOWN", format [localize "STR_FORMAT_AUTHOR_SCRIPTED", _itemAuthor]] select (_itemAuthor != "")); // DLC / mod icon - private _ctrlDLC = _display displayctrl IDC_DLCIcon; - private _ctrlDLCBackground = _display displayctrl IDC_DLCBackground; + private _ctrlDLC = _display displayCtrl IDC_DLCIcon; + private _ctrlDLCBackground = _display displayCtrl IDC_DLCBackground; private _dlc = _itemCfg call EFUNC(common,getAddon); if (_dlc != "") then { @@ -48,7 +48,7 @@ if (isClass _itemCfg) then { _ctrlDLC ctrlSetFade 0; // If an item is from a DLC, set it so when you press the icon on the bottom right it opens the DLC page - if ((getNumber (configfile >> "CfgMods" >> _dlc >> "appId")) > 0) then { + if ((getNumber (configFile >> "CfgMods" >> _dlc >> "appId")) > 0) then { _ctrlDLC ctrlSetEventHandler ["MouseExit", format ["(_this select 0) ctrlSetText '%1';", _logo]]; _ctrlDLC ctrlSetEventHandler ["MouseEnter", format ["(_this select 0) ctrlSetText '%1';", _logoOver]]; _ctrlDLC ctrlSetEventHandler [ diff --git a/addons/arsenal/functions/fnc_onArsenalOpen.sqf b/addons/arsenal/functions/fnc_onArsenalOpen.sqf index ea05cf1769f..2a2d8716c84 100644 --- a/addons/arsenal/functions/fnc_onArsenalOpen.sqf +++ b/addons/arsenal/functions/fnc_onArsenalOpen.sqf @@ -121,7 +121,7 @@ _mouseBlockCtrl ctrlEnable false; private _statsBoxCtrl = _display displayCtrl IDC_statsBox; _statsBoxCtrl ctrlSetPosition [ (0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP, - safezoneY + 1.8 * GRID_H, + safeZoneY + 1.8 * GRID_H, 47 * GRID_W, 11 * GRID_H ]; @@ -132,7 +132,7 @@ _statsBoxCtrl ctrlCommit 0; private _actionsBoxCtrl = _display displayCtrl IDC_actionsBox; _actionsBoxCtrl ctrlSetPosition [ (0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP, - safezoneY + 58.6 * GRID_H, + safeZoneY + 58.6 * GRID_H, 47 * GRID_W, 11 * GRID_H ]; diff --git a/addons/arsenal/functions/fnc_onSelChangedLeft.sqf b/addons/arsenal/functions/fnc_onSelChangedLeft.sqf index e25016b303d..2a5d4204345 100644 --- a/addons/arsenal/functions/fnc_onSelChangedLeft.sqf +++ b/addons/arsenal/functions/fnc_onSelChangedLeft.sqf @@ -17,7 +17,7 @@ params ["_control", "_curSel"]; -if (_curSel < 0) exitwith {}; +if (_curSel < 0) exitWith {}; private _display = ctrlParent _control; private _item = [_control lbData _curSel, _control lnbData [_curSel, 0]] select (ctrlType _control == CT_LISTNBOX); diff --git a/addons/arsenal/functions/fnc_onSelChangedRight.sqf b/addons/arsenal/functions/fnc_onSelChangedRight.sqf index abec68ceeef..66315f7dc79 100644 --- a/addons/arsenal/functions/fnc_onSelChangedRight.sqf +++ b/addons/arsenal/functions/fnc_onSelChangedRight.sqf @@ -16,7 +16,7 @@ params ["_control", "_curSel"]; -if (_curSel < 0) exitwith {}; +if (_curSel < 0) exitWith {}; private _display = ctrlParent _control; private _item = _control lbData _curSel; diff --git a/addons/arsenal/functions/fnc_scanConfig.sqf b/addons/arsenal/functions/fnc_scanConfig.sqf index fef97e8bd85..b5c6627cc7a 100644 --- a/addons/arsenal/functions/fnc_scanConfig.sqf +++ b/addons/arsenal/functions/fnc_scanConfig.sqf @@ -228,10 +228,10 @@ private _faceCategory = ""; _faceCache set [configName _x, [getText (_x >> "displayName"), _modPicture, _faceCategory]]; }; } forEach ("true" configClasses _x); -} forEach ("true" configClasses (configfile >> "CfgFaces")); +} forEach ("true" configClasses (configFile >> "CfgFaces")); // Get all voices -private _voiceCache = (configProperties [configFile >> "CfgVoice", "isClass _x && {getNumber (_x >> 'scope') == 2}", true]) - [configfile >> "CfgVoice" >> "NoVoice"]; +private _voiceCache = (configProperties [configFile >> "CfgVoice", "isClass _x && {getNumber (_x >> 'scope') == 2}", true]) - [configFile >> "CfgVoice" >> "NoVoice"]; _voiceCache = _voiceCache apply {configName _x}; // Get all insignia diff --git a/addons/arsenal/functions/fnc_statTextStatement_load.sqf b/addons/arsenal/functions/fnc_statTextStatement_load.sqf index 032019f5825..a7a132b1844 100644 --- a/addons/arsenal/functions/fnc_statTextStatement_load.sqf +++ b/addons/arsenal/functions/fnc_statTextStatement_load.sqf @@ -17,7 +17,7 @@ params ["_stats", "_config"]; TRACE_2("statTextStatement_load",_stats,_config); if (!isNull (_config >> "ItemInfo" >> "containerClass")) then { // Uniform/Vest - _config = configfile >> "CfgVehicles" >> getText (_config >> "ItemInfo" >> "containerClass"); + _config = configFile >> "CfgVehicles" >> getText (_config >> "ItemInfo" >> "containerClass"); }; private _load = getNumber (_config >> (_stats # 0)); diff --git a/addons/arsenal/ui/RscAttributes.hpp b/addons/arsenal/ui/RscAttributes.hpp index dc70caa0c27..b487cffd617 100644 --- a/addons/arsenal/ui/RscAttributes.hpp +++ b/addons/arsenal/ui/RscAttributes.hpp @@ -15,14 +15,14 @@ class GVAR(display) { class ControlsBackground { class blackLeft: ctrlStatic { colorBackground[] = {0,0,0,1}; - x = QUOTE(safezoneXAbs); - y = QUOTE(safezoneY); - w = QUOTE(safezoneXAbs - safezoneX); - h = QUOTE(safezoneH); + x = QUOTE(safeZoneXAbs); + y = QUOTE(safeZoneY); + w = QUOTE(safeZoneXAbs - safeZoneX); + h = QUOTE(safeZoneH); }; class blackRight: blackLeft { - x = QUOTE(safezoneX + safezoneW); + x = QUOTE(safeZoneX + safeZoneW); }; class mouseArea: ctrlStatic { @@ -31,10 +31,10 @@ class GVAR(display) { onMouseMoving = QUOTE([ARR_3('onMouseMoving',_this,GVAR(display))] call FUNC(handleMouse)); onMouseHolding = QUOTE([ARR_3('onMouseHolding',_this,GVAR(display))] call FUNC(handleMouse)); onMouseZChanged = QUOTE([ARR_3('onMouseZChanged',_this,GVAR(display))] call FUNC(handleScrollWheel)); - x = QUOTE(safezoneX); - y = QUOTE(safezoneY); - w = QUOTE(safezoneW); - h = QUOTE(safezoneH); + x = QUOTE(safeZoneX); + y = QUOTE(safeZoneY); + w = QUOTE(safeZoneW); + h = QUOTE(safeZoneH); }; }; class controls { @@ -58,34 +58,34 @@ class GVAR(display) { }; class blockLeftFrame: RscFrame { idc = IDC_blockLeftFrame; - x = QUOTE(safezoneX + 13 * GRID_W); - y = QUOTE(safezoneY + 14 * GRID_H); + x = QUOTE(safeZoneX + 13 * GRID_W); + y = QUOTE(safeZoneY + 14 * GRID_H); w = QUOTE(80 * GRID_W); - h = QUOTE(safezoneH - 24 * GRID_H); + h = QUOTE(safeZoneH - 24 * GRID_H); colorText[] = {0,0,0,1}; }; class blockLeftBackground: ctrlStaticBackground { idc = IDC_blockLeftBackground; - x = QUOTE(safezoneX + 13 * GRID_W); - y = QUOTE(safezoneY + 14 * GRID_H); + x = QUOTE(safeZoneX + 13 * GRID_W); + y = QUOTE(safeZoneY + 14 * GRID_H); w = QUOTE(80 * GRID_W); - h = QUOTE(safezoneH - 24 * GRID_H); + h = QUOTE(safeZoneH - 24 * GRID_H); colorBackground[] = {0,0,0,0.5}; }; class blockRightFrame: blockLeftFrame { idc = IDC_blockRightFrame; - x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); - h = QUOTE(safezoneH - 34 * GRID_H); + x = QUOTE(safeZoneX + safeZoneW - 93 * GRID_W); + h = QUOTE(safeZoneH - 34 * GRID_H); }; class blockRighttBackground: blockLeftBackground { idc = IDC_blockRighttBackground; - x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); - h = QUOTE(safezoneH - 34 * GRID_H); + x = QUOTE(safeZoneX + safeZoneW - 93 * GRID_W); + h = QUOTE(safeZoneH - 34 * GRID_H); }; class loadIndicator: RscControlsGroupNoScrollbars { idc = IDC_loadIndicator; - x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); - y = QUOTE(safeZoneH + safezoneY - 20 * GRID_H); + x = QUOTE(safeZoneX + safeZoneW - 93 * GRID_W); + y = QUOTE(safeZoneH + safeZoneY - 20 * GRID_H); w = QUOTE(80 * GRID_W); h = QUOTE(6 * GRID_H); class controls { @@ -112,8 +112,8 @@ class GVAR(display) { }; class totalWeight: RscControlsGroupNoScrollbars { idc = IDC_totalWeight; - x = QUOTE(safezoneX + 13 * GRID_W); - y = QUOTE(safeZoneH + safezoneY - 10 * GRID_H); + x = QUOTE(safeZoneX + 13 * GRID_W); + y = QUOTE(safeZoneH + safeZoneY - 10 * GRID_H); w = QUOTE(80 * GRID_W); h = QUOTE(8 * GRID_H); class controls { @@ -154,7 +154,7 @@ class GVAR(display) { colorBackground[] = {0,0,0,0.69999999}; text = ""; x = QUOTE(0.5 - WIDTH_TOTAL / 2); - y = QUOTE(safeZoneH + safezoneY - 25 * GRID_H); + y = QUOTE(safeZoneH + safeZoneY - 25 * GRID_H); w = QUOTE(WIDTH_TOTAL); h = QUOTE(10 * GRID_H); sizeEx = QUOTE(5 * GRID_H); @@ -162,7 +162,7 @@ class GVAR(display) { class menuBar: RscControlsGroupNoScrollbars { idc = IDC_menuBar; x = QUOTE(0.5 - WIDTH_TOTAL / 2); - y = QUOTE(safezoneH + safezoneY - 9 * GRID_H); + y = QUOTE(safeZoneH + safeZoneY - 9 * GRID_H); w = QUOTE(WIDTH_TOTAL); h = QUOTE(7 * GRID_H); class controls { @@ -223,8 +223,8 @@ class GVAR(display) { class infoBox: RscControlsGroupNoScrollbars { idc = IDC_infoBox; fade = 1; - x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); - y = QUOTE(safeZoneH + safezoneY - 14 * GRID_H); + x = QUOTE(safeZoneX + safeZoneW - 93 * GRID_W); + y = QUOTE(safeZoneH + safeZoneY - 14 * GRID_H); w = QUOTE(92 * GRID_W); h = QUOTE(12 * GRID_H); class controls { @@ -278,12 +278,12 @@ class GVAR(display) { class statsBox: RscControlsGroupNoScrollbars { idc = IDC_statsBox; x = QUOTE((0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP); - y = QUOTE(safezoneY + 1.8 * GRID_H); + y = QUOTE(safeZoneY + 1.8 * GRID_H); w = QUOTE(47 * GRID_W); h = QUOTE(55 * GRID_H); class controls { class statsStaticBackground1: ctrlStaticBackground { - idc = -1; + idc = IDC_statsBoxBackground; x = QUOTE(0); y = QUOTE(0); w = QUOTE(47 * GRID_W); @@ -291,7 +291,7 @@ class GVAR(display) { colorBackground[] = {0.1,0.1,0.1,0.5}; }; class statsStaticBackground2: ctrlStaticBackground { - idc = -1; + idc = IDC_statsBoxTitleBackground; x = QUOTE(0); y = QUOTE(0); w = QUOTE(47 * GRID_W); @@ -316,7 +316,7 @@ class GVAR(display) { x = QUOTE(1 * GRID_W); y = QUOTE(10 * GRID_H); w = QUOTE(45 * GRID_W); - h = QUOTE(4 * GRID_H); + h = QUOTE(5 * GRID_H); colorBackground[] = {1,1,1,0.15}; }; class statsBar1: ctrlProgress { @@ -329,9 +329,9 @@ class GVAR(display) { x = QUOTE(1 * GRID_W); y = QUOTE(10 * GRID_H); w = QUOTE(45 * GRID_W); - h = QUOTE(4 * GRID_H); + h = QUOTE(5 * GRID_H); }; - class statsText1: RscText { + class statsText1: RscTextMulti { idc = IDC_statsText1; shadow = 0; fade = 1; @@ -340,7 +340,7 @@ class GVAR(display) { x = QUOTE(0 * GRID_W); y = QUOTE(10 * GRID_H); w = QUOTE(45 * GRID_W); - h = QUOTE(4 * GRID_H); + h = QUOTE(5 * GRID_H); sizeEx = QUOTE(5 * GRID_H); text = ""; }; @@ -419,7 +419,7 @@ class GVAR(display) { colorBackgroundDisabled[] = {0,0,0,0}; onButtonClick = QUOTE([ARR_2(QQGVAR(statsChangePage),[ARR_3(ctrlParent (_this select 0),_this select 0,false)])] call CBA_fnc_localEvent); x = QUOTE((0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP); - y = QUOTE(safezoneY + 1.8 * GRID_H); + y = QUOTE(safeZoneY + 1.8 * GRID_H); w = QUOTE(5 * GRID_W); h = QUOTE(5 * GRID_H); sizeEx = QUOTE(5.5 * GRID_H); @@ -434,7 +434,7 @@ class GVAR(display) { idc = IDC_statsCurrentPage; style = ST_CENTER; x = QUOTE((0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP + 5 * GRID_W); - y = QUOTE(safezoneY + 1.8 * GRID_H); + y = QUOTE(safeZoneY + 1.8 * GRID_H); w = QUOTE(37 * GRID_W); h = QUOTE(5 * GRID_H); colorBackground[] = {0,0,0,0}; @@ -445,7 +445,7 @@ class GVAR(display) { class actionsBox: RscControlsGroupNoScrollbars { idc = IDC_actionsBox; x = QUOTE((0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP); - y = QUOTE(safezoneY + 58.6 * GRID_H); + y = QUOTE(safeZoneY + 58.6 * GRID_H); w = QUOTE(47 * GRID_W); h = QUOTE(55 * GRID_H); class controls { @@ -482,7 +482,7 @@ class GVAR(display) { x = QUOTE(1 * GRID_W); y = QUOTE(6 * GRID_H); w = QUOTE(45 * GRID_W); - h = QUOTE(4 * GRID_H); + h = QUOTE(5 * GRID_H); }; class actionsText2: actionsText1 { idc = IDC_actionsText2; @@ -550,10 +550,10 @@ class GVAR(display) { class mouseBlock: RscText { idc = IDC_mouseBlock; style = 16; - x = QUOTE(safezoneX); - y = QUOTE(safezoneY); - w = QUOTE(safezoneW); - h = QUOTE(safezoneH); + x = QUOTE(safeZoneX); + y = QUOTE(safeZoneY); + w = QUOTE(safeZoneW); + h = QUOTE(safeZoneH); }; class leftTabContent: RscListBox { idc = IDC_leftTabContent; @@ -569,10 +569,10 @@ class GVAR(display) { onLBDblClick = QUOTE(_this call FUNC(onPanelDblClick)); onSetFocus = QUOTE(GVAR(leftTabFocus) = true); onKillFocus = QUOTE(GVAR(leftTabFocus) = false); - x = QUOTE(safezoneX + 13 * GRID_W); - y = QUOTE(safezoneY + 14 * GRID_H); + x = QUOTE(safeZoneX + 13 * GRID_W); + y = QUOTE(safeZoneY + 14 * GRID_H); w = QUOTE(80 * GRID_W); - h = QUOTE(safezoneH - 24.5 * GRID_H); + h = QUOTE(safeZoneH - 24.5 * GRID_H); sizeEx = QUOTE(7 * GRID_H); }; class rightTabContent: leftTabContent { @@ -583,8 +583,8 @@ class GVAR(display) { onLBDblClick = QUOTE(_this call FUNC(onPanelDblClick)); onSetFocus = QUOTE(GVAR(rightTabFocus) = true); onKillFocus = QUOTE(GVAR(rightTabFocus) = false); - x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); - h = QUOTE(safezoneH - 28 * GRID_H); + x = QUOTE(safeZoneX + safeZoneW - 93 * GRID_W); + h = QUOTE(safeZoneH - 28 * GRID_H); }; class rightTabContentListnBox: RscListNBox { idc = IDC_rightTabContentListnBox; @@ -605,16 +605,16 @@ class GVAR(display) { onLBDblClick = QUOTE(_this call FUNC(onPanelDblClick)); onSetFocus = QUOTE(GVAR(rightTabLnBFocus) = true); onKillFocus = QUOTE(GVAR(rightTabLnBFocus) = false); - x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); - y = QUOTE(safezoneY + 14 * GRID_H); + x = QUOTE(safeZoneX + safeZoneW - 93 * GRID_W); + y = QUOTE(safeZoneY + 14 * GRID_H); w = QUOTE(80 * GRID_W); - h = QUOTE(safezoneH - 34 * GRID_H); + h = QUOTE(safeZoneH - 34 * GRID_H); sizeEx = QUOTE(7 * GRID_H); }; class sortLeftTab: RscCombo { idc = IDC_sortLeftTab; - x = QUOTE(safezoneX + 13 * GRID_W); - y = QUOTE(safezoneY + 8 * GRID_H); + x = QUOTE(safeZoneX + 13 * GRID_W); + y = QUOTE(safeZoneY + 8 * GRID_H); w = QUOTE(40 * GRID_W); h = QUOTE(6 * GRID_H); onLBSelChanged = QUOTE(_this call FUNC(sortPanel)); @@ -622,16 +622,16 @@ class GVAR(display) { }; class sortLeftTabDirection: sortLeftTab { idc = IDC_sortLeftTabDirection; - x = QUOTE(safezoneX + 53 * GRID_W); + x = QUOTE(safeZoneX + 53 * GRID_W); w = QUOTE(40 * GRID_W); }; class sortRightTab: sortLeftTab { idc = IDC_sortRightTab; - x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); + x = QUOTE(safeZoneX + safeZoneW - 93 * GRID_W); }; class sortRightTabDirection: sortLeftTabDirection { idc = IDC_sortRightTabDirection; - x = QUOTE(safezoneX + safezoneW - 53 * GRID_W); + x = QUOTE(safeZoneX + safeZoneW - 53 * GRID_W); }; class leftSearchbar: ctrlEdit { idc = IDC_leftSearchbar; @@ -639,8 +639,8 @@ class GVAR(display) { onKillFocus = QUOTE(GVAR(leftSearchbarFocus) = false); onMouseButtonClick = QUOTE([ARR_3(ctrlParent (_this select 0),_this select 0,_this select 1)] call FUNC(clearSearchbar)); onEditChanged = QUOTE(call FUNC(handleSearchInputChanged)); - x = QUOTE(safezoneX + 13 * GRID_W); - y = QUOTE(safezoneY + 1.8 * GRID_H); + x = QUOTE(safeZoneX + 13 * GRID_W); + y = QUOTE(safeZoneY + 1.8 * GRID_H); w = QUOTE(74 * GRID_W); h = QUOTE(6 * GRID_H); sizeEx = QUOTE(6 * GRID_H); @@ -652,8 +652,8 @@ class GVAR(display) { colorBackground[] = {0,0,0,0.5}; onButtonClick = QUOTE([ARR_2(ctrlParent (_this select 0),ctrlParent (_this select 0) displayCtrl IDC_leftSearchbar)] call FUNC(handleSearchbar)); onMouseButtonDown = QUOTE(call FUNC(handleSearchModeToggle)); - x = QUOTE(safezoneX + 87 * GRID_W); - y = QUOTE(safezoneY + 1.8 * GRID_H); + x = QUOTE(safeZoneX + 87 * GRID_W); + y = QUOTE(safeZoneY + 1.8 * GRID_H); w = QUOTE(6 * GRID_W); h = QUOTE(6 * GRID_H); }; @@ -661,17 +661,17 @@ class GVAR(display) { idc = IDC_rightSearchbar; onSetFocus = QUOTE(GVAR(rightSearchbarFocus) = true); onKillFocus = QUOTE(GVAR(rightSearchbarFocus) = false); - x = QUOTE(safezoneX + safezoneW - 87 * GRID_W); + x = QUOTE(safeZoneX + safeZoneW - 87 * GRID_W); }; class rightSearchbarButton: leftSearchbarButton { idc = IDC_rightSearchbarButton; onButtonClick = QUOTE([ARR_2(ctrlParent (_this select 0),ctrlParent (_this select 0) displayCtrl IDC_rightSearchbar)] call FUNC(handleSearchbar)); - x = QUOTE(safezoneX + safezoneW - 93 * GRID_W); + x = QUOTE(safeZoneX + safeZoneW - 93 * GRID_W); }; class tabLeft: RscControlsGroupNoScrollbars { idc = IDC_tabLeft; - x = QUOTE(safezoneX + 1 * GRID_W); - y = QUOTE(safezoneY + 8 * GRID_H); + x = QUOTE(safeZoneX + 1 * GRID_W); + y = QUOTE(safeZoneY + 8 * GRID_H); w = QUOTE(12 * GRID_W); h = QUOTE(200 * GRID_H); class controls { @@ -873,8 +873,8 @@ class GVAR(display) { colorBackground[] = {0,0,0,1}; fade = 1; enable = 0; - x = QUOTE(safezoneW + safezoneX - 13 * GRID_W); - y = QUOTE(safezoneY + 8 * GRID_H); + x = QUOTE(safeZoneW + safeZoneX - 13 * GRID_W); + y = QUOTE(safeZoneY + 8 * GRID_H); w = QUOTE(12 * GRID_W); h = QUOTE(9 * GRID_H); }; @@ -884,110 +884,110 @@ class GVAR(display) { text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\ItemOptic_ca.paa"; onButtonClick = QUOTE([ARR_2(ctrlParent (_this select 0),_this select 0)] call FUNC(fillRightPanel)); colorBackground[] = {0,0,0,0.5}; - x = QUOTE(safezoneW + safezoneX - 10 * GRID_W); - y = QUOTE(safezoneY + 8 * GRID_H); + x = QUOTE(safeZoneW + safeZoneX - 10 * GRID_W); + y = QUOTE(safeZoneY + 8 * GRID_H); w = QUOTE(9 * GRID_W); h = QUOTE(9 * GRID_H); }; class iconBackgroundItemAcc: iconBackgroundOptic { idc = IDC_iconBackgroundItemAcc; - y = QUOTE(safezoneY + 18 * GRID_H); + y = QUOTE(safeZoneY + 18 * GRID_H); }; class buttonItemAcc: buttonOptic { idc = IDC_buttonItemAcc; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\ItemAcc_ca.paa"; tooltip = "$STR_A3_RscDisplayArsenal_tab_ItemAcc"; - y = QUOTE(safezoneY + 18 * GRID_H); + y = QUOTE(safeZoneY + 18 * GRID_H); }; class iconBackgroundMuzzle: iconBackgroundOptic { idc = IDC_iconBackgroundMuzzle; - y = QUOTE(safezoneY + 28 * GRID_H); + y = QUOTE(safeZoneY + 28 * GRID_H); }; class buttonMuzzle: buttonOptic { idc = IDC_buttonMuzzle; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\ItemMuzzle_ca.paa"; tooltip = "$STR_A3_RscDisplayArsenal_tab_ItemMuzzle"; - y = QUOTE(safezoneY + 28 * GRID_H); + y = QUOTE(safeZoneY + 28 * GRID_H); }; class iconBackgroundBipod: iconBackgroundOptic { idc = IDC_iconBackgroundBipod; - y = QUOTE(safezoneY + 38 * GRID_H); + y = QUOTE(safeZoneY + 38 * GRID_H); }; class buttonBipod: buttonOptic { idc = IDC_buttonBipod; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\ItemBipod_ca.paa"; tooltip = "$STR_A3_RscDisplayArsenal_tab_ItemBipod"; - y = QUOTE(safezoneY + 38 * GRID_H); + y = QUOTE(safeZoneY + 38 * GRID_H); }; class iconBackgroundCurrentMag: iconBackgroundOptic { idc = IDC_iconBackgroundCurrentMag; - y = QUOTE(safezoneY + 48 * GRID_H); + y = QUOTE(safeZoneY + 48 * GRID_H); }; class buttonCurrentMag: buttonOptic { idc = IDC_buttonCurrentMag; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoMag_ca.paa"; tooltip = CSTRING(buttonCurrentMagTooltip); - y = QUOTE(safezoneY + 48 * GRID_H); + y = QUOTE(safeZoneY + 48 * GRID_H); }; class iconBackgroundCurrentMag2: iconBackgroundOptic { idc = IDC_iconBackgroundCurrentMag2; - y = QUOTE(safezoneY + 58 * GRID_H); + y = QUOTE(safeZoneY + 58 * GRID_H); }; class buttonCurrentMag2: buttonOptic { idc = IDC_buttonCurrentMag2; text = QPATHTOF(data\iconSecondaryMuzzle); tooltip = CSTRING(buttonCurrentMag2Tooltip); - y = QUOTE(safezoneY + 58 * GRID_H); + y = QUOTE(safeZoneY + 58 * GRID_H); }; class iconBackgroundMag: iconBackgroundOptic { idc = IDC_iconBackgroundMag; - y = QUOTE(safezoneY + 48 * GRID_H); + y = QUOTE(safeZoneY + 48 * GRID_H); }; class buttonMag: buttonOptic { idc = IDC_buttonMag; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoMag_ca.paa"; tooltip = "$STR_A3_RscDisplayArsenal_tab_CargoMag"; - y = QUOTE(safezoneY + 48 * GRID_H); + y = QUOTE(safeZoneY + 48 * GRID_H); }; class iconBackgroundMagALL: iconBackgroundOptic { idc = IDC_iconBackgroundMagALL; - y = QUOTE(safezoneY + 58 * GRID_H); + y = QUOTE(safeZoneY + 58 * GRID_H); }; class buttonMagALL: buttonOptic { idc = IDC_buttonMagALL; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoMagAll_ca.paa"; tooltip = "$STR_A3_RscDisplayArsenal_tab_CargoMagAll"; - y = QUOTE(safezoneY + 58 * GRID_H); + y = QUOTE(safeZoneY + 58 * GRID_H); }; class iconBackgroundThrow: iconBackgroundOptic { idc = IDC_iconBackgroundThrow; - y = QUOTE(safezoneY + 68 * GRID_H); + y = QUOTE(safeZoneY + 68 * GRID_H); }; class buttonThrow: buttonOptic { idc = IDC_buttonThrow; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoThrow_ca.paa"; tooltip = "$STR_A3_RscDisplayArsenal_tab_CargoThrow"; - y = QUOTE(safezoneY + 68 * GRID_H); + y = QUOTE(safeZoneY + 68 * GRID_H); }; class iconBackgroundPut: iconBackgroundOptic { idc = IDC_iconBackgroundPut; - y = QUOTE(safezoneY + 78 * GRID_H); + y = QUOTE(safeZoneY + 78 * GRID_H); }; class buttonPut: buttonOptic { idc = IDC_buttonPut; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoPut_ca.paa"; tooltip = "$STR_A3_RscDisplayArsenal_tab_CargoPut"; - y = QUOTE(safezoneY + 78 * GRID_H); + y = QUOTE(safeZoneY + 78 * GRID_H); }; class iconBackgroundMisc: iconBackgroundOptic { idc = IDC_iconBackgroundMisc; - y = QUOTE(safezoneY + 88 * GRID_H); + y = QUOTE(safeZoneY + 88 * GRID_H); }; class buttonMisc: buttonOptic { idc = IDC_buttonMisc; text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\CargoMisc_ca.paa"; tooltip = "$STR_A3_RscDisplayArsenal_tab_CargoMisc"; - y = QUOTE(safezoneY + 88 * GRID_H); + y = QUOTE(safeZoneY + 88 * GRID_H); }; class buttonRemoveAll: ctrlButtonPicture { @@ -998,8 +998,8 @@ class GVAR(display) { onButtonClick = QUOTE(ctrlParent (_this select 0) call FUNC(buttonClearAll)); fade = 1; enable = 0; - x = QUOTE(safezoneW + safezoneX - 11 * GRID_W); - y = QUOTE(safeZoneH + safezoneY - 29 * GRID_H); + x = QUOTE(safeZoneW + safeZoneX - 11 * GRID_W); + y = QUOTE(safeZoneH + safeZoneY - 29 * GRID_H); w = QUOTE(9 * GRID_W); h = QUOTE(9 * GRID_H); }; @@ -1013,17 +1013,17 @@ class GVAR(loadoutsDisplay) { class controls { class centerBox: ctrlControlsGroupNoScrollbars { idc = IDC_centerBox; - x = QUOTE(safezoneW + safezoneX - (180 * GRID_W)); - y = QUOTE(safezoneY + (5 * GRID_H)); + x = QUOTE(safeZoneW + safeZoneX - (180 * GRID_W)); + y = QUOTE(safeZoneY + (5 * GRID_H)); w = QUOTE(160 * GRID_W); - h = QUOTE(safezoneH - (34 * GRID_H)); + h = QUOTE(safeZoneH - (34 * GRID_H)); class controls { class centerFrame: RscFrame { idc = -1; x = QUOTE(0 * GRID_W); y = QUOTE(0 * GRID_H); w = QUOTE(160 * GRID_W); - h = QUOTE(safezoneH - (45 * GRID_H)); + h = QUOTE(safeZoneH - (45 * GRID_H)); colorText[] = {0,0,0,1}; }; class centerBackground: ctrlStaticBackground { @@ -1031,7 +1031,7 @@ class GVAR(loadoutsDisplay) { x = QUOTE(0); y = QUOTE(0); w = QUOTE(160 * GRID_W); - h = QUOTE(safezoneH - (45 * GRID_H)); + h = QUOTE(safeZoneH - (45 * GRID_H)); colorBackground[] = {0.13,0.13,0.13,0.9}; }; class centerTitle: ctrlStaticTitle { @@ -1056,14 +1056,14 @@ class GVAR(loadoutsDisplay) { x = QUOTE(0); y = QUOTE(5 * GRID_H); w = QUOTE(160 * GRID_W); - h = QUOTE(safezoneH - (57 * GRID_H)); + h = QUOTE(safeZoneH - (57 * GRID_H)); sizeEx = QUOTE(7 * GRID_H); }; class textTitle: RscText { idc = -1; text = "$STR_DISP_GAME_NAME"; x = QUOTE(0 * GRID_W); - y = QUOTE(safezoneH - (51 * GRID_H)); + y = QUOTE(safeZoneH - (51 * GRID_H)); w = QUOTE(15 * GRID_W); h = QUOTE(5 * GRID_H); sizeEx = QUOTE(5 * GRID_H); @@ -1072,7 +1072,7 @@ class GVAR(loadoutsDisplay) { class textEditBox: ctrlEdit { idc = IDC_textEditBox; x = QUOTE(15 * GRID_W); - y = QUOTE(safezoneH - (51 * GRID_H)); + y = QUOTE(safeZoneH - (51 * GRID_H)); w = QUOTE(65 * GRID_W); h = QUOTE(5 * GRID_H); sizeEx = QUOTE(6 * GRID_H); @@ -1083,7 +1083,7 @@ class GVAR(loadoutsDisplay) { onKillFocus = QUOTE(GVAR(loadoutsSearchbarFocus) = false); onMouseButtonClick = QUOTE([ARR_3(ctrlParent (_this select 0),_this select 0,_this select 1)] call FUNC(clearSearchbar)); x = QUOTE(83 * GRID_W); - y = QUOTE(safezoneH - (51 * GRID_H)); + y = QUOTE(safeZoneH - (51 * GRID_H)); w = QUOTE(72 * GRID_W); h = QUOTE(5 * GRID_H); sizeEx = QUOTE(6 * GRID_H); @@ -1094,14 +1094,14 @@ class GVAR(loadoutsDisplay) { colorBackground[] = {0,0,0,0.5}; onButtonClick = QUOTE([ARR_2(ctrlParent (_this select 0),ctrlParent (_this select 0) displayCtrl IDC_loadoutsSearchbar)] call FUNC(handleLoadoutsSearchbar)); x = QUOTE(155 * GRID_W); - y = QUOTE(safezoneH - (51 * GRID_H)); + y = QUOTE(safeZoneH - (51 * GRID_H)); w = QUOTE(5 * GRID_W); h = QUOTE(5 * GRID_H); }; class buttonSave: ctrlButton { idc = IDC_buttonSave; x = QUOTE(0 * GRID_W); - y = QUOTE(safezoneH - (44 * GRID_H)); + y = QUOTE(safeZoneH - (44 * GRID_H)); w = QUOTE(30 * GRID_W); h = QUOTE(10 * GRID_H); text = CSTRING(buttonSaveText); @@ -1143,8 +1143,8 @@ class GVAR(loadoutsDisplay) { }; class buttonClose: ctrlButton { idc = -1; - x = QUOTE(safezoneW + safezoneX - 32 * GRID_W); - y = QUOTE(safezoneH + safezoneY - 9 * GRID_H); + x = QUOTE(safeZoneW + safeZoneX - 32 * GRID_W); + y = QUOTE(safeZoneH + safeZoneY - 9 * GRID_H); w = QUOTE(30 * GRID_W); h = QUOTE(7 * GRID_H); sizeEx = QUOTE(5 * GRID_H); @@ -1154,8 +1154,8 @@ class GVAR(loadoutsDisplay) { }; class buttonBar: ctrlControlsGroupNoScrollbars { idc = -1; - x = QUOTE((safezoneW * 0.5) + safezoneX - (80.5 * GRID_W)); - y = QUOTE(safezoneH + safezoneY - 9 * GRID_H); + x = QUOTE((safeZoneW * 0.5) + safeZoneX - (80.5 * GRID_W)); + y = QUOTE(safeZoneH + safeZoneY - 9 * GRID_H); w = QUOTE(161 * GRID_W); h = QUOTE(7 * GRID_H); class controls { diff --git a/addons/arsenal/ui/RscCommon.hpp b/addons/arsenal/ui/RscCommon.hpp index f74326bcfb7..cb36a67aed3 100644 --- a/addons/arsenal/ui/RscCommon.hpp +++ b/addons/arsenal/ui/RscCommon.hpp @@ -86,12 +86,12 @@ #define TR_AUTOCOLLAPSE 2 // Default grid -#define GUI_GRID_WAbs ((safezoneW / safezoneH) min 1.2) +#define GUI_GRID_WAbs ((safeZoneW / safeZoneH) min 1.2) #define GUI_GRID_HAbs (GUI_GRID_WAbs / 1.2) #define GUI_GRID_W (GUI_GRID_WAbs / 40) #define GUI_GRID_H (GUI_GRID_HAbs / 25) -#define GUI_GRID_X (safezoneX) -#define GUI_GRID_Y (safezoneY + safezoneH - GUI_GRID_HAbs) +#define GUI_GRID_X (safeZoneX) +#define GUI_GRID_Y (safeZoneY + safeZoneH - GUI_GRID_HAbs) // Default text sizes #define GUI_TEXT_SIZE_SMALL (GUI_GRID_H * 0.8) diff --git a/addons/arsenal/ui/RscCustomArsenalButton.hpp b/addons/arsenal/ui/RscCustomArsenalButton.hpp index 0aa077f424c..e745203e7ea 100644 --- a/addons/arsenal/ui/RscCustomArsenalButton.hpp +++ b/addons/arsenal/ui/RscCustomArsenalButton.hpp @@ -1,6 +1,6 @@ class GVAR(customArsenalButton_Button): RscButtonArsenal { - x = QUOTE(safezoneW + safezoneX - 10 * GRID_W); - y = QUOTE(safezoneY + 88 * GRID_H); + x = QUOTE(safeZoneW + safeZoneX - 10 * GRID_W); + y = QUOTE(safeZoneY + 88 * GRID_H); w = QUOTE(9 * GRID_W); h = QUOTE(9 * GRID_H); @@ -11,8 +11,8 @@ class GVAR(customArsenalButton_Button): RscButtonArsenal { }; class GVAR(customArsenalButton_Background): ctrlStaticBackground { - x = QUOTE(safezoneW + safezoneX - 13 * GRID_W); - y = QUOTE(safezoneY + 88 * GRID_H); + x = QUOTE(safeZoneW + safeZoneX - 13 * GRID_W); + y = QUOTE(safeZoneY + 88 * GRID_H); w = QUOTE(12 * GRID_W); h = QUOTE(9 * GRID_H); diff --git a/addons/artillerytables/RscRangeTable.hpp b/addons/artillerytables/RscRangeTable.hpp index ef11d7eac82..a24aa503cb5 100644 --- a/addons/artillerytables/RscRangeTable.hpp +++ b/addons/artillerytables/RscRangeTable.hpp @@ -8,16 +8,16 @@ class GVAR(rangeTableDialog) { class TableBackground: RscPicture { idc = -1; text = QPATHTOF(UI\RangeTable_background.paa); - x = "18 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH) / 2)"; - y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2)) / 2)"; + x = "18 *(safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH) / 2)"; + y = "1 * ((safeZoneH / 1.2) / 25) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2)) / 2)"; w = "16.2634559672906 * (safeZoneH / 40)"; h = "23 * ((safeZoneH / 1.2) / 25)"; colorBackground[] = {1,1,1,1}; }; class LeftSideBackground: RscText { idc = -1; - x = "13 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH) / 2)"; - y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2)) / 2)"; + x = "13 *(safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH) / 2)"; + y = "1 * ((safeZoneH / 1.2) / 25) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2)) / 2)"; w = "5 * (safeZoneH / 40)"; h = "23 * ((safeZoneH / 1.2) / 25)"; colorBackground[] = {0,0,0,0.8}; @@ -26,8 +26,8 @@ class GVAR(rangeTableDialog) { class controls { class TheTable: RscListNBox { idc = IDC_TABLE; - x = "18 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH) / 2)"; - y = "3.76 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2)) / 2)"; + x = "18 *(safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH) / 2)"; + y = "3.76 * ((safeZoneH / 1.2) / 25) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2)) / 2)"; w = "16.2634559672906 * (safeZoneH / 40)"; h = "20.24 * ((safeZoneH / 1.2) / 25)"; columns[] = {"10/867", "86/867", "171/867", "238/867", "320/867", "405/867", "485/867", "546/867", "607/867", "668/867", "729/867", "790/867"}; @@ -48,8 +48,8 @@ class GVAR(rangeTableDialog) { }; class ChargeListBox: RscListBox { idc = IDC_CHARGELIST; - x = "13 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH) / 2)"; - y = "2 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2)) / 2)"; + x = "13 *(safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH) / 2)"; + y = "2 * ((safeZoneH / 1.2) / 25) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2)) / 2)"; w = "5 * (safeZoneH / 40)"; h = "22 * ((safeZoneH / 1.2) / 25)"; onLBSelChanged = QUOTE([] call FUNC(rangeTableUpdate)); @@ -58,8 +58,8 @@ class GVAR(rangeTableDialog) { idc = IDC_BUTTON_ELEV_HIGH; text = "High"; onButtonClick = QUOTE([true] call FUNC(rangeTableUpdate)); - x = "13.1 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH) / 2)"; - y = "1.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2)) / 2)"; + x = "13.1 *(safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH) / 2)"; + y = "1.1 * ((safeZoneH / 1.2) / 25) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2)) / 2)"; w = "2.3 * (safeZoneH / 40)"; h = "0.8 * ((safeZoneH / 1.2) / 25)"; }; @@ -67,12 +67,12 @@ class GVAR(rangeTableDialog) { idc = IDC_BUTTON_ELEV_LOW; text = "Low"; onButtonClick = QUOTE([false] call FUNC(rangeTableUpdate)); - x = "15.6 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH) / 2)"; + x = "15.6 *(safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH) / 2)"; }; class CloseBackground: RscText { idc = -1; - x = "33.7634559672906 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH) / 2)"; - y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2)) / 2)"; + x = "33.7634559672906 *(safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH) / 2)"; + y = "1 * ((safeZoneH / 1.2) / 25) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2)) / 2)"; w = "0.5 * (safeZoneH / 40)"; h = "0.5 * ((safeZoneH / 1.2) / 25)"; colorBackground[] = {0,0,0,0.5}; @@ -82,8 +82,8 @@ class GVAR(rangeTableDialog) { style = 48; color[] = {1,1,1,0.7}; text = "A3\Ui_f\data\GUI\Rsc\RscDisplayArcadeMap\icon_exit_cross_ca.paa"; - x = "33.7634559672906 *(safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH) / 2)"; - y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2)) / 2)"; + x = "33.7634559672906 *(safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH) / 2)"; + y = "1 * ((safeZoneH / 1.2) / 25) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2)) / 2)"; w = "0.5 * (safeZoneH / 40)"; h = "0.5 * ((safeZoneH / 1.2) / 25)"; colorText[] = {1,1,1,0.7}; diff --git a/addons/artillerytables/RscTitles.hpp b/addons/artillerytables/RscTitles.hpp index c26f302a00f..e0c4cc34495 100644 --- a/addons/artillerytables/RscTitles.hpp +++ b/addons/artillerytables/RscTitles.hpp @@ -9,10 +9,10 @@ class RscTitles { class controls { class ModeControlGroup: RscControlsGroupNoScrollbars { idc = IDC_MODECONTROLGROUP; - x = "3.8 * (((safezoneW / safezoneH) min 1.2) / 40) + (profilenamespace getvariable ['IGUI_GRID_WEAPON_X',((safezoneX + safezoneW) - (10 * (((safezoneW / safezoneH) min 1.2) / 40)) - 4.3 * (((safezoneW / safezoneH) min 1.2) / 40))])"; - y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (profilenamespace getVariable ['IGUI_GRID_WEAPON_Y', (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])"; - w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "3.8 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (profilenamespace getvariable ['IGUI_GRID_WEAPON_X',((safeZoneX + safeZoneW) - (10 * (((safeZoneW / safeZoneH) min 1.2) / 40)) - 4.3 * (((safeZoneW / safeZoneH) min 1.2) / 40))])"; + y = "2.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (profilenamespace getVariable ['IGUI_GRID_WEAPON_Y', (safeZoneY + 0.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25))])"; + w = "10 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; class controls { class Charge: RscText { @@ -21,18 +21,18 @@ class RscTitles { colorBackground[] = {0, 0, 0, 0}; x = "0"; y = "0"; - w = "(2) * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "(2) * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + sizeEx = "0.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class Azimuth: Charge { idc = IDC_AZIMUTH; - x = "(2) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "(3) * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "(2) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "(3) * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class Elevation: Azimuth { idc = IDC_ELEVATION; - x = "(5) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "(5) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; }; }; diff --git a/addons/artillerytables/dev/showShotInfo.inc.sqf b/addons/artillerytables/dev/showShotInfo.inc.sqf index ac99acbdc16..6945e95ba0b 100644 --- a/addons/artillerytables/dev/showShotInfo.inc.sqf +++ b/addons/artillerytables/dev/showShotInfo.inc.sqf @@ -35,7 +35,7 @@ INFO("showing shot info"); private _diff = _lastPos vectorDiff _shootPos; _mkrB setMarkerText format ["%1", _diff apply {round _x}]; - private _dist2d = _shootPos distance2d _lastPos; + private _dist2d = _shootPos distance2D _lastPos; private _dir = _shootPos getDir _lastPos; private _height = (_lastPos select 2) - (_shootPos select 2); _mkrB setMarkerText format ["Dist: %1m Az: %2[%3] Height:%4", _dist2d toFixed 0, _dir toFixed 2, ((6400 / 360) * _dir) toFixed 0, _height toFixed 0]; diff --git a/addons/artillerytables/functions/fnc_adjustFire.sqf b/addons/artillerytables/functions/fnc_adjustFire.sqf index 96c884880da..1e07c5ca212 100644 --- a/addons/artillerytables/functions/fnc_adjustFire.sqf +++ b/addons/artillerytables/functions/fnc_adjustFire.sqf @@ -36,6 +36,6 @@ params ["_gunPos", "_targetPos", "_adjustEast", "_adjustNorth", "_adjustUp", "_m private _resultPos = [_adjustEast + _targetPos select 0, _adjustNorth + _targetPos select 1, _adjustUp + _targetPos select 2]; -private _returns = ["_gunPos", "_resultPos", "_muzzleVelocity", "_highAngle", "_airFriction", "_temperature", "_airDensity", "_windDir", "_windSpeed"] call FUNC(calculateSolution); +private _returns = [_gunPos, _resultPos, _muzzleVelocity, _highAngle, _airFriction, _temperature, _airDensity, _windDir, _windSpeed] call FUNC(calculateSolution); _returns diff --git a/addons/artillerytables/functions/fnc_turretPFEH.sqf b/addons/artillerytables/functions/fnc_turretPFEH.sqf index e1964f7e41a..5e4e6c94657 100644 --- a/addons/artillerytables/functions/fnc_turretPFEH.sqf +++ b/addons/artillerytables/functions/fnc_turretPFEH.sqf @@ -43,7 +43,7 @@ BEGIN_COUNTER(pfeh); private _currentFireMode = (weaponState [_vehicle, _turret]) select 2; private _currentChargeMode = _fireModes find _currentFireMode; -private _lookVector = (AGLtoASL (positionCameraToWorld [0,0,0])) vectorFromTo (AGLtoASL (positionCameraToWorld [0,0,1])); +private _lookVector = (AGLToASL (positionCameraToWorld [0,0,0])) vectorFromTo (AGLToASL (positionCameraToWorld [0,0,1])); private _weaponDir = _vehicle weaponDirection (currentWeapon _vehicle); // Calc real azimuth/elevation @@ -51,7 +51,7 @@ private _weaponDir = _vehicle weaponDirection (currentWeapon _vehicle); private _display = uiNamespace getVariable ["ACE_dlgArtillery", displayNull]; private _useRealWeaponDir = if ((isNull (_display displayCtrl 173)) || {(_vehicle ammo (currentWeapon _vehicle)) == 0}) then { // With no ammo, distance display will be empty, but gun will still fire at wonky angle if aimed at ground - private _testSeekerPosASL = AGLtoASL (positionCameraToWorld [0,0,0]); + private _testSeekerPosASL = AGLToASL (positionCameraToWorld [0,0,0]); private _testPoint = _testSeekerPosASL vectorAdd (_lookVector vectorMultiply viewDistance); !((terrainIntersectASL [_testSeekerPosASL, _testPoint]) || {lineIntersects [_testSeekerPosASL, _testPoint, _vehicle]}); } else { @@ -84,8 +84,8 @@ private _ctrlCharge = (uiNamespace getVariable [QGVAR(display), displayNull]) di private _ctrlAzimuth = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_AZIMUTH; private _ctrlElevation = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_ELEVATION; -_ctrlAzimuth ctrlSetText Format ["AZ: %1", [DEGTOMILS * _realAzimuth, 4, 0] call CBA_fnc_formatNumber]; -_ctrlElevation ctrlSetText Format ["EL: %1", [DEGTOMILS * _realElevation, 4, 0] call CBA_fnc_formatNumber]; +_ctrlAzimuth ctrlSetText format ["AZ: %1", [DEGTOMILS * _realAzimuth, 4, 0] call CBA_fnc_formatNumber]; +_ctrlElevation ctrlSetText format ["EL: %1", [DEGTOMILS * _realElevation, 4, 0] call CBA_fnc_formatNumber]; _ctrlCharge ctrlSetText format ["CH: %1", _currentChargeMode]; // avalible for other addons (mk6) diff --git a/addons/atragmx/RscTitles.hpp b/addons/atragmx/RscTitles.hpp index 6196346c575..33b8c8036a0 100644 --- a/addons/atragmx/RscTitles.hpp +++ b/addons/atragmx/RscTitles.hpp @@ -157,8 +157,8 @@ class ATragMX_Display { SizeEX="0.025"; idc=720000; style=48; - x="0.55*safezoneW+safezoneX-0.256"; - y="0.265*safezoneH+safezoneY-0.1"; + x="0.55*safeZoneW+safeZoneX-0.256"; + y="0.265*safeZoneH+safeZoneY-0.1"; w="1.024"; h="1.024*4/3"; colorBackground[]={1,1,1,1}; @@ -167,8 +167,8 @@ class ATragMX_Display { }; class POWER: ATragMX_RscButton { idc=-1; - x="0.55*safezoneW+safezoneX+0.145"; - y="0.265*safezoneH+safezoneY+0.94"; + x="0.55*safeZoneW+safeZoneX+0.145"; + y="0.265*safeZoneH+safeZoneY+0.94"; w="0.045"; h="0.045*4/3"; colorBackground[]={0,0,0,0.0}; @@ -177,26 +177,26 @@ class ATragMX_Display { class BACK: POWER { idc=-1; w="0.06"; - x="0.55*safezoneW+safezoneX+0.3122"; + x="0.55*safeZoneW+safeZoneX+0.3122"; action=QUOTE(call FUNC(init); call FUNC(update_target_selection)); }; class WINDOWS: ATragMX_RscButton { idc=-1; - x="0.55*safezoneW+safezoneX+0.130"; - y="0.265*safezoneH+safezoneY+0.88"; + x="0.55*safeZoneW+safeZoneX+0.130"; + y="0.265*safeZoneH+safeZoneY+0.88"; w="0.035"; h="0.035*4/3"; colorBackground[]={0,0,0,0.0}; }; class OK: WINDOWS { idc=-1; - x="0.55*safezoneW+safezoneX+0.347"; - y="0.265*safezoneH+safezoneY+0.878"; + x="0.55*safeZoneW+safeZoneX+0.347"; + y="0.265*safeZoneH+safeZoneY+0.878"; }; class TOP: ATragMX_RscButton { idc=-1; - x="0.55*safezoneW+safezoneX+0.242"; - y="0.265*safezoneH+safezoneY+0.85"; + x="0.55*safeZoneW+safeZoneX+0.242"; + y="0.265*safeZoneH+safeZoneY+0.85"; w="0.03"; h="0.03"; colorBackground[]={0,0,0,0.0}; @@ -204,13 +204,13 @@ class ATragMX_Display { }; class BOTTOM: TOP { idc=-1; - y="0.265*safezoneH+safezoneY+0.955"; + y="0.265*safeZoneH+safeZoneY+0.955"; action=QUOTE(+1 call FUNC(cycle_gun_list)); }; class LEFT: ATragMX_RscButton { idc=-1; - x="0.55*safezoneW+safezoneX+0.1925"; - y="0.265*safezoneH+safezoneY+0.9"; + x="0.55*safeZoneW+safeZoneX+0.1925"; + y="0.265*safeZoneH+safeZoneY+0.9"; w="0.05"; h="0.03"; colorBackground[]={0,0,0,0}; @@ -218,50 +218,50 @@ class ATragMX_Display { }; class RIGHT: LEFT { idc=-1; - x="0.55*safezoneW+safezoneX+0.2725"; + x="0.55*safeZoneW+safeZoneX+0.2725"; action=QUOTE(((4 + GVAR(currentTarget) + 1) % 4) call FUNC(change_target_slot)); }; class TOP_LEFT: ATragMX_RscButton { idc=-1; - x="0.55*safezoneW+safezoneX+0.162"; - y="0.265*safezoneH+safezoneY+0.82"; + x="0.55*safeZoneW+safeZoneX+0.162"; + y="0.265*safeZoneH+safeZoneY+0.82"; w="0.031"; h="0.031*4/3"; colorBackground[]={0,0,0,0.0}; }; class TOP_RIGHT: TOP_LEFT { idc=-1; - x="0.55*safezoneW+safezoneX+0.315"; + x="0.55*safeZoneW+safeZoneX+0.315"; }; class TEXT_GUN_FRAME: ATragMX_RscText { idc=1001; style=64; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.25"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.25"; w="0.0925"; h="0.205"; text=""; }; class TEXT_ATMOSPHERE_FRAME: TEXT_GUN_FRAME { idc=1002; - x="0.550*safezoneW+safezoneX+0.205"; + x="0.550*safeZoneW+safeZoneX+0.205"; }; class TEXT_TARGET_FRAME: TEXT_GUN_FRAME { idc=1003; - x="0.550*safezoneW+safezoneX+0.3"; + x="0.550*safeZoneW+safeZoneX+0.3"; }; class TEXT_RESULT_FRAME: TEXT_GUN_FRAME { idc=1004; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.46"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.46"; w="0.2825"; h="0.15"; }; class TEXT_GUN_PROFILE: ATragMX_RscText { idc=1000; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.20"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.20"; w="0.18"; h="0.03"; style=ST_LEFT; @@ -271,8 +271,8 @@ class ATragMX_Display { class TEXT_D: ATragMX_RscButton { idc=600; w="0.0231"; - x="0.550*safezoneW+safezoneX+0.29"; - y="0.265*safezoneH+safezoneY+0.20"; + x="0.550*safeZoneW+safeZoneX+0.29"; + y="0.265*safeZoneH+safeZoneY+0.20"; colorText[]={0,0,0,1}; colorDisabled[]={0.8,0.8,0.8,1}; colorBackgroundDisabled[]={0,0,0,1}; @@ -282,20 +282,20 @@ class ATragMX_Display { }; class TEXT_E: TEXT_D { idc=601; - x="0.550*safezoneW+safezoneX+0.3131"; + x="0.550*safeZoneW+safeZoneX+0.3131"; text="E"; action=QUOTE(GVAR(currentUnit)=1; call FUNC(update_unit_selection)); }; class TEXT_M: TEXT_E { idc=602; - x="0.550*safezoneW+safezoneX+0.3362"; + x="0.550*safeZoneW+safeZoneX+0.3362"; text="M"; action=QUOTE(GVAR(currentUnit)=2; call FUNC(update_unit_selection)); }; class TEXT_RANGE_CARD: TEXT_D { idc=603; w="0.03"; - x="0.550*safezoneW+safezoneX+0.36"; + x="0.550*safeZoneW+safeZoneX+0.36"; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="RC"; @@ -305,8 +305,8 @@ class ATragMX_Display { class TEXT_GUN: ATragMX_RscButton { idc=4000; w="0.0925"; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.25"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.25"; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="Gun"; @@ -315,41 +315,41 @@ class ATragMX_Display { class TEXT_BORE_HEIGHT: TEXT_GUN_PROFILE { idc=10; style=ST_LEFT; - y="0.265*safezoneH+safezoneY+0.285"; + y="0.265*safeZoneH+safeZoneY+0.285"; text="BH"; }; class TEXT_BORE_HEIGHT_OUTPUT: TEXT_BORE_HEIGHT { idc=100; style=ST_RIGHT; w="0.058"; - x="0.550*safezoneW+safezoneX+0.145"; - y="0.265*safezoneH+safezoneY+0.285"; + x="0.550*safeZoneW+safeZoneX+0.145"; + y="0.265*safeZoneH+safeZoneY+0.285"; }; class TEXT_BULLET_MASS: TEXT_BORE_HEIGHT { idc=11; style=ST_LEFT; - y="0.265*safezoneH+safezoneY+0.320"; + y="0.265*safeZoneH+safeZoneY+0.320"; text="BW"; }; class TEXT_BULLET_MASS_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=110; - y="0.265*safezoneH+safezoneY+0.320"; + y="0.265*safeZoneH+safeZoneY+0.320"; }; class TEXT_AIR_FRICTION: TEXT_BORE_HEIGHT { idc=12; - y="0.265*safezoneH+safezoneY+0.355"; + y="0.265*safeZoneH+safeZoneY+0.355"; text="C1"; }; class TEXT_AIR_FRICTION_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=120; - y="0.265*safezoneH+safezoneY+0.355"; + y="0.265*safeZoneH+safeZoneY+0.355"; }; class TEXT_MUZZLE_VELOCITY: ATragMX_RscButton { idc=13; style=0; w="0.03"; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.390"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.390"; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="MV"; @@ -357,69 +357,69 @@ class ATragMX_Display { }; class TEXT_MUZZLE_VELOCITY_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=130; - y="0.265*safezoneH+safezoneY+0.390"; + y="0.265*safeZoneH+safeZoneY+0.390"; }; class TEXT_ZERO_RANGE: TEXT_BORE_HEIGHT { idc=14; - y="0.265*safezoneH+safezoneY+0.425"; + y="0.265*safeZoneH+safeZoneY+0.425"; text="ZR"; }; class TEXT_ZERO_RANGE_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=140; - y="0.265*safezoneH+safezoneY+0.425"; + y="0.265*safeZoneH+safeZoneY+0.425"; }; class TEXT_ATMOSPHERE: TEXT_GUN { idc=4001; - x="0.550*safezoneW+safezoneX+0.205"; + x="0.550*safeZoneW+safeZoneX+0.205"; text="Atmsphr"; action=QUOTE(0 call FUNC(toggle_atmo_env_data)); }; class TEXT_TEMPERATURE: TEXT_BULLET_MASS { idc=20; - x="0.550*safezoneW+safezoneX+0.20"; + x="0.550*safeZoneW+safeZoneX+0.20"; text="Tmp"; }; class TEXT_TEMPERATURE_OUTPUT: TEXT_TEMPERATURE { idc=200; style=ST_RIGHT; w="0.050"; - x="0.550*safezoneW+safezoneX+0.245"; - y="0.265*safezoneH+safezoneY+0.320"; + x="0.550*safeZoneW+safeZoneX+0.245"; + y="0.265*safeZoneH+safeZoneY+0.320"; text=""; }; class TEXT_BAROMETRIC_PRESSURE: TEXT_TEMPERATURE { idc=21; - x="0.550*safezoneW+safezoneX+0.20"; - y="0.265*safezoneH+safezoneY+0.355"; + x="0.550*safeZoneW+safeZoneX+0.20"; + y="0.265*safeZoneH+safeZoneY+0.355"; text="BP"; }; class TEXT_BAROMETRIC_PRESSURE_OUTPUT: TEXT_TEMPERATURE_OUTPUT { idc=210; - y="0.265*safezoneH+safezoneY+0.355"; + y="0.265*safeZoneH+safeZoneY+0.355"; }; class TEXT_RELATIVE_HUMIDITY: TEXT_BAROMETRIC_PRESSURE { idc=22; - y="0.265*safezoneH+safezoneY+0.390"; + y="0.265*safeZoneH+safeZoneY+0.390"; text="RH"; }; class TEXT_RELATIVE_HUMIDITY_OUTPUT: TEXT_TEMPERATURE_OUTPUT { idc=220; - y="0.265*safezoneH+safezoneY+0.390"; + y="0.265*safeZoneH+safeZoneY+0.390"; }; class TEXT_ALTITUDE: TEXT_BORE_HEIGHT { idc=23; - x="0.550*safezoneW+safezoneX+0.20"; + x="0.550*safeZoneW+safeZoneX+0.20"; text="Alt"; }; class TEXT_ALTITUDE_OUTPUT: TEXT_TEMPERATURE_OUTPUT { idc=230; - y="0.265*safezoneH+safezoneY+0.285"; + y="0.265*safeZoneH+safeZoneY+0.285"; }; class TEXT_TARGET_A: ATragMX_RscButton { idc=500; w="0.0231"; - x="0.550*safezoneW+safezoneX+0.205"; - y="0.265*safezoneH+safezoneY+0.425"; + x="0.550*safeZoneW+safeZoneX+0.205"; + y="0.265*safeZoneH+safeZoneY+0.425"; colorText[]={0,0,0,1}; colorDisabled[]={0.8,0.8,0.8,1}; colorBackgroundDisabled[]={0,0,0,1}; @@ -429,103 +429,103 @@ class ATragMX_Display { }; class TEXT_TARGET_B: TEXT_TARGET_A { idc=501; - x="0.550*safezoneW+safezoneX+0.2281"; + x="0.550*safeZoneW+safeZoneX+0.2281"; text="B"; action=QUOTE(1 call FUNC(change_target_slot)); }; class TEXT_TARGET_C: TEXT_TARGET_A { idc=502; - x="0.550*safezoneW+safezoneX+0.2512"; + x="0.550*safeZoneW+safeZoneX+0.2512"; text="C"; action=QUOTE(2 call FUNC(change_target_slot)); }; class TEXT_TARGET_D: TEXT_TARGET_A { idc=503; - x="0.550*safezoneW+safezoneX+0.2743"; + x="0.550*safeZoneW+safeZoneX+0.2743"; text="D"; action=QUOTE(3 call FUNC(change_target_slot)); }; class TEXT_TARGET: TEXT_GUN { idc=4002; - x="0.550*safezoneW+safezoneX+0.3"; + x="0.550*safeZoneW+safeZoneX+0.3"; text="Target"; action=QUOTE(0 call FUNC(toggle_target_data)); }; class TEXT_WIND_SPEED: TEXT_BORE_HEIGHT { idc=30; - x="0.550*safezoneW+safezoneX+0.3"; + x="0.550*safeZoneW+safeZoneX+0.3"; text="WS"; }; class TEXT_WIND_SPEED_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=300; w="0.058"; - x="0.550*safezoneW+safezoneX+0.335"; - y="0.265*safezoneH+safezoneY+0.285"; + x="0.550*safeZoneW+safeZoneX+0.335"; + y="0.265*safeZoneH+safeZoneY+0.285"; text="0"; }; class TEXT_WIND_DIRECTION: TEXT_BULLET_MASS { idc=31; - x="0.550*safezoneW+safezoneX+0.3"; + x="0.550*safeZoneW+safeZoneX+0.3"; text="WD"; }; class TEXT_WIND_DIRECTION_OUTPUT: TEXT_WIND_SPEED_OUTPUT { idc=310; - y="0.265*safezoneH+safezoneY+0.32"; + y="0.265*safeZoneH+safeZoneY+0.32"; }; class TEXT_INCLINATION_ANGLE: TEXT_AIR_FRICTION { idc=32; - x="0.550*safezoneW+safezoneX+0.3"; + x="0.550*safeZoneW+safeZoneX+0.3"; text="IA"; }; class TEXT_INCLINATION_ANGLE_OUTPUT: TEXT_WIND_SPEED_OUTPUT { idc=320; - y="0.265*safezoneH+safezoneY+0.355"; + y="0.265*safeZoneH+safeZoneY+0.355"; }; class TEXT_TARGET_SPEED: TEXT_MUZZLE_VELOCITY { idc=33; - x="0.550*safezoneW+safezoneX+0.3"; + x="0.550*safeZoneW+safeZoneX+0.3"; text="TS"; action=QUOTE(0 call FUNC(toggle_target_speed_assist)); }; class TEXT_TARGET_SPEED_OUTPUT: TEXT_WIND_SPEED_OUTPUT { idc=330; - y="0.265*safezoneH+safezoneY+0.39"; + y="0.265*safeZoneH+safeZoneY+0.39"; }; class TEXT_TARGET_RANGE: TEXT_TARGET_SPEED { idc=34; - y="0.265*safezoneH+safezoneY+0.425"; + y="0.265*safeZoneH+safeZoneY+0.425"; text="TR"; action=QUOTE(0 call FUNC(toggle_target_range_assist)); }; class TEXT_TARGET_RANGE_INPUT: TEXT_WIND_SPEED_OUTPUT { idc=340; - y="0.265*safezoneH+safezoneY+0.425"; + y="0.265*safeZoneH+safeZoneY+0.425"; }; class TEXT_ELEVATION: TEXT_GUN_PROFILE { idc=40; w="0.05"; - x="0.550*safezoneW+safezoneX+0.115"; - y="0.265*safezoneH+safezoneY+0.50"; + x="0.550*safeZoneW+safeZoneX+0.115"; + y="0.265*safeZoneH+safeZoneY+0.50"; text="Elev"; }; class TEXT_ABSOLUTE: TEXT_GUN_PROFILE { idc=4003; w="0.07"; style=ST_CENTER; - x="0.550*safezoneW+safezoneX+0.17"; - y="0.265*safezoneH+safezoneY+0.47"; + x="0.550*safeZoneW+safeZoneX+0.17"; + y="0.265*safeZoneH+safeZoneY+0.47"; text="Abs"; }; class TEXT_RELATIVE: TEXT_ABSOLUTE { idc=4004; - x="0.550*safezoneW+safezoneX+0.245"; + x="0.550*safeZoneW+safeZoneX+0.245"; text="Rel"; }; class TEXT_CURRENT: TEXT_ABSOLUTE { idc=4005; - x="0.550*safezoneW+safezoneX+0.32"; + x="0.550*safeZoneW+safeZoneX+0.32"; text="Cur"; }; class TEXT_ELEVATION_OUTPUT_ABSOLUTE: ATragMX_RscText { @@ -534,67 +534,67 @@ class ATragMX_Display { sizeEx="0.025"; w="0.065"; h="0.032"; - x="0.550*safezoneW+safezoneX+0.17"; - y="0.265*safezoneH+safezoneY+0.50"; + x="0.550*safeZoneW+safeZoneX+0.17"; + y="0.265*safeZoneH+safeZoneY+0.50"; text=""; }; class TEXT_ELEVATION_OUTPUT_RELATIVE: TEXT_ELEVATION_OUTPUT_ABSOLUTE { idc=401; - x="0.550*safezoneW+safezoneX+0.2465"; + x="0.550*safeZoneW+safeZoneX+0.2465"; }; class TEXT_ELEVATION_INPUT_CURRENT: TEXT_ELEVATION_OUTPUT_ABSOLUTE { idc=402; - x="0.550*safezoneW+safezoneX+0.323"; + x="0.550*safeZoneW+safeZoneX+0.323"; }; class TEXT_WINDAGE: TEXT_ELEVATION { idc=41; - y="0.265*safezoneH+safezoneY+0.535"; + y="0.265*safeZoneH+safeZoneY+0.535"; text="Wind"; }; class TEXT_WINDAGE_OUTPUT_ABSOLUTE: TEXT_ELEVATION_OUTPUT_ABSOLUTE { idc=410; - y="0.265*safezoneH+safezoneY+0.535"; + y="0.265*safeZoneH+safeZoneY+0.535"; }; class TEXT_WINDAGE_OUTPUT_RELATIVE: TEXT_WINDAGE_OUTPUT_ABSOLUTE { idc=411; - x="0.550*safezoneW+safezoneX+0.2465"; + x="0.550*safeZoneW+safeZoneX+0.2465"; }; class TEXT_WINDAGE_INPUT_CURRENT: TEXT_WINDAGE_OUTPUT_ABSOLUTE { idc=412; - x="0.550*safezoneW+safezoneX+0.323"; + x="0.550*safeZoneW+safeZoneX+0.323"; }; class TEXT_LEAD: TEXT_GUN { idc=42; w="0.05"; - x="0.550*safezoneW+safezoneX+0.115"; - y="0.265*safezoneH+safezoneY+0.57"; + x="0.550*safeZoneW+safeZoneX+0.115"; + y="0.265*safeZoneH+safeZoneY+0.57"; text="Lead"; action=QUOTE(GVAR(showWind2) = !GVAR(showWind2); call FUNC(update_result); call FUNC(update_target)); }; class TEXT_LEAD_OUTPUT: TEXT_ELEVATION_OUTPUT_ABSOLUTE { idc=420; - y="0.265*safezoneH+safezoneY+0.57"; + y="0.265*safeZoneH+safeZoneY+0.57"; }; class TEXT_RESET_SCOPE_ZERO: TEXT_GUN { idc=4006; w="0.07"; style=ST_CENTER; colorBackground[]={0,0,0,0}; - x="0.550*safezoneW+safezoneX+0.2465"; - y="0.265*safezoneH+safezoneY+0.57"; + x="0.550*safeZoneW+safeZoneX+0.2465"; + y="0.265*safeZoneH+safeZoneY+0.57"; text="Reset"; action=QUOTE(call FUNC(reset_relative_click_memory)); }; class TEXT_UPDATE_SCOPE_ZERO: TEXT_RESET_SCOPE_ZERO { idc=4007; - x="0.550*safezoneW+safezoneX+0.323"; + x="0.550*safeZoneW+safeZoneX+0.323"; text="Update"; action=QUOTE(call FUNC(update_relative_click_memory)); }; class TEXT_GUN_LIST: TEXT_GUN { idc=4008; style=ST_LEFT; - y="0.265*safezoneH+safezoneY+0.65"; + y="0.265*safeZoneH+safeZoneY+0.65"; text="GunList"; action=QUOTE(call FUNC(toggle_gun_list)); }; @@ -602,7 +602,7 @@ class ATragMX_Display { idc=2000; style=ST_CENTER; w="0.06"; - x="0.550*safezoneW+safezoneX+0.205"; + x="0.550*safeZoneW+safeZoneX+0.205"; colorBackground[]={0,0,0,0}; text="TMOA"; action=QUOTE(call FUNC(cycle_scope_unit)); @@ -611,14 +611,14 @@ class ATragMX_Display { idc=2001; style=ST_CENTER; w="0.025"; - x="0.550*safezoneW+safezoneX+0.27"; + x="0.550*safeZoneW+safeZoneX+0.27"; text="4"; action=QUOTE(call FUNC(toggle_solution_setup)); }; class TEXT_OPTIONS: TEXT_GUN_LIST { idc=3000; style=ST_RIGHT; - x="0.550*safezoneW+safezoneX+0.3"; + x="0.550*safeZoneW+safeZoneX+0.3"; text="Options"; action=QUOTE(false call FUNC(toggle_option_menu)); }; @@ -627,8 +627,8 @@ class ATragMX_Display { colorBackground[]={0.15,0.21,0.23,0.2}; colorBackgroundActive[]={0.15,0.21,0.23,0.2}; colorFocused[]={0.15,0.21,0.23,0.2}; - x="0.550*safezoneW+safezoneX+0.105"; - y="0.265*safezoneH+safezoneY+0.17"; + x="0.550*safeZoneW+safeZoneX+0.105"; + y="0.265*safeZoneH+safeZoneY+0.17"; w="0.3"; h="0.535"; offsetPressedX="0.0"; @@ -640,8 +640,8 @@ class ATragMX_Display { style=0; w="0.17"; h="0.28"; - x="0.550*safezoneW+safezoneX+0.225"; - y="0.265*safezoneH+safezoneY+0.355"; + x="0.550*safeZoneW+safeZoneX+0.225"; + y="0.265*safeZoneH+safeZoneY+0.355"; sizeEx="0.025"; onMouseButtonClick=QUOTE(true call FUNC(toggle_option_menu)); }; @@ -653,8 +653,8 @@ class ATragMX_Display { class TEXT_RANGE_CARD_SETUP: ATragMX_RscButton { idc=5001; w="0.055675"; - x="0.550*safezoneW+safezoneX+0.28"; - y="0.265*safezoneH+safezoneY+0.20"; + x="0.550*safeZoneW+safeZoneX+0.28"; + y="0.265*safeZoneH+safeZoneY+0.20"; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="Setup"; @@ -662,7 +662,7 @@ class ATragMX_Display { }; class TEXT_RANGE_CARD_DONE: TEXT_RANGE_CARD_SETUP { idc=5002; - x="0.550*safezoneW+safezoneX+0.3362"; + x="0.550*safeZoneW+safeZoneX+0.3362"; text="Done"; action=QUOTE(call FUNC(toggle_range_card)); }; @@ -670,24 +670,24 @@ class ATragMX_Display { idc=5003; style=ST_LEFT; w="0.07"; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.24"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.24"; colorBackground[]={0.15,0.21,0.23,0.3}; text="Meters"; }; class TEXT_RANGE_CARD_COLUMN_2_CAPTION: TEXT_RANGE_CARD_COLUMN_1_CAPTION { idc=5004; - x="0.550*safezoneW+safezoneX+0.180625"; + x="0.550*safeZoneW+safeZoneX+0.180625"; text="Elev"; }; class TEXT_RANGE_CARD_COLUMN_3_CAPTION: TEXT_RANGE_CARD_COLUMN_1_CAPTION { idc=5005; - x="0.550*safezoneW+safezoneX+0.25125"; + x="0.550*safeZoneW+safeZoneX+0.25125"; text="Wind"; }; class TEXT_RANGE_CARD_COLUMN_4_CAPTION: TEXT_RANGE_CARD_COLUMN_1_CAPTION { idc=5006; - x="0.550*safezoneW+safezoneX+0.321875"; + x="0.550*safeZoneW+safeZoneX+0.321875"; text="TmFlt"; action=QUOTE(call FUNC(cycle_range_card_columns)); }; @@ -698,8 +698,8 @@ class ATragMX_Display { idcRight=50062; w="0.285"; h="0.42"; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.27"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.27"; }; class TEXT_GUN_LIST_OUTPUT: ATragMX_RscListNBox { @@ -707,8 +707,8 @@ class ATragMX_Display { columns[]={-0.05}; w="0.16"; h="0.45"; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.24"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.24"; sizeEx="0.018"; colorSelectBackground[]={0.15,0.21,0.23,0.3}; colorSelectBackground2[]={0.15,0.21,0.23,0.3}; @@ -724,8 +724,8 @@ class ATragMX_Display { idc=6002; style=ST_RIGHT; w="0.115"; - x="0.550*safezoneW+safezoneX+0.28"; - y="0.265*safezoneH+safezoneY+0.20"; + x="0.550*safeZoneW+safeZoneX+0.28"; + y="0.265*safeZoneH+safeZoneY+0.20"; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; sizeEx="0.024"; @@ -734,30 +734,30 @@ class ATragMX_Display { }; class TEXT_GUN_LIST_SAVE_GUN: TEXT_GUN_LIST_OPEN_GUN { idc=6003; - y="0.265*safezoneH+safezoneY+0.24"; + y="0.265*safeZoneH+safeZoneY+0.24"; text="Save Gun"; action=QUOTE(call FUNC(save_gun)); }; class TEXT_GUN_LIST_ADD_NEW_GUN: TEXT_GUN_LIST_OPEN_GUN { idc=6004; - y="0.265*safezoneH+safezoneY+0.28"; + y="0.265*safeZoneH+safeZoneY+0.28"; text="Add New Gun"; action=QUOTE(false call FUNC(show_gun_list); true call FUNC(show_add_new_gun)); }; class TEXT_GUN_LIST_DELETE_GUN: TEXT_GUN_LIST_OPEN_GUN { idc=6005; - y="0.265*safezoneH+safezoneY+0.34"; + y="0.265*safeZoneH+safeZoneY+0.34"; text="Delete Gun"; action=QUOTE(call FUNC(delete_gun)); }; class TEXT_GUN_LIST_NOTE: TEXT_GUN_LIST_OPEN_GUN { idc=6006; - y="0.265*safezoneH+safezoneY+0.40"; + y="0.265*safeZoneH+safeZoneY+0.40"; text="Note"; }; class TEXT_GUN_LIST_DONE: TEXT_GUN_LIST_OPEN_GUN { idc=6007; - y="0.265*safezoneH+safezoneY+0.65"; + y="0.265*safeZoneH+safeZoneY+0.65"; text="Done"; action=QUOTE(false call FUNC(toggle_gun_list)); }; @@ -766,8 +766,8 @@ class ATragMX_Display { idc=7000; style="16+0x200"; lineSpacing=1.0; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.24"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.24"; w="0.29"; h="0.10"; sizeEx="0.022"; @@ -776,8 +776,8 @@ class ATragMX_Display { class TEXT_TARGET_RANGE_ASSIST_MEASUREMENT_METHOD: TEXT_TARGET_RANGE_ASSIST_CAPTION { idc=7001; style=ST_LEFT; - x="0.550*safezoneW+safezoneX+0.115"; - y="0.265*safezoneH+safezoneY+0.35"; + x="0.550*safeZoneW+safeZoneX+0.115"; + y="0.265*safeZoneH+safeZoneY+0.35"; w="0.12"; h="0.03"; sizeEx="0.027"; @@ -786,8 +786,8 @@ class ATragMX_Display { class TEXT_TARGET_RANGE_ASSIST_WIDTH_HEIGHT: ATragMX_RscToolbox { idc=7002; w="0.14"; - x="0.550*safezoneW+safezoneX+0.24"; - y="0.265*safezoneH+safezoneY+0.35"; + x="0.550*safeZoneW+safeZoneX+0.24"; + y="0.265*safeZoneH+safeZoneY+0.35"; strings[]={"Height","Width"}; values[]={1,0}; onToolBoxSelChanged=QUOTE(GVAR(rangeAssistUseTargetHeight) = ((_this select 1) == 0)); @@ -795,73 +795,73 @@ class ATragMX_Display { class TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE: TEXT_TARGET_RANGE_ASSIST_MEASUREMENT_METHOD { idc=7003; style=ST_RIGHT; - x="0.550*safezoneW+safezoneX+0.092"; - y="0.265*safezoneH+safezoneY+0.4"; + x="0.550*safeZoneW+safeZoneX+0.092"; + y="0.265*safeZoneH+safeZoneY+0.4"; w="0.128"; text="Target Size"; }; class TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE { idc=7004; - y="0.265*safezoneH+safezoneY+0.45"; + y="0.265*safeZoneH+safeZoneY+0.45"; text="Image Size"; }; class TEXT_TARGET_RANGE_ASSIST_ANGLE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE { idc=7005; - y="0.265*safezoneH+safezoneY+0.5"; + y="0.265*safeZoneH+safeZoneY+0.5"; text="Angle"; }; class TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE { idc=7006; - y="0.265*safezoneH+safezoneY+0.55"; + y="0.265*safeZoneH+safeZoneY+0.55"; text="Est Range"; }; class TEXT_TARGET_RANGE_ASSIST_CALC_1: TEXT_MUZZLE_VELOCITY { idc=7007; w="0.0231"; - x="0.550*safezoneW+safezoneX+0.22"; - y="0.265*safezoneH+safezoneY+0.4"; + x="0.550*safeZoneW+safeZoneX+0.22"; + y="0.265*safeZoneH+safeZoneY+0.4"; sizeEx="0.03"; text="!"; action=QUOTE(0 call FUNC(calculate_target_range_assist)); }; class TEXT_TARGET_RANGE_ASSIST_CALC_2: TEXT_TARGET_RANGE_ASSIST_CALC_1 { idc=7008; - y="0.265*safezoneH+safezoneY+0.45"; + y="0.265*safeZoneH+safeZoneY+0.45"; action=QUOTE(1 call FUNC(calculate_target_range_assist)); }; class TEXT_TARGET_RANGE_ASSIST_CALC_3: TEXT_TARGET_RANGE_ASSIST_CALC_1 { idc=7009; - y="0.265*safezoneH+safezoneY+0.55"; + y="0.265*safeZoneH+safeZoneY+0.55"; action=QUOTE(2 call FUNC(calculate_target_range_assist)); }; class TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT: ATragMX_RscEdit { idc=7010; w="0.065"; - x="0.550*safezoneW+safezoneX+0.2475"; - y="0.265*safezoneH+safezoneY+0.4"; + x="0.550*safeZoneW+safeZoneX+0.2475"; + y="0.265*safeZoneH+safeZoneY+0.4"; }; class TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT { idc=7011; - y="0.265*safezoneH+safezoneY+0.45"; + y="0.265*safeZoneH+safeZoneY+0.45"; }; class TEXT_TARGET_RANGE_ASSIST_ANGLE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT { idc=7012; - y="0.265*safezoneH+safezoneY+0.5"; + y="0.265*safeZoneH+safeZoneY+0.5"; }; class TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT { idc=7013; - y="0.265*safezoneH+safezoneY+0.55"; + y="0.265*safeZoneH+safeZoneY+0.55"; }; class TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_UNIT: TEXT_TARGET_RANGE_ASSIST_CALC_1 { idc=7014; w="0.07"; - x="0.550*safezoneW+safezoneX+0.32"; + x="0.550*safeZoneW+safeZoneX+0.32"; text="cm"; action=QUOTE(call FUNC(cycle_target_size_units)); }; class TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_UNIT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_UNIT { idc=7015; - y="0.265*safezoneH+safezoneY+0.45"; + y="0.265*safeZoneH+safeZoneY+0.45"; text="MIL"; action=QUOTE(call FUNC(cycle_image_size_units)); }; @@ -869,15 +869,15 @@ class ATragMX_Display { idc=7016; style=ST_LEFT; w="0.07"; - x="0.550*safezoneW+safezoneX+0.32"; + x="0.550*safeZoneW+safeZoneX+0.32"; text="Meters"; }; class TEXT_TARGET_RANGE_ASSIST_DONE: ATragMX_RscButton { idc=7017; style=ST_CENTER; w="0.07"; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.60"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.60"; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="Done"; @@ -885,41 +885,41 @@ class ATragMX_Display { }; class TEXT_TARGET_RANGE_ASSIST_CANCEL: TEXT_TARGET_RANGE_ASSIST_DONE { idc=7018; - x="0.550*safezoneW+safezoneX+0.180625"; + x="0.550*safeZoneW+safeZoneX+0.180625"; text="Cancel"; action=QUOTE(0 call FUNC(toggle_target_range_assist)); }; class TEXT_TARGET_RANGE_ASSIST_PREV: TEXT_TARGET_RANGE_ASSIST_DONE { idc=7019; - x="0.550*safezoneW+safezoneX+0.25125"; + x="0.550*safeZoneW+safeZoneX+0.25125"; text="Prev"; action=""; }; class TEXT_TARGET_RANGE_ASSIST_NEXT: TEXT_TARGET_RANGE_ASSIST_DONE { idc=7020; - x="0.550*safezoneW+safezoneX+0.321875"; + x="0.550*safeZoneW+safeZoneX+0.321875"; text="Next"; action=""; }; class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE { idc=8000; - x="0.550*safezoneW+safezoneX+0.12"; + x="0.550*safeZoneW+safeZoneX+0.12"; text="Target Range"; }; class TEXT_TARGET_SPEED_ASSIST_NUM_TICKS: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE { idc=8001; - x="0.550*safezoneW+safezoneX+0.12"; + x="0.550*safeZoneW+safeZoneX+0.12"; text="Num Ticks"; }; class TEXT_TARGET_SPEED_ASSIST_TIME: TEXT_TARGET_RANGE_ASSIST_ANGLE { idc=8002; - x="0.550*safezoneW+safezoneX+0.12"; + x="0.550*safeZoneW+safeZoneX+0.12"; text="Time (secs)"; }; class TEXT_TARGET_SPEED_ASSIST_TARGET_ESTIMATED_SPEED: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE { idc=8003; - x="0.550*safezoneW+safezoneX+0.12"; + x="0.550*safeZoneW+safeZoneX+0.12"; text="Est Speed"; }; class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT { @@ -937,14 +937,14 @@ class ATragMX_Display { class TEXT_TARGET_SPEED_ASSIST_TARGET_ESTIMATED_SPEED_OUTPUT: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE { idc=8007; w="0.065"; - x="0.550*safezoneW+safezoneX+0.2475"; - y="0.265*safezoneH+safezoneY+0.55"; + x="0.550*safeZoneW+safeZoneX+0.2475"; + y="0.265*safeZoneH+safeZoneY+0.55"; colorBackground[]={0.15,0.21,0.23,0.3}; text="0"; }; class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE_UNIT: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE_UNIT { idc=8008; - y="0.265*safezoneH+safezoneY+0.4"; + y="0.265*safeZoneH+safeZoneY+0.4"; text="Meters"; }; class TEXT_TARGET_SPEED_ASSIST_NUM_TICKS_UNIT: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_UNIT { @@ -954,7 +954,7 @@ class ATragMX_Display { }; class TEXT_TARGET_SPEED_ASSIST_TIMER_START: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_UNIT { idc=8010; - y="0.265*safezoneH+safezoneY+0.5"; + y="0.265*safeZoneH+safeZoneY+0.5"; text="Start"; action=QUOTE(call FUNC(target_speed_assist_timer)); }; @@ -981,16 +981,16 @@ class ATragMX_Display { idc=9000; w="0.285"; h="0.49"; - x="0.550*safezoneW+safezoneX+0.11"; - y="0.265*safezoneH+safezoneY+0.2"; + x="0.550*safeZoneW+safeZoneX+0.11"; + y="0.265*safeZoneH+safeZoneY+0.2"; colorBackground[]={0,0,0,0}; colorBackgroundActive[]={0,0,0,0}; action=QUOTE(GVAR(speedAssistTimer)=false); }; class TEXT_TARGET_SPEED_ASSIST_TIME_OUTPUT: ATragMX_RscText { idc=9001; - x="0.550*safezoneW+safezoneX+0.22"; - y="0.265*safezoneH+safezoneY+0.51"; + x="0.550*safeZoneW+safeZoneX+0.22"; + y="0.265*safeZoneH+safeZoneY+0.51"; w="0.08"; h="0.09"; style=ST_CENTER; @@ -1002,8 +1002,8 @@ class ATragMX_Display { style=ST_CENTER; w="0.07"; h="0.04"; - x="0.550*safezoneW+safezoneX+0.225"; - y="0.265*safezoneH+safezoneY+0.60"; + x="0.550*safeZoneW+safeZoneX+0.225"; + y="0.265*safeZoneH+safeZoneY+0.60"; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="Stop"; @@ -1012,17 +1012,17 @@ class ATragMX_Display { class TEXT_RANGE_CARD_SETUP_START_RANGE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE { idc=10000; - x="0.550*safezoneW+safezoneX+0.12"; + x="0.550*safeZoneW+safeZoneX+0.12"; text="Start Range"; }; class TEXT_RANGE_CARD_SETUP_END_RANGE: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE { idc=10001; - x="0.550*safezoneW+safezoneX+0.12"; + x="0.550*safeZoneW+safeZoneX+0.12"; text="End Range"; }; class TEXT_RANGE_CARD_SETUP_INCREMENT: TEXT_TARGET_RANGE_ASSIST_ANGLE { idc=10002; - x="0.550*safezoneW+safezoneX+0.12"; + x="0.550*safeZoneW+safeZoneX+0.12"; text="Increment"; }; class TEXT_RANGE_CARD_SETUP_START_RANGE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT { @@ -1057,8 +1057,8 @@ class ATragMX_Display { style=ST_LEFT; w="0.25"; h="0.04"; - x="0.550*safezoneW+safezoneX+0.12"; - y="0.265*safezoneH+safezoneY+0.24"; + x="0.550*safeZoneW+safeZoneX+0.12"; + y="0.265*safeZoneH+safeZoneY+0.24"; sizeEx="0.025"; text="New Gun Name"; }; @@ -1067,8 +1067,8 @@ class ATragMX_Display { style=ST_LEFT; w="0.225"; h="0.04"; - x="0.550*safezoneW+safezoneX+0.12"; - y="0.265*safezoneH+safezoneY+0.28"; + x="0.550*safeZoneW+safeZoneX+0.12"; + y="0.265*safeZoneH+safeZoneY+0.28"; text=""; onKeyDown=QUOTE(call FUNC(trim_gun_name)); onKeyUp=QUOTE(call FUNC(trim_gun_name)); @@ -1078,8 +1078,8 @@ class ATragMX_Display { style=ST_CENTER; w="0.1"; h="0.04"; - x="0.550*safezoneW+safezoneX+0.12"; - y="0.265*safezoneH+safezoneY+0.33"; + x="0.550*safeZoneW+safeZoneX+0.12"; + y="0.265*safeZoneH+safeZoneY+0.33"; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="OK"; @@ -1087,7 +1087,7 @@ class ATragMX_Display { }; class TEXT_ADD_NEW_GUN_CANCEL: TEXT_ADD_NEW_GUN_OK { idc=11003; - x="0.550*safezoneW+safezoneX+0.245"; + x="0.550*safeZoneW+safeZoneX+0.245"; text="Cancel"; action=QUOTE(false call FUNC(show_add_new_gun); true call FUNC(show_gun_list)); }; @@ -1095,74 +1095,74 @@ class ATragMX_Display { class TEXT_GUN_AMMO_DATA_BORE_HEIGHT: TEXT_BORE_HEIGHT { idc=12000; w="0.22"; - y="0.265*safezoneH+safezoneY+0.28"; + y="0.265*safeZoneH+safeZoneY+0.28"; text="Bore (cm)"; }; class TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT: ATragMX_RscEdit { idc=120000; w="0.06"; - x="0.550*safezoneW+safezoneX+0.335"; - y="0.265*safezoneH+safezoneY+0.28"; + x="0.550*safeZoneW+safeZoneX+0.335"; + y="0.265*safeZoneH+safeZoneY+0.28"; }; class TEXT_GUN_AMMO_DATA_BULLET_MASS: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { idc=12001; - y="0.265*safezoneH+safezoneY+0.320"; + y="0.265*safeZoneH+safeZoneY+0.320"; text="Bullet Weight (grams)"; }; class TEXT_GUN_AMMO_DATA_BULLET_MASS_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { idc=120010; - y="0.265*safezoneH+safezoneY+0.320"; + y="0.265*safeZoneH+safeZoneY+0.320"; }; class TEXT_GUN_AMMO_DATA_BULLET_DIAMETER: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { idc=12002; - y="0.265*safezoneH+safezoneY+0.360"; + y="0.265*safeZoneH+safeZoneY+0.360"; text="Bullet Diam (cm)"; }; class TEXT_GUN_AMMO_DATA_BULLET_DIAMETER_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { idc=120020; - y="0.265*safezoneH+safezoneY+0.360"; + y="0.265*safeZoneH+safeZoneY+0.360"; }; class TEXT_GUN_AMMO_DATA_AIR_FRICTION: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { idc=12003; - y="0.265*safezoneH+safezoneY+0.400"; + y="0.265*safeZoneH+safeZoneY+0.400"; text="C1 Coefficient"; }; class TEXT_GUN_AMMO_DATA_AIR_FRICTION_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { idc=120030; - y="0.265*safezoneH+safezoneY+0.400"; + y="0.265*safeZoneH+safeZoneY+0.400"; }; class TEXT_GUN_AMMO_DATA_RIFLE_TWIST: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { idc=12004; - y="0.265*safezoneH+safezoneY+0.440"; + y="0.265*safeZoneH+safeZoneY+0.440"; text="Rifle Twist (cm/trn)"; }; class TEXT_GUN_AMMO_DATA_RIFLE_TWIST_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { idc=120040; - y="0.265*safezoneH+safezoneY+0.440"; + y="0.265*safeZoneH+safeZoneY+0.440"; }; class TEXT_GUN_AMMO_DATA_MUZZLE_VELOCITY: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { idc=12005; - y="0.265*safezoneH+safezoneY+0.480"; + y="0.265*safeZoneH+safeZoneY+0.480"; text="Muzzle Velocity (m/s)"; }; class TEXT_GUN_AMMO_DATA_MUZZLE_VELOCITY_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { idc=120050; - y="0.265*safezoneH+safezoneY+0.480"; + y="0.265*safeZoneH+safeZoneY+0.480"; }; class TEXT_GUN_AMMO_DATA_ZERO_RANGE: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { idc=12006; - y="0.265*safezoneH+safezoneY+0.520"; + y="0.265*safeZoneH+safeZoneY+0.520"; text="Zero Range (meters)"; }; class TEXT_GUN_AMMO_DATA_ZERO_RANGE_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { idc=120060; - y="0.265*safezoneH+safezoneY+0.520"; + y="0.265*safeZoneH+safeZoneY+0.520"; }; class TEXT_GUN_AMMO_DATA_ZERO_RANGE_METER_INDICATOR: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { idc=120061; w="0.05"; - x="0.550*safezoneW+safezoneX+0.315"; - y="0.265*safezoneH+safezoneY+0.520"; + x="0.550*safeZoneW+safeZoneX+0.315"; + y="0.265*safeZoneH+safeZoneY+0.520"; text=""; }; class TEXT_GUN_AMMO_DATA_DONE: TEXT_TARGET_SPEED_ASSIST_DONE { @@ -1183,62 +1183,62 @@ class ATragMX_Display { class TEXT_ATMO_ENV_DATA_DEFAULT: TEXT_LEAD { idc=13000; w="0.08"; - x="0.550*safezoneW+safezoneX+0.15"; - y="0.265*safezoneH+safezoneY+0.320"; + x="0.550*safeZoneW+safeZoneX+0.15"; + y="0.265*safeZoneH+safeZoneY+0.320"; text="Default"; action=QUOTE(call FUNC(restore_atmo_default)); }; class TEXT_ATMO_ENV_DATA_AT: TEXT_TARGET_A { idc=13001; w="0.04"; - x="0.550*safezoneW+safezoneX+0.24"; - y="0.265*safezoneH+safezoneY+0.320"; + x="0.550*safeZoneW+safeZoneX+0.24"; + y="0.265*safeZoneH+safeZoneY+0.320"; text="AT"; action=QUOTE(GVAR(atmosphereModeTBH) = false; call FUNC(update_atmo_selection)); }; class TEXT_ATMO_ENV_DATA_TBH: TEXT_ATMO_ENV_DATA_AT { idc=13002; - x="0.550*safezoneW+safezoneX+0.28"; + x="0.550*safeZoneW+safeZoneX+0.28"; text="TBH"; action=QUOTE(GVAR(atmosphereModeTBH) = true; call FUNC(update_atmo_selection)); }; class TEXT_ATMO_ENV_DATA_ALTITUDE: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { idc=13003; - x="0.550*safezoneW+safezoneX+0.115"; - y="0.265*safezoneH+safezoneY+0.400"; + x="0.550*safeZoneW+safeZoneX+0.115"; + y="0.265*safeZoneH+safeZoneY+0.400"; text="Altitude (ft)"; }; class TEXT_ATMO_ENV_DATA_ALTITUDE_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { idc=130030; - x="0.550*safezoneW+safezoneX+0.330"; - y="0.265*safezoneH+safezoneY+0.400"; + x="0.550*safeZoneW+safeZoneX+0.330"; + y="0.265*safeZoneH+safeZoneY+0.400"; }; class TEXT_ATMO_ENV_DATA_TEMPERATURE: TEXT_ATMO_ENV_DATA_ALTITUDE { idc=13004; - y="0.265*safezoneH+safezoneY+0.440"; + y="0.265*safeZoneH+safeZoneY+0.440"; text="temperature (F)"; }; class TEXT_ATMO_ENV_DATA_TEMPERATURE_INPUT: TEXT_ATMO_ENV_DATA_ALTITUDE_INPUT { idc=130040; - y="0.265*safezoneH+safezoneY+0.440"; + y="0.265*safeZoneH+safeZoneY+0.440"; }; class TEXT_ATMO_ENV_DATA_BAROMETRIC_PRESSURE: TEXT_ATMO_ENV_DATA_ALTITUDE { idc=13005; - y="0.265*safezoneH+safezoneY+0.480"; + y="0.265*safeZoneH+safeZoneY+0.480"; text="Barom Pres (in.merc.)"; }; class TEXT_ATMO_ENV_DATA_BAROMETRIC_PRESSURE_INPUT: TEXT_ATMO_ENV_DATA_ALTITUDE_INPUT { idc=130050; - y="0.265*safezoneH+safezoneY+0.480"; + y="0.265*safeZoneH+safeZoneY+0.480"; }; class TEXT_ATMO_ENV_DATA_RELATIVE_HUMIDITY: TEXT_ATMO_ENV_DATA_ALTITUDE { idc=13006; - y="0.265*safezoneH+safezoneY+0.520"; + y="0.265*safeZoneH+safeZoneY+0.520"; text="Relative Humidity (%)"; }; class TEXT_ATMO_ENV_DATA_RELATIVE_HUMIDITY_INPUT: TEXT_ATMO_ENV_DATA_ALTITUDE_INPUT { idc=130060; - y="0.265*safezoneH+safezoneY+0.520"; + y="0.265*safeZoneH+safeZoneY+0.520"; }; class TEXT_ATMO_ENV_DATA_DONE: TEXT_TARGET_SPEED_ASSIST_DONE { idc=13007; @@ -1259,36 +1259,36 @@ class ATragMX_Display { style=64; w="0.14"; h="0.07"; - x="0.550*safezoneW+safezoneX+0.235"; - y="0.265*safezoneH+safezoneY+0.29"; + x="0.550*safeZoneW+safeZoneX+0.235"; + y="0.265*safeZoneH+safeZoneY+0.29"; text="Calc Method"; }; class TEXT_TARGET_DATA_LATITUDE: TEXT_BORE_HEIGHT { idc=14000; w="0.22"; - y="0.265*safezoneH+safezoneY+0.28"; + y="0.265*safeZoneH+safeZoneY+0.28"; text="Latitude"; }; class TEXT_TARGET_DATA_LATITUDE_INPUT: ATragMX_RscEdit { idc=140000; w="0.06"; - x="0.550*safezoneW+safezoneX+0.335"; - y="0.265*safezoneH+safezoneY+0.28"; + x="0.550*safeZoneW+safeZoneX+0.335"; + y="0.265*safeZoneH+safeZoneY+0.28"; }; class TEXT_TARGET_DATA_DIR_OF_FIRE: TEXT_TARGET_DATA_LATITUDE { idc=14001; - y="0.265*safezoneH+safezoneY+0.320"; + y="0.265*safeZoneH+safeZoneY+0.320"; text="Dir of Fire (deg from N)"; }; class TEXT_TARGET_DATA_DIR_OF_FIRE_INPUT: TEXT_TARGET_DATA_LATITUDE_INPUT { idc=140010; - y="0.265*safezoneH+safezoneY+0.320"; + y="0.265*safeZoneH+safeZoneY+0.320"; }; class TEXT_TARGET_DATA_WIND_SPEED: TEXT_TARGET_DATA_LATITUDE { idc=14002; w="1.2"; - y="0.265*safezoneH+safezoneY+0.360"; + y="0.265*safeZoneH+safeZoneY+0.360"; text="Wind Speed (m/s)"; }; class TEXT_TARGET_DATA_WIND_SPEED_1: TEXT_TARGET_DATA_LATITUDE { @@ -1297,40 +1297,40 @@ class ATragMX_Display { w="0.05"; h="0.03"; sizeEx="0.025"; - x="0.550*safezoneW+safezoneX+0.270"; - y="0.265*safezoneH+safezoneY+0.357"; + x="0.550*safeZoneW+safeZoneX+0.270"; + y="0.265*safeZoneH+safeZoneY+0.357"; text="1"; }; class TEXT_TARGET_DATA_WIND_SPEED_INPUT_1: TEXT_TARGET_DATA_LATITUDE_INPUT { idc=140020; w="0.045"; - x="0.550*safezoneW+safezoneX+0.290"; - y="0.265*safezoneH+safezoneY+0.360"; + x="0.550*safeZoneW+safeZoneX+0.290"; + y="0.265*safeZoneH+safeZoneY+0.360"; }; class TEXT_TARGET_DATA_WIND_SPEED_2: TEXT_TARGET_DATA_WIND_SPEED_1 { idc=141021; - x="0.550*safezoneW+safezoneX+0.330"; + x="0.550*safeZoneW+safeZoneX+0.330"; text="2"; }; class TEXT_TARGET_DATA_WIND_SPEED_INPUT_2: TEXT_TARGET_DATA_LATITUDE_INPUT { idc=140021; w="0.045"; - x="0.550*safezoneW+safezoneX+0.350"; - y="0.265*safezoneH+safezoneY+0.360"; + x="0.550*safeZoneW+safeZoneX+0.350"; + y="0.265*safeZoneH+safeZoneY+0.360"; }; class TEXT_TARGET_DATA_WIND_DIRECTION: TEXT_TARGET_DATA_LATITUDE { idc=14003; - y="0.265*safezoneH+safezoneY+0.400"; + y="0.265*safeZoneH+safeZoneY+0.400"; text="Wind Direction (clock)"; }; class TEXT_TARGET_DATA_WIND_DIRECTION_INPUT: TEXT_TARGET_DATA_LATITUDE_INPUT { idc=140030; - y="0.265*safezoneH+safezoneY+0.400"; + y="0.265*safeZoneH+safeZoneY+0.400"; }; class TEXT_TARGET_DATA_INCLINATION_ANGLE: TEXT_TARGET_DATA_LATITUDE { idc=14004; w="1.2"; - y="0.265*safezoneH+safezoneY+0.440"; + y="0.265*safeZoneH+safeZoneY+0.440"; text="Inclination Angle"; }; class TEXT_TARGET_DATA_INCLINATION_ANGLE_COSINE: TEXT_TARGET_DATA_LATITUDE { @@ -1339,62 +1339,62 @@ class ATragMX_Display { w="0.05"; h="0.03"; sizeEx="0.025"; - x="0.550*safezoneW+safezoneX+0.270"; - y="0.265*safezoneH+safezoneY+0.437"; + x="0.550*safeZoneW+safeZoneX+0.270"; + y="0.265*safeZoneH+safeZoneY+0.437"; text="c"; }; class TEXT_TARGET_DATA_INCLINATION_ANGLE_INPUT_COSINE: TEXT_TARGET_DATA_LATITUDE_INPUT { idc=140041; w="0.045"; - x="0.550*safezoneW+safezoneX+0.290"; - y="0.265*safezoneH+safezoneY+0.440"; + x="0.550*safeZoneW+safeZoneX+0.290"; + y="0.265*safeZoneH+safeZoneY+0.440"; onKeyUp=QUOTE(if (_this select 1 == 28) then {0 call FUNC(update_inclination_angle)}); }; class TEXT_TARGET_DATA_INCLINATION_ANGLE_DEGREE: TEXT_TARGET_DATA_INCLINATION_ANGLE_COSINE { idc=141040; - x="0.550*safezoneW+safezoneX+0.330"; + x="0.550*safeZoneW+safeZoneX+0.330"; text="d"; }; class TEXT_TARGET_DATA_INCLINATION_ANGLE_INPUT_DEGREE: TEXT_TARGET_DATA_LATITUDE_INPUT { idc=140040; w="0.045"; - x="0.550*safezoneW+safezoneX+0.350"; - y="0.265*safezoneH+safezoneY+0.440"; + x="0.550*safeZoneW+safeZoneX+0.350"; + y="0.265*safeZoneH+safeZoneY+0.440"; onKeyUp=QUOTE(if (_this select 1 == 28) then {1 call FUNC(update_inclination_angle)}); }; class TEXT_TARGET_DATA_TARGET_SPEED: TEXT_TARGET_DATA_LATITUDE { idc=14005; - y="0.265*safezoneH+safezoneY+0.480"; + y="0.265*safeZoneH+safeZoneY+0.480"; text="Target Speed (m/s)"; }; class TEXT_TARGET_DATA_TARGET_SPEED_INPUT: TEXT_TARGET_DATA_LATITUDE_INPUT { idc=140050; - y="0.265*safezoneH+safezoneY+0.480"; + y="0.265*safeZoneH+safeZoneY+0.480"; }; class TEXT_TARGET_DATA_TARGET_SPEED_DIRECTION: ATragMX_RscButton { idc=140051; colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; w="0.0231"; - x="0.550*safezoneW+safezoneX+0.305"; - y="0.265*safezoneH+safezoneY+0.480"; + x="0.550*safeZoneW+safeZoneX+0.305"; + y="0.265*safeZoneH+safeZoneY+0.480"; text=">"; action=QUOTE(call FUNC(cycle_target_speed_direction)); }; class TEXT_TARGET_DATA_TARGET_RANGE: TEXT_TARGET_DATA_LATITUDE { idc=14006; - y="0.265*safezoneH+safezoneY+0.520"; + y="0.265*safeZoneH+safeZoneY+0.520"; text="Target Range (meters)"; }; class TEXT_TARGET_DATA_TARGET_RANGE_INPUT: TEXT_TARGET_DATA_LATITUDE_INPUT { idc=140060; - y="0.265*safezoneH+safezoneY+0.520"; + y="0.265*safeZoneH+safeZoneY+0.520"; }; class TEXT_TARGET_DATA_TARGET_RANGE_METER_INDICATOR: TEXT_TARGET_DATA_LATITUDE { idc=140061; w="0.05"; - x="0.550*safezoneW+safezoneX+0.315"; - y="0.265*safezoneH+safezoneY+0.520"; + x="0.550*safeZoneW+safeZoneX+0.315"; + y="0.265*safeZoneH+safeZoneY+0.520"; text=""; }; class TEXT_TARGET_DATA_DONE: TEXT_TARGET_SPEED_ASSIST_DONE { @@ -1417,45 +1417,45 @@ class ATragMX_Display { style=64; w="0.25"; h="0.07"; - x="0.550*safezoneW+safezoneX+0.13"; - y="0.265*safezoneH+safezoneY+0.32"; + x="0.550*safeZoneW+safeZoneX+0.13"; + y="0.265*safeZoneH+safeZoneY+0.32"; text="Show result in"; }; class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1: TEXT_TARGET_A { idc=15001; w="0.04"; - x="0.550*safezoneW+safezoneX+0.14"; - y="0.265*safezoneH+safezoneY+0.35"; + x="0.550*safeZoneW+safeZoneX+0.14"; + y="0.265*safeZoneH+safeZoneY+0.35"; text="1"; action=QUOTE(GVAR(currentScopeClickNumberTemp) = 1; call FUNC(update_solution_setup)); }; class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_2: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 { idc=15002; - x="0.550*safezoneW+safezoneX+0.18"; + x="0.550*safeZoneW+safeZoneX+0.18"; text="2"; action=QUOTE(GVAR(currentScopeClickNumberTemp) = 2; call FUNC(update_solution_setup)); }; class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_3: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 { idc=15003; - x="0.550*safezoneW+safezoneX+0.22"; + x="0.550*safeZoneW+safeZoneX+0.22"; text="3"; action=QUOTE(GVAR(currentScopeClickNumberTemp) = 3; call FUNC(update_solution_setup)); }; class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_4: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 { idc=15004; - x="0.550*safezoneW+safezoneX+0.26"; + x="0.550*safeZoneW+safeZoneX+0.26"; text="4"; action=QUOTE(GVAR(currentScopeClickNumberTemp) = 4; call FUNC(update_solution_setup)); }; class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_8: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 { idc=15005; - x="0.550*safezoneW+safezoneX+0.30"; + x="0.550*safeZoneW+safeZoneX+0.30"; text="8"; action=QUOTE(GVAR(currentScopeClickNumberTemp) = 8; call FUNC(update_solution_setup)); }; class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_10: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 { idc=15006; - x="0.550*safezoneW+safezoneX+0.34"; + x="0.550*safeZoneW+safeZoneX+0.34"; text="10"; action=QUOTE(GVAR(currentScopeClickNumberTemp) = 10; call FUNC(update_solution_setup)); }; @@ -1464,53 +1464,53 @@ class ATragMX_Display { style=64; w="0.25"; h="0.07"; - x="0.550*safezoneW+safezoneX+0.13"; - y="0.265*safezoneH+safezoneY+0.42"; + x="0.550*safeZoneW+safeZoneX+0.13"; + y="0.265*safeZoneH+safeZoneY+0.42"; text="Clicks per"; }; class TEXT_SOLUTION_SETUP_CLICKS_PER_TMOA: TEXT_TARGET_A { idc=15008; w="0.05"; - x="0.550*safezoneW+safezoneX+0.15"; - y="0.265*safezoneH+safezoneY+0.45"; + x="0.550*safeZoneW+safeZoneX+0.15"; + y="0.265*safeZoneH+safeZoneY+0.45"; text="TMOA"; action=QUOTE(GVAR(currentScopeClickUnitTemp) = 0; call FUNC(update_solution_setup)); }; class TEXT_SOLUTION_SETUP_CLICKS_PER_SMOA: TEXT_SOLUTION_SETUP_CLICKS_PER_TMOA { idc=15009; - x="0.550*safezoneW+safezoneX+0.23"; + x="0.550*safeZoneW+safeZoneX+0.23"; text="SMOA"; action=QUOTE(GVAR(currentScopeClickUnitTemp) = 1; call FUNC(update_solution_setup)); }; class TEXT_SOLUTION_SETUP_CLICKS_PER_MILS: TEXT_SOLUTION_SETUP_CLICKS_PER_TMOA { idc=15010; - x="0.550*safezoneW+safezoneX+0.31"; + x="0.550*safeZoneW+safeZoneX+0.31"; text="MILS"; action=QUOTE(GVAR(currentScopeClickUnitTemp) = 2; call FUNC(update_solution_setup)); }; class TEXT_SOLUTION_SETUP_DONE: TEXT_TARGET_SPEED_ASSIST_DONE { idc=15011; - x="0.550*safezoneW+safezoneX+0.18"; - y="0.265*safezoneH+safezoneY+0.55"; + x="0.550*safeZoneW+safeZoneX+0.18"; + y="0.265*safeZoneH+safeZoneY+0.55"; action=QUOTE(1 call FUNC(toggle_solution_setup)); }; class TEXT_SOLUTION_SETUP_CANCEL: TEXT_TARGET_SPEED_ASSIST_CANCEL { idc=15012; - x="0.550*safezoneW+safezoneX+0.26"; - y="0.265*safezoneH+safezoneY+0.55"; + x="0.550*safeZoneW+safeZoneX+0.26"; + y="0.265*safeZoneH+safeZoneY+0.55"; action=QUOTE(0 call FUNC(toggle_solution_setup)); }; class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE: TEXT_BORE_HEIGHT { idc=16000; w="0.22"; - y="0.265*safezoneH+safezoneY+0.25"; + y="0.265*safeZoneH+safeZoneY+0.25"; sizeEx="0.022"; text="Temperature"; }; class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE { idc=16001; - x="0.550*safezoneW+safezoneX+0.215"; + x="0.550*safeZoneW+safeZoneX+0.215"; sizeEx="0.022"; text="Muzzle velocity"; }; @@ -1518,73 +1518,73 @@ class ATragMX_Display { idc=160021; w="0.082"; h="0.035"; - x="0.550*safezoneW+safezoneX+0.128"; - y="0.265*safezoneH+safezoneY+0.29"; + x="0.550*safeZoneW+safeZoneX+0.128"; + y="0.265*safeZoneH+safeZoneY+0.29"; text="0"; }; class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_2: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { idc=160022; - y="0.265*safezoneH+safezoneY+0.325"; + y="0.265*safeZoneH+safeZoneY+0.325"; }; class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_3: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { idc=160023; - y="0.265*safezoneH+safezoneY+0.360"; + y="0.265*safeZoneH+safeZoneY+0.360"; }; class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_4: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { idc=160024; - y="0.265*safezoneH+safezoneY+0.395"; + y="0.265*safeZoneH+safeZoneY+0.395"; }; class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_5: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { idc=160025; - y="0.265*safezoneH+safezoneY+0.430"; + y="0.265*safeZoneH+safeZoneY+0.430"; }; class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_6: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { idc=160026; - y="0.265*safezoneH+safezoneY+0.465"; + y="0.265*safeZoneH+safeZoneY+0.465"; }; class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_7: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { idc=160027; - y="0.265*safezoneH+safezoneY+0.500"; + y="0.265*safeZoneH+safeZoneY+0.500"; }; class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_1: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { idc=160031; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_2: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_2 { idc=160032; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_3: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_3 { idc=160033; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_4: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_4 { idc=160034; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_5: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_5 { idc=160035; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_6: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_6 { idc=160036; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_7: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_7 { idc=160037; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_MUZZLE_VELOCITY_DATA_CLEAR: TEXT_TARGET_DATA_NEXT { idc=16004; style=ST_CENTER; h="0.035"; - y="0.265*safezoneH+safezoneY+0.3625"; + y="0.265*safeZoneH+safeZoneY+0.3625"; text="Clear"; action=QUOTE(call FUNC(clear_muzzle_velocity_data)); }; class TEXT_MUZZLE_VELOCITY_DATA_QUESTIONMARK: TEXT_MUZZLE_VELOCITY_DATA_CLEAR { idc=16005; - y="0.265*safezoneH+safezoneY+0.430"; + y="0.265*safeZoneH+safeZoneY+0.430"; text="?"; action=""; }; @@ -1606,14 +1606,14 @@ class ATragMX_Display { class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE: TEXT_BORE_HEIGHT { idc=17000; w="0.22"; - x="0.550*safezoneW+safezoneX+0.15"; - y="0.265*safezoneH+safezoneY+0.25"; + x="0.550*safeZoneW+safeZoneX+0.15"; + y="0.265*safeZoneH+safeZoneY+0.25"; sizeEx="0.022"; text="Meters"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE { idc=17001; - x="0.550*safezoneW+safezoneX+0.235"; + x="0.550*safeZoneW+safeZoneX+0.235"; sizeEx="0.022"; text="BC-Coef"; }; @@ -1621,75 +1621,75 @@ class ATragMX_Display { idc=170021; w="0.082"; h="0.035"; - x="0.550*safezoneW+safezoneX+0.128"; - y="0.265*safezoneH+safezoneY+0.29"; + x="0.550*safeZoneW+safeZoneX+0.128"; + y="0.265*safeZoneH+safeZoneY+0.29"; text="0"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_2: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { idc=170022; - y="0.265*safezoneH+safezoneY+0.325"; + y="0.265*safeZoneH+safeZoneY+0.325"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_3: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { idc=170023; - y="0.265*safezoneH+safezoneY+0.360"; + y="0.265*safeZoneH+safeZoneY+0.360"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_4: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { idc=170024; - y="0.265*safezoneH+safezoneY+0.395"; + y="0.265*safeZoneH+safeZoneY+0.395"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_5: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { idc=170025; - y="0.265*safezoneH+safezoneY+0.430"; + y="0.265*safeZoneH+safeZoneY+0.430"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_6: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { idc=170026; - y="0.265*safezoneH+safezoneY+0.465"; + y="0.265*safeZoneH+safeZoneY+0.465"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_7: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { idc=170027; - y="0.265*safezoneH+safezoneY+0.500"; + y="0.265*safeZoneH+safeZoneY+0.500"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_1: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { idc=170031; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_2: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_2 { idc=170032; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_3: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_3 { idc=170033; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_4: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_4 { idc=170034; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_5: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_5 { idc=170035; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_6: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_6 { idc=170036; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_7: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_7 { idc=170037; - x="0.550*safezoneW+safezoneX+0.225"; + x="0.550*safeZoneW+safeZoneX+0.225"; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_QUESTIONMARK: TEXT_TARGET_DATA_NEXT { idc=17004; style=ST_CENTER; w="0.04"; h="0.035"; - y="0.265*safezoneH+safezoneY+0.35"; + y="0.265*safeZoneH+safeZoneY+0.35"; text="?"; action=""; }; class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_CLEAR: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_QUESTIONMARK { idc=17005; w="0.07"; - y="0.265*safezoneH+safezoneY+0.4175"; + y="0.265*safeZoneH+safeZoneY+0.4175"; text="Clear"; action=QUOTE(call FUNC(clear_c1_ballistic_coefficient_data)); }; @@ -1711,8 +1711,8 @@ class ATragMX_Display { class TEXT_TRUING_DROP_ZERO_RANGE: ATragMX_RscText { idc=18000; style=ST_LEFT; - x="0.550*safezoneW+safezoneX+0.115"; - y="0.265*safezoneH+safezoneY+0.220"; + x="0.550*safeZoneW+safeZoneX+0.115"; + y="0.265*safeZoneH+safeZoneY+0.220"; w="0.135"; h="0.03"; sizeEx="0.025"; @@ -1721,29 +1721,29 @@ class ATragMX_Display { class TEXT_TRUING_DROP_DROP_UNIT: TEXT_TRUING_DROP_ZERO_RANGE { idc=18001; style=ST_LEFT; - x="0.550*safezoneW+safezoneX+0.25"; + x="0.550*safeZoneW+safeZoneX+0.25"; text="Drop=mil"; }; class TEXT_TRUING_DROP_TARGET_RANGE: TEXT_TRUING_DROP_ZERO_RANGE { idc=18002; - y="0.265*safezoneH+safezoneY+0.35"; + y="0.265*safeZoneH+safeZoneY+0.35"; sizeEx="0.027"; text="Target Range"; }; class TEXT_TRUING_DROP_DROP: TEXT_TRUING_DROP_TARGET_RANGE { idc=18003; w="0.07"; - y="0.265*safezoneH+safezoneY+0.40"; + y="0.265*safeZoneH+safeZoneY+0.40"; text="Drop"; }; class TEXT_TRUING_DROP_MUZZLE_VELOCITY: TEXT_TRUING_DROP_DROP { idc=18004; - y="0.265*safezoneH+safezoneY+0.50"; + y="0.265*safeZoneH+safeZoneY+0.50"; text="MV"; }; class TEXT_TRUING_DROP_C1_BALLISTIC_COEFFICIENT: TEXT_TRUING_DROP_DROP { idc=18005; - y="0.265*safezoneH+safezoneY+0.55"; + y="0.265*safeZoneH+safeZoneY+0.55"; text="C1"; }; class TEXT_TRUING_DROP_DROP_OUTPUT: ATragMX_RscEdit { @@ -1752,31 +1752,31 @@ class ATragMX_Display { colorBackground[]={0.15,0.21,0.23,0.3}; colorDisabled[]={0,0,0,1}; w="0.06"; - y="0.265*safezoneH+safezoneY+0.40"; - x="0.550*safezoneW+safezoneX+0.17"; + y="0.265*safeZoneH+safeZoneY+0.40"; + x="0.550*safeZoneW+safeZoneX+0.17"; text=""; }; class TEXT_TRUING_DROP_MUZZLE_VELOCITY_OUTPUT: TEXT_TRUING_DROP_DROP_OUTPUT { idc=18007; - y="0.265*safezoneH+safezoneY+0.50"; + y="0.265*safeZoneH+safeZoneY+0.50"; text=""; }; class TEXT_TRUING_DROP_C1_BALLISTIC_COEFFICIENT_OUTPUT: TEXT_TRUING_DROP_DROP_OUTPUT { idc=18008; - y="0.265*safezoneH+safezoneY+0.55"; + y="0.265*safeZoneH+safeZoneY+0.55"; text=""; }; class TEXT_TRUING_DROP_SUPER: TEXT_TARGET_A { idc=18009; w="0.06"; - x="0.550*safezoneW+safezoneX+0.25"; - y="0.265*safezoneH+safezoneY+0.30"; + x="0.550*safeZoneW+safeZoneX+0.25"; + y="0.265*safeZoneH+safeZoneY+0.30"; text="SUPER"; action=QUOTE(GVAR(truingDropMode) = 0; call FUNC(update_truing_drop_selection)); }; class TEXT_TRUING_DROP_SUB: TEXT_TRUING_DROP_SUPER { idc=18010; - x="0.550*safezoneW+safezoneX+0.32"; + x="0.550*safeZoneW+safeZoneX+0.32"; text="SUB"; action=QUOTE(GVAR(truingDropMode) = 1; call FUNC(update_truing_drop_selection)); }; @@ -1785,56 +1785,56 @@ class ATragMX_Display { style=QUOTE(ST_WITH_RECT+ST_RIGHT); colorDisabled[]={0,0,0,0.6}; w="0.06"; - x="0.550*safezoneW+safezoneX+0.25"; - y="0.265*safezoneH+safezoneY+0.35"; + x="0.550*safeZoneW+safeZoneX+0.25"; + y="0.265*safeZoneH+safeZoneY+0.35"; }; class TEXT_TRUING_DROP_TARGET_RANGE_SUB_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUPER_INPUT { idc=18012; - x="0.550*safezoneW+safezoneX+0.32"; + x="0.550*safeZoneW+safeZoneX+0.32"; }; class TEXT_TRUING_DROP_DROP_SUPER_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUPER_INPUT { idc=18013; - y="0.265*safezoneH+safezoneY+0.40"; + y="0.265*safeZoneH+safeZoneY+0.40"; }; class TEXT_TRUING_DROP_DROP_SUB_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUB_INPUT { idc=18014; - y="0.265*safezoneH+safezoneY+0.40"; + y="0.265*safeZoneH+safeZoneY+0.40"; }; class TEXT_TRUING_DROP_CALC: TEXT_GUN_LIST { idc=18015; style=ST_CENTER; w="0.11"; - x="0.550*safezoneW+safezoneX+0.26"; - y="0.265*safezoneH+safezoneY+0.45"; + x="0.550*safeZoneW+safeZoneX+0.26"; + y="0.265*safeZoneH+safeZoneY+0.45"; text="Calc"; action=QUOTE(true call FUNC(calculate_truing_drop)); }; class TEXT_TRUING_DROP_MV_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUPER_INPUT { idc=18016; - y="0.265*safezoneH+safezoneY+0.50"; + y="0.265*safeZoneH+safeZoneY+0.50"; }; class TEXT_TRUING_DROP_C1_BALLISTIC_COEFFICIENT_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUB_INPUT { idc=18017; - y="0.265*safezoneH+safezoneY+0.55"; + y="0.265*safeZoneH+safeZoneY+0.55"; }; class TEXT_TRUING_DROP_ACCEPT: TEXT_GUN_LIST { idc=18018; w="0.085"; h="0.04"; - x="0.550*safezoneW+safezoneX+0.125"; - y="0.265*safezoneH+safezoneY+0.60"; + x="0.550*safeZoneW+safeZoneX+0.125"; + y="0.265*safeZoneH+safeZoneY+0.60"; text="Accept"; action=QUOTE(1 call FUNC(toggle_truing_drop)); }; class TEXT_TRUING_DROP_CANCEL: TEXT_TRUING_DROP_ACCEPT { idc=18019; - x="0.550*safezoneW+safezoneX+0.210"; + x="0.550*safeZoneW+safeZoneX+0.210"; text="Cancel"; action=QUOTE(0 call FUNC(toggle_truing_drop)); }; class TEXT_TRUING_DROP_RESTORE: TEXT_TRUING_DROP_CANCEL { idc=18020; - x="0.550*safezoneW+safezoneX+0.29525"; + x="0.550*safeZoneW+safeZoneX+0.29525"; text="Restore"; action=QUOTE(true call FUNC(restore_truing_drop)); }; diff --git a/addons/atragmx/functions/fnc_calculate_solution.sqf b/addons/atragmx/functions/fnc_calculate_solution.sqf index 5f09fb35b1b..7b56217799d 100644 --- a/addons/atragmx/functions/fnc_calculate_solution.sqf +++ b/addons/atragmx/functions/fnc_calculate_solution.sqf @@ -110,8 +110,8 @@ _bulletPos set [1, 0]; _bulletPos set [2, -(_boreHeight / 100)]; _bulletVelocity set [0, 0]; -_bulletVelocity set [1, Cos(_scopeBaseAngle) * _muzzleVelocity]; -_bulletVelocity set [2, Sin(_scopeBaseAngle) * _muzzleVelocity]; +_bulletVelocity set [1, cos(_scopeBaseAngle) * _muzzleVelocity]; +_bulletVelocity set [2, sin(_scopeBaseAngle) * _muzzleVelocity]; while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { _bulletSpeed = vectorMagnitude _bulletVelocity; @@ -153,7 +153,7 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { _windage1 = - atan(_tx / _trueRange); _windDrift = (_wind2 select 0) * (_TOF - _trueRange / _muzzleVelocity); _windage2 = - atan(_windDrift / _trueRange); - _lead = (_targetSpeed * _TOF) / (Tan(MRAD_TO_DEG(1)) * _trueRange); + _lead = (_targetSpeed * _TOF) / (tan(MRAD_TO_DEG(1)) * _trueRange); }; _kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); _kineticEnergy = _kineticEnergy * 0.737562149; @@ -188,7 +188,7 @@ if (_targetRange != 0) then { _windage1 = - atan(_tx / _targetRange); _windDrift = (_wind2 select 0) * (_TOF - _targetRange / _muzzleVelocity); _windage2 = - atan(_windDrift / _targetRange); - _lead = (_targetSpeed * _TOF) / (Tan(MRAD_TO_DEG(1)) * _targetRange); + _lead = (_targetSpeed * _TOF) / (tan(MRAD_TO_DEG(1)) * _targetRange); }; _kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); diff --git a/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf b/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf index dc9c62c3fc5..5ad543ccc94 100644 --- a/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf @@ -68,7 +68,7 @@ switch (_this) do { }; }; - ctrlSetText [7010, Str(Round(_targetSize * 100) / 100)]; + ctrlSetText [7010, str(round(_targetSize * 100) / 100)]; }; case 1: { if (_estRange > 0) then { @@ -87,13 +87,13 @@ switch (_this) do { }; }; - ctrlSetText [7011, Str(Round(_imageSize * 100) / 100)]; + ctrlSetText [7011, str(round(_imageSize * 100) / 100)]; }; case 2: { if (tan(_imageSize) != 0) then { _estRange = _targetSize / tan(_imageSize); }; - ctrlSetText [7013, Str(Round(_estRange))]; + ctrlSetText [7013, str(round(_estRange))]; }; }; diff --git a/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf b/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf index 69af9eba165..25106c794e9 100644 --- a/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf +++ b/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf @@ -44,4 +44,4 @@ if (GVAR(currentUnit) != 2) then { _estSpeed = _estSpeed * 2.23693629; }; -ctrlSetText [8007, Str(Round(_estSpeed * 10) / 10)]; +ctrlSetText [8007, str(round(_estSpeed * 10) / 10)]; diff --git a/addons/atragmx/functions/fnc_calculate_truing_drop.sqf b/addons/atragmx/functions/fnc_calculate_truing_drop.sqf index 5191848d050..5f7adee2838 100644 --- a/addons/atragmx/functions/fnc_calculate_truing_drop.sqf +++ b/addons/atragmx/functions/fnc_calculate_truing_drop.sqf @@ -29,8 +29,8 @@ if (_parseInput) then { _transonicRange = _transonicRange * 0.9144; _subsonicRange = _subsonicRange * 0.9144; }; - _transonicRange = Round(_transonicRange); - _subsonicRange = Round(_subsonicRange); + _transonicRange = round(_transonicRange); + _subsonicRange = round(_subsonicRange); _subsonicRange = _transonicRange max _subsonicRange; @@ -54,8 +54,8 @@ if (_parseInput) then { _subsonicDrop = _subsonicDrop / 1.047; }; }; - _transonicDrop = Round(_transonicDrop * 100) / 100; - _subsonicDrop = Round(_subsonicDrop * 100) / 100; + _transonicDrop = round(_transonicDrop * 100) / 100; + _subsonicDrop = round(_subsonicDrop * 100) / 100; _subsonicDrop = _transonicDrop max _subsonicDrop; }; @@ -67,11 +67,11 @@ if ((GVAR(truingDropDropData) select 0) == 0 || {[_transonicRange, _subsonicRang private _solutionInput = +GVAR(targetSolutionInput); if (_transonicRange == 0) then { - _transonicRange = Round(403 call FUNC(calculate_distance_at_velocity)); + _transonicRange = round(403 call FUNC(calculate_distance_at_velocity)); }; _solutionInput set [13, _transonicRange]; private _result1 = _solutionInput call FUNC(calculate_solution); - _transonicDrop = Round((_result1 select 0) * 100) / 100; + _transonicDrop = round((_result1 select 0) * 100) / 100; GVAR(truingDropRangeData) set [0, _transonicRange]; GVAR(truingDropDropData) set [1, _transonicDrop]; GVAR(truingDropReferenceDropData) set [0, _transonicDrop]; @@ -84,11 +84,11 @@ if ((GVAR(truingDropDropData) select 0) == 0 || {[_transonicRange, _subsonicRang } else { _subsonicRange = _subsonicRange + 200 * 1.0936133; }; - _subsonicRange = Round(_subsonicRange); + _subsonicRange = round(_subsonicRange); }; _solutionInput set [13, _subsonicRange]; private _result2 = _solutionInput call FUNC(calculate_solution); - _subsonicDrop = Round((_result2 select 0) * 100) / 100; + _subsonicDrop = round((_result2 select 0) * 100) / 100; GVAR(truingDropRangeData) set [1, _subsonicRange]; GVAR(truingDropDropData) set [2, _subsonicDrop]; GVAR(truingDropReferenceDropData) set [1, _subsonicDrop]; diff --git a/addons/atragmx/functions/fnc_parse_input.sqf b/addons/atragmx/functions/fnc_parse_input.sqf index 1c3ea3398a5..4f62f301160 100644 --- a/addons/atragmx/functions/fnc_parse_input.sqf +++ b/addons/atragmx/functions/fnc_parse_input.sqf @@ -100,11 +100,11 @@ if (GVAR(currentUnit) == 1) then { _targetRange = 25 max _targetRange min 3700; }; GVAR(targetRangeDirtyFlag) = GVAR(targetRangeDirtyFlag) || {_targetRange != GVAR(targetRange) select GVAR(currentTarget)}; -GVAR(latitude) set [GVAR(currentTarget), -90 max Round(parseNumber(ctrlText 140000)) min 90]; -GVAR(directionOfFire) set [GVAR(currentTarget), 0 max abs(Round(parseNumber(ctrlText 140010))) min 359]; +GVAR(latitude) set [GVAR(currentTarget), -90 max round(parseNumber(ctrlText 140000)) min 90]; +GVAR(directionOfFire) set [GVAR(currentTarget), 0 max abs(round(parseNumber(ctrlText 140010))) min 359]; GVAR(windSpeed1) set [GVAR(currentTarget), _windSpeed1]; GVAR(windSpeed2) set [GVAR(currentTarget), _windSpeed2]; -GVAR(windDirection) set [GVAR(currentTarget), 1 max Round(parseNumber(ctrlText 140030)) min 12]; +GVAR(windDirection) set [GVAR(currentTarget), 1 max round(parseNumber(ctrlText 140030)) min 12]; GVAR(targetSpeed) set [GVAR(currentTarget), _targetSpeed]; GVAR(targetRange) set [GVAR(currentTarget), _targetRange]; private _inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1; @@ -112,7 +112,7 @@ private _inclinationAngleDegree = -60 max round(parseNumber(ctrlText 140040)) mi if (_inclinationAngleDegree != GVAR(inclinationAngle) select GVAR(currentTarget)) then { GVAR(inclinationAngle) set [GVAR(currentTarget), _inclinationAngleDegree]; } else { - if (_inclinationAngleCosine != Round(cos(GVAR(inclinationAngle) select GVAR(currentTarget)) * 100) / 100) then { + if (_inclinationAngleCosine != round(cos(GVAR(inclinationAngle) select GVAR(currentTarget)) * 100) / 100) then { GVAR(inclinationAngle) set [GVAR(currentTarget), round(acos(_inclinationAngleCosine))]; }; }; diff --git a/addons/atragmx/functions/fnc_show_range_card_setup.sqf b/addons/atragmx/functions/fnc_show_range_card_setup.sqf index 15558ceb983..a4301f5b761 100644 --- a/addons/atragmx/functions/fnc_show_range_card_setup.sqf +++ b/addons/atragmx/functions/fnc_show_range_card_setup.sqf @@ -22,7 +22,7 @@ GVAR(showRangeCardSetup) = _this; if (_this) then { ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 10006); - ctrlSetText [10003, Str(Round(GVAR(rangeCardStartRange)))]; - ctrlSetText [10004, Str(Round(GVAR(rangeCardEndRange)))]; - ctrlSetText [10005, Str(Round(GVAR(rangeCardIncrement)))]; + ctrlSetText [10003, str(round(GVAR(rangeCardStartRange)))]; + ctrlSetText [10004, str(round(GVAR(rangeCardEndRange)))]; + ctrlSetText [10005, str(round(GVAR(rangeCardIncrement)))]; }; diff --git a/addons/atragmx/functions/fnc_show_target_range_assist.sqf b/addons/atragmx/functions/fnc_show_target_range_assist.sqf index 83516ef5c6a..b13352d22f9 100644 --- a/addons/atragmx/functions/fnc_show_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_show_target_range_assist.sqf @@ -21,8 +21,8 @@ GVAR(showTargetRangeAssist) = _this; if (_this) then { ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 7018); - ctrlSetText [7012, Str(parseNumber(ctrlText 320))]; - ctrlSetText [7013, Str(parseNumber(ctrlText 340))]; + ctrlSetText [7012, str(parseNumber(ctrlText 320))]; + ctrlSetText [7013, str(parseNumber(ctrlText 340))]; if (GVAR(currentUnit) == 1) then { ctrlSetText [7016, "Yards"]; diff --git a/addons/atragmx/functions/fnc_show_target_speed_assist.sqf b/addons/atragmx/functions/fnc_show_target_speed_assist.sqf index 3efa6ed6d43..c2b34bd9081 100644 --- a/addons/atragmx/functions/fnc_show_target_speed_assist.sqf +++ b/addons/atragmx/functions/fnc_show_target_speed_assist.sqf @@ -22,7 +22,7 @@ GVAR(showTargetSpeedAssist) = _this; if (_this) then { ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 8012); - ctrlSetText [8004, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; + ctrlSetText [8004, str(round((GVAR(targetRange) select GVAR(currentTarget))))]; if (GVAR(currentUnit) == 1) then { ctrlSetText [8008, "Yards"]; diff --git a/addons/atragmx/functions/fnc_show_truing_drop.sqf b/addons/atragmx/functions/fnc_show_truing_drop.sqf index 5e7f60f4d4e..f75d3f7758c 100644 --- a/addons/atragmx/functions/fnc_show_truing_drop.sqf +++ b/addons/atragmx/functions/fnc_show_truing_drop.sqf @@ -21,9 +21,9 @@ GVAR(showTruingDrop) = _this; if (_this) then { if (GVAR(currentUnit) == 2) then { - ctrlSetText [18000, format["ZR=%1meters", Round(GVAR(workingMemory) select 2)]]; + ctrlSetText [18000, format["ZR=%1meters", round(GVAR(workingMemory) select 2)]]; } else { - ctrlSetText [18000, format["ZR=%1yards", Round((GVAR(workingMemory) select 2) * 1.0936133)]]; + ctrlSetText [18000, format["ZR=%1yards", round((GVAR(workingMemory) select 2) * 1.0936133)]]; }; private _dropUnit = GVAR(currentScopeUnit); if (_dropUnit == 3) then { diff --git a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf index 5408edee3af..40c0ac7cd8f 100644 --- a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf +++ b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf @@ -29,7 +29,7 @@ if !(ctrlVisible 9000) then { if !(GVAR(speedAssistTimer)) exitWith { GVAR(speedAssistTimer) = true; - ctrlSetText [8006, Str(Round((CBA_missionTime - _startTime) * 10) / 10)]; + ctrlSetText [8006, str(round((CBA_missionTime - _startTime) * 10) / 10)]; [] call FUNC(calculate_target_speed_assist); @@ -39,7 +39,7 @@ if !(ctrlVisible 9000) then { [_this select 1] call CBA_fnc_removePerFrameHandler; }; - ctrlSetText [9001, Str(Round((CBA_missionTime - _startTime) * 10) / 10)]; + ctrlSetText [9001, str(round((CBA_missionTime - _startTime) * 10) / 10)]; }, 0.1, [CBA_missionTime]] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf b/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf index 5c499b8b826..29c856013b4 100644 --- a/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf +++ b/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf @@ -20,9 +20,9 @@ if (ctrlVisible 10000) then { true call FUNC(show_range_card); if (_this == 1) then { - GVAR(rangeCardStartRange) = 0 max Round(parseNumber(ctrlText 10003)) min 3000; - GVAR(rangeCardEndRange) = 0 max Round(parseNumber(ctrlText 10004)) min 3000; - GVAR(rangeCardIncrement) = 1 max Round(parseNumber(ctrlText 10005)) min 3000; + GVAR(rangeCardStartRange) = 0 max round(parseNumber(ctrlText 10003)) min 3000; + GVAR(rangeCardEndRange) = 0 max round(parseNumber(ctrlText 10004)) min 3000; + GVAR(rangeCardIncrement) = 1 max round(parseNumber(ctrlText 10005)) min 3000; [] call FUNC(calculate_range_card); [] call FUNC(update_range_card); diff --git a/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf b/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf index 1e6c485e995..dd14f2ddcd0 100644 --- a/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf @@ -20,10 +20,10 @@ if (ctrlVisible 7000) then { true call FUNC(show_main_page); if (_this == 1) then { - ctrlSetText [320, Str(parseNumber(ctrlText 7012))]; - ctrlSetText [140040, Str(parseNumber(ctrlText 7012))]; - ctrlSetText [340, Str(parseNumber(ctrlText 7013))]; - ctrlSetText [140060, Str(parseNumber(ctrlText 7013))]; + ctrlSetText [320, str(parseNumber(ctrlText 7012))]; + ctrlSetText [140040, str(parseNumber(ctrlText 7012))]; + ctrlSetText [340, str(parseNumber(ctrlText 7013))]; + ctrlSetText [140060, str(parseNumber(ctrlText 7013))]; [] call FUNC(calculate_target_solution); }; } else { diff --git a/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf b/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf index 009074105e8..fec9e528e57 100644 --- a/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf +++ b/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf @@ -23,8 +23,8 @@ if (ctrlVisible 8000) then { [] call FUNC(calculate_target_speed_assist); private _targetSpeed = parseNumber(ctrlText 8007); if (_targetSpeed != 0) then { - ctrlSetText [330, Str(_targetSpeed)]; - ctrlSetText [140050, Str(_targetSpeed)]; + ctrlSetText [330, str(_targetSpeed)]; + ctrlSetText [140050, str(_targetSpeed)]; [] call FUNC(calculate_target_solution); }; }; diff --git a/addons/atragmx/functions/fnc_true_c1_ballistic_coefficient.sqf b/addons/atragmx/functions/fnc_true_c1_ballistic_coefficient.sqf index 84371ca8527..06824cc7a20 100644 --- a/addons/atragmx/functions/fnc_true_c1_ballistic_coefficient.sqf +++ b/addons/atragmx/functions/fnc_true_c1_ballistic_coefficient.sqf @@ -18,7 +18,7 @@ private _referenceDrop = GVAR(truingDropDropData) select 0; private _actualDrop = GVAR(truingDropDropData) select 2; -if (Round(_actualDrop * 10) / 10 == Round(_referenceDrop * 10) / 10) exitWith {}; +if (round(_actualDrop * 10) / 10 == round(_referenceDrop * 10) / 10) exitWith {}; private _step = 0.01; if (_actualDrop > _referenceDrop) then { diff --git a/addons/atragmx/functions/fnc_true_muzzle_velocity.sqf b/addons/atragmx/functions/fnc_true_muzzle_velocity.sqf index f8fb9e621c4..75e1fbdc78d 100644 --- a/addons/atragmx/functions/fnc_true_muzzle_velocity.sqf +++ b/addons/atragmx/functions/fnc_true_muzzle_velocity.sqf @@ -18,7 +18,7 @@ private _referenceDrop = GVAR(truingDropDropData) select 0; private _actualDrop = GVAR(truingDropDropData) select 1; -if (Round(_actualDrop * 10) / 10 == Round(_referenceDrop * 10) / 10) exitWith {}; +if (round(_actualDrop * 10) / 10 == round(_referenceDrop * 10) / 10) exitWith {}; private _step = 10; if (_actualDrop > _referenceDrop) then { diff --git a/addons/atragmx/functions/fnc_update_atmo_env_data.sqf b/addons/atragmx/functions/fnc_update_atmo_env_data.sqf index 340924b5aa7..3118bee2233 100644 --- a/addons/atragmx/functions/fnc_update_atmo_env_data.sqf +++ b/addons/atragmx/functions/fnc_update_atmo_env_data.sqf @@ -18,20 +18,20 @@ ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 13007); if (GVAR(currentUnit) == 2) then { - ctrlSetText [130040, Str(Round(GVAR(temperature) * 10) / 10)]; + ctrlSetText [130040, str(round(GVAR(temperature) * 10) / 10)]; } else { - ctrlSetText [130040, Str(Round((GVAR(temperature) * 1.8 + 32) * 10) / 10)]; + ctrlSetText [130040, str(round((GVAR(temperature) * 1.8 + 32) * 10) / 10)]; }; if (GVAR(currentUnit) == 2) then { - ctrlSetText [130050, Str(Round(GVAR(barometricPressure)))]; + ctrlSetText [130050, str(round(GVAR(barometricPressure)))]; } else { - ctrlSetText [130050, Str(Round(GVAR(barometricPressure) / 33.8638866667 * 100) / 100)]; + ctrlSetText [130050, str(round(GVAR(barometricPressure) / 33.8638866667 * 100) / 100)]; }; -ctrlSetText [130060, Str(Round(GVAR(relativeHumidity) * 100 * 10) / 10)]; +ctrlSetText [130060, str(round(GVAR(relativeHumidity) * 100 * 10) / 10)]; if (GVAR(currentUnit) == 2) then { - ctrlSetText [130030, Str(Round(GVAR(altitude)))]; + ctrlSetText [130030, str(round(GVAR(altitude)))]; } else { - ctrlSetText [130030, Str(Round(GVAR(altitude) * 3.2808399))]; + ctrlSetText [130030, str(round(GVAR(altitude) * 3.2808399))]; }; if (GVAR(currentUnit) == 2) then { diff --git a/addons/atragmx/functions/fnc_update_atmosphere.sqf b/addons/atragmx/functions/fnc_update_atmosphere.sqf index 7d523158925..ac04d19ba9a 100644 --- a/addons/atragmx/functions/fnc_update_atmosphere.sqf +++ b/addons/atragmx/functions/fnc_update_atmosphere.sqf @@ -16,18 +16,18 @@ */ if (GVAR(currentUnit) == 2) then { - ctrlSetText [200, Str(Round(GVAR(temperature) * 10) / 10)]; + ctrlSetText [200, str(round(GVAR(temperature) * 10) / 10)]; } else { - ctrlSetText [200, Str(Round((GVAR(temperature) * 1.8 + 32) * 10) / 10)]; + ctrlSetText [200, str(round((GVAR(temperature) * 1.8 + 32) * 10) / 10)]; }; if (GVAR(currentUnit) == 2) then { - ctrlSetText [210, Str(Round(GVAR(barometricPressure)))]; + ctrlSetText [210, str(round(GVAR(barometricPressure)))]; } else { - ctrlSetText [210, Str(Round(GVAR(barometricPressure) / 33.8638866667 * 100) / 100)]; + ctrlSetText [210, str(round(GVAR(barometricPressure) / 33.8638866667 * 100) / 100)]; }; -ctrlSetText [220, Str(Round(GVAR(relativeHumidity) * 100 * 10) / 10)]; +ctrlSetText [220, str(round(GVAR(relativeHumidity) * 100 * 10) / 10)]; if (GVAR(currentUnit) == 2) then { - ctrlSetText [230, Str(Round(GVAR(altitude)))]; + ctrlSetText [230, str(round(GVAR(altitude)))]; } else { - ctrlSetText [230, Str(Round(GVAR(altitude) * 3.2808399))]; + ctrlSetText [230, str(round(GVAR(altitude) * 3.2808399))]; }; diff --git a/addons/atragmx/functions/fnc_update_c1_ballistic_coefficient_data.sqf b/addons/atragmx/functions/fnc_update_c1_ballistic_coefficient_data.sqf index 4c0c6d7175b..886ad33ba97 100644 --- a/addons/atragmx/functions/fnc_update_c1_ballistic_coefficient_data.sqf +++ b/addons/atragmx/functions/fnc_update_c1_ballistic_coefficient_data.sqf @@ -17,9 +17,9 @@ // Distances if (GVAR(currentUnit) != 1) then { - {ctrlSetText [_x, Str(Round(((GVAR(workingMemory) select 19) select _forEachIndex) select 0))]} forEach [170021, 170022, 170023, 170024, 170025, 170026, 170027]; + {ctrlSetText [_x, str(round(((GVAR(workingMemory) select 19) select _forEachIndex) select 0))]} forEach [170021, 170022, 170023, 170024, 170025, 170026, 170027]; } else { - {ctrlSetText [_x, Str(Round((((GVAR(workingMemory) select 19) select _forEachIndex) select 0) * 1.0936133))]} forEach [170021, 170022, 170023, 170024, 170025, 170026, 170027]; + {ctrlSetText [_x, str(round((((GVAR(workingMemory) select 19) select _forEachIndex) select 0) * 1.0936133))]} forEach [170021, 170022, 170023, 170024, 170025, 170026, 170027]; }; // Ballistic coefficients -{ctrlSetText [_x, Str(Round((((GVAR(workingMemory) select 19) select _forEachIndex) select 1) * 1000) / 1000)]} forEach [170031, 170032, 170033, 170034, 170035, 170036, 170037]; +{ctrlSetText [_x, str(round((((GVAR(workingMemory) select 19) select _forEachIndex) select 1) * 1000) / 1000)]} forEach [170031, 170032, 170033, 170034, 170035, 170036, 170037]; diff --git a/addons/atragmx/functions/fnc_update_gun.sqf b/addons/atragmx/functions/fnc_update_gun.sqf index 5a5dab00fa8..67f726e92e6 100644 --- a/addons/atragmx/functions/fnc_update_gun.sqf +++ b/addons/atragmx/functions/fnc_update_gun.sqf @@ -17,34 +17,34 @@ ctrlSetText [1000, GVAR(workingMemory) select 0]; if (GVAR(currentUnit) != 2) then { - ctrlSetText [100, Str(Round((GVAR(workingMemory) select 5) / 2.54 * 100) / 100)]; + ctrlSetText [100, str(round((GVAR(workingMemory) select 5) / 2.54 * 100) / 100)]; } else { - ctrlSetText [100, Str(Round((GVAR(workingMemory) select 5) * 100) / 100)]; + ctrlSetText [100, str(round((GVAR(workingMemory) select 5) * 100) / 100)]; }; if (GVAR(currentUnit) != 2) then { - ctrlSetText [110, Str(Round((GVAR(workingMemory) select 12) * 15.4323584))]; + ctrlSetText [110, str(round((GVAR(workingMemory) select 12) * 15.4323584))]; } else { - ctrlSetText [110, Str(Round((GVAR(workingMemory) select 12) * 10) / 10)]; + ctrlSetText [110, str(round((GVAR(workingMemory) select 12) * 10) / 10)]; }; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - ctrlSetText [120, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; + ctrlSetText [120, str(round((GVAR(workingMemory) select 15) * 1000) / 1000)]; } else { - ctrlSetText [120, Str(Round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)]; + ctrlSetText [120, str(round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)]; }; if (GVAR(currentUnit) != 2) then { - ctrlSetText [130, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))]; + ctrlSetText [130, str(round((GVAR(workingMemory) select 1) * 3.2808399))]; } else { - ctrlSetText [130, Str(Round(GVAR(workingMemory) select 1))]; + ctrlSetText [130, str(round(GVAR(workingMemory) select 1))]; }; switch (GVAR(currentUnit)) do { case 0: { - ctrlSetText [140, format["*%1", Round(GVAR(workingMemory) select 2)]]; + ctrlSetText [140, format["*%1", round(GVAR(workingMemory) select 2)]]; }; case 1: { - ctrlSetText [140, Str(Round((GVAR(workingMemory) select 2) * 1.0936133))]; + ctrlSetText [140, str(round((GVAR(workingMemory) select 2) * 1.0936133))]; }; case 2: { - ctrlSetText [140, Str(Round(GVAR(workingMemory) select 2))]; + ctrlSetText [140, str(round(GVAR(workingMemory) select 2))]; }; }; [] call FUNC(update_scope_unit); diff --git a/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf b/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf index 59bd0149733..56347ac6db6 100644 --- a/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf +++ b/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf @@ -18,39 +18,39 @@ ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 12008); if (GVAR(currentUnit) != 2) then { - ctrlSetText [120000, Str(Round((GVAR(workingMemory) select 5) / 2.54 * 100) / 100)]; + ctrlSetText [120000, str(round((GVAR(workingMemory) select 5) / 2.54 * 100) / 100)]; } else { - ctrlSetText [120000, Str(Round((GVAR(workingMemory) select 5) * 100) / 100)]; + ctrlSetText [120000, str(round((GVAR(workingMemory) select 5) * 100) / 100)]; }; if (GVAR(currentUnit) != 2) then { - ctrlSetText [120010, Str(Round((GVAR(workingMemory) select 12) * 15.4323584))]; + ctrlSetText [120010, str(round((GVAR(workingMemory) select 12) * 15.4323584))]; } else { - ctrlSetText [120010, Str(Round((GVAR(workingMemory) select 12) * 10) / 10)]; + ctrlSetText [120010, str(round((GVAR(workingMemory) select 12) * 10) / 10)]; }; if (GVAR(currentUnit) != 2) then { - ctrlSetText [120020, Str(Round((GVAR(workingMemory) select 13) / 10 / 2.54 * 1000) / 1000)]; + ctrlSetText [120020, str(round((GVAR(workingMemory) select 13) / 10 / 2.54 * 1000) / 1000)]; } else { - ctrlSetText [120020, Str(Round((GVAR(workingMemory) select 13) / 10 * 1000) / 1000)]; + ctrlSetText [120020, str(round((GVAR(workingMemory) select 13) / 10 * 1000) / 1000)]; }; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - ctrlSetText [120030, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; + ctrlSetText [120030, str(round((GVAR(workingMemory) select 15) * 1000) / 1000)]; } else { - ctrlSetText [120030, Str(Round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)]; + ctrlSetText [120030, str(round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)]; }; if (GVAR(currentUnit) != 2) then { - ctrlSetText [120040, Str(Round((GVAR(workingMemory) select 14) / 2.54 * 10) / 10)]; + ctrlSetText [120040, str(round((GVAR(workingMemory) select 14) / 2.54 * 10) / 10)]; } else { - ctrlSetText [120040, Str(Round((GVAR(workingMemory) select 14) * 100) / 100)]; + ctrlSetText [120040, str(round((GVAR(workingMemory) select 14) * 100) / 100)]; }; if (GVAR(currentUnit) != 2) then { - ctrlSetText [120050, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))]; + ctrlSetText [120050, str(round((GVAR(workingMemory) select 1) * 3.2808399))]; } else { - ctrlSetText [120050, Str(Round(GVAR(workingMemory) select 1))]; + ctrlSetText [120050, str(round(GVAR(workingMemory) select 1))]; }; if (GVAR(currentUnit) == 1) then { - ctrlSetText [120060, Str(Round((GVAR(workingMemory) select 2) * 1.0936133))]; + ctrlSetText [120060, str(round((GVAR(workingMemory) select 2) * 1.0936133))]; } else { - ctrlSetText [120060, Str(Round(GVAR(workingMemory) select 2))]; + ctrlSetText [120060, str(round(GVAR(workingMemory) select 2))]; }; if (GVAR(currentUnit) == 0) then { ctrlSetText [120061, "*"]; diff --git a/addons/atragmx/functions/fnc_update_inclination_angle.sqf b/addons/atragmx/functions/fnc_update_inclination_angle.sqf index 532b3d94e8f..b7ae40160c6 100644 --- a/addons/atragmx/functions/fnc_update_inclination_angle.sqf +++ b/addons/atragmx/functions/fnc_update_inclination_angle.sqf @@ -19,7 +19,7 @@ private _inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1; private _inclinationAngleDegree = -60 max parseNumber(ctrlText 140040) min 60; if (_this == 0) then { - ctrlSetText [140040, Str(round(acos(_inclinationAngleCosine)))]; + ctrlSetText [140040, str(round(acos(_inclinationAngleCosine)))]; } else { - ctrlSetText [140041, Str(round(cos(_inclinationAngleDegree) * 100) / 100)]; + ctrlSetText [140041, str(round(cos(_inclinationAngleDegree) * 100) / 100)]; }; diff --git a/addons/atragmx/functions/fnc_update_muzzle_velocity_data.sqf b/addons/atragmx/functions/fnc_update_muzzle_velocity_data.sqf index 23193aa9036..36af09d6427 100644 --- a/addons/atragmx/functions/fnc_update_muzzle_velocity_data.sqf +++ b/addons/atragmx/functions/fnc_update_muzzle_velocity_data.sqf @@ -17,12 +17,12 @@ if (GVAR(currentUnit) == 2) then { // Temperatures - {ctrlSetText [_x, Str(Round((((GVAR(workingMemory) select 18) select _forEachIndex) select 0) * 10) / 10)]} forEach [160021, 160022, 160023, 160024, 160025, 160026, 160027]; + {ctrlSetText [_x, str(round((((GVAR(workingMemory) select 18) select _forEachIndex) select 0) * 10) / 10)]} forEach [160021, 160022, 160023, 160024, 160025, 160026, 160027]; // Muzzle velocities - {ctrlSetText [_x, Str(Round(((GVAR(workingMemory) select 18) select _forEachIndex) select 1))]} forEach [160031, 160032, 160033, 160034, 160035, 160036, 160037]; + {ctrlSetText [_x, str(round(((GVAR(workingMemory) select 18) select _forEachIndex) select 1))]} forEach [160031, 160032, 160033, 160034, 160035, 160036, 160037]; } else { // Temperatures - {ctrlSetText [_x, Str(Round(((((GVAR(workingMemory) select 18) select _forEachIndex) select 0) * 1.8 + 32) * 10) / 10)]} forEach [160021, 160022, 160023, 160024, 160025, 160026, 160027]; + {ctrlSetText [_x, str(round(((((GVAR(workingMemory) select 18) select _forEachIndex) select 0) * 1.8 + 32) * 10) / 10)]} forEach [160021, 160022, 160023, 160024, 160025, 160026, 160027]; // Muzzle velocities - {ctrlSetText [_x, Str(Round((((GVAR(workingMemory) select 18) select _forEachIndex) select 1) * 3.2808399))]} forEach [160031, 160032, 160033, 160034, 160035, 160036, 160037]; + {ctrlSetText [_x, str(round((((GVAR(workingMemory) select 18) select _forEachIndex) select 1) * 3.2808399))]} forEach [160031, 160032, 160033, 160034, 160035, 160036, 160037]; }; diff --git a/addons/atragmx/functions/fnc_update_range_card.sqf b/addons/atragmx/functions/fnc_update_range_card.sqf index 066bd651746..e280c7d137a 100644 --- a/addons/atragmx/functions/fnc_update_range_card.sqf +++ b/addons/atragmx/functions/fnc_update_range_card.sqf @@ -59,16 +59,16 @@ private _speedOfSound = GVAR(temperature) call EFUNC(weather,calculateSpeedOfSou private _clickNumber = GVAR(workingMemory) select 8; private _clickInterval = _clickSize / _clickNumber; - _elevation = Round(_elevation / _clickInterval); - _windage1 = Round(_windage1 / _clickInterval); - _windage2 = Round(_windage2 / _clickInterval); + _elevation = round(_elevation / _clickInterval); + _windage1 = round(_windage1 / _clickInterval); + _windage2 = round(_windage2 / _clickInterval); }; }; - private _elevationOutput = Str(Round(_elevation * 100) / 100); - private _windageOutput = Str(Round(_windage1 * 100) / 100); + private _elevationOutput = str(round(_elevation * 100) / 100); + private _windageOutput = str(round(_windage1 * 100) / 100); - private _rangeOutput = Str(_range); + private _rangeOutput = str(_range); if (_velocity < _speedOfSound) then { _rangeOutput = _rangeOutput + "*"; }; @@ -80,19 +80,19 @@ private _speedOfSound = GVAR(temperature) call EFUNC(weather,calculateSpeedOfSou switch (GVAR(rangeCardCurrentColumn)) do { case 0: { if (GVAR(showWind2)) then { - _lastColumnOutput = Str(Round(_windage2 * 100) / 100); + _lastColumnOutput = str(round(_windage2 * 100) / 100); } else { - _lastColumnOutput = Str(Round(_lead * 100) / 100); + _lastColumnOutput = str(round(_lead * 100) / 100); }; }; case 1: { - _lastColumnOutput = Str(Round(_velocity)); + _lastColumnOutput = str(round(_velocity)); }; case 2: { - _lastColumnOutput = Str(Round(_kineticEnergy)); + _lastColumnOutput = str(round(_kineticEnergy)); }; case 3: { - _lastColumnOutput = Str(Round(_TOF * 100) / 100); + _lastColumnOutput = str(round(_TOF * 100) / 100); } }; diff --git a/addons/atragmx/functions/fnc_update_result.sqf b/addons/atragmx/functions/fnc_update_result.sqf index cfd8f460a93..3e8d4ef9bd3 100644 --- a/addons/atragmx/functions/fnc_update_result.sqf +++ b/addons/atragmx/functions/fnc_update_result.sqf @@ -69,16 +69,16 @@ switch (GVAR(currentScopeUnit)) do { private _clickNumber = GVAR(workingMemory) select 8; private _clickInterval = _clickSize / _clickNumber; - _elevationAbs = Round(_elevationAbs / _clickInterval); - _windageAbs = Round(_windageAbs / _clickInterval); + _elevationAbs = round(_elevationAbs / _clickInterval); + _windageAbs = round(_windageAbs / _clickInterval); - _wind2 = Round(_wind2 / _clickInterval); + _wind2 = round(_wind2 / _clickInterval); - _elevationRel = Round(_elevationRel / _clickInterval); - _windageRel = Round(_windageRel / _clickInterval); + _elevationRel = round(_elevationRel / _clickInterval); + _windageRel = round(_windageRel / _clickInterval); - _elevationCur = Round(_elevationCur / _clickInterval); - _windageCur = Round(_windageCur / _clickInterval); + _elevationCur = round(_elevationCur / _clickInterval); + _windageCur = round(_windageCur / _clickInterval); }; }; @@ -88,7 +88,7 @@ if (GVAR(showWind2)) then { ctrlSetText [42, "Lead"]; }; -_elevationAbs = Round(_elevationAbs * 100) / 100; +_elevationAbs = round(_elevationAbs * 100) / 100; if (_elevationAbs > 0) then { ctrlSetText [400, str abs _elevationAbs]; } else { @@ -98,7 +98,7 @@ if (_elevationAbs > 0) then { ctrlSetText [400, "0.0"]; }; }; -_elevationRel = Round(_elevationRel * 100) / 100; +_elevationRel = round(_elevationRel * 100) / 100; if (_elevationRel > 0) then { ctrlSetText [401, str abs _elevationRel]; } else { @@ -108,7 +108,7 @@ if (_elevationRel > 0) then { ctrlSetText [401, "0.0"]; }; }; -_elevationCur = Round(_elevationCur * 100) / 100; +_elevationCur = round(_elevationCur * 100) / 100; if (_elevationCur > 0) then { ctrlSetText [402, str abs _elevationCur]; } else { @@ -119,7 +119,7 @@ if (_elevationCur > 0) then { }; }; -_windageAbs = Round(_windageAbs * 100) / 100; +_windageAbs = round(_windageAbs * 100) / 100; if (_windageAbs > 0) then { ctrlSetText [410, format["%1R", abs(_windageAbs)]]; } else { @@ -129,7 +129,7 @@ if (_windageAbs > 0) then { ctrlSetText [410, "0.0"]; }; }; -_windageRel = Round(_windageRel * 100) / 100; +_windageRel = round(_windageRel * 100) / 100; if (_windageRel > 0) then { ctrlSetText [411, format["%1R", abs(_windageRel)]]; } else { @@ -139,7 +139,7 @@ if (_windageRel > 0) then { ctrlSetText [411, "0.0"]; }; }; -_windageCur = Round(_windageCur * 100) / 100; +_windageCur = round(_windageCur * 100) / 100; if (_windageCur > 0) then { ctrlSetText [412, format["%1R", abs(_windageCur)]]; } else { @@ -151,7 +151,7 @@ if (_windageCur > 0) then { }; if (GVAR(showWind2)) then { - _wind2 = Round(_wind2 * 100) / 100; + _wind2 = round(_wind2 * 100) / 100; if (_wind2 > 0) then { ctrlSetText [420, format["%1R", abs(_wind2)]]; } else { @@ -162,7 +162,7 @@ if (GVAR(showWind2)) then { }; }; } else { - _lead = Round(_lead * 100) / 100; + _lead = round(_lead * 100) / 100; if (_lead > 0) then { if ((GVAR(targetSpeedDirection) select GVAR(currentTarget)) == 1) then { ctrlSetText [420, format["%1R", abs(_lead)]]; diff --git a/addons/atragmx/functions/fnc_update_scope_unit.sqf b/addons/atragmx/functions/fnc_update_scope_unit.sqf index d1f0e9cf170..e72b490ef03 100644 --- a/addons/atragmx/functions/fnc_update_scope_unit.sqf +++ b/addons/atragmx/functions/fnc_update_scope_unit.sqf @@ -16,7 +16,7 @@ */ ctrlSetText [2000, GVAR(scopeUnits) select GVAR(currentScopeUnit)]; -ctrlSetText [2001, Str(GVAR(currentScopeClickNumber))]; +ctrlSetText [2001, str(GVAR(currentScopeClickNumber))]; if (GVAR(currentScopeUnit) == 3) then { ctrlSetText [5000, format["Clicks=%1", GVAR(currentScopeClickNumber)]]; diff --git a/addons/atragmx/functions/fnc_update_target.sqf b/addons/atragmx/functions/fnc_update_target.sqf index a87ba9ba54f..df37e7848e4 100644 --- a/addons/atragmx/functions/fnc_update_target.sqf +++ b/addons/atragmx/functions/fnc_update_target.sqf @@ -17,32 +17,32 @@ if (GVAR(showWind2)) then { if (GVAR(currentUnit) != 2) then { - ctrlSetText [300, format["%1/%2", Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629), Round((GVAR(windSpeed2) select GVAR(currentTarget)) * 2.23693629)]]; + ctrlSetText [300, format["%1/%2", round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629), round((GVAR(windSpeed2) select GVAR(currentTarget)) * 2.23693629)]]; } else { - ctrlSetText [300, format["%1/%2", Round(GVAR(windSpeed1) select GVAR(currentTarget)), Round(GVAR(windSpeed2) select GVAR(currentTarget))]]; + ctrlSetText [300, format["%1/%2", round(GVAR(windSpeed1) select GVAR(currentTarget)), round(GVAR(windSpeed2) select GVAR(currentTarget))]]; }; } else { if (GVAR(currentUnit) != 2) then { - ctrlSetText [300, Str(Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; + ctrlSetText [300, str(round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; } else { - ctrlSetText [300, Str(Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 100) / 100)]; + ctrlSetText [300, str(round((GVAR(windSpeed1) select GVAR(currentTarget)) * 100) / 100)]; }; }; -ctrlSetText [310, Str(Round((GVAR(windDirection) select GVAR(currentTarget))))]; -ctrlSetText [320, Str(Round((GVAR(inclinationAngle) select GVAR(currentTarget))))]; +ctrlSetText [310, str(round((GVAR(windDirection) select GVAR(currentTarget))))]; +ctrlSetText [320, str(round((GVAR(inclinationAngle) select GVAR(currentTarget))))]; if (GVAR(currentUnit) != 2) then { - ctrlSetText [330, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; + ctrlSetText [330, str(round((GVAR(targetSpeed) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; } else { - ctrlSetText [330, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 100) / 100)]; + ctrlSetText [330, str(round((GVAR(targetSpeed) select GVAR(currentTarget)) * 100) / 100)]; }; switch (GVAR(currentUnit)) do { case 0: { - ctrlSetText [340, format["*%1", Round((GVAR(targetRange) select GVAR(currentTarget)))]]; + ctrlSetText [340, format["*%1", round((GVAR(targetRange) select GVAR(currentTarget)))]]; }; case 1: { - ctrlSetText [340, Str(Round((GVAR(targetRange) select GVAR(currentTarget)) * 1.0936133))]; + ctrlSetText [340, str(round((GVAR(targetRange) select GVAR(currentTarget)) * 1.0936133))]; }; case 2: { - ctrlSetText [340, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; + ctrlSetText [340, str(round((GVAR(targetRange) select GVAR(currentTarget))))]; }; }; diff --git a/addons/atragmx/functions/fnc_update_target_data.sqf b/addons/atragmx/functions/fnc_update_target_data.sqf index 92b5df50a06..f47d0401ddb 100644 --- a/addons/atragmx/functions/fnc_update_target_data.sqf +++ b/addons/atragmx/functions/fnc_update_target_data.sqf @@ -15,22 +15,22 @@ * Public: No */ -ctrlSetText [140000, Str(Round((GVAR(latitude) select GVAR(currentTarget)) * 100) / 100)]; -ctrlSetText [140010, Str(Round((GVAR(directionOfFire) select GVAR(currentTarget)) * 100) / 100)]; +ctrlSetText [140000, str(round((GVAR(latitude) select GVAR(currentTarget)) * 100) / 100)]; +ctrlSetText [140010, str(round((GVAR(directionOfFire) select GVAR(currentTarget)) * 100) / 100)]; if (GVAR(currentUnit) != 2) then { - ctrlSetText [140020, Str(Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; - ctrlSetText [140021, Str(Round((GVAR(windSpeed2) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; + ctrlSetText [140020, str(round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; + ctrlSetText [140021, str(round((GVAR(windSpeed2) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; } else { - ctrlSetText [140020, Str(Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 100) / 100)]; - ctrlSetText [140021, Str(Round((GVAR(windSpeed2) select GVAR(currentTarget)) * 100) / 100)]; + ctrlSetText [140020, str(round((GVAR(windSpeed1) select GVAR(currentTarget)) * 100) / 100)]; + ctrlSetText [140021, str(round((GVAR(windSpeed2) select GVAR(currentTarget)) * 100) / 100)]; }; -ctrlSetText [140030, Str(Round((GVAR(windDirection) select GVAR(currentTarget))))]; -ctrlSetText [140040, Str(Round((GVAR(inclinationAngle) select GVAR(currentTarget))))]; -ctrlSetText [140041, Str(Round(cos(GVAR(inclinationAngle) select GVAR(currentTarget)) * 100) / 100)]; +ctrlSetText [140030, str(round((GVAR(windDirection) select GVAR(currentTarget))))]; +ctrlSetText [140040, str(round((GVAR(inclinationAngle) select GVAR(currentTarget))))]; +ctrlSetText [140041, str(round(cos(GVAR(inclinationAngle) select GVAR(currentTarget)) * 100) / 100)]; if (GVAR(currentUnit) != 2) then { - ctrlSetText [140050, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; + ctrlSetText [140050, str(round((GVAR(targetSpeed) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; } else { - ctrlSetText [140050, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 100) / 100)]; + ctrlSetText [140050, str(round((GVAR(targetSpeed) select GVAR(currentTarget)) * 100) / 100)]; }; if ((GVAR(targetSpeedDirection) select GVAR(currentTarget)) == 1) then { ctrlSetText [140051, ">"]; @@ -38,9 +38,9 @@ if ((GVAR(targetSpeedDirection) select GVAR(currentTarget)) == 1) then { ctrlSetText [140051, "<"]; }; if (GVAR(currentUnit) == 1) then { - ctrlSetText [140060, Str(Round((GVAR(targetRange) select GVAR(currentTarget)) * 1.0936133))]; + ctrlSetText [140060, str(round((GVAR(targetRange) select GVAR(currentTarget)) * 1.0936133))]; } else { - ctrlSetText [140060, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; + ctrlSetText [140060, str(round((GVAR(targetRange) select GVAR(currentTarget))))]; }; if (GVAR(currentUnit) == 0) then { ctrlSetText [140061, "*"]; diff --git a/addons/atragmx/functions/fnc_update_truing_drop_data.sqf b/addons/atragmx/functions/fnc_update_truing_drop_data.sqf index ad0f0dda0e8..1180b689cd0 100644 --- a/addons/atragmx/functions/fnc_update_truing_drop_data.sqf +++ b/addons/atragmx/functions/fnc_update_truing_drop_data.sqf @@ -16,11 +16,11 @@ */ if (GVAR(currentUnit) == 2) then { - ctrlSetText [18011, Str(Round(GVAR(truingDropRangeData) select 0))]; - ctrlSetText [18012, Str(Round(GVAR(truingDropRangeData) select 1))]; + ctrlSetText [18011, str(round(GVAR(truingDropRangeData) select 0))]; + ctrlSetText [18012, str(round(GVAR(truingDropRangeData) select 1))]; } else { - ctrlSetText [18011, Str(Round((GVAR(truingDropRangeData) select 0) * 1.0936133))]; - ctrlSetText [18012, Str(Round((GVAR(truingDropRangeData) select 1) * 1.0936133))]; + ctrlSetText [18011, str(round((GVAR(truingDropRangeData) select 0) * 1.0936133))]; + ctrlSetText [18012, str(round((GVAR(truingDropRangeData) select 1) * 1.0936133))]; }; if (GVAR(truingDropMode) == 0) then { @@ -53,25 +53,25 @@ switch (_dropUnit) do { }; }; -ctrlSetText [18006, Str(Round((_dropData select 0) * 100) / 100)]; -ctrlSetText [18013, Str(Round((_dropData select 1) * 100) / 100)]; -ctrlSetText [18014, Str(Round((_dropData select 2) * 100) / 100)]; +ctrlSetText [18006, str(round((_dropData select 0) * 100) / 100)]; +ctrlSetText [18013, str(round((_dropData select 1) * 100) / 100)]; +ctrlSetText [18014, str(round((_dropData select 2) * 100) / 100)]; if (GVAR(currentUnit) != 2) then { - ctrlSetText [18007, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))]; - ctrlSetText [18016, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))]; + ctrlSetText [18007, str(round((GVAR(workingMemory) select 1) * 3.2808399))]; + ctrlSetText [18016, str(round((GVAR(workingMemory) select 1) * 3.2808399))]; if (GVAR(truingDropMuzzleVelocity) > 0) then { - ctrlSetText [18016, Str(Round(GVAR(truingDropMuzzleVelocity) * 3.2808399))]; + ctrlSetText [18016, str(round(GVAR(truingDropMuzzleVelocity) * 3.2808399))]; }; } else { - ctrlSetText [18007, Str(Round(GVAR(workingMemory) select 1))]; - ctrlSetText [18016, Str(Round(GVAR(workingMemory) select 1))]; + ctrlSetText [18007, str(round(GVAR(workingMemory) select 1))]; + ctrlSetText [18016, str(round(GVAR(workingMemory) select 1))]; if (GVAR(truingDropMuzzleVelocity) > 0) then { - ctrlSetText [18016, Str(Round(GVAR(truingDropMuzzleVelocity)))]; + ctrlSetText [18016, str(round(GVAR(truingDropMuzzleVelocity)))]; }; }; -ctrlSetText [18008, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; -ctrlSetText [18017, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; +ctrlSetText [18008, str(round((GVAR(workingMemory) select 15) * 1000) / 1000)]; +ctrlSetText [18017, str(round((GVAR(workingMemory) select 15) * 1000) / 1000)]; if (GVAR(truingDropC1) > 0) then { - ctrlSetText [18017, Str(Round(GVAR(truingDropC1) * 1000) / 1000)]; + ctrlSetText [18017, str(round(GVAR(truingDropC1) * 1000) / 1000)]; }; diff --git a/addons/attach/functions/fnc_canDetach.sqf b/addons/attach/functions/fnc_canDetach.sqf index 7202ba410fc..9b70d35ff4e 100644 --- a/addons/attach/functions/fnc_canDetach.sqf +++ b/addons/attach/functions/fnc_canDetach.sqf @@ -32,7 +32,7 @@ private _inRange = false; _attachedList deleteAt _forEachIndex; _attachToVehicle setVariable [QGVAR(attached), _attachedList, true]; }; - if (((getPos _unit) distance2d (getPos _xObject)) < 4) exitWith {_inRange = true}; + if (((getPos _unit) distance2D (getPos _xObject)) < 4) exitWith {_inRange = true}; } forEach _attachedList; _inRange && diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index d953b02bd16..8eab98e0720 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -31,8 +31,8 @@ private _minDistance = 1000; { _x params ["_xObject", "_xItemName"]; - if (((getPos _unit) distance2d (getPos _xObject)) < _minDistance) then { - _minDistance = ((getPos _unit) distance2d (getPos _xObject)); + if (((getPos _unit) distance2D (getPos _xObject)) < _minDistance) then { + _minDistance = ((getPos _unit) distance2D (getPos _xObject)); _attachedObject = _xObject; _itemName = _xItemName; _attachedIndex = _forEachIndex; diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index 2f0c4d6b751..9e9f8effba4 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -48,10 +48,10 @@ while {(_closeInMax - _closeInMin) > 0.01} do { { if (_doesIntersect) exitWith {}; private _startingPosShifted = _startingPosition vectorAdd _x; - private _startASL = if (surfaceIsWater _startingPosShifted) then {_startingPosShifted} else {ATLtoASL _startingPosShifted}; + private _startASL = if (surfaceIsWater _startingPosShifted) then {_startingPosShifted} else {ATLToASL _startingPosShifted}; { private _endPosShifted = _endPosTest vectorAdd _x; - private _endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLtoASL _endPosShifted}; + private _endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLToASL _endPosShifted}; #ifdef DRAW_ATTACH_SCAN [{ diff --git a/addons/cargo/XEH_PREP.hpp b/addons/cargo/XEH_PREP.hpp index 10281e29674..4632a401f17 100644 --- a/addons/cargo/XEH_PREP.hpp +++ b/addons/cargo/XEH_PREP.hpp @@ -5,6 +5,7 @@ PREP(canUnloadItem); PREP(deployCancel); PREP(deployConfirm); PREP(getCargoSpaceLeft); +PREP(getDelayItem); PREP(getNameItem); PREP(getSelectedItem); PREP(getSizeItem); diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf index f48849b50bc..45c1b9601a6 100644 --- a/addons/cargo/XEH_postInit.sqf +++ b/addons/cargo/XEH_postInit.sqf @@ -51,7 +51,7 @@ params ["_item", "_emptyPosAGL"]; _item hideObjectGlobal false; - _item setPosASL (AGLtoASL _emptyPosAGL); + _item setPosASL (AGLToASL _emptyPosAGL); // Let objects remain invulernable for a short while after placement [EFUNC(common,statusEffect_set), [_item, "blockDamage", QUOTE(ADDON), false], 2] call CBA_fnc_waitAndExecute; diff --git a/addons/cargo/functions/fnc_deployConfirm.sqf b/addons/cargo/functions/fnc_deployConfirm.sqf index 27674b0515b..e4c87342f04 100644 --- a/addons/cargo/functions/fnc_deployConfirm.sqf +++ b/addons/cargo/functions/fnc_deployConfirm.sqf @@ -24,7 +24,7 @@ if (!isNull GVAR(itemPreviewObject) && {[GVAR(selectedItem), GVAR(interactionVeh // Position is AGL for unloading event private _position = ASLToAGL getPosASL GVAR(itemPreviewObject); private _direction = getDir GVAR(itemPreviewObject); - private _duration = GVAR(loadTimeCoefficient) * (GVAR(selectedItem) call FUNC(getSizeItem)); + private _duration = [GVAR(selectedItem), false] call FUNC(getDelayItem); // If unload time is 0, don't show a progress bar if (_duration <= 0) exitWith { diff --git a/addons/cargo/functions/fnc_getDelayItem.sqf b/addons/cargo/functions/fnc_getDelayItem.sqf new file mode 100644 index 00000000000..7f1d6b4d401 --- /dev/null +++ b/addons/cargo/functions/fnc_getDelayItem.sqf @@ -0,0 +1,26 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Gets the delay duration an item should take to load/unload. + * + * Arguments: + * 0: Item or + * 1: If delay is for paradrop context + * + * Return Value: + * Item load/unload duration + * + * Example: + * [cursorObject, false] call ace_cargo_fnc_getDelayItem + * + * Public: No + */ + +params ["_item", "_isParadrop"]; + +if ((_item isEqualType objNull) && {_item getVariable [QGVAR(delay), -1] >= 0}) exitWith { + _item getVariable QGVAR(delay) // return +}; + +([GVAR(loadTimeCoefficient), GVAR(paradropTimeCoefficent)] select _isParadrop) * (_item call FUNC(getSizeItem)) // return + diff --git a/addons/cargo/functions/fnc_handleScrollWheel.sqf b/addons/cargo/functions/fnc_handleScrollWheel.sqf index 9ec2c498e64..e6f3b23e76f 100644 --- a/addons/cargo/functions/fnc_handleScrollWheel.sqf +++ b/addons/cargo/functions/fnc_handleScrollWheel.sqf @@ -38,7 +38,7 @@ if (!CBA_events_control) then { // Uses this method of selecting position because setPosATL did not have immediate effect private _positionChange = _position vectorDiff (getPosASL _deployedItem); - private _selectionPosition = _unit worldToModel (ASLtoAGL getPosWorld _deployedItem); + private _selectionPosition = _unit worldToModel (ASLToAGL getPosWorld _deployedItem); _selectionPosition = _selectionPosition vectorAdd _positionChange; _deployedItem attachTo [_unit, _selectionPosition]; diff --git a/addons/cargo/functions/fnc_paradropItem.sqf b/addons/cargo/functions/fnc_paradropItem.sqf index 6a84a20799c..934beb2aad2 100644 --- a/addons/cargo/functions/fnc_paradropItem.sqf +++ b/addons/cargo/functions/fnc_paradropItem.sqf @@ -63,7 +63,7 @@ if (_item isEqualType objNull) then { [QGVAR(serverUnload), [_object, _posBehindVehicleAGL]] call CBA_fnc_serverEvent; } else { _object = createVehicle [_item, _posBehindVehicleAGL, [], 0, "NONE"]; - _object setPosASL (AGLtoASL _posBehindVehicleAGL); + _object setPosASL (AGLToASL _posBehindVehicleAGL); }; [QEGVAR(common,setVelocity), [_object, (velocity _vehicle) vectorAdd ((vectorNormalized (vectorDir _vehicle)) vectorMultiply -5)], _object] call CBA_fnc_targetEvent; diff --git a/addons/cargo/functions/fnc_setSpace.sqf b/addons/cargo/functions/fnc_setSpace.sqf index 01c078496c2..514b84ea176 100644 --- a/addons/cargo/functions/fnc_setSpace.sqf +++ b/addons/cargo/functions/fnc_setSpace.sqf @@ -35,7 +35,7 @@ private _cargoSpace = _space; } forEach _loaded; // If the new value is the same as the old, do nothing -if (_cargoSpace == (_vehicle call FUNC(getCargoSpaceLeft))) exitwith {}; +if (_cargoSpace == (_vehicle call FUNC(getCargoSpaceLeft))) exitWith {}; // Apply new space globally // Necessary to update value, even if no space, as API could be used again diff --git a/addons/cargo/functions/fnc_startLoadIn.sqf b/addons/cargo/functions/fnc_startLoadIn.sqf index 7212d89c229..23d62c7c01b 100644 --- a/addons/cargo/functions/fnc_startLoadIn.sqf +++ b/addons/cargo/functions/fnc_startLoadIn.sqf @@ -36,7 +36,7 @@ if (isNull _vehicle) exitWith { // Start progress bar if ([_item, _vehicle] call FUNC(canLoadItemIn)) then { - private _duration = GVAR(loadTimeCoefficient) * (_item call FUNC(getSizeItem)); + private _duration = [_item, false] call FUNC(getDelayItem); // If load time is 0, don't show a progress bar if (_duration <= 0) exitWith { diff --git a/addons/cargo/functions/fnc_startUnload.sqf b/addons/cargo/functions/fnc_startUnload.sqf index 39dbf59f48a..e5eaab76dc7 100644 --- a/addons/cargo/functions/fnc_startUnload.sqf +++ b/addons/cargo/functions/fnc_startUnload.sqf @@ -26,7 +26,7 @@ if (GVAR(interactionParadrop)) exitWith { // Close the cargo menu closeDialog 0; - private _duration = GVAR(paradropTimeCoefficent) * (_item call FUNC(getSizeItem)); + private _duration = [_item, true] call FUNC(getDelayItem); // If drop time is 0, don't show a progress bar if (_duration <= 0) exitWith { @@ -81,7 +81,7 @@ if ([_item, GVAR(interactionVehicle), _unit] call FUNC(canUnloadItem)) then { // Close the cargo menu closeDialog 0; - private _duration = GVAR(loadTimeCoefficient) * (_item call FUNC(getSizeItem)); + private _duration = [_item, false] call FUNC(getDelayItem); // If unload time is 0, don't show a progress bar if (_duration <= 0) exitWith { diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf index 7580de8488a..e22d87a098b 100644 --- a/addons/cargo/functions/fnc_unloadItem.sqf +++ b/addons/cargo/functions/fnc_unloadItem.sqf @@ -116,7 +116,7 @@ if (_object isEqualType objNull) then { _object setDir _direction; }; - _object setPosASL (AGLtoASL _emptyPosAGL); + _object setPosASL (AGLToASL _emptyPosAGL); [QEGVAR(common,fixCollision), _object] call CBA_fnc_localEvent; [QEGVAR(common,fixPosition), _object] call CBA_fnc_localEvent; diff --git a/addons/cargo/menu.hpp b/addons/cargo/menu.hpp index 1811369d7d5..51020335d45 100644 --- a/addons/cargo/menu.hpp +++ b/addons/cargo/menu.hpp @@ -8,16 +8,16 @@ class GVAR(menu) { class controlsBackground { class HeaderBackground: ACE_gui_backgroundBase { idc = -1; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; text = "#(argb,8,8,3)color(0,0,0,0)"; }; class CenterBackground: HeaderBackground { - y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - h = "14.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "2.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + h = "14.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; text = "#(argb,8,8,3)color(0,0,0,0.8)"; colorText[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; colorBackground[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; @@ -28,36 +28,36 @@ class GVAR(menu) { class HeaderName { idc = 1; type = CT_STATIC; - x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; style = QUOTE(ST_LEFT + ST_SHADOW); font = "RobotoCondensed"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; colorText[] = {0.95, 0.95, 0.95, 0.75}; colorBackground[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; text = CSTRING(cargoMenu); }; class SubHeader: HeaderName { idc = 2; - x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "2.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; style = ST_CENTER; colorText[] = {1, 1, 1, 0.9}; colorBackground[] = {0, 0, 0, 0}; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1.2)"; text = ""; }; class cargoList: ACE_gui_listBoxBase { idc = 100; - x = "13.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "12.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + x = "13.1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "12.8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "10 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.7)"; rowHeight = 0.03; colorBackground[] = {0, 0, 0, 0.2}; colorText[] = {1, 1, 1, 1.0}; @@ -70,12 +70,12 @@ class GVAR(menu) { class btnCancel: ACE_gui_buttonBase { text = "$STR_DISP_CANCEL"; idc = 11; - x = "13.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "14.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + x = "13.1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "14.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "6 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.7)"; animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; @@ -96,13 +96,13 @@ class GVAR(menu) { class btnUnload: btnCancel { text = CSTRING(unloadObject); idc = 12; - x = "19.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + x = "19.9 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; action = QUOTE(ACE_player call FUNC(startUnload)); }; class btnPlace: btnUnload { text = CSTRING(deployObject); idc = 13; - y = "15.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "15.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; action = QUOTE(ACE_player call FUNC(startDeploy)); colorDisabled[] = {0.25, 0.25, 0.25, 1}; }; diff --git a/addons/cargo/renameMenu.hpp b/addons/cargo/renameMenu.hpp index b6acc9ad4e3..a3cb845c6b7 100644 --- a/addons/cargo/renameMenu.hpp +++ b/addons/cargo/renameMenu.hpp @@ -8,16 +8,16 @@ class GVAR(renameMenu) { class controlsBackground { class HeaderBackground: ACE_gui_backgroundBase { idc = -1; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; text = "#(argb,8,8,3)color(0,0,0,0)"; }; class CenterBackground: HeaderBackground { - y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - h = "2.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "2.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + h = "2.9 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; text = "#(argb,8,8,3)color(0,0,0,0.8)"; colorText[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; colorBackground[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; @@ -28,13 +28,13 @@ class GVAR(renameMenu) { class HeaderName { idc = 1; type = CT_STATIC; - x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "13 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; style = QUOTE(ST_LEFT + ST_SHADOW); font = "RobotoCondensed"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; colorText[] = {0.95, 0.95, 0.95, 0.75}; colorBackground[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])", "(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])", "(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; text = CSTRING(renameObjectUI); @@ -43,21 +43,21 @@ class GVAR(renameMenu) { onLoad = QUOTE((_this select 0) ctrlSetText (GVAR(interactionVehicle) getVariable [ARR_2(QQGVAR(customName),'')])); idc = 100; canModify = 1; - x = "13.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "2.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "12.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - SizeEx = "1.5 * (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + x = "13.1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "2.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "12.8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "1.5 * (((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.7)"; }; class btnCancel: ACE_gui_buttonBase { text = "$STR_DISP_CANCEL"; idc = 11; - x = "13.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "3.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + x = "13.1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "3.9 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "5 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.7)"; animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; @@ -78,7 +78,7 @@ class GVAR(renameMenu) { class btnSave: btnCancel { text = ECSTRING(Common,Save); idc = 12; - x = "20.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + x = "20.9 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; action = QUOTE(closeDialog 1; call FUNC(renameObject)); }; }; diff --git a/addons/casings/functions/fnc_createCasing.sqf b/addons/casings/functions/fnc_createCasing.sqf index fe35ad5945c..428d940414a 100644 --- a/addons/casings/functions/fnc_createCasing.sqf +++ b/addons/casings/functions/fnc_createCasing.sqf @@ -47,7 +47,7 @@ private _modelPath = GVAR(cachedCasings) getOrDefaultCall [_ammo, { if (_modelPath isEqualTo "") exitWith {}; -private _unitPos = getposASL _unit; +private _unitPos = getPosASL _unit; // Distant shooters don't produce as many cases if ((AGLToASL positionCameraToWorld [0,0,0]) vectorDistance _unitPos > 100 && {random 1 < 0.9}) exitWith {}; diff --git a/addons/common/CfgUIGrids.hpp b/addons/common/CfgUIGrids.hpp index 1e8963e03e1..7c48886bafd 100644 --- a/addons/common/CfgUIGrids.hpp +++ b/addons/common/CfgUIGrids.hpp @@ -5,13 +5,13 @@ class CfgUIGrids { class Variables { grid_ACE_displayText[] = { { - "((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40))", - "safeZoneY + 0.175 * safezoneH", - "(10 *(((safezoneW / safezoneH) min 1.2) / 40))", - "(3 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))" + "((safeZoneX + safeZoneW) - (10 *(((safeZoneW / safeZoneH) min 1.2) / 40)) - 2.9 *(((safeZoneW / safeZoneH) min 1.2) / 40))", + "safeZoneY + 0.175 * safeZoneH", + "(10 *(((safeZoneW / safeZoneH) min 1.2) / 40))", + "(3 *((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25))" }, - "(((safezoneW / safezoneH) min 1.2) / 40)", - "((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)" + "(((safeZoneW / safeZoneH) min 1.2) / 40)", + "((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)" }; }; }; diff --git a/addons/common/CompassControl.hpp b/addons/common/CompassControl.hpp index 627e18d2f8d..16b1b3cf43d 100644 --- a/addons/common/CompassControl.hpp +++ b/addons/common/CompassControl.hpp @@ -10,7 +10,7 @@ #define POINTER_WIDTH_FACTOR (1/128) #define LEFT (0.5 - 8 * GUI_GRID_W) -#define TOP (safezoneY + 1.6 * GUI_GRID_H) +#define TOP (safeZoneY + 1.6 * GUI_GRID_H) #define WIDTH (16 * GUI_GRID_W) #define HEIGHT (0.5 * GUI_GRID_H) diff --git a/addons/common/DisableMouseDialog.hpp b/addons/common/DisableMouseDialog.hpp index 75689cf6526..1d1d6cfaa74 100644 --- a/addons/common/DisableMouseDialog.hpp +++ b/addons/common/DisableMouseDialog.hpp @@ -8,10 +8,10 @@ class GVAR(DisableMouse_Dialog) { class Background: ctrlMapEmpty { idc = 101; fade = 1; - x = "safezoneXAbs"; - y = "safezoneY"; - w = "safezoneWAbs"; - h = "safezoneH"; + x = "safeZoneXAbs"; + y = "safeZoneY"; + w = "safeZoneWAbs"; + h = "safeZoneH"; }; }; }; diff --git a/addons/common/HintConfig.hpp b/addons/common/HintConfig.hpp index c299bee8dfb..c3eda57d6bb 100644 --- a/addons/common/HintConfig.hpp +++ b/addons/common/HintConfig.hpp @@ -39,11 +39,11 @@ class RscTitles { idc = 1; text = ""; //size = "1 / 40 / (getResolution select 5)"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0, 0, 0, 0.5}; - x = "safeZoneW + safeZoneX - 0 * safezoneW"; //safeZoneW + safeZoneX - 0.2 * safezoneW; - y = "safeZoneY + 0.2 * safezoneH"; + x = "safeZoneW + safeZoneX - 0 * safeZoneW"; //safeZoneW + safeZoneX - 0.2 * safeZoneW; + y = "safeZoneY + 0.2 * safeZoneH"; w = "0.2 * safeZoneW"; h = "0.1 * SafeZoneH"; font = "RobotoCondensed"; @@ -63,11 +63,11 @@ class RscTitles { idc = 1; text = ""; //size = "1 / 40 / (getResolution select 5)"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0.8, 0, 0, 0.5}; x = "0.3 * safeZoneW + safeZoneX"; - y = "0.4 * safezoneH + safeZoneY"; + y = "0.4 * safeZoneH + safeZoneY"; w = "0.4 * safeZoneW"; h = "0.2 * SafeZoneH"; }; diff --git a/addons/common/ProgressScreen.hpp b/addons/common/ProgressScreen.hpp index bef2994e7d9..c3026a9fe4f 100644 --- a/addons/common/ProgressScreen.hpp +++ b/addons/common/ProgressScreen.hpp @@ -18,28 +18,28 @@ class GVAR(ProgressBar_Dialog) { size = 1; colorBackground[] = {0, 0, 0, 0.0}; colorText[] = {0, 0, 0, 0}; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; + x = "safeZoneX"; + y = "safeZoneY"; + w = "safeZoneW"; + h = "safeZoneH"; }; class TitleBackground: ACE_gui_staticBase { idc = 1; style = ST_CENTER; - sizeEx = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; colorBackground[] = {0, 0, 0, 0.5}; colorText[] = {1, 1, 1, 1}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "0 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class Progress: ACE_gui_RscProgress { idc = 2; - x = "1.2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "0.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1.2 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "0.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; colorFrame[] = {1,1,1,0.5}; colorBar[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.77])","(profilenamespace getVariable ['GUI_BCG_RGB_G',0.51])","(profilenamespace getVariable ['GUI_BCG_RGB_B',0.08])","(profilenamespace getVariable ['GUI_BCG_RGB_A',0.8])"}; texture = "#(argb,8,8,3)color(1,1,1,0.7)"; diff --git a/addons/common/RscInfoType.hpp b/addons/common/RscInfoType.hpp index 672d043276c..89d3c02ec1d 100644 --- a/addons/common/RscInfoType.hpp +++ b/addons/common/RscInfoType.hpp @@ -6,19 +6,19 @@ class RscInGameUI { }; class RscUnitInfoSoldier: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSoldier',_this select 0)]; [ARR_2('ace_infoDisplayChanged',[ARR_2(_this select 0,'Soldier')])] call CBA_fnc_localEvent;); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSoldier',_this select 0)]; [ARR_2('ace_infoDisplayChanged',[ARR_2(_this select 0,'Soldier')])] call CBA_fnc_localEvent;); }; class RscUnitInfoTank: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgVehicle',_this select 0)];); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgVehicle',_this select 0)];); }; class RscUnitInfoAirNoWeapon: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft',_this select 0)];); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft',_this select 0)];); }; class RscUnitInfoAir: RscUnitInfoAirNoWeapon { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft',_this select 0)];); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft',_this select 0)];); }; class RscUnitInfo_AH64D_gunner { @@ -30,11 +30,11 @@ class RscInGameUI { }; class RscUnitInfoSubmarine: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSubmarine',_this select 0)];); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSubmarine',_this select 0)];); }; class RscUnitInfoShip: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgShip',_this select 0)];); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgShip',_this select 0)];); }; class RscWeaponEmpty { @@ -94,7 +94,7 @@ class RscInGameUI { }; class RscUnitInfoParachute: RscUnitInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgParachute',_this select 0)]; [ARR_2('ace_infoDisplayChanged',[ARR_2(_this select 0,'Parachute')])] call CBA_fnc_localEvent;); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgParachute',_this select 0)]; [ARR_2('ace_infoDisplayChanged',[ARR_2(_this select 0,'Parachute')])] call CBA_fnc_localEvent;); }; class RscUnitVehicle { @@ -106,10 +106,10 @@ class RscInGameUI { }; class RscStaminaBar { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStaminaBar"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgStaminaBar)),_this select 0)]); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStaminaBar"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgStaminaBar)),_this select 0)]); }; class RscStanceInfo { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStanceInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_2('ace_infoDisplayChanged',[ARR_2(_this select 0,'Stance')])] call CBA_fnc_localEvent;); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStanceInfo"",'IGUI')] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); [ARR_2('ace_infoDisplayChanged',[ARR_2(_this select 0,'Stance')])] call CBA_fnc_localEvent;); }; }; diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index 36147753459..529da07da2b 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -269,6 +269,7 @@ PREP(_handleRequestAllSyncedEvents); // other eventhandlers PREP(addActionEventHandler); PREP(addActionMenuEventHandler); +PREP(addExplosionEventHandler); PREP(addMapMarkerCreatedEventHandler); PREP(addPlayerEH); diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 44197df81af..91f3de8e0c6 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -165,7 +165,7 @@ if (isServer) then { private _zeusLogic = getAssignedCuratorLogic _dcPlayer; if ((!isNil "_zeusLogic") && {!isNull _zeusLogic}) then { { - if ((_x getvariable ["bis_fnc_moduleRemoteControl_owner", objnull]) isEqualTo _dcPlayer) exitWith { + if ((_x getVariable ["bis_fnc_moduleRemoteControl_owner", objNull]) isEqualTo _dcPlayer) exitWith { INFO_3("[%1] DC - Was Zeus [%2] while controlling unit [%3] - manually clearing `bis_fnc_moduleRemoteControl_owner`",[_x] call FUNC(getName),_dcPlayer,_x); _x setVariable ["bis_fnc_moduleRemoteControl_owner", nil, true]; }; @@ -215,6 +215,7 @@ if (isServer) then { [QGVAR(switchMove), {(_this select 0) switchMove (_this select 1)}] call CBA_fnc_addEventHandler; [QGVAR(setVectorDirAndUp), {(_this select 0) setVectorDirAndUp (_this select 1)}] call CBA_fnc_addEventHandler; [QGVAR(addWeaponItem), {(_this select 0) addWeaponItem [(_this select 1), (_this select 2)]}] call CBA_fnc_addEventHandler; +[QGVAR(addMagazineTurret), {(_this select 0) addMagazineTurret (_this select 1)}] call CBA_fnc_addEventHandler; [QGVAR(removeMagazinesTurret), {(_this select 0) removeMagazinesTurret [_this select 1, _this select 2]}] call CBA_fnc_addEventHandler; [QGVAR(triggerAmmo), {triggerAmmo _this}] call CBA_fnc_addEventHandler; @@ -495,10 +496,10 @@ GVAR(reloadMutex_lastMagazines) = []; private _isLauncher = _weapon isKindOf ["Launcher", configFile >> "CfgWeapons"]; private _duration = 0; if (_isLauncher) then { - _duration = getNumber (configfile >> "CfgMovesMaleSdr" >> "States" >> _gesture >> "speed"); + _duration = getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> _gesture >> "speed"); }; if (_duration == 0) then { - _duration = getNumber (configfile >> "CfgGesturesMale" >> "States" >> _gesture >> "speed"); + _duration = getNumber (configFile >> "CfgGesturesMale" >> "States" >> _gesture >> "speed"); }; if (_duration != 0) then { @@ -561,7 +562,7 @@ GVAR(reloadMutex_lastMagazines) = []; // Lastly, do JIP events // JIP Detection and event trigger. Run this at the very end, just in case anything uses it // Note: usage of player is most likely on purpose -if (didJip) then { +if (didJIP) then { // We are jipping! Get ready and wait, and throw the event [{ if(!isNull player && GVAR(settingsInitFinished)) then { diff --git a/addons/common/XEH_preStart.sqf b/addons/common/XEH_preStart.sqf index 3168243c067..5e02fb26f17 100644 --- a/addons/common/XEH_preStart.sqf +++ b/addons/common/XEH_preStart.sqf @@ -3,7 +3,7 @@ #include "XEH_PREP.hpp" if (isFilePatchingEnabled) then { - private _notLoaded = configProperties [configfile >> "ace_notLoaded", "isText _x"]; + private _notLoaded = configProperties [configFile >> "ace_notLoaded", "isText _x"]; { INFO_2("%1 not loaded because %2",configName _x,getText _x); } forEach _notLoaded; diff --git a/addons/common/define.hpp b/addons/common/define.hpp index ce8765ec9f4..e27c369146b 100644 --- a/addons/common/define.hpp +++ b/addons/common/define.hpp @@ -107,7 +107,7 @@ class ACE_gui_editBase { style = "0x00 + 0x40"; font = "RobotoCondensed"; shadow = 2; - sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + sizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1)"; colorDisabled[] = {1, 1, 1, 0.25}; }; @@ -187,10 +187,10 @@ class ACE_gui_RscProgress { colorFrame[] = {1, 1, 1, 0.7}; colorBar[] = {1, 1, 1, 0.7}; texture = "#(argb,8,8,3)color(1,1,1,0.7)"; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "10 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "0.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class ACE_gui_staticBase { @@ -384,9 +384,9 @@ class ACE_gui_comboBoxBase: RscCombo { class ACE_gui_mapBase { moveOnEdges = 1; x = "SafeZoneXAbs"; - y = "SafeZoneY + 1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "SafeZoneY + 1.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; w = "SafeZoneWAbs"; - h = "SafeZoneH - 1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + h = "SafeZoneH - 1.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; type = 100; // Use 100 to hide markers style = 48; shadow = 0; @@ -440,15 +440,15 @@ class ACE_gui_mapBase { onMouseButtonDblClick = ""; fontLabel = "RobotoCondensed"; - sizeExLabel = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + sizeExLabel = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.8)"; fontGrid = "TahomaB"; sizeExGrid = 0.02; fontUnits = "TahomaB"; - sizeExUnits = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + sizeExUnits = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.8)"; fontNames = "RobotoCondensed"; - sizeExNames = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8) * 2"; + sizeExNames = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.8) * 2"; fontInfo = "RobotoCondensed"; - sizeExInfo = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + sizeExInfo = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.8)"; fontLevel = "TahomaB"; sizeExLevel = 0.02; text = "#(argb,8,8,3)color(1,1,1,1)"; @@ -458,12 +458,12 @@ class ACE_gui_mapBase { size = 50; }; class Legend { - x = "SafeZoneX + (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "SafeZoneY + safezoneH - 4.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "SafeZoneX + (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "SafeZoneY + safeZoneH - 4.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "10 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "3.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; font = "RobotoCondensed"; - sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + sizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.8)"; colorBackground[] = {1, 1, 1, 0.5}; color[] = {0, 0, 0, 1}; }; diff --git a/addons/common/dev/test_mapConfigs.sqf b/addons/common/dev/test_mapConfigs.sqf index 369b2b18089..261dc0a9abd 100644 --- a/addons/common/dev/test_mapConfigs.sqf +++ b/addons/common/dev/test_mapConfigs.sqf @@ -28,7 +28,7 @@ private _maps = configProperties [configFile >> "CfgWorldList", "(isClass _x)", private _stepX = 1e10; private _stepY = 1e10; { - private _zoom = getnumber (_x >> "zoomMax"); + private _zoom = getNumber (_x >> "zoomMax"); if (_zoom < _zoomMax) then { _zoomMax = _zoom; _formatX = getText (_x >> "formatX"); diff --git a/addons/common/functions/fnc_ASLToPosition.sqf b/addons/common/functions/fnc_ASLToPosition.sqf index b99e9fb88a3..991e79c4331 100644 --- a/addons/common/functions/fnc_ASLToPosition.sqf +++ b/addons/common/functions/fnc_ASLToPosition.sqf @@ -20,5 +20,5 @@ if (surfaceIsWater _this) then { _this } else { - ASLtoATL _this + ASLToATL _this }; diff --git a/addons/common/functions/fnc_addExplosionEventHandler.sqf b/addons/common/functions/fnc_addExplosionEventHandler.sqf new file mode 100644 index 00000000000..9fb5ef80f24 --- /dev/null +++ b/addons/common/functions/fnc_addExplosionEventHandler.sqf @@ -0,0 +1,48 @@ +#include "..\script_component.hpp" +/* + * Author: johnb432, PabstMirror + * Adds event hander for explosions (for local projectiles) + * Warning: For shots that are tracers and explosive the event will trigger on all machines in range + * This function may be changed after 2.18! + * + * Arguments: + * 0: Code to execute + * + * Return Value: + * The CBA Event Handler Index + * + * Example: + * [{systemChat "boom"}] call ace_common_fnc_addExplosionEventHandler + * + * Public: No (maybe after 2.18) + */ + +params [["_code", {}, [{}]]]; + +if !(missionNamespace getVariable [QGVAR(addExplosionEventHandlerActive), false]) then { + GVAR(addExplosionEventHandlerActive) = true; + + // Add EH to existing projectiles and mines + { + TRACE_2("existing",typeOf _x,local _x); + // Rockets only explode on local clients + _x addEventHandler ["Explode", { + TRACE_1("exp (existing)",_this); + [QGVAR(explosion), _this] call CBA_fnc_localEvent; + }]; + } forEach ((8 allObjects 2) select {local _x}); + + addMissionEventHandler ["ProjectileCreated", { + params ["_projectile"]; + TRACE_2("pc",typeOf _projectile,local _projectile); + + if (!local _projectile) exitWith {}; // Rockets only explode on local clients + + _projectile addEventHandler ["Explode", { + TRACE_1("exp",_this); + [QGVAR(explosion), _this] call CBA_fnc_localEvent; + }]; + }]; +}; + +[QGVAR(explosion), _code] call CBA_fnc_addEventHandler diff --git a/addons/common/functions/fnc_addLineToDebugDraw.sqf b/addons/common/functions/fnc_addLineToDebugDraw.sqf index 016c99ddf48..3d6309fdd43 100644 --- a/addons/common/functions/fnc_addLineToDebugDraw.sqf +++ b/addons/common/functions/fnc_addLineToDebugDraw.sqf @@ -25,10 +25,10 @@ if (isNil QGVAR(debugLines)) then { }; if (count GVAR(debugLines) < 100) then { - GVAR(debugLines) pushBack [ASLtoAGL _startASL, ASLtoAGL _endASL, _color]; + GVAR(debugLines) pushBack [ASLToAGL _startASL, ASLToAGL _endASL, _color]; GVAR(debugLinesIndex) = 0; } else { - GVAR(debugLines) set [GVAR(debugLinesIndex), [ASLtoAGL _startASL, ASLtoAGL _endASL, _color]]; + GVAR(debugLines) set [GVAR(debugLinesIndex), [ASLToAGL _startASL, ASLToAGL _endASL, _color]]; GVAR(debugLinesIndex) = (GVAR(debugLinesIndex) + 1) mod 100; }; diff --git a/addons/common/functions/fnc_checkFiles_diagnoseACE.sqf b/addons/common/functions/fnc_checkFiles_diagnoseACE.sqf index f9271ca2137..82241c45274 100644 --- a/addons/common/functions/fnc_checkFiles_diagnoseACE.sqf +++ b/addons/common/functions/fnc_checkFiles_diagnoseACE.sqf @@ -16,7 +16,7 @@ */ // Only run once -if (missionNameSpace getVariable [QGVAR(checkFiles_diagnoseACE), false]) exitWith { +if (missionNamespace getVariable [QGVAR(checkFiles_diagnoseACE), false]) exitWith { createHashMap // return }; diff --git a/addons/common/functions/fnc_claim.sqf b/addons/common/functions/fnc_claim.sqf index 997d54f33b8..170c2c6a8f3 100644 --- a/addons/common/functions/fnc_claim.sqf +++ b/addons/common/functions/fnc_claim.sqf @@ -30,10 +30,10 @@ _target setVariable [QGVAR(owner), _unit, true]; // lock target object if (_lockTarget) then { - if (!isNull _unit) then { - [QGVAR(lockVehicle), _target, _target] call CBA_fnc_targetEvent; - } else { + if (isNull _unit) then { [QGVAR(unlockVehicle), _target, _target] call CBA_fnc_targetEvent; + } else { + [QGVAR(lockVehicle), _target, _target] call CBA_fnc_targetEvent; }; }; diff --git a/addons/common/functions/fnc_defineVariable.sqf b/addons/common/functions/fnc_defineVariable.sqf index 85eb7b447f2..e0e7c49e4de 100644 --- a/addons/common/functions/fnc_defineVariable.sqf +++ b/addons/common/functions/fnc_defineVariable.sqf @@ -24,7 +24,7 @@ params ["_name", "_value", "_defaultGlobal", "_category", ["_code", 0], ["_persi if (isNil "_defaultGlobal") exitWith {}; -if !(_name isEqualType "") exitwith { +if !(_name isEqualType "") exitWith { [format ["Tried to the deinfe a variable with an invalid name: %1 Arguments: %2", _name, _this]] call FUNC(debug); }; diff --git a/addons/common/functions/fnc_deprecateComponent.sqf b/addons/common/functions/fnc_deprecateComponent.sqf index d979c043efa..1ed85de2336 100644 --- a/addons/common/functions/fnc_deprecateComponent.sqf +++ b/addons/common/functions/fnc_deprecateComponent.sqf @@ -23,8 +23,8 @@ _oldComponent params ["_oldComponentName", "_oldSettingName"]; _newComponent params ["_newComponentName", "_newSettingName"]; private _isReplacementAvailable = [_newComponentName] call FUNC(isModLoaded); -private _isDeprecatedLoaded = missionNamespace getvariable [_oldSettingName, false]; -private _isReplacementLoaded = missionNamespace getvariable [_newSettingName, false]; +private _isDeprecatedLoaded = missionNamespace getVariable [_oldSettingName, false]; +private _isReplacementLoaded = missionNamespace getVariable [_newSettingName, false]; if (_isDeprecatedLoaded && {_isReplacementAvailable} && {!_isReplacementLoaded}) then { [_newSettingName, true, true, true] call FUNC(setSetting); diff --git a/addons/common/functions/fnc_displayIcon.sqf b/addons/common/functions/fnc_displayIcon.sqf index da08fa832a4..db01bedb043 100644 --- a/addons/common/functions/fnc_displayIcon.sqf +++ b/addons/common/functions/fnc_displayIcon.sqf @@ -21,11 +21,11 @@ */ // positions for the icon UI -#define RIGHT_SIDE (safezoneW + safezoneX) -#define LEFT_SIDE safezoneX +#define RIGHT_SIDE (safeZoneW + safeZoneX) +#define LEFT_SIDE safeZoneX #define TOP_SIDE safeZoneY -#define BOTTOM_SIDE (safeZoneH + safezoneY) -#define ICON_WIDTH (2 * (((safezoneW / safezoneH) min 1.2) / 40)) +#define BOTTOM_SIDE (safeZoneH + safeZoneY) +#define ICON_WIDTH (2 * (((safeZoneW / safeZoneH) min 1.2) / 40)) #define X_POS_ICONS (RIGHT_SIDE - (1.5 * ICON_WIDTH)) #define Y_POS_ICONS (TOP_SIDE + (2.5 * ICON_WIDTH)) #define DIFFERENCE_ICONS (1.1 * ICON_WIDTH) diff --git a/addons/common/functions/fnc_displayTextStructured.sqf b/addons/common/functions/fnc_displayTextStructured.sqf index a9376552a95..ed494627702 100644 --- a/addons/common/functions/fnc_displayTextStructured.sqf +++ b/addons/common/functions/fnc_displayTextStructured.sqf @@ -30,7 +30,7 @@ if (typeName _text != "TEXT") then { if (_x isEqualType "" && {isLocalized _x}) then { _text set [_foreachIndex, localize _x]; }; - }foreach _text; + } forEach _text; _text = format _text; }; }; @@ -51,18 +51,18 @@ _ctrlHint ctrlSetBackgroundColor GVAR(displayTextColor); _ctrlHint ctrlSetTextColor GVAR(displayTextFontColor); // Use profile settings from CfgUIGrids.hpp -private _xPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_X", ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40))]; -private _yPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_Y", safeZoneY + 0.175 * safezoneH]; -private _wPos = (_width *(((safezoneW / safezoneH) min 1.2) / 40)); -private _hPos = _size * (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)); +private _xPos = profileNamespace getVariable ["IGUI_GRID_ACE_displayText_X", ((safeZoneX + safeZoneW) - (10 *(((safeZoneW / safeZoneH) min 1.2) / 40)) - 2.9 *(((safeZoneW / safeZoneH) min 1.2) / 40))]; +private _yPos = profileNamespace getVariable ["IGUI_GRID_ACE_displayText_Y", safeZoneY + 0.175 * safeZoneH]; +private _wPos = (_width *(((safeZoneW / safeZoneH) min 1.2) / 40)); +private _hPos = _size * (2 *((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)); // Ensure still in bounds for large width/height -_xPos = safezoneX max (_xPos min (safezoneX + safezoneW - _wPos)); -_yPos = safeZoneY max (_yPos min (safeZoneY + safezoneH - _hPos)); +_xPos = safeZoneX max (_xPos min (safeZoneX + safeZoneW - _wPos)); +_yPos = safeZoneY max (_yPos min (safeZoneY + safeZoneH - _hPos)); // Zeus Interface Open and Display would be under the "CREATE" list if (!isNull curatorCamera) then { - _xPos = _xPos min ((safezoneX + safezoneW - 12.5 * (((safezoneW / safezoneH) min 1.2) / 40)) - _wPos); + _xPos = _xPos min ((safeZoneX + safeZoneW - 12.5 * (((safeZoneW / safeZoneH) min 1.2) / 40)) - _wPos); }; private _position = [_xPos, _yPos, _wPos, _hPos]; diff --git a/addons/common/functions/fnc_findUnloadPosition.sqf b/addons/common/functions/fnc_findUnloadPosition.sqf index 2047f7349d8..7fb4e41a73c 100644 --- a/addons/common/functions/fnc_findUnloadPosition.sqf +++ b/addons/common/functions/fnc_findUnloadPosition.sqf @@ -61,7 +61,7 @@ if (isNull _unloader || {_unloader in _vehicle}) then { // Ideal unload pos is halfway between unloader and vehicle (at the unloader's height) private _originASL = ((getPosASL _unloader) vectorAdd (getPosASL _vehicle)) vectorMultiply 0.5; _originASL set [2, (getPosASL _unloader) select 2]; -private _originAGL = ASLtoAGL _originASL; +private _originAGL = ASLToAGL _originASL; // Do a manual search for empty pos (handles underwater, buildings or piers) TRACE_2("Checking for unload",_originAGL,_radiusOfItem); @@ -74,9 +74,9 @@ while {_rangeToCheck < _maxDistance} do { private _roundPointIsValid = false; - if (((AGLtoASL _roundAGL) select 2) > 0) then { + if (((AGLToASL _roundAGL) select 2) > 0) then { // Shoot a ray down, and make sure we hit something solid like a building or the ground - private _belowRoundArray = lineIntersectsSurfaces [(AGLtoASL _roundAGL) vectorAdd [0, 0, 0.5], (AGLtoASL _roundAGL) vectorAdd [0, 0, -1]]; + private _belowRoundArray = lineIntersectsSurfaces [(AGLToASL _roundAGL) vectorAdd [0, 0, 0.5], (AGLToASL _roundAGL) vectorAdd [0, 0, -1]]; TRACE_4("Testing for solid",_roundDistance,_roundAngle,_roundAGL,_belowRoundArray); if (_belowRoundArray isNotEqualTo []) then { @@ -85,7 +85,7 @@ while {_rangeToCheck < _maxDistance} do { // Point is above something: Terrain (null) or Building if ((isNull _aboveBuilding) || {_aboveBuilding isKindOf "Building"}) then { // Get the real intersection point - _roundAGL = ASLtoAGL ((_belowRoundArray select 0) select 0); + _roundAGL = ASLToAGL ((_belowRoundArray select 0) select 0); _roundPointIsValid = true; }; @@ -102,13 +102,13 @@ while {_rangeToCheck < _maxDistance} do { for "_index" from 0 to (COL_TEST_COUNT -1) do { // Scan for collisions with objects with lineIntersectsSurfaces private _angle = _index * (360 / COL_TEST_COUNT); - private _point1ASL = (AGLtoASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.1]; - private _point2ASL = (AGLtoASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, _radiusOfItem + 0.5]; + private _point1ASL = (AGLToASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.1]; + private _point2ASL = (AGLToASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, _radiusOfItem + 0.5]; private _testIntersections = lineIntersectsSurfaces [_point1ASL, _point2ASL]; if (((count _testIntersections) == 1) && {isNull ((_testIntersections select 0) select 2)}) then { private _hitGroundASL = (_testIntersections select 0) select 0; - private _hitHeightOffset = ((AGLtoASL _roundAGL) select 2) - (_hitGroundASL select 2); + private _hitHeightOffset = ((AGLToASL _roundAGL) select 2) - (_hitGroundASL select 2); private _hit2dOffset = _roundAGL distance2D _hitGroundASL; private _slope = _hitHeightOffset atan2 _hit2dOffset; @@ -124,8 +124,8 @@ while {_rangeToCheck < _maxDistance} do { _roundPointIsValid = false; }; - _point1ASL = (AGLtoASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.5]; - _point2ASL = (AGLtoASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, 1]; + _point1ASL = (AGLToASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.5]; + _point2ASL = (AGLToASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, 1]; _testIntersections = lineIntersectsSurfaces [_point1ASL, _point2ASL]; if (_testIntersections isNotEqualTo []) exitWith { diff --git a/addons/common/functions/fnc_getAddon.sqf b/addons/common/functions/fnc_getAddon.sqf index b1a6f7cf995..ab3ad1c2173 100644 --- a/addons/common/functions/fnc_getAddon.sqf +++ b/addons/common/functions/fnc_getAddon.sqf @@ -22,7 +22,7 @@ params ["_config"]; // Return first addon if (_addons isNotEqualTo []) then { - (configSourceModList (configfile >> "CfgPatches" >> _addons select 0)) param [0, ""] + (configSourceModList (configFile >> "CfgPatches" >> _addons select 0)) param [0, ""] } else { // If nothing found at all, return "" "" diff --git a/addons/common/functions/fnc_getDeathAnim.sqf b/addons/common/functions/fnc_getDeathAnim.sqf index 18c6c93c074..4e0b0578729 100644 --- a/addons/common/functions/fnc_getDeathAnim.sqf +++ b/addons/common/functions/fnc_getDeathAnim.sqf @@ -29,7 +29,9 @@ private _unitActionsCfg = configFile >> "CfgMovesBasic" >> "Actions" >> getText TRACE_2("Animation/Action",configName _unitAnimationCfg,configName _unitActionsCfg); -if (!isNull objectParent _unit) then { +if (isNull objectParent _unit) then { + _returnAnimation = getText (_unitActionsCfg >> "die"); +} else { private _interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo"); for "_index" from 0 to (count _interpolateArray - 1) step 2 do { @@ -42,8 +44,6 @@ if (!isNull objectParent _unit) then { _returnAnimation = _indexAnimation; }; }; -} else { - _returnAnimation = getText (_unitActionsCfg >> "die"); }; //Fallback if nothing valid found: diff --git a/addons/common/functions/fnc_getMapGridData.sqf b/addons/common/functions/fnc_getMapGridData.sqf index daa4bd86cdf..c6817b5d5b5 100644 --- a/addons/common/functions/fnc_getMapGridData.sqf +++ b/addons/common/functions/fnc_getMapGridData.sqf @@ -30,7 +30,7 @@ private _stepX = 1e10; private _stepY = 1e10; { - private _zoom = getnumber (_x >> "zoomMax"); + private _zoom = getNumber (_x >> "zoomMax"); if (_zoom < _zoomMax) then { _zoomMax = _zoom; _formatX = getText (_x >> "formatX"); diff --git a/addons/common/functions/fnc_getVehicleIcon.sqf b/addons/common/functions/fnc_getVehicleIcon.sqf index a18765567cc..6bda8f63108 100644 --- a/addons/common/functions/fnc_getVehicleIcon.sqf +++ b/addons/common/functions/fnc_getVehicleIcon.sqf @@ -28,8 +28,8 @@ private _objectType = if (_object isEqualType objNull) then { private _cachedValue = GVAR(vehicleIconCache) get _objectType; if (isNil "_cachedValue") then { - private _vehicleValue = getText (configfile >> "CfgVehicles" >> _objectType >> "icon"); - private _vehicleIconValue = getText (configfile >> "CfgVehicleIcons" >> _vehicleValue); + private _vehicleValue = getText (configFile >> "CfgVehicles" >> _objectType >> "icon"); + private _vehicleIconValue = getText (configFile >> "CfgVehicleIcons" >> _vehicleValue); if (_vehicleIconValue == "") then { if (_vehicleValue != "" && {((toLowerANSI _vehicleValue) find ".paa") > -1}) then { diff --git a/addons/common/functions/fnc_positionToASL.sqf b/addons/common/functions/fnc_positionToASL.sqf index b286d2f7ab6..808bfe35636 100644 --- a/addons/common/functions/fnc_positionToASL.sqf +++ b/addons/common/functions/fnc_positionToASL.sqf @@ -20,5 +20,5 @@ if (surfaceIsWater _this) then { _this } else { - ATLtoASL _this + ATLToASL _this }; diff --git a/addons/common/functions/fnc_progressBar.sqf b/addons/common/functions/fnc_progressBar.sqf index 9b5519c232f..36f04b18f8c 100644 --- a/addons/common/functions/fnc_progressBar.sqf +++ b/addons/common/functions/fnc_progressBar.sqf @@ -57,7 +57,7 @@ if (_dialog) then { //Adjust position based on user setting: private _ctrlPos = ctrlPosition (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)); -_ctrlPos set [1, ((0 + 29 * GVAR(settingProgressBarLocation)) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))]; +_ctrlPos set [1, ((0 + 29 * GVAR(settingProgressBarLocation)) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2))]; (uiNamespace getVariable QGVAR(ctrlProgressBG)) ctrlSetPosition _ctrlPos; (uiNamespace getVariable QGVAR(ctrlProgressBG)) ctrlCommit 0; diff --git a/addons/common/functions/fnc_readSettingsFromParamsArray.sqf b/addons/common/functions/fnc_readSettingsFromParamsArray.sqf index 7273fc61caf..0134bc210c2 100644 --- a/addons/common/functions/fnc_readSettingsFromParamsArray.sqf +++ b/addons/common/functions/fnc_readSettingsFromParamsArray.sqf @@ -17,7 +17,7 @@ */ //paramsArray is a normal variable not a command -private _paramsArray = missionnamespace getVariable ["paramsArray", []]; +private _paramsArray = missionNamespace getVariable ["paramsArray", []]; TRACE_1("Reading missionConfigFile params",_paramsArray); diff --git a/addons/common/functions/fnc_runTests.sqf b/addons/common/functions/fnc_runTests.sqf index 4a449fb7eb8..a430cadabaa 100644 --- a/addons/common/functions/fnc_runTests.sqf +++ b/addons/common/functions/fnc_runTests.sqf @@ -30,7 +30,7 @@ INFO_1("ace_common_fnc_runTests starting for [%1]",_specificTest); _total = _total + 1; private _testFile = getText _x; diag_log text format ["----- Starting Testing %1 [%2] -----", _testName, _testFile]; - private _return = ([nil] apply (compile preProcessFileLineNumbers _testFile)) select 0; + private _return = ([nil] apply (compile preprocessFileLineNumbers _testFile)) select 0; if ((isNil "_return") || {_return isNotEqualTo true}) then { systemChat format ["Test [%1] Failed", _testName]; diag_log text format ["----- Finished Testing %1 [Failed] -----", _testName]; diff --git a/addons/common/functions/fnc_setPlayerOwner.sqf b/addons/common/functions/fnc_setPlayerOwner.sqf index 2b37349f9af..010f0b9b462 100644 --- a/addons/common/functions/fnc_setPlayerOwner.sqf +++ b/addons/common/functions/fnc_setPlayerOwner.sqf @@ -17,7 +17,7 @@ * Public: No */ -if (missionNameSpace getVariable [QGVAR(setPlayerOwnerRunning), false]) exitWith {}; +if (missionNamespace getVariable [QGVAR(setPlayerOwnerRunning), false]) exitWith {}; GVAR(setPlayerOwnerRunning) = true; if (isServer) then { diff --git a/addons/common/functions/fnc_showHud.sqf b/addons/common/functions/fnc_showHud.sqf index d74bed9cbde..b552b7230af 100644 --- a/addons/common/functions/fnc_showHud.sqf +++ b/addons/common/functions/fnc_showHud.sqf @@ -65,6 +65,6 @@ for "_index" from 0 to 9 do { }; TRACE_2("showHud",_resultMask,keys GVAR(showHudHash)); -showHud _resultMask; +showHUD _resultMask; _resultMask diff --git a/addons/common/functions/fnc_switchAttachmentMode.sqf b/addons/common/functions/fnc_switchAttachmentMode.sqf index f721428a531..ab1dac6c1c7 100644 --- a/addons/common/functions/fnc_switchAttachmentMode.sqf +++ b/addons/common/functions/fnc_switchAttachmentMode.sqf @@ -63,7 +63,7 @@ switch (_weapon) do { }; if (_exit) exitWith {}; // Don't notify if the unit isn't the local player or if an invalid weapon was passed -private _configSwitchItem = configfile >> "CfgWeapons" >> _switchItem; +private _configSwitchItem = configFile >> "CfgWeapons" >> _switchItem; private _switchItemHintText = getText (_configSwitchItem >> "MRT_SwitchItemHintText"); private _switchItemHintImage = getText (_configSwitchItem >> "picture"); diff --git a/addons/common/functions/fnc_switchPersistentLaser.sqf b/addons/common/functions/fnc_switchPersistentLaser.sqf index 79c0e91f727..5c61693c54f 100644 --- a/addons/common/functions/fnc_switchPersistentLaser.sqf +++ b/addons/common/functions/fnc_switchPersistentLaser.sqf @@ -17,7 +17,7 @@ params ["_enabled"]; -if (!hasInterface) exitwith {}; +if (!hasInterface) exitWith {}; // Reset state { diff --git a/addons/common/functions/fnc_unloadPersonLocal.sqf b/addons/common/functions/fnc_unloadPersonLocal.sqf index 0378c6a4b86..24e44fc6797 100644 --- a/addons/common/functions/fnc_unloadPersonLocal.sqf +++ b/addons/common/functions/fnc_unloadPersonLocal.sqf @@ -34,7 +34,7 @@ if (_emptyPos isEqualTo []) then { }; }; -if (count _emptyPos != 3) exitwith { +if (count _emptyPos != 3) exitWith { WARNING_4("Could not find unload pos %1-ASL: %2 isTouchingGround: %3 Speed: %4",_vehicle,getPosASL _vehicle,isTouchingGround _vehicle,speed _vehicle); if ((!isNull _unloader) && {[_unloader] call FUNC(isPlayer)}) then { //display text saying there are no safe places to exit the vehicle diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 4593805846b..86f046de55f 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -1932,5 +1932,22 @@ Влияет на величину колебания прицела оружия при его развертывании. Afecta la cantidad de oscilación del arma cuando se está desplegado. + + Release + Отпустить + Soltar + Puść + Položit + Lâcher + Loslassen + Soltar + Lascia + Elengedés + 離す + 놓기 + 放開 + 放开 + Bırak + diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp index 752745fb35e..c96253ec51c 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp @@ -19,7 +19,7 @@ class CfgVehicles { magazineLocation = "_target selectionPosition 'otochlaven'"; proxyWeapon = "CUP_proxy_mortar_82mm"; disassembleWeapon = "CUP_2b14_carry"; - disassembleTurret = "ace_csw_mortarBaseplate"; + disassembleTurret = QEGVAR(csw,mortarBaseplate); desiredAmmo = 1; ammoLoadTime = 3; ammoUnloadTime = 3; @@ -29,14 +29,14 @@ class CfgVehicles { class CUP_M252_base: CUP_2b14_82mm_Base { class ace_csw: ace_csw { disassembleWeapon = "CUP_m252_carry"; - disassembleTurret = "ace_csw_mortarBaseplate"; + disassembleTurret = QEGVAR(csw,mortarBaseplate); }; }; class CUP_L16A2_base: CUP_M252_base { class ace_csw: ace_csw { disassembleWeapon = "CUP_l16a2_carry"; - disassembleTurret = "ace_csw_mortarBaseplate"; + disassembleTurret = QEGVAR(csw,mortarBaseplate); }; }; @@ -47,7 +47,7 @@ class CfgVehicles { proxyWeapon = "CUP_proxy_m2"; magazineLocation = "_target selectionPosition 'magazine'"; disassembleWeapon = "CUP_m2_carry"; - disassembleTurret = "ace_csw_m3Tripod"; + disassembleTurret = QEGVAR(csw,m3Tripod); desiredAmmo = 100; ammoLoadTime = 10; ammoUnloadTime = 8; @@ -57,7 +57,7 @@ class CfgVehicles { class CUP_M2StaticMG_MiniTripod_base: CUP_M2StaticMG_base { class ace_csw: ace_csw { enabled = 1; - disassembleTurret = "ace_csw_m3TripodLow"; + disassembleTurret = QEGVAR(csw,m3TripodLow); }; }; @@ -67,7 +67,7 @@ class CfgVehicles { proxyWeapon = "CUP_proxy_DSHKM"; magazineLocation = "_target selectionPosition 'otocvez'"; disassembleWeapon = "CUP_DSHKM_carry"; - disassembleTurret = "ace_csw_kordTripod"; + disassembleTurret = QEGVAR(csw,kordTripod); desiredAmmo = 100; ammoLoadTime = 10; ammoUnloadTime = 8; @@ -87,7 +87,7 @@ class CfgVehicles { proxyWeapon = "CUP_proxy_KORD"; magazineLocation = "_target selectionPosition 'magazine'"; disassembleWeapon = "CUP_KORD_carry"; - disassembleTurret = "ace_csw_kordTripod"; + disassembleTurret = QEGVAR(csw,kordTripod); desiredAmmo = 100; ammoLoadTime = 10; ammoUnloadTime = 8; @@ -97,7 +97,7 @@ class CfgVehicles { class CUP_KORD_MiniTripod_Base: CUP_KORD_Base { class ace_csw: ace_csw { enabled = 1; - disassembleTurret = "ace_csw_kordTripodLow"; + disassembleTurret = QEGVAR(csw,kordTripodLow); }; }; @@ -108,7 +108,7 @@ class CfgVehicles { proxyWeapon = "CUP_proxy_AGS30"; magazineLocation = "_target selectionPosition 'otochlaven'"; disassembleWeapon = "CUP_AGS30_carry"; - disassembleTurret = "ace_csw_sag30Tripod"; + disassembleTurret = QEGVAR(csw,sag30Tripod); desiredAmmo = 29; ammoLoadTime = 10; ammoUnloadTime = 8; @@ -121,7 +121,7 @@ class CfgVehicles { proxyWeapon = "CUP_proxy_MK19"; magazineLocation = "_target selectionPosition 'otochlaven'"; disassembleWeapon = "CUP_MK19_carry"; - disassembleTurret = "ace_csw_m3TripodLow"; + disassembleTurret = QEGVAR(csw,m3TripodLow); desiredAmmo = 48; ammoLoadTime = 10; ammoUnloadTime = 8; @@ -148,7 +148,7 @@ class CfgVehicles { proxyWeapon = "CUP_proxy_TOW"; magazineLocation = "_target selectionPosition 'otochlaven'"; disassembleWeapon = "CUP_TOW_carry"; - disassembleTurret = "ace_csw_m220Tripod"; + disassembleTurret = QEGVAR(csw,m220Tripod); desiredAmmo = 1; ammoLoadTime = 8; ammoUnloadTime = 5; @@ -167,7 +167,7 @@ class CfgVehicles { proxyWeapon = "CUP_proxy_SPG9"; magazineLocation = "_target selectionPosition 'handle'"; disassembleWeapon = "CUP_SPG9_carry"; - disassembleTurret = "ace_csw_spg9Tripod"; + disassembleTurret = QEGVAR(csw,spg9Tripod); desiredAmmo = 1; ammoLoadTime = 5; ammoUnloadTime = 3; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgWeapons.hpp b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgWeapons.hpp index 9ff8519ce11..56213219040 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgWeapons.hpp +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgWeapons.hpp @@ -60,6 +60,7 @@ class CfgWeapons { class assembleTo { ace_csw_m3Tripod = "CUP_I_M2StaticMG_AAF"; ace_csw_m3TripodLow = "CUP_I_M2StaticMG_MiniTripod_AAF"; + EGVAR(compat_spe,m3Tripod) = "CUP_I_M2StaticMG_MiniTripod_AAF"; }; }; class WeaponSlotsInfo: WeaponSlotsInfo { diff --git a/addons/compat_cup_weapons/compat_cup_weapons_javelin/CfgAmmo.hpp b/addons/compat_cup_weapons/compat_cup_weapons_javelin/CfgAmmo.hpp index 2632a43e61e..220af016575 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_javelin/CfgAmmo.hpp +++ b/addons/compat_cup_weapons/compat_cup_weapons_javelin/CfgAmmo.hpp @@ -7,20 +7,51 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - minDeflection = 0.00005; - maxDeflection = 0.025; - incDeflection = 0.00005; + + pitchRate = 120; // degrees per second + yawRate = 120; + stabilityCoefficient = 0.2; + bangBangGuidance = 0; + canVanillaLock = 0; + + // Guidance type for munitions defaultSeekerType = "Optic"; - seekerTypes[] = {"Optic"}; + seekerTypes[] = { "Optic" }; + defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = {"LOBL"}; - seekerAngle = 180; - seekerAccuracy = 1; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "Direct"; + navigationTypes[] = { "Direct", "ZeroEffortMiss" }; + + navigationGain = 3; + + seekerAngle = 180; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + seekerMinRange = 0; - seekerMaxRange = 2500; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] + + // Attack profile type selection defaultAttackProfile = "JAV_TOP"; - attackProfiles[] = {"JAV_TOP", "JAV_DIR"}; + attackProfiles[] = { "JAV_TOP", "JAV_DIR" }; + useModeForAttackProfile = 1; + + class navigationStates { + class initial { + transitionCondition = QEFUNC(missileguidance,javelin_midCourseTransition); + navigationType = "Direct"; + }; + class terminal { + transitionCondition = ""; + navigationType = "ZeroEffortMiss"; + }; + // transitions from initial -> termimal + states[] = {"initial", "terminal"}; + }; }; }; }; diff --git a/addons/compat_rf/CfgVehicles.hpp b/addons/compat_rf/CfgVehicles.hpp new file mode 100644 index 00000000000..fa0343908a9 --- /dev/null +++ b/addons/compat_rf/CfgVehicles.hpp @@ -0,0 +1,25 @@ +class CfgVehicles { + // Applies the offset to all RF Offroads which can have the optional tank in the back + class Offroad_01_unarmed_base_F; + class Pickup_01_base_rf: Offroad_01_unarmed_base_F { + EXGVAR(field_rations,offset)[] = {-0.04, -2.45, -0.9}; + }; + + // Enable Water Source by Default + class C_IDAP_Pickup_rf; + class C_IDAP_Pickup_water_rf: C_IDAP_Pickup_rf { + EXGVAR(field_rations,waterSupply) = 500; + }; + + class O_Truck_03_fuel_F; + class C_Truck_03_water_rf: O_Truck_03_fuel_F { + EXGVAR(field_rations,waterSupply) = 10000; + EXGVAR(field_rations,offset)[] = {0, -5.05, -0.3}; + }; + + class B_Truck_01_fuel_F; + class C_Truck_01_water_rf: B_Truck_01_fuel_F { + EXGVAR(field_rations,waterSupply) = 10000; + EXGVAR(field_rations,offset)[] = {-0.41, -5.15, -0.3}; + }; +}; diff --git a/addons/compat_rf/config.cpp b/addons/compat_rf/config.cpp index ab6fb942751..52ef83c1b74 100644 --- a/addons/compat_rf/config.cpp +++ b/addons/compat_rf/config.cpp @@ -9,10 +9,11 @@ class CfgPatches { requiredAddons[] = {"RF_Data_Loadorder"}; skipWhenMissingDependencies = 1; author = ECSTRING(common,ACETeam); - authors[] = {"Mike"}; + authors[] = {"Mike", "OverlordZorn[CVO]"}; url = ECSTRING(main,URL); VERSION_CONFIG; }; }; #include "CfgWeapons.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgVehicles.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgVehicles.hpp index 6a3bb0a083e..fb52cc6373c 100644 --- a/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgVehicles.hpp +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgVehicles.hpp @@ -5,7 +5,7 @@ class CfgVehicles { class StaticGrenadeLauncher; class rhs_SPG9_base: AT_01_base_F { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_SPG9); magazineLocation = "_target selectionPosition 'breach'"; @@ -18,14 +18,14 @@ class CfgVehicles { }; class rhs_SPG9M_base: rhs_SPG9_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; disassembleWeapon = QGVAR(spg9m_carry); }; }; class rhs_Kornet_Base: AT_01_base_F { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_9K133_launcher); magazineLocation = "_target selectionPosition 'gun'"; @@ -38,7 +38,7 @@ class CfgVehicles { }; class rhs_Metis_Base: AT_01_base_F { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_9K115_2_launcher); magazineLocation = "_target selectionPosition 'gun'"; @@ -51,7 +51,7 @@ class CfgVehicles { }; class rhs_2b14_82mm_Base: StaticMortar { - class ACE_CSW { + class ace_csw { enabled = 1; magazineLocation = ""; proxyWeapon = QGVAR(rhs_weap_2b14); @@ -64,7 +64,7 @@ class CfgVehicles { }; class rhs_nsv_tripod_base: StaticMGWeapon { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_nsvt_effects); magazineLocation = "_target selectionPosition 'magazine'"; @@ -77,7 +77,7 @@ class CfgVehicles { }; class RHS_KORD_Base: rhs_nsv_tripod_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_KORD); disassembleWeapon = QGVAR(kord_carry); @@ -86,7 +86,7 @@ class CfgVehicles { }; class RHS_KORD_high_base: RHS_KORD_Base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_KORD); disassembleWeapon = QGVAR(kord_carry); @@ -95,7 +95,7 @@ class CfgVehicles { }; class RHS_AGS30_TriPod_base: StaticGrenadeLauncher { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_AGS30); magazineLocation = "_target selectionPosition 'magazine'"; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgWeapons.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgWeapons.hpp index 1e8f4dbdfd1..e444a2aa32f 100644 --- a/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgWeapons.hpp +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgWeapons.hpp @@ -14,7 +14,7 @@ class CfgWeapons { class GVAR(2b14_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 20; pickupTime = 25; @@ -40,7 +40,7 @@ class CfgWeapons { class GVAR(nsv_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -64,7 +64,7 @@ class CfgWeapons { class GVAR(kord_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -89,7 +89,7 @@ class CfgWeapons { class GVAR(ags30_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -113,7 +113,7 @@ class CfgWeapons { class GVAR(spg9_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -136,7 +136,7 @@ class CfgWeapons { }; class GVAR(spg9m_carry): GVAR(spg9_carry) { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { class assembleTo { EGVAR(csw,spg9Tripod) = "rhs_SPG9M_MSV"; }; @@ -147,7 +147,7 @@ class CfgWeapons { class GVAR(metis_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "mount"; deployTime = 4; pickupTime = 4; @@ -169,7 +169,7 @@ class CfgWeapons { class GVAR(kornet_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "mount"; deployTime = 4; pickupTime = 4; diff --git a/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgVehicles.hpp b/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgVehicles.hpp index 7e58387dabc..1a15fc03f40 100644 --- a/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgVehicles.hpp +++ b/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgVehicles.hpp @@ -1,7 +1,7 @@ class CfgVehicles { class StaticMGWeapon; class rhs_DSHKM_base: StaticMGWeapon { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_DSHKM); magazineLocation = "_target selectionPosition 'otocvez'"; @@ -13,7 +13,7 @@ class CfgVehicles { }; }; class rhs_DSHkM_Mini_TriPod_base: rhs_DSHKM_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; disassembleTurret = QEGVAR(csw,kordTripodLow); }; diff --git a/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgWeapons.hpp b/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgWeapons.hpp index 15ff9488cad..279ec98eaa4 100644 --- a/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgWeapons.hpp +++ b/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgWeapons.hpp @@ -7,7 +7,7 @@ class CfgWeapons { }; class GVAR(dshkm_carry): Launcher_Base_F { - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_csw/CfgVehicles.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_csw/CfgVehicles.hpp index cbca20cce76..bfe157c6099 100644 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_csw/CfgVehicles.hpp +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_csw/CfgVehicles.hpp @@ -14,7 +14,7 @@ class CfgVehicles { }; }; - class ACE_CSW { + class ace_csw { enabled = 1; magazineLocation = ""; proxyWeapon = QGVAR(rhs_mortar_81mm); @@ -28,7 +28,7 @@ class CfgVehicles { class StaticMGWeapon; class rhs_m2staticmg_base: StaticMGWeapon { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_M2); magazineLocation = "_target selectionPosition 'magazine'"; @@ -41,7 +41,7 @@ class CfgVehicles { }; class RHS_M2StaticMG_MiniTripod_base: rhs_m2staticmg_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; disassembleTurret = QEGVAR(csw,m3TripodLow); }; @@ -49,7 +49,7 @@ class CfgVehicles { class StaticGrenadeLauncher; class RHS_MK19_TriPod_base: StaticGrenadeLauncher { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_MK19); magazineLocation = "_target selectionPosition 'magazine'"; @@ -63,7 +63,7 @@ class CfgVehicles { class StaticATWeapon; class RHS_TOW_TriPod_base: StaticATWeapon { - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(rhs_weap_TOW_Launcher_static); magazineLocation = "_target selectionPosition 'tube'"; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_csw/CfgWeapons.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_csw/CfgWeapons.hpp index d373e7fe673..b1a8bd88593 100644 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_csw/CfgWeapons.hpp +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_csw/CfgWeapons.hpp @@ -11,7 +11,7 @@ class CfgWeapons { class GVAR(m252_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 20; pickupTime = 25; @@ -37,13 +37,14 @@ class CfgWeapons { class GVAR(m2_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; class assembleTo { EGVAR(csw,m3Tripod) = "RHS_M2StaticMG_WD"; EGVAR(csw,m3TripodLow) = "RHS_M2StaticMG_MiniTripod_WD"; + EGVAR(compat_spe,m3Tripod) = "RHS_M2StaticMG_MiniTripod_WD"; }; }; class WeaponSlotsInfo: WeaponSlotsInfo { @@ -62,7 +63,7 @@ class CfgWeapons { class GVAR(mk19_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -86,7 +87,7 @@ class CfgWeapons { class GVAR(tow_carry): Launcher_Base_F { dlc = "ace"; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_javelin/CfgAmmo.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_javelin/CfgAmmo.hpp index 65ca880587f..b0df767e3a0 100644 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_javelin/CfgAmmo.hpp +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_javelin/CfgAmmo.hpp @@ -9,9 +9,10 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - minDeflection = 0.00005; // Minium flap deflection for guidance - maxDeflection = 0.025; // Maximum flap deflection for guidance - incDeflection = 0.00005; // The incrmeent in which deflection adjusts. + pitchRate = 120; // degrees per second + yawRate = 120; + stabilityCoefficient = 0.2; + bangBangGuidance = 0; canVanillaLock = 0; @@ -22,6 +23,11 @@ class CfgAmmo { defaultSeekerLockMode = "LOBL"; seekerLockModes[] = { "LOBL" }; + defaultNavigationType = "Direct"; + navigationTypes[] = { "Direct", "ZeroEffortMiss" }; + + navigationGain = 3; + seekerAngle = 180; // Angle in front of the missile which can be searched seekerAccuracy = 1; // seeker accuracy multiplier @@ -34,6 +40,19 @@ class CfgAmmo { defaultAttackProfile = "JAV_TOP"; attackProfiles[] = { "JAV_TOP", "JAV_DIR" }; useModeForAttackProfile = 1; + + class navigationStates { + class initial { + transitionCondition = QEFUNC(missileguidance,javelin_midCourseTransition); + navigationType = "Direct"; + }; + class terminal { + transitionCondition = ""; + navigationType = "ZeroEffortMiss"; + }; + // transitions from initial -> termimal + states[] = {"initial", "terminal"}; + }; }; }; }; diff --git a/addons/compat_sog/CfgVehicles/turrets.hpp b/addons/compat_sog/CfgVehicles/turrets.hpp index 6142a018e81..928b80716a4 100644 --- a/addons/compat_sog/CfgVehicles/turrets.hpp +++ b/addons/compat_sog/CfgVehicles/turrets.hpp @@ -17,7 +17,7 @@ class vn_static_m2_high_base: StaticMGWeapon { }; }; - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = "vn_m2_v_01"; magazineLocation = "_target selectionPosition 'mg1_magazine'"; @@ -31,7 +31,7 @@ class vn_static_m2_high_base: StaticMGWeapon { // M2 Browning - Low class vn_static_m2_low_base: vn_static_m2_high_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleTurret = QEGVAR(csw,m3TripodLow); }; }; @@ -45,7 +45,7 @@ class vn_static_m1919a6_base: vn_static_m2_low_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = "vn_m1919_v_01"; magazineLocation = "_target selectionPosition 'mg1_magazine' vectorAdd [-0.3, 0, 0]"; @@ -66,7 +66,7 @@ class vn_static_m1919a4_high_base: vn_static_m1919a6_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = "vn_m1919_v_01"; magazineLocation = "_target selectionPosition 'mg1_magazine'"; @@ -80,7 +80,7 @@ class vn_static_m1919a4_high_base: vn_static_m1919a6_base { // M1919A4 - Low class vn_static_m1919a4_low_base: vn_static_m1919a4_high_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleTurret = QEGVAR(csw,m3TripodLow); }; }; @@ -93,7 +93,7 @@ class vn_static_m60_high_base: vn_static_m2_low_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = "vn_m60_v_01"; magazineLocation = "_target selectionPosition 'mg1_trigger'"; @@ -113,7 +113,7 @@ class vn_static_m60_low_base: vn_static_m60_high_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { magazineLocation = "_target selectionPosition 'mg1_otochlaven_recoil'"; disassembleTurret = QEGVAR(csw,m3TripodLow); }; @@ -131,7 +131,7 @@ class vn_static_tow_base: vn_static_at3_base { }; }; - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = "vn_missile_tow_launcher"; magazineLocation = "_target selectionPosition 'magazine'"; @@ -145,7 +145,7 @@ class vn_static_tow_base: vn_static_at3_base { // DShKM - High class vn_static_dp28_high_base: vn_static_m2_high_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 0; }; }; @@ -156,7 +156,7 @@ class vn_static_dshkm_high_01_base: vn_static_dp28_high_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = "vn_dshkm_v_01"; magazineLocation = "_target selectionPosition 'mg1_boxmag'"; @@ -170,7 +170,7 @@ class vn_static_dshkm_high_01_base: vn_static_dp28_high_base { // DShKM - High, with AA sight class vn_static_dshkm_high_02_base: vn_static_dshkm_high_01_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleWeapon = QGVAR(dshkm_AA_carry); }; }; @@ -185,7 +185,7 @@ class vn_static_dshkm_low_01_base: vn_static_dshkm_high_01_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleWeapon = QGVAR(dshkm_shield_carry); disassembleTurret = QEGVAR(csw,kordTripodLow); }; @@ -193,7 +193,7 @@ class vn_static_dshkm_low_01_base: vn_static_dshkm_high_01_base { // DShKM - Low class vn_static_dshkm_low_02_base: vn_static_dshkm_low_01_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleWeapon = QGVAR(dshkm_carry); }; }; @@ -206,7 +206,7 @@ class vn_static_rpd_high_base: vn_static_dp28_high_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = "vn_rpd_v_01"; magazineLocation = "_target selectionPosition 'mg1_otochlaven_recoil'"; @@ -226,7 +226,7 @@ class vn_static_pk_high_base: vn_static_rpd_high_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = "vn_pk_v_01"; magazineLocation = "_target selectionPosition 'mg1_otochlaven_recoil'"; @@ -246,7 +246,7 @@ class vn_static_pk_low_base: vn_static_pk_high_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleTurret = QEGVAR(csw,kordTripodLow); }; }; @@ -259,7 +259,7 @@ class vn_static_mg42_high_base: vn_static_rpd_high_base { }; }; - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = "vn_mg42_v_01"; magazineLocation = "_target selectionPosition 'mg1_otochlaven_recoil'"; @@ -278,7 +278,7 @@ class vn_static_mg42_low_base: vn_static_mg42_high_base { }; }; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleTurret = ""; }; }; @@ -294,7 +294,7 @@ class vn_static_sgm_high_base: vn_static_sgm_base { }; }; - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = "vn_sgm_v_01"; magazineLocation = "_target selectionPosition 'mg1_otochlaven_recoil'"; @@ -308,7 +308,7 @@ class vn_static_sgm_high_base: vn_static_sgm_base { // SGM - Low class vn_static_sgm_low_base: vn_static_sgm_high_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleWeapon = QGVAR(sgm_carry); disassembleTurret = QEGVAR(csw,kordTripodLow); }; @@ -316,25 +316,25 @@ class vn_static_sgm_low_base: vn_static_sgm_high_base { // SGM - Shield class vn_o_pl_static_sgm_low_01: vn_static_sgm_low_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleWeapon = QGVAR(sgm_shield_carry); disassembleTurret = QEGVAR(csw,kordTripodLow); }; }; class vn_o_nva_65_static_sgm_low_01: vn_static_sgm_low_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleWeapon = QGVAR(sgm_shield_carry); disassembleTurret = QEGVAR(csw,kordTripodLow); }; }; class vn_o_nva_static_sgm_low_01: vn_static_sgm_low_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleWeapon = QGVAR(sgm_shield_carry); disassembleTurret = QEGVAR(csw,kordTripodLow); }; }; class vn_o_nva_navy_static_sgm_low_01: vn_static_sgm_low_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { disassembleWeapon = QGVAR(sgm_shield_carry); disassembleTurret = QEGVAR(csw,kordTripodLow); }; @@ -351,7 +351,7 @@ class vn_static_mk18_base: StaticCannon { }; }; - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = "vn_mk18_v_01"; magazineLocation = "_target selectionPosition 'mg1_magazine'"; @@ -378,7 +378,7 @@ class vn_static_mortar_m29_base: Mortar_01_base_F { }; }; - class ACE_CSW { + class ace_csw { enabled = 1; proxyWeapon = QGVAR(vn_mortar_m29); magazineLocation = "_target selectionPosition 'pohon'"; @@ -392,7 +392,7 @@ class vn_static_mortar_m29_base: Mortar_01_base_F { // M2 / Type 63 Mortar class vn_static_mortar_m2_base: vn_static_mortar_m29_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = QGVAR(vn_mortar_m2); magazineLocation = "_target selectionPosition 'pohon'"; @@ -406,7 +406,7 @@ class vn_static_mortar_m2_base: vn_static_mortar_m29_base { // Type 53 Mortar class vn_static_mortar_type53_base: vn_static_mortar_m29_base { - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 1; proxyWeapon = QGVAR(vn_mortar_type53); magazineLocation = "_target selectionPosition 'pohon'"; @@ -430,7 +430,7 @@ class vn_static_h12_base: Mortar_01_base_F { }; }; - class ACE_CSW { + class ace_csw { enabled = 0; }; }; @@ -441,7 +441,7 @@ class vn_static_m45_base: vn_static_m2_high_base { EGVAR(dragging,canCarry) = 0; EGVAR(dragging,canDrag) = 0; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 0; }; }; @@ -450,7 +450,7 @@ class vn_static_zpu4_base: vn_static_m2_high_base { EGVAR(dragging,canCarry) = 0; EGVAR(dragging,canDrag) = 0; - class ACE_CSW: ACE_CSW { + class ace_csw: ace_csw { enabled = 0; }; }; @@ -466,7 +466,7 @@ class vn_o_static_rsna75: StaticMGWeapon { }; }; - class ACE_CSW { + class ace_csw { enabled = 0; }; }; diff --git a/addons/compat_sog/CfgWeapons/csw.hpp b/addons/compat_sog/CfgWeapons/csw.hpp index 87b1b16c5ec..b5ca942f6e8 100644 --- a/addons/compat_sog/CfgWeapons/csw.hpp +++ b/addons/compat_sog/CfgWeapons/csw.hpp @@ -20,7 +20,7 @@ class GVAR(m2_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_m2b_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -48,7 +48,7 @@ class GVAR(m1919a4_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_m1919a4_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -76,7 +76,7 @@ class GVAR(m1919a6_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_m1919a6_ca.paa); - class ACE_CSW { + class ace_csw { type = "mount"; deployTime = 2; pickupTime = 2; @@ -100,7 +100,7 @@ class GVAR(m60_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_m60_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -128,7 +128,7 @@ class GVAR(tow_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_tow_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -155,7 +155,7 @@ class GVAR(dshkm_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_dshkm_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -183,7 +183,7 @@ class GVAR(dshkm_shield_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_dshkm_shield_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -210,7 +210,7 @@ class GVAR(dshkm_AA_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_dshkm_aa_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -237,7 +237,7 @@ class GVAR(rpd_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_rpd_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -264,7 +264,7 @@ class GVAR(pk_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_pk_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -292,7 +292,7 @@ class GVAR(mortar_m29_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_m29_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 20; pickupTime = 25; @@ -319,7 +319,7 @@ class GVAR(mg42_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_mg42_ca.paa); - class ACE_CSW { + class ace_csw { type = "mount"; deployTime = 4; pickupTime = 4; @@ -347,7 +347,7 @@ class GVAR(sgm_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_sgm_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -374,7 +374,7 @@ class GVAR(sgm_shield_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_sgm_shield_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -401,7 +401,7 @@ class GVAR(mk18_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_mk18_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 4; pickupTime = 4; @@ -430,7 +430,7 @@ class GVAR(mortar_m2_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_m2_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 20; pickupTime = 25; @@ -457,7 +457,7 @@ class GVAR(mortar_type53_carry): Launcher_Base_F { modes[] = {}; picture = QPATHTOF(UI\csw_type53_ca.paa); - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 20; pickupTime = 25; diff --git a/addons/compat_spe/CfgMagazines/csw.hpp b/addons/compat_spe/CfgMagazines/csw.hpp index 404156bd8f8..6b4c385a42a 100644 --- a/addons/compat_spe/CfgMagazines/csw.hpp +++ b/addons/compat_spe/CfgMagazines/csw.hpp @@ -2,43 +2,16 @@ class CA_Magazine; // M1919A4/A6 class SPE_50Rnd_762x63: CA_Magazine { - ACE_isBelt = 0; -}; - -class SPE_100Rnd_762x63: SPE_50Rnd_762x63 { - ACE_isBelt = 1; -}; - -class SPE_100Rnd_762x63_M1: SPE_100Rnd_762x63 { ACE_isBelt = 1; }; -class SPE_100Rnd_762x63_M2_AP: SPE_100Rnd_762x63 { +// M2 +class VehicleMagazine; +class SPE_100Rnd_127x99_M2: VehicleMagazine { ACE_isBelt = 1; }; -//MG34/42 - +// MG34/42 class SPE_50Rnd_792x57: CA_Magazine { - ACE_isBelt = 0; -}; - -class SPE_50Rnd_792x57_sS: SPE_50Rnd_792x57 { - ACE_isBelt = 0; -}; - -class SPE_50Rnd_792x57_SMK: SPE_50Rnd_792x57_sS { - ACE_isBelt = 0; -}; - -class SPE_100Rnd_792x57: SPE_50Rnd_792x57 { - ACE_isBelt = 1; -}; - -class SPE_100Rnd_792x57_sS: SPE_50Rnd_792x57_sS { - ACE_isBelt = 1; -}; - -class SPE_100Rnd_792x57_SMK: SPE_50Rnd_792x57_SMK { ACE_isBelt = 1; }; diff --git a/addons/compat_spe/compat_spe_csw/ACE_CSW_Groups.hpp b/addons/compat_spe/compat_spe_csw/ACE_CSW_Groups.hpp deleted file mode 100644 index 35758ed5333..00000000000 --- a/addons/compat_spe/compat_spe_csw/ACE_CSW_Groups.hpp +++ /dev/null @@ -1,50 +0,0 @@ -class ACE_CSW_Groups { - - // --- Gun Turrets ------------------------------------------------------------- - - class SPE_100Rnd_762x63 { - SPE_100Rnd_762x63 = 1; - }; - - class SPE_100Rnd_762x63_M1 { - SPE_100Rnd_762x63_M1 = 1; - }; - - class SPE_100Rnd_762x63_M2_AP { - SPE_100Rnd_762x63_M2_AP = 1; - }; - - class SPE_100Rnd_792x57 { - SPE_100Rnd_792x57 = 1; - }; - - class SPE_100Rnd_792x57_sS { - SPE_100Rnd_792x57_sS = 1; - }; - - class SPE_100Rnd_792x57_SMK { - SPE_100Rnd_792x57_SMK = 1; - }; - - // --- Mortars ------------------------------------------------------------- - - class SPE_1Rnd_81mmHE_M1_M43A1 { - SPE_1Rnd_81mmHE_M1_M43A1 = 1; - }; - class SPE_1Rnd_81mmWP_M1_M57 { - SPE_1Rnd_81mmWP_M1_M57 = 1; - }; - class SPE_81mm_M1_M57_SmokeShell { - SPE_81mm_M1_M57_SmokeShell = 1; - }; - - class SPE_1Rnd_81mm_FA_Mle_1932_HE { - SPE_1Rnd_81mm_FA_Mle_1932_HE = 1; - }; - class SPE_81mm_FA_Mle_1932_Smoke { - SPE_81mm_FA_Mle_1932_Smoke = 1; - }; - class SPE_81mm_FA_Mle_1932_Illu { - SPE_81mm_FA_Mle_1932_Illu = 1; - }; -}; diff --git a/addons/compat_spe/compat_spe_csw/CfgMagazineGroups.hpp b/addons/compat_spe/compat_spe_csw/CfgMagazineGroups.hpp new file mode 100644 index 00000000000..78f6d0629dd --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/CfgMagazineGroups.hpp @@ -0,0 +1,94 @@ +class EGVAR(csw,groups) { + // --- Gun Turrets ------------------------------------------------------------- + class SPE_50Rnd_762x63 { + SPE_50Rnd_762x63 = 1; + }; + class SPE_100Rnd_762x63 { + SPE_100Rnd_762x63 = 1; + }; + + class SPE_50Rnd_762x63_M1 { + SPE_50Rnd_762x63_M1 = 1; + }; + class SPE_100Rnd_762x63_M1 { + SPE_100Rnd_762x63_M1 = 1; + }; + + class SPE_50Rnd_762x63_M2_AP { + SPE_50Rnd_762x63_M2_AP = 1; + }; + class SPE_100Rnd_762x63_M2_AP { + SPE_100Rnd_762x63_M2_AP = 1; + }; + + class SPE_50Rnd_762x63_Tracer { + SPE_50Rnd_762x63_Tracer = 1; + }; + class SPE_100Rnd_762x63_Tracer { + SPE_100Rnd_762x63_Tracer = 1; + }; + + class SPE_50Rnd_792x57 { + SPE_50Rnd_792x57 = 1; + }; + class SPE_100Rnd_792x57 { + SPE_100Rnd_792x57 = 1; + SPE_250Rnd_792x57 = 1; + }; + + class SPE_50Rnd_792x57_sS { + SPE_50Rnd_792x57_sS = 1; + }; + class SPE_100Rnd_792x57_sS { + SPE_100Rnd_792x57_sS = 1; + SPE_250Rnd_792x57_sS = 1; + }; + + class SPE_50Rnd_792x57_SMK { + SPE_50Rnd_792x57_SMK = 1; + }; + class SPE_100Rnd_792x57_SMK { + SPE_100Rnd_792x57_SMK = 1; + SPE_250Rnd_792x57_SMK = 1; + }; + + class SPE_50Rnd_792x57_Tracer { + SPE_50Rnd_792x57_Tracer = 1; + }; + class SPE_100Rnd_792x57_Tracer { + SPE_100Rnd_792x57_Tracer = 1; + }; + + // Makes it compatible with other mods' .50 BMG + class EGVAR(csw,100Rnd_127x99_mag) { + SPE_100Rnd_127x99_M2 = 1; + }; + class SPE_100Rnd_127x99_M2: EGVAR(csw,100Rnd_127x99_mag) {}; + + // --- Mortars ------------------------------------------------------------- + class SPE_1Rnd_81mmHE_M1_M43A1 { + SPE_8Rnd_81mmHE_M1_M43A1 = 1; + SPE_1Rnd_81mmHE_M1_M43A1 = 1; + }; + class SPE_1Rnd_81mmWP_M1_M57 { + SPE_8Rnd_81mmWP_M1_M57 = 1; + SPE_1Rnd_81mmWP_M1_M57 = 1; + }; + class SPE_81mm_M1_M57_SmokeShell { + SPE_8rnd_81mm_M1_M57_SmokeShell = 1; + SPE_81mm_M1_M57_SmokeShell = 1; + }; + + class SPE_1Rnd_81mm_FA_Mle_1932_HE { + SPE_8Rnd_81mm_FA_Mle_1932_HE = 1; + SPE_1Rnd_81mm_FA_Mle_1932_HE = 1; + }; + class SPE_81mm_FA_Mle_1932_Smoke { + SPE_8Rnd_81mm_FA_Mle_1932_Smoke = 1; + SPE_81mm_FA_Mle_1932_Smoke = 1; + }; + class SPE_81mm_FA_Mle_1932_Illu { + SPE_8Rnd_81mm_FA_Mle_1932_Illu = 1; + SPE_81mm_FA_Mle_1932_Illu = 1; + }; +}; diff --git a/addons/compat_spe/compat_spe_csw/CfgMagazines.hpp b/addons/compat_spe/compat_spe_csw/CfgMagazines.hpp new file mode 100644 index 00000000000..9c255c28008 --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/CfgMagazines.hpp @@ -0,0 +1,26 @@ +// In SPE 1.1.1, the tracer magazines don't have proper names +class CfgMagazines { + class SPE_50Rnd_762x63; + class SPE_50Rnd_762x63_Tracer: SPE_50Rnd_762x63 { + displayName = SUBCSTRING(50Rnd_762x63_Tracer); + displayNameShort = "$STR_A3_tracer_dns"; + }; + + class SPE_100Rnd_762x63; + class SPE_100Rnd_762x63_Tracer: SPE_100Rnd_762x63 { + displayName = SUBCSTRING(100Rnd_762x63_Tracer); + displayNameShort = "$STR_A3_tracer_dns"; + }; + + class SPE_50Rnd_792x57; + class SPE_50Rnd_792x57_Tracer: SPE_50Rnd_792x57 { + displayName = SUBCSTRING(50Rnd_792x57_Tracer); + displayNameShort = "$STR_A3_tracer_dns"; + }; + + class SPE_100Rnd_792x57; + class SPE_100Rnd_792x57_Tracer: SPE_100Rnd_792x57 { + displayName = SUBCSTRING(100Rnd_792x57_Tracer); + displayNameShort = "$STR_A3_tracer_dns"; + }; +}; diff --git a/addons/compat_spe/compat_spe_csw/CfgVehicles.hpp b/addons/compat_spe/compat_spe_csw/CfgVehicles.hpp index e0a38aa341c..30d39301f38 100644 --- a/addons/compat_spe/compat_spe_csw/CfgVehicles.hpp +++ b/addons/compat_spe/compat_spe_csw/CfgVehicles.hpp @@ -9,90 +9,267 @@ class CfgVehicles { class ACE_Actions { class ACE_MainActions; }; - class Turrets { - class MainTurret; + }; + + // --- Gun Turrets ------------------------------------------------------------- + class StaticMGWeapon: StaticWeapon {}; + class SPE_StaticMGWeapon_base: StaticMGWeapon {}; + class SPE_M2_M3: SPE_StaticMGWeapon_base { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = ""; + selection = "zamerny"; + }; + }; + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(M2_proxy); + magazineLocation = ""; + disassembleWeapon = "SPE_M2_50"; + disassembleTurret = QGVAR(m3Tripod); + ammoLoadTime = 10; + ammoUnloadTime = 8; + desiredAmmo = 100; + }; + }; + class SPE_M2_M3_Trench: SPE_M2_M3 { + class ace_csw: ace_csw { + disassembleWeapon = ""; + disassembleTurret = ""; }; - class UserActions; }; - // --- Mortars ----------------------------------------------------------------- - class StaticMortar: StaticWeapon { - class Turrets: Turrets { - class MainTurret: MainTurret {}; + + class SPE_M1919_M2: SPE_StaticMGWeapon_base { + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(M1919A4_proxy); + magazineLocation = "_target selectionPosition ['magazine', 'FireGeometry', 'AveragePoint']"; + disassembleWeapon = "SPE_M1919A4"; + disassembleTurret = QGVAR(m2Tripod); + ammoLoadTime = 8; + ammoUnloadTime = 6; + desiredAmmo = 100; }; }; - class SPE_StaticMortar_base: StaticMortar { - class Turrets: Turrets { - class MainTurret: MainTurret {}; + class SPE_M1919_M2_Trench_Deployed: SPE_M1919_M2 { + class ace_csw: ace_csw { + disassembleWeapon = ""; + disassembleTurret = ""; }; - class EventHandlers: EventHandlers { - class SPE_StaticWeaponsHandler { - init = ""; + }; + + + class SPE_MG42_Lafette: SPE_StaticMGWeapon_base { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + class GVAR(alterHeight) { + condition = "getText (configOf _target >> 'SPE_AltHeight_Tripod_Name') != '' && {[_target, true] call SPE_WEAPONS_STATIC_fnc_can_alter_height}"; + displayName = "$STR_SPE_DN_ASSETS_VEHICLES_ADJUST_TRIPOD_HEIGHT"; + statement = "[_target, getText (configOf _target >> 'SPE_AltHeight_Tripod_Name'), true] call SPE_Weapons_Static_fnc_alter_height"; + icon = "\A3\Ui_f\data\IGUI\Cfg\Actions\repair_ca.paa"; + modifierFunction = "(_this select 3) set [1, format [localize 'STR_SPE_DN_ASSETS_VEHICLES_ADJUST_TRIPOD_HEIGHT', getText (configOf _target >> 'displayName')]]"; + }; }; }; }; + class SPE_MG42_Lafette_Deployed: SPE_MG42_Lafette { + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(MG42_proxy); + magazineLocation = ""; + disassembleWeapon = "SPE_MG42"; + disassembleTurret = QGVAR(LafetteTripod); + ammoLoadTime = 7; + ammoUnloadTime = 5; + desiredAmmo = 100; + }; + }; + class SPE_MG34_Lafette_Deployed: SPE_MG42_Lafette { + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(MG34_proxy); + magazineLocation = ""; + disassembleWeapon = "SPE_MG34"; + disassembleTurret = QGVAR(LafetteTripod); + ammoLoadTime = 7; + ammoUnloadTime = 5; + desiredAmmo = 100; + }; + }; - class SPE_US_Mortar_base: SPE_StaticMortar_base {}; - class SPE_M1_81: SPE_US_Mortar_base { - class Turrets: Turrets { - class MainTurret: MainTurret { - magazines[] = {}; + class SPE_MG42_Lafette_low; + class SPE_MG42_Lafette_low_Deployed: SPE_MG42_Lafette_low { + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(MG42_proxy); + magazineLocation = ""; + disassembleWeapon = "SPE_MG42"; + disassembleTurret = QGVAR(LafetteTripodLow); + ammoLoadTime = 7; + ammoUnloadTime = 5; + desiredAmmo = 100; + }; + }; + class SPE_MG42_Lafette_trench_Deployed: SPE_MG42_Lafette_low_Deployed { + class ace_csw: ace_csw { + disassembleWeapon = ""; + disassembleTurret = ""; + }; + }; + + class SPE_MG34_Lafette_low_Deployed: SPE_MG42_Lafette_low { + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(MG34_proxy); + magazineLocation = ""; + disassembleWeapon = "SPE_MG34"; + disassembleTurret = QGVAR(LafetteTripodLow); + ammoLoadTime = 7; + ammoUnloadTime = 5; + desiredAmmo = 100; + }; + }; + class SPE_MG34_Lafette_Trench_Deployed: SPE_MG34_Lafette_low_Deployed { + class ace_csw: ace_csw { + disassembleWeapon = ""; + disassembleTurret = ""; + }; + }; + + + class SPE_MG_Bipod_base; + class SPE_M1919A6_Bipod: SPE_MG_Bipod_base { + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(M1919A6_proxy); + magazineLocation = ""; + disassembleWeapon = ""; + disassembleTurret = ""; + ammoLoadTime = 8; + ammoUnloadTime = 6; + desiredAmmo = 100; + }; + }; + + + class SPE_MG42_Bipod: SPE_MG_Bipod_base { + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(MG42_proxy); + magazineLocation = ""; + disassembleWeapon = ""; + disassembleTurret = ""; + ammoLoadTime = 7; + ammoUnloadTime = 5; + desiredAmmo = 100; + }; + }; + class SPE_MG34_Bipod: SPE_MG_Bipod_base { + class ace_csw { + enabled = 1; + proxyWeapon = QGVAR(MG34_proxy); + magazineLocation = ""; + disassembleWeapon = ""; + disassembleTurret = ""; + ammoLoadTime = 7; + ammoUnloadTime = 5; + desiredAmmo = 100; + }; + }; + + + class ThingX; + class EGVAR(csw,baseTripod): ThingX { + class ACE_Actions { + class ACE_MainActions; + }; + }; + class GVAR(m3Tripod): EGVAR(csw,baseTripod) { + scope = 2; + displayName = "$STR_DN_SPE_M3_Tripod"; + model = "\WW2\SPE_Assets_m\Vehicles\StaticWeapons_U1_m\SPE_M3_Tripod.p3d"; + picture = "\WW2\SPE_Assets_t\Weapons\Equipment_U1_t\Weapons\Launchers\Gear_M3_Tripod_X_ca.paa"; + class ace_csw { + disassembleTo = "SPE_M3_Tripod"; + }; + }; + + class GVAR(m2Tripod): EGVAR(csw,baseTripod) { + scope = 2; + displayName = "$STR_DN_SPE_M2_Tripod"; + model = "\WW2\SPE_Assets_m\Vehicles\StaticWeapons_m\SPE_M2_Tripod_Low.p3d"; + picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_M2_Tripod_X_ca.paa"; + class ace_csw { + disassembleTo = "SPE_M2_Tripod"; + }; + }; + + class GVAR(LafetteTripodLow): EGVAR(csw,baseTripod) { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + class GVAR(alterHeight) { + condition = "getText (configOf _target >> 'SPE_AltHeight_Tripod_Name') != '' && {[_target, true] call SPE_WEAPONS_STATIC_fnc_can_alter_height}"; + displayName = "$STR_SPE_DN_ASSETS_VEHICLES_ADJUST_TRIPOD_HEIGHT"; + statement = "[_target, getText (configOf _target >> 'SPE_AltHeight_Tripod_Name'), true] call SPE_Weapons_Static_fnc_alter_height"; + icon = "\A3\Ui_f\data\IGUI\Cfg\Actions\repair_ca.paa"; + modifierFunction = "(_this select 3) set [1, format [localize 'STR_SPE_DN_ASSETS_VEHICLES_ADJUST_TRIPOD_HEIGHT', getText (configOf _target >> 'displayName')]]"; + }; }; }; + scope = 2; + displayName = "$STR_DN_SPE_Lafette_Tripod"; + model = "\WW2\SPE_Assets_m\Vehicles\StaticWeapons_m\SPE_Lafette_Tripod_Low.p3d"; + picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_Lafette_Tripod_X_ca.paa"; + SPE_AltHeight_Tripod_Name = QGVAR(LafetteTripod); + class ace_csw { + disassembleTo = "SPE_Lafette_Tripod"; + }; + }; + + class GVAR(LafetteTripod): GVAR(LafetteTripodLow) { + model = "\WW2\SPE_Assets_m\Vehicles\StaticWeapons_m\SPE_Lafette_Tripod_High.p3d"; + SPE_AltHeight_Tripod_Name = QGVAR(LafetteTripodLow); + class ace_csw { + disassembleTo = "SPE_Lafette_Tripod"; + }; + }; + + // --- Mortars ----------------------------------------------------------------- + class StaticMortar: StaticWeapon {}; + class SPE_StaticMortar_base: StaticMortar {}; + class SPE_US_Mortar_base: SPE_StaticMortar_base {}; + class SPE_M1_81: SPE_US_Mortar_base { class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { position = ""; selection = "zamerny"; }; }; - class UserActions { - delete Prepare_WP_Selected; - delete Prepare_WP; - delete Prepare_Smoke_Selected; - delete Prepare_Smoke; - delete Prepare_HE_Selected; - delete Prepare_HE; - delete Reload; - delete Unload; - }; - class ACE_CSW { + class ace_csw { enabled = 1; - proxyWeapon = "SPE_M1_81_proxy"; + proxyWeapon = QGVAR(M1_proxy); magazineLocation = "_target selectionPosition 'usti hlavne'"; disassembleWeapon = "SPE_M1_81_Barrel"; - disassembleTurret = QGVAR(M1_81_baseplate); + disassembleTurret = QGVAR(m1Baseplate); ammoLoadTime = 3; ammoUnloadTime = 3; desiredAmmo = 1; }; }; + class SPE_FR_Mortar_base: SPE_StaticMortar_base {}; class SPE_MLE_27_31: SPE_FR_Mortar_base { - class Turrets: Turrets { - class MainTurret: MainTurret { - magazines[] = {}; - }; - }; class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { position = ""; selection = "zamerny"; }; }; - class UserActions { - delete Prepare_Illu_Selected; - delete Prepare_Illu; - delete Prepare_Smoke_Selected; - delete Prepare_Smoke; - delete Prepare_HE_Selected; - delete Prepare_HE; - delete Reload; - delete Unload; - }; - class ACE_CSW { + class ace_csw { enabled = 1; - proxyWeapon = "SPE_MLE_27_31_proxy"; + proxyWeapon = QGVAR(MLE_27_31_proxy); magazineLocation = "_target selectionPosition 'usti hlavne'"; disassembleWeapon = "SPE_MLE_27_31_Barrel"; disassembleTurret = QGVAR(MLE_27_31_baseplate); @@ -103,30 +280,9 @@ class CfgVehicles { }; class SPE_GrW278_1: SPE_MLE_27_31 { - class Turrets: Turrets { - class MainTurret: MainTurret { - magazines[] = {}; - }; - }; - class ACE_Actions: ACE_Actions { - class ACE_MainActions: ACE_MainActions { - position = ""; - selection = "zamerny"; - }; - }; - class UserActions { - delete Prepare_Illu_Selected; - delete Prepare_Illu; - delete Prepare_Smoke_Selected; - delete Prepare_Smoke; - delete Prepare_HE_Selected; - delete Prepare_HE; - delete Reload; - delete Unload; - }; - class ACE_CSW { + class ace_csw { enabled = 1; - proxyWeapon = "SPE_GrW278_1_proxy"; + proxyWeapon = QGVAR(GrW278_1_proxy); magazineLocation = "_target selectionPosition 'usti hlavne'"; disassembleWeapon = "SPE_GrW278_1_Barrel"; disassembleTurret = QGVAR(GrW278_baseplate); @@ -137,7 +293,15 @@ class CfgVehicles { }; - class EGVAR(csw,baseTripod); + class GVAR(m1Baseplate): EGVAR(csw,baseTripod) { + scope = 2; + displayName = "$STR_DN_SPE_M1_81_STAND"; + model = "\WW2\SPE_Assets_m\Weapons\Mortars_m\SPE_M1_Mortar_Stand_Deployed.p3d"; + picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_M1_81_Stand_X_ca.paa"; + class ace_csw { + disassembleTo = "SPE_M1_81_Stand"; + }; + }; class GVAR(MLE_27_31_baseplate): EGVAR(csw,baseTripod) { scope = 2; @@ -146,7 +310,7 @@ class CfgVehicles { picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_MLE_27_31_Stand_X_ca.paa"; hiddenSelections[] = {"camo_0","camo_1"}; hiddenSelectionsTextures[] = {"ww2\spe_assets_t\weapons\mortars_t\m1_mortar\Brandt_81mm_Mortar_French_co.paa","WW2\SPE_Assets_t\Weapons\Mortars_t\M1_Mortar\Brandt_81mm_Sight_French_co.paa"}; - class ACE_CSW { + class ace_csw { disassembleTo = "SPE_MLE_27_31_Stand"; }; }; @@ -158,83 +322,8 @@ class CfgVehicles { picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_GrW278_1_Stand_X_ca.paa"; hiddenSelections[] = {"camo_0"}; hiddenSelectionsTextures[] = {"ww2\spe_assets_t\weapons\mortars_t\m1_mortar\Brandt_81mm_Mortar_Gelb_co.paa"}; - class ACE_CSW { + class ace_csw { disassembleTo = "SPE_GrW278_1_Stand"; }; }; - - class GVAR(M1_81_baseplate): EGVAR(csw,baseTripod) { - scope = 2; - displayName = "$STR_DN_SPE_M1_81_STAND"; - model = "\WW2\SPE_Assets_m\Weapons\Mortars_m\SPE_M1_Mortar_Stand_Deployed.p3d"; - picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_M1_81_Stand_X_ca.paa"; - class ACE_CSW { - disassembleTo = "SPE_M1_81_Stand"; - }; - }; - - - class ACE_SPE_M1_81_Stand_Deployed: EGVAR(csw,baseTripod) { - author = "SPE"; - scope = 2; - displayName = "$STR_DN_SPE_M1_81_STAND"; - model = "\WW2\SPE_Assets_m\Weapons\Mortars_m\SPE_M1_Mortar_Stand_Deployed.p3d"; - picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_M1_81_Stand_X_ca.paa"; - class assembleInfo { - base = ""; - primary = 0; - displayName = ""; - assembleTo = ""; - class SPE_M1_81_Barrel { - deployTime = 0; - assembleTo = ""; - }; - }; - class ACE_CSW { - disassembleTo = "SPE_M1_81_Stand"; - }; - }; - class ACE_SPE_GrW278_1_Stand_Deployed: EGVAR(csw,baseTripod) { - author = "SPE"; - scope = 2; - displayName = "$STR_DN_SPE_GrW278_1_STAND"; - model = "\WW2\SPE_Assets_m\Weapons\Mortars_m\SPE_M1_Mortar_Stand_Deployed.p3d"; - picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_GrW278_1_Stand_X_ca.paa"; - hiddenSelectionsTextures[] = {"ww2\spe_assets_t\weapons\mortars_t\m1_mortar\Brandt_81mm_Mortar_Gelb_co.paa","WW2\SPE_Assets_t\Weapons\Mortars_t\M1_Mortar\Brandt_81mm_Sight_Gelb_co.paa"}; - class assembleInfo { - base = ""; - primary = 0; - displayName = ""; - assembleTo = ""; - class SPE_GrW278_1_Barrel { - deployTime = 0; - assembleTo = ""; - }; - }; - class ACE_CSW { - disassembleTo = "SPE_GrW278_1_Stand"; - }; - }; - class ACE_SPE_MLE_27_31_Stand_Deployed: EGVAR(csw,baseTripod) { - author = "SPE"; - scope = 2; - displayName = "$STR_DN_SPE_MLE_27_31_STAND"; - model = "\WW2\SPE_Assets_m\Weapons\Mortars_m\SPE_M1_Mortar_Stand_Deployed.p3d"; - picture = "\WW2\SPE_Assets_t\Weapons\Equipment_t\Weapons\Launchers\Gear_MLE_27_31_Stand_X_ca.paa"; - hiddenSelections[] = {"camo_0","camo_1"}; - hiddenSelectionsTextures[] = {"ww2\spe_assets_t\weapons\mortars_t\m1_mortar\Brandt_81mm_Mortar_French_co.paa","WW2\SPE_Assets_t\Weapons\Mortars_t\M1_Mortar\Brandt_81mm_Sight_French_co.paa"}; - class assembleInfo { - base = ""; - primary = 0; - displayName = ""; - assembleTo = ""; - class SPE_MLE_27_31_Barrel { - deployTime = 0; - assembleTo = ""; - }; - }; - class ACE_CSW { - disassembleTo = "SPE_MLE_27_31_Stand"; - }; - }; }; diff --git a/addons/compat_spe/compat_spe_csw/CfgWeapons.hpp b/addons/compat_spe/compat_spe_csw/CfgWeapons.hpp index db090c77080..b6e71dcb6a9 100644 --- a/addons/compat_spe/compat_spe_csw/CfgWeapons.hpp +++ b/addons/compat_spe/compat_spe_csw/CfgWeapons.hpp @@ -1,43 +1,162 @@ class CfgWeapons { - class Launcher; - class Launcher_Base_F: Launcher { - class WeaponSlotsInfo; + class Launcher_Base_F; + class SPE_Slung_Static_Weapon_Base: Launcher_Base_F {}; + + // --- Vanilla Compat ------------------------------------------------------------- + class EGVAR(csw,staticHMGCarry): Launcher_Base_F { + class ace_csw { + class assembleTo { + GVAR(m3Tripod) = "B_HMG_01_F"; + }; + }; + }; + class EGVAR(csw,staticM2ShieldCarry): EGVAR(csw,staticHMGCarry) { + class ace_csw: ace_csw { + class assembleTo { + GVAR(m3Tripod) = "B_HMG_02_F"; + }; + }; }; - class SPE_Slung_Static_Weapon_Base: Launcher_Base_F {}; + class EGVAR(csw,staticGMGCarry): Launcher_Base_F { + class ace_csw { + class assembleTo { + GVAR(m3Tripod) = "B_GMG_01_F"; + }; + }; + }; + + // --- Gun Turrets ------------------------------------------------------------- + class SPE_M2_M3_Tripod; + class GVAR(M2_proxy): SPE_M2_M3_Tripod { + magazineReloadTime = 0.5; + }; + class SPE_M3_Tripod: SPE_Slung_Static_Weapon_Base { + class ace_csw { + type = "mount"; + deployTime = 4; + pickupTime = 4; + deploy = QGVAR(m3Tripod); + }; + }; + class SPE_M2_50: SPE_Slung_Static_Weapon_Base { + class ace_csw { + type = "weapon"; + deployTime = 4; + pickupTime = 4; + class assembleTo { + GVAR(m3Tripod) = "SPE_M2_M3"; + EGVAR(csw,m3TripodLow) = "SPE_M2_M3"; + }; + }; + }; + + class SPE_M1919A4_tripod; + class GVAR(M1919A4_proxy): SPE_M1919A4_tripod { + magazineReloadTime = 0.5; + }; + + class SPE_M2_Tripod: SPE_Slung_Static_Weapon_Base { + class ace_csw { + type = "mount"; + deployTime = 4; + pickupTime = 4; + deploy = QGVAR(m2Tripod); + }; + }; + + class SPE_LMG; + class SPE_M1919A4: SPE_LMG { + class ace_csw { + type = "weapon"; + deployTime = 4; + pickupTime = 4; + class assembleTo { + GVAR(m2Tripod) = "SPE_M1919_M2"; + }; + }; + }; + + class SPE_M1919A6_StaticBipod; + class GVAR(M1919A6_proxy): SPE_M1919A6_StaticBipod { + magazineReloadTime = 0.5; + }; + + class SPE_MG42_Tripod; + class GVAR(MG42_proxy): SPE_MG42_Tripod { + magazineReloadTime = 0.5; + }; + + class SPE_MG34_Tripod; + class GVAR(MG34_proxy): SPE_MG34_Tripod { + magazineReloadTime = 0.5; + }; + + class SPE_Lafette_Tripod: SPE_Slung_Static_Weapon_Base { + class ace_csw { + type = "mount"; + deployTime = 4; + pickupTime = 4; + deploy = QGVAR(LafetteTripodLow); + }; + }; + class SPE_MG42: SPE_LMG { + class ace_csw { + type = "weapon"; + deployTime = 4; + pickupTime = 4; + class assembleTo { + GVAR(LafetteTripodLow) = "SPE_MG42_Lafette_low_Deployed"; + GVAR(LafetteTripod) = "SPE_MG42_Lafette_Deployed"; + }; + }; + }; + class SPE_MG34: SPE_LMG { + class ace_csw { + type = "weapon"; + deployTime = 4; + pickupTime = 4; + class assembleTo { + GVAR(LafetteTripodLow) = "SPE_MG34_Lafette_low_Deployed"; + GVAR(LafetteTripod) = "SPE_MG34_Lafette_Deployed"; + }; + }; + }; + + // --- Mortars ----------------------------------------------------------------- class SPE_M1_81; - class SPE_M1_81_proxy: SPE_M1_81 { + class GVAR(M1_proxy): SPE_M1_81 { magazineReloadTime = 0.5; }; class SPE_M1_81_Stand: SPE_Slung_Static_Weapon_Base { - class ACE_CSW { + class ace_csw { type = "mount"; deployTime = 4; pickupTime = 4; - deploy = QGVAR(M1_81_baseplate); + deploy = QGVAR(m1Baseplate); }; }; class SPE_M1_81_Barrel: SPE_Slung_Static_Weapon_Base { - class ACE_CSW { + class ace_csw { type = "weapon"; - deployTime = 4; - pickupTime = 4; + deployTime = 20; + pickupTime = 25; class assembleTo { - GVAR(M1_81_baseplate) = "SPE_M1_81"; + GVAR(m1Baseplate) = "SPE_M1_81"; EGVAR(csw,mortarBaseplate) = "SPE_M1_81"; }; }; }; class SPE_MLE_27_31; - class SPE_MLE_27_31_proxy: SPE_MLE_27_31 { + class GVAR(MLE_27_31_proxy): SPE_MLE_27_31 { magazineReloadTime = 0.5; }; class SPE_MLE_27_31_Stand: SPE_Slung_Static_Weapon_Base { - class ACE_CSW { + class ace_csw { type = "mount"; deployTime = 4; pickupTime = 4; @@ -45,7 +164,7 @@ class CfgWeapons { }; }; class SPE_MLE_27_31_Barrel: SPE_Slung_Static_Weapon_Base { - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 20; pickupTime = 25; @@ -57,21 +176,20 @@ class CfgWeapons { }; class SPE_GrW278_1; - class SPE_GrW278_1_proxy: SPE_GrW278_1 { + class GVAR(GrW278_1_proxy): SPE_GrW278_1 { magazineReloadTime = 0.5; }; class SPE_GrW278_1_Stand: SPE_MLE_27_31_Stand { - class ACE_CSW { + class ace_csw { type = "mount"; deployTime = 4; pickupTime = 4; deploy = QGVAR(GrW278_baseplate); }; }; - class SPE_GrW278_1_Barrel: SPE_MLE_27_31_Barrel { - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 20; pickupTime = 25; diff --git a/addons/compat_spe/compat_spe_csw/config.cpp b/addons/compat_spe/compat_spe_csw/config.cpp index 6ff669629bf..05627a8f6db 100644 --- a/addons/compat_spe/compat_spe_csw/config.cpp +++ b/addons/compat_spe/compat_spe_csw/config.cpp @@ -23,7 +23,22 @@ class CfgPatches { }; }; -#include "ACE_CSW_Groups.hpp" -// Todo: https://github.com/acemod/ACE3/pull/9292#discussion_r1327738181 -// #include "CfgVehicles.hpp" -// #include "CfgWeapons.hpp" +#include "CfgMagazines.hpp" +#include "CfgMagazineGroups.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" + +class CfgFunctions { + class SPE_WEAPONS_STATIC { + class SPE_Weapons_Static { + OVERWRITE_FUNC(alter_height); + OVERWRITE_FUNC(can_alter_height); + OVERWRITE_FUNC(can_assemble_weapon); + OVERWRITE_FUNC(can_disassemble_weapon); + OVERWRITE_FUNC(can_prepare_ammo); + OVERWRITE_FUNC(can_Reload); + OVERWRITE_FUNC(can_resupply_ammo); + OVERWRITE_FUNC(can_unload_ammo); + }; + }; +}; diff --git a/addons/compat_spe/compat_spe_csw/functions/fnc_alter_height.sqf b/addons/compat_spe/compat_spe_csw/functions/fnc_alter_height.sqf new file mode 100644 index 00000000000..927b754b7eb --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/functions/fnc_alter_height.sqf @@ -0,0 +1,106 @@ +#include "..\script_component.hpp" +/* + * Author: Kerc (SPE), original by www.3commandobrigade.com, edited by johnb43 to be made CSW compatible + * Alters the static weapon's height. + * + * Arguments: + * 0: Static Weapon + * 1: New static weapon (i.e. the weapon to replace the current weapon) + * 2: Use ACE's progress bar (default: false) + * + * Return Value: + * None + * + * Example: + * cursorObject call SPE_Weapons_Static_fnc_can_alter_height + * + * Public: No + */ + +private _unit = call SPE_fnc_findPlayer; + +if !(alive _unit) exitWith {}; + +params ["_weaponPlatform", "_newStaticWeapon", ["_playProgressBar", false, [false]]]; + +if (_playProgressBar) exitWith { + [10 * EGVAR(csw,progressBarTimeCoefficent), [_weaponPlatform, _newStaticWeapon], { + (_this select 0) params ["_weaponPlatform", "_newStaticWeapon"]; + + [_weaponPlatform, _newStaticWeapon] call SPE_Weapons_Static_fnc_alter_height; + }, {}, LSUBLSTRING(alteringHeight), { + (_this select 0) params ["_weaponPlatform"]; + + _player distance _weaponPlatform <= 4 && {[_weaponPlatform, true] call SPE_Weapons_Static_fnc_can_alter_height} + }] call EFUNC(common,progressBar); +}; + +private _dir = vectorDir _weaponPlatform; +private _pos = (getPosATL _weaponPlatform) vectorAdd [0, 0, 0.1]; // 10 cm above terrain surface + +// Save state +private _magazines = magazinesAmmoFull _weaponPlatform; +private _assemblyModeIndex = _weaponPlatform getVariable QEGVAR(csw,assemblyMode); + +// Delete weapon and create new one +deleteVehicle _weaponPlatform; + +[{ + params ["_unit", "_newStaticWeapon", "_magazines", "_pos", "_dir", "_assemblyModeIndex"]; + + private _weaponPlatform = createVehicle [_newStaticWeapon, _pos, [], 0, "CAN_COLLIDE"]; + + if (!isNil "_assemblyModeIndex") then { + // Don't empty the weapon of its existing mags + _weaponPlatform setVariable [QEGVAR(csw,assemblyMode), 0, true]; + + if (_assemblyModeIndex == 0) exitWith {}; + + // Reset variable to original after initVehicle has run + [{ + (_this select 0) setVariable [QEGVAR(csw,assemblyMode), _this select 1, true]; + }, [_weaponPlatform, _assemblyModeIndex], 1.5] call CBA_fnc_waitAndExecute; + }; + + _weaponPlatform disableCollisionWith _unit; + _weaponPlatform setVectorDir _dir; + + [{ + _this remoteExecCall ["enableCollisionWith", _this]; + }, [_weaponPlatform, _unit], 0.5] call CBA_fnc_waitAndExecute; + + // Restore state + // First remove magazines that were spawned in with new weapon + { + _weaponPlatform removeMagazineTurret [_x, [0]]; + } forEach (_weaponPlatform magazinesTurret [0]); + + // Remove weapon temporarily and readd it to instantly load previous magazine + private _weapon = (_weaponPlatform weaponsTurret [0]) param [0, ""]; + + if (_weapon != "") then { + _weaponPlatform removeWeaponTurret [_weapon, [0]]; + }; + + if (_magazines isEqualTo []) exitWith {}; + + // Find loaded magazine + private _loadedIndex = _magazines findIf {_x select 2}; + + // If there was a loaded magazine, add that one first + if (_loadedIndex != -1) then { + (_magazines deleteAt _loadedIndex) params ["_magClass", "_ammoCount"]; + _weaponPlatform addMagazineTurret [_magClass, [0], _ammoCount]; + }; + + _weaponPlatform addWeaponTurret [_weapon, [0]]; + + { + _x params ["_magClass", "_ammoCount", "_loaded"]; + + // In some instances the loaded magazine is listed twice, so we skip it. + if (!_loaded) then { + _weaponPlatform addMagazineTurret [_magClass, [0], _ammoCount]; + }; + } forEach _magazines; +}, [_unit, _newStaticWeapon, _magazines, _pos, _dir, _assemblyModeIndex]] call CBA_fnc_execNextFrame; diff --git a/addons/compat_spe/compat_spe_csw/functions/fnc_can_Reload.sqf b/addons/compat_spe/compat_spe_csw/functions/fnc_can_Reload.sqf new file mode 100644 index 00000000000..c8a666753a1 --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/functions/fnc_can_Reload.sqf @@ -0,0 +1,42 @@ +#include "..\script_component.hpp" +/* + * Author: Kerc (SPE), edited by johnb43 to be made CSW compatible + * Checks if the prepped magazine for the static weapon can be loaded. + * + * Arguments: + * 0: Static Weapon + * 1: Default magazine to load (unused) (default: "") + * + * Return Value: + * If the player can load the selected ammo for the static weapon's + * + * Example: + * cursorObject call SPE_Weapons_Static_fnc_can_Reload + * + * Public: No + */ + +params ["_weaponPlatform"]; + +private _unit = call SPE_fnc_findPlayer; + +alive _unit && +{alive _weaponPlatform} && +{vehicle _unit in [_unit, _weaponPlatform]} && +{(magazines _weaponPlatform) isEqualTo []} && +{ + private _selectedMagazine = _unit getVariable ["SPE_Static_Weapon_Magazine", ""]; + + if (_selectedMagazine == "") exitWith { + false + }; + + _selectedMagazine = _selectedMagazine call EFUNC(common,getConfigName); + + if (_selectedMagazine == "") exitWith { + false + }; + + _selectedMagazine in compatibleMagazines ((_weaponPlatform weaponsTurret [0]) select 0) +} && +{CONDITION_NO_CSW(_weaponPlatform)} // CSW check diff --git a/addons/compat_spe/compat_spe_csw/functions/fnc_can_alter_height.sqf b/addons/compat_spe/compat_spe_csw/functions/fnc_can_alter_height.sqf new file mode 100644 index 00000000000..7c3f8c1f84b --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/functions/fnc_can_alter_height.sqf @@ -0,0 +1,31 @@ +#include "..\script_component.hpp" +/* + * Author: Kerc (SPE), original by www.3commandobrigade.com, edited by johnb43 to be made CSW compatible + * Checks if the static weapon's height can be adjusted. + * + * Arguments: + * 0: Static Weapon + * 1: Check for ACE CSW (default: false) + * + * Return Value: + * If the player can alter the static weapon's height + * + * Example: + * cursorObject call SPE_Weapons_Static_fnc_can_alter_height + * + * Public: No + */ + +params ["_weaponPlatform", ["_checkForCSW", false, [false]]]; + +private _unit = call SPE_fnc_findPlayer; + +alive _unit && +{alive _weaponPlatform} && +{isNull objectParent _unit} && +{crew _weaponPlatform isEqualTo []} && +{!(_weaponPlatform lockedTurret [0])} && { + // CSW check + (!_checkForCSW && {CONDITION_NO_CSW(_weaponPlatform)}) || + {_checkForCSW && {!(CONDITION_NO_CSW(_weaponPlatform))}} +} diff --git a/addons/compat_spe/compat_spe_csw/functions/fnc_can_assemble_weapon.sqf b/addons/compat_spe/compat_spe_csw/functions/fnc_can_assemble_weapon.sqf new file mode 100644 index 00000000000..60911d49fe1 --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/functions/fnc_can_assemble_weapon.sqf @@ -0,0 +1,27 @@ +#include "..\script_component.hpp" +/* + * Author: Kerc (SPE), original by www.3commandobrigade.com, edited by johnb43 to be made CSW compatible + * Determines whether the player can assemble the static weapon. + * + * Arguments: + * 0: Tripod + * 1: Weapon + * + * Return Value: + * If the player can assemble the static weapon + * + * Example: + * cursorObject call SPE_Weapons_Static_fnc_can_assemble_weapon + * + * Public: No + */ + +params ["_tripod", "_weaponComponent"]; + +private _unit = call SPE_fnc_findPlayer; + +alive _unit && +{alive _tripod} && +{isNull objectParent _unit} && +{_weaponComponent in (weapons _unit)} && +{CONDITION_NO_CSW(_tripod)} // CSW check diff --git a/addons/compat_spe/compat_spe_csw/functions/fnc_can_disassemble_weapon.sqf b/addons/compat_spe/compat_spe_csw/functions/fnc_can_disassemble_weapon.sqf new file mode 100644 index 00000000000..66a54829537 --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/functions/fnc_can_disassemble_weapon.sqf @@ -0,0 +1,29 @@ +#include "..\script_component.hpp" +/* + * Author: Kerc (SPE), original by www.3commandobrigade.com, edited by johnb43 to be made CSW compatible + * Checks if the static weapon can be disassembled. + * + * Arguments: + * 0: Static Weapon + * + * Return Value: + * If the player can disassemble the static weapon + * + * Example: + * cursorObject call SPE_Weapons_Static_fnc_can_Reload + * + * Public: No + */ + +params ["_weaponPlatform"]; + +private _unit = call SPE_fnc_findPlayer; + +alive _unit && +{alive _weaponPlatform} && +{isNull objectParent _unit} && +{crew _weaponPlatform isEqualTo []} && +{weaponDisassemblyEnabled _unit} && +{weaponDisassemblyEnabled _weaponPlatform} && +{!(_weaponPlatform lockedTurret [0])} && +{CONDITION_NO_CSW(_weaponPlatform)} // CSW check diff --git a/addons/compat_spe/compat_spe_csw/functions/fnc_can_prepare_ammo.sqf b/addons/compat_spe/compat_spe_csw/functions/fnc_can_prepare_ammo.sqf new file mode 100644 index 00000000000..e310b2a63cb --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/functions/fnc_can_prepare_ammo.sqf @@ -0,0 +1,38 @@ +#include "..\script_component.hpp" +/* + * Author: ? (SPE), edited by johnb43 to be made CSW compatible + * Checks if the player can prepare the static weapon's ammo. + * + * Arguments: + * 0: Static Weapon + * 1: Magazine to load + * 2: If the magazine has been selected to be prepped for loading (default: false) + * + * Return Value: + * If the player can prepare the static weapon's ammo + * + * Example: + * cursorObject call SPE_Weapons_Static_fnc_can_prepare_ammo + * + * Public: No + */ + +params ["_weaponPlatform", "_ammo", ["_isSelected", false]]; + +private _unit = call SPE_fnc_findPlayer; + +alive _unit && +{alive _weaponPlatform} && +{vehicle _unit in [_unit, _weaponPlatform]} && +{ + private _defaultMags = getArray (configOf _weaponPlatform >> "Turrets" >> "MainTurret" >> "magazines"); + + if (({_x in _defaultMags} count (magazines _weaponPlatform)) > 1) exitWith { + false + }; + + private _selectedMagazine = _unit getVariable ["SPE_Static_Weapon_Magazine", ""]; + + _isSelected == (_selectedMagazine == _ammo) +} && +{CONDITION_NO_CSW(_weaponPlatform)} // CSW check diff --git a/addons/compat_spe/compat_spe_csw/functions/fnc_can_resupply_ammo.sqf b/addons/compat_spe/compat_spe_csw/functions/fnc_can_resupply_ammo.sqf new file mode 100644 index 00000000000..283c11d98d9 --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/functions/fnc_can_resupply_ammo.sqf @@ -0,0 +1,27 @@ +#include "..\script_component.hpp" +/* + * Author: Kerc (SPE), original by www.3commandobrigade.com, edited by johnb43 to be made CSW compatible + * Checks if resupply of ammo to a static weapon is available. + * + * Arguments: + * 0: Static Weapon + * 1: Default magazine to load (unused) (default: "") + * + * Return Value: + * If the player can load the static weapon's ammo + * + * Example: + * cursorObject call SPE_Weapons_Static_fnc_can_resupply_ammo + * + * Public: No + */ + +params ["_weaponPlatform"]; + +private _unit = call SPE_fnc_findPlayer; + +alive _unit && +{alive _weaponPlatform} && +{vehicle _unit in [_unit, _weaponPlatform]} && +{(_weaponPlatform magazinesTurret [[0], false]) isEqualTo []} && // Limit the reload capacity of a static weapon to 1 magazines +{CONDITION_NO_CSW(_weaponPlatform)} // CSW check diff --git a/addons/compat_spe/compat_spe_csw/functions/fnc_can_unload_ammo.sqf b/addons/compat_spe/compat_spe_csw/functions/fnc_can_unload_ammo.sqf new file mode 100644 index 00000000000..23384d29733 --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/functions/fnc_can_unload_ammo.sqf @@ -0,0 +1,27 @@ +#include "..\script_component.hpp" +/* + * Author: Kerc (SPE), original by www.3commandobrigade.com, edited by johnb43 to be made CSW compatible + * Checks if the player can unload a static weapon's magazines. + * + * Arguments: + * 0: Static Weapon + * + * Return Value: + * If the player can unload the static weapon's ammo + * + * Example: + * cursorObject call SPE_Weapons_Static_fnc_can_unload_ammo + * + * Public: No + */ + +params ["_weaponPlatform"]; + +private _unit = call SPE_fnc_findPlayer; + +alive _unit && +{alive _weaponPlatform} && +{_unit in _weaponPlatform || {isNull objectParent _unit && {(crew _weaponPlatform) isEqualTo []}}} && +{!(_weaponPlatform lockedTurret [0])} && +{(_weaponPlatform magazinesTurret [[0], false]) isNotEqualTo []} && +{CONDITION_NO_CSW(_weaponPlatform)} // CSW check diff --git a/addons/compat_spe/compat_spe_csw/script_component.hpp b/addons/compat_spe/compat_spe_csw/script_component.hpp index 1f7ace46a9e..8803d6fd261 100644 --- a/addons/compat_spe/compat_spe_csw/script_component.hpp +++ b/addons/compat_spe/compat_spe_csw/script_component.hpp @@ -1,3 +1,10 @@ #define SUBCOMPONENT csw #define SUBCOMPONENT_BEAUTIFIED Crew-Served Weapons #include "..\script_component.hpp" + +#define CONDITION_NO_CSW(var) (EGVAR(csw,ammoHandling) == 0) && {!([false, true, true, EGVAR(csw,defaultAssemblyMode)] select (var getVariable [ARR_2('EGVAR(csw,assemblyMode)',3)]))} + +#define OVERWRITE_FUNC(funcName)\ +class funcName {\ + file = QPATHTOF(DOUBLES(COMPONENT,SUBCOMPONENT)\functions\DOUBLES(fnc,funcName).sqf);\ +} diff --git a/addons/compat_spe/compat_spe_csw/stringtable.xml b/addons/compat_spe/compat_spe_csw/stringtable.xml new file mode 100644 index 00000000000..3368d4eb5e6 --- /dev/null +++ b/addons/compat_spe/compat_spe_csw/stringtable.xml @@ -0,0 +1,20 @@ + + + + + Altering Height... + + + .30-06 50Rnd Belt (M2/Tracer) + + + .30-06 100Rnd Belt (M2/Tracer) + + + 7.92x57 50Rnd Gurttrommel (L.S./Tracer) + + + 7.92x57 100Rnd Belt (L.S./Tracer) + + + diff --git a/addons/concertina_wire/functions/fnc_deploy.sqf b/addons/concertina_wire/functions/fnc_deploy.sqf index c915109e1b0..b1699ffc857 100644 --- a/addons/concertina_wire/functions/fnc_deploy.sqf +++ b/addons/concertina_wire/functions/fnc_deploy.sqf @@ -48,7 +48,7 @@ GVAR(deployPFH) = [{ private _anim = 0 max (1 - (_range / 12)); if (!(alive _unit) || _range >= 12 || (_unit getVariable [QGVAR(wireDeployed), false])) exitWith { - private _wire = "ACE_ConcertinaWire" createvehicle [0, 0, 0]; + private _wire = "ACE_ConcertinaWire" createVehicle [0, 0, 0]; { _wire animate [_x, _anim]; } forEach WIRE_FAST; diff --git a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf index 86aac9e8bf5..d90d3931dab 100644 --- a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf +++ b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf @@ -31,7 +31,7 @@ params ["_wire"]; private _dir = getDir _wire; private _pos = getPosASL _wire; - private _wirecoil = "ACE_ConcertinaWireCoil" createvehicle [0, 0, 0]; + private _wirecoil = "ACE_ConcertinaWireCoil" createVehicle [0, 0, 0]; deleteVehicle _wire; diff --git a/addons/csw/XEH_postInit.sqf b/addons/csw/XEH_postInit.sqf index 87196f33772..419e7013809 100644 --- a/addons/csw/XEH_postInit.sqf +++ b/addons/csw/XEH_postInit.sqf @@ -8,18 +8,32 @@ GVAR(vehicleMagCache) = createHashMap; // needs a small delay for network syncing, or we end up with duplicate mags with ammo handling [LINKFUNC(initVehicle), _this, 1] call CBA_fnc_waitAndExecute; }, true, [], true] call CBA_fnc_addClassEventHandler; - - GVAR(quickmountEnabled) = ( - missionNamespace getVariable [QEGVAR(quickmount,enabled), false] && - {(missionNamespace getVariable [QEGVAR(quickmount,enableMenu), -1]) in [1,3]} - ); }] call CBA_fnc_addEventHandler; +// Also triggered at mission start ["CBA_SettingChanged", { GVAR(quickmountEnabled) = ( missionNamespace getVariable [QEGVAR(quickmount,enabled), false] && {(missionNamespace getVariable [QEGVAR(quickmount,enableMenu), -1]) in [1,3]} ); + + // Do not allow no ammo handling when advanced assembly is enabled + // Reason: When using advanced assembly, the amount of ammo is not stored anywhere, so when you reassemble a static, it will spawn full ammo + if (GVAR(defaultAssemblyMode) && GVAR(ammoHandling) == 0) then { + if (isServer) then { + [QGVAR(ammoHandling), 2, 2, "server"] call CBA_settings_fnc_set; + }; + + // Notify everyone about change + [QEGVAR(common,displayTextStructured), [composeText [ + lineBreak, + parseText format [ + "%1", format ["%1 requires %2 to be set higher than 0.", QGVAR(defaultAssemblyMode), QGVAR(ammoHandling)] + ], + lineBreak, + parseText format ["%1", "No mission restart is required."] + ], 4]] call CBA_fnc_localEvent; + }; }] call CBA_fnc_addEventHandler; // Event handlers: diff --git a/addons/csw/functions/fnc_ai_handleFired.sqf b/addons/csw/functions/fnc_ai_handleFired.sqf index 6f7a6452579..4a6615f4043 100644 --- a/addons/csw/functions/fnc_ai_handleFired.sqf +++ b/addons/csw/functions/fnc_ai_handleFired.sqf @@ -12,6 +12,8 @@ * Public: No */ +if (GVAR(ammoHandling) != 2) exitWith {}; + params ["_vehicle", "_weapon", "", "", "", "_magazine", "", "_gunner"]; TRACE_4("firedEH:",_vehicle,_weapon,_magazine,_gunner); diff --git a/addons/csw/functions/fnc_ai_handleGetIn.sqf b/addons/csw/functions/fnc_ai_handleGetIn.sqf index 14b4453f530..bbbddaf537f 100644 --- a/addons/csw/functions/fnc_ai_handleGetIn.sqf +++ b/addons/csw/functions/fnc_ai_handleGetIn.sqf @@ -12,6 +12,8 @@ * Public: No */ +if (GVAR(ammoHandling) != 2) exitWith {}; + params ["_vehicle", "", "_gunner"]; TRACE_2("getInEH:",_vehicle,_gunner); diff --git a/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf b/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf index 6dd58fe4fba..12d00ca44e9 100644 --- a/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf @@ -20,4 +20,7 @@ params ["_target", "_player"]; // If the current launcher has a config-value that defines the tripod, it is a CSW (alive _target) && -{(getText (configFile >> "CfgWeapons" >> secondaryWeapon _player >> QUOTE(ADDON) >> "assembleTo" >> typeOf _target)) != ""} +{ + (getText (configFile >> "CfgWeapons" >> secondaryWeapon _player >> QUOTE(ADDON) >> "assembleTo" >> typeOf _target)) != "" || + {(getText (configFile >> "CfgWeapons" >> primaryWeapon _player >> QUOTE(ADDON) >> "assembleTo" >> typeOf _target)) != ""} +} diff --git a/addons/csw/functions/fnc_assemble_deployTripod.sqf b/addons/csw/functions/fnc_assemble_deployTripod.sqf index c69d618066e..e0a058a1af0 100644 --- a/addons/csw/functions/fnc_assemble_deployTripod.sqf +++ b/addons/csw/functions/fnc_assemble_deployTripod.sqf @@ -58,9 +58,8 @@ _cswTripod setVariable [QGVAR(secondaryWeaponMagazines), _secondaryWeaponMagazines, true]; }; - if (!GVAR(defaultAssemblyMode)) then { - [_cswTripod, "disableWeaponAssembly", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); - }; + // Disable vanilla assembly until FUNC(initVehicle) runs and sets the definite value + [_cswTripod, "disableWeaponAssembly", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); private _posATL = _player getRelPos [2, 0]; _posATL set [2, ((getPosATL _player) select 2) + 0.5]; diff --git a/addons/csw/functions/fnc_assemble_deployWeapon.sqf b/addons/csw/functions/fnc_assemble_deployWeapon.sqf index a0e0acdd282..a0cdc102ca8 100644 --- a/addons/csw/functions/fnc_assemble_deployWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_deployWeapon.sqf @@ -21,8 +21,19 @@ [{ params ["_tripod", "_player"]; + private _tripodClassname = typeOf _tripod; + private _assembledClassname = getText (configFile >> "CfgWeapons" >> secondaryWeapon _player >> QUOTE(ADDON) >> "assembleTo" >> _tripodClassname); + private _index = 1; + + if (_assembledClassname == "") then { + _assembledClassname = getText (configFile >> "CfgWeapons" >> primaryWeapon _player >> QUOTE(ADDON) >> "assembleTo" >> _tripodClassname); + _index = 0; + }; + + if (!isClass (configFile >> "CfgVehicles" >> _assembledClassname)) exitWith {ERROR_1("bad static classname [%1]",_assembledClassname);}; + // Save magazines and attachments (handle loaded launchers which can become csw like CUP Metis) - private _carryWeaponInfo = (getUnitLoadout _player) select 1; + private _carryWeaponInfo = (getUnitLoadout _player) select _index; private _carryWeaponClassname = _carryWeaponInfo deleteAt 0; // Remove empty entries @@ -30,21 +41,15 @@ TRACE_3("assemble_deployWeapon_carryWeaponClassname",_tripod,_player,_carryWeaponClassname); - private _tripodClassname = typeOf _tripod; - private _weaponConfig = configfile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON); - private _assembledClassname = getText (_weaponConfig >> "assembleTo" >> _tripodClassname); - - if (!isClass (configFile >> "CfgVehicles" >> _assembledClassname)) exitWith {ERROR_1("bad static classname [%1]",_assembledClassname);}; - _player removeWeaponGlobal _carryWeaponClassname; - private _deployTime = getNumber (_weaponConfig >> "deployTime"); + private _deployTime = getNumber (configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "deployTime"); TRACE_4("",_carryWeaponClassname,_tripodClassname,_assembledClassname,_deployTime); private _onFinish = { params ["_args"]; - _args params ["_tripod", "_player", "_assembledClassname", "", "_carryWeaponInfo"]; + _args params ["_tripod", "_player", "_assembledClassname", "_tripodClassname", "_carryWeaponClassname", "_carryWeaponInfo"]; TRACE_3("deployWeapon finish",_tripod,_player,_assembledClassname); private _secondaryWeaponMagazines = _tripod getVariable [QGVAR(secondaryWeaponMagazines), []]; @@ -56,10 +61,11 @@ _tripodPos set [2, (_tripodPos select 2) + 0.1]; // Delay a frame so tripod has a chance to be deleted [{ - params ["_assembledClassname", "_tripodDir", "_tripodPos", "_player", "_carryWeaponInfo", "_secondaryWeaponMagazines"]; + params ["_assembledClassname", "_componentClasses", "_tripodDir", "_tripodPos", "_player", "_carryWeaponInfo", "_secondaryWeaponMagazines"]; private _csw = createVehicle [_assembledClassname, [0, 0, 0], [], 0, "NONE"]; // Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] _csw setVariable [QGVAR(assemblyMode), 2, true]; // Explicitly set advanced assembly mode + unload, and broadcast + _csw setVariable [QGVAR(componentClasses), _componentClasses, true]; { // Magazines @@ -76,9 +82,9 @@ _csw setVariable [QGVAR(secondaryWeaponMagazines), _secondaryWeaponMagazines, true]; }; - if (!GVAR(defaultAssemblyMode)) then { - [_csw, "disableWeaponAssembly", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); - }; + // Disable vanilla assembly until FUNC(initVehicle) runs and sets the definite value + [_csw, "disableWeaponAssembly", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + _csw setDir _tripodDir; _csw setPosATL _tripodPos; if ((_tripodPos select 2) < 0.5) then { @@ -86,12 +92,12 @@ }; [QGVAR(deployWeaponSucceeded), [_csw]] call CBA_fnc_localEvent; TRACE_2("csw placed",_csw,_assembledClassname); - }, [_assembledClassname, _tripodDir, _tripodPos, _player, _carryWeaponInfo, _secondaryWeaponMagazines]] call CBA_fnc_execNextFrame; + }, [_assembledClassname, [_tripodClassname, _carryWeaponClassname], _tripodDir, _tripodPos, _player, _carryWeaponInfo, _secondaryWeaponMagazines]] call CBA_fnc_execNextFrame; }; private _onFailure = { params ["_args"]; - _args params ["", "_player", "", "_carryWeaponClassname", "_carryWeaponInfo"]; + _args params ["", "_player", "", "", "_carryWeaponClassname", "_carryWeaponInfo"]; TRACE_2("deployWeapon failure",_player,_carryWeaponClassname); // Add weapon back @@ -110,5 +116,5 @@ alive _tripod }; - [TIME_PROGRESSBAR(_deployTime), [_tripod, _player, _assembledClassname, _carryWeaponClassname, _carryWeaponInfo], _onFinish, _onFailure, LLSTRING(AssembleCSW_progressBar), _condition] call EFUNC(common,progressBar); + [TIME_PROGRESSBAR(_deployTime), [_tripod, _player, _assembledClassname, _tripodClassname, _carryWeaponClassname, _carryWeaponInfo], _onFinish, _onFailure, LLSTRING(AssembleCSW_progressBar), _condition] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf b/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf index f98978195d9..f3f1fd7bfcb 100644 --- a/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf +++ b/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf @@ -20,9 +20,14 @@ params ["_target", "_player", "", "_actionData"]; -private _carryWeaponClassname = secondaryWeapon _player; -private _assembleTo = getText (configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "assembleTo" >> typeOf _target); -private _icon = getText (configFile >> "CfgVehicles" >> _assembleTo >> "picture"); -TRACE_2("",_assembleTo,_icon); +private _tripodClassname = typeOf _target; +private _assembledClassname = getText (configFile >> "CfgWeapons" >> secondaryWeapon _player >> QUOTE(ADDON) >> "assembleTo" >> _tripodClassname); + +if (_assembledClassname == "") then { + _assembledClassname = getText (configFile >> "CfgWeapons" >> primaryWeapon _player >> QUOTE(ADDON) >> "assembleTo" >> _tripodClassname); +}; + +private _icon = getText (configFile >> "CfgVehicles" >> _assembledClassname >> "picture"); +TRACE_2("",_assembledClassname,_icon); _actionData set [2, _icon]; diff --git a/addons/csw/functions/fnc_assemble_pickupWeapon.sqf b/addons/csw/functions/fnc_assemble_pickupWeapon.sqf index 65dc5fa7403..023143710b6 100644 --- a/addons/csw/functions/fnc_assemble_pickupWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_pickupWeapon.sqf @@ -21,14 +21,18 @@ TRACE_2("assemble_pickupWeapon",_vehicle,_player); private _weaponConfig = configOf _vehicle >> QUOTE(ADDON); - private _carryWeaponClassname = getText (_weaponConfig >> "disassembleWeapon"); + private _componentClasses = _vehicle getVariable QGVAR(componentClasses); + + (if (!isNil "_componentClasses") then { + _componentClasses + } else { + [getText (_weaponConfig >> "disassembleTurret"), getText (_weaponConfig >> "disassembleWeapon")] + }) params ["_turretClassname", "_carryWeaponClassname"]; if (!isClass (configFile >> "CfgWeapons" >> _carryWeaponClassname)) exitWith { ERROR_1("bad weapon classname [%1]",_carryWeaponClassname); }; - private _turretClassname = getText (_weaponConfig >> "disassembleTurret"); - // Turret classname can equal nothing if the deploy bag is the "whole" weapon. e.g Kornet, Metis, other ATGMs if ((_turretClassname != "") && {!isClass (configFile >> "CfgVehicles" >> _turretClassname)}) exitWith { ERROR_1("bad turret classname [%1]",_turretClassname); @@ -58,7 +62,9 @@ if (_carryWeaponMag isEqualTo [] && {_carryMag in _carryWeaponMags}) then { TRACE_3("Adding mag to secondary weapon",_xMag,_xAmmo,_carryMag); _carryWeaponMag = [_carryMag, _xAmmo]; - DEC(_xAmmo); + + // Do not return this magazine, as it will be put into the weapon + continue; }; if ((_xAmmo > 0) && {_carryMag != ""}) then { TRACE_2("Removing ammo",_xMag,_carryMag); @@ -82,8 +88,19 @@ [{ params ["_player", "_weaponPos", "_carryWeaponClassname", "_carryWeaponMag", "_turretClassname"]; + private _carryWeaponType = _carryWeaponClassname call EFUNC(common,getWeaponType); + + if !(_carryWeaponType in [1, 2]) exitWith { + ERROR_1("bad carry weapon type [%1]",_carryWeaponClassname); + + if (_carryWeaponMag isEqualTo []) exitWith {}; + + // Return the ammo, so it doesn't vanish + [_player, _carryWeaponMag select 0, _carryWeaponMag select 1] call FUNC(reload_handleReturnAmmo); + }; + // Give the weapon to the player if possible - if ((alive _player) && {(secondaryWeapon _player) == ""}) exitWith { + if ((alive _player) && {([primaryWeapon _player, secondaryWeapon _player] select (_carryWeaponType - 1)) == ""}) exitWith { [_player, _carryWeaponClassname] call CBA_fnc_addWeaponWithoutItems; if (_carryWeaponMag isNotEqualTo []) then { diff --git a/addons/csw/functions/fnc_initVehicle.sqf b/addons/csw/functions/fnc_initVehicle.sqf index 80ff071f107..f9cd10dbb1c 100644 --- a/addons/csw/functions/fnc_initVehicle.sqf +++ b/addons/csw/functions/fnc_initVehicle.sqf @@ -34,30 +34,33 @@ if (_configEnabled && {GVAR(ammoHandling) == 2}) then { }; TRACE_2("",local _vehicle,_vehicle turretLocal [0]); -if (_configEnabled && {_vehicle turretLocal [0]}) then { // if turret is local to us, then handle mags/weapon - [{ - params ["_vehicle"]; - if (!alive _vehicle) exitWith { TRACE_1("dead/deleted",_vehicle); }; - // Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] - private _assemblyModeIndex = _vehicle getVariable [QGVAR(assemblyMode), 3]; + +if (_vehicle turretLocal [0]) then { + // Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] + private _assemblyModeIndex = _vehicle getVariable [QGVAR(assemblyMode), 3]; + private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select _assemblyModeIndex; + + TRACE_2("turretLocal",_vehicle,_assemblyMode); + + // If turret is local, handle unloading mags and proxy weapons + if (_configEnabled) then { + TRACE_2("config enabled",_vehicle,_assemblyMode); + private _emptyWeapon = _assemblyModeIndex isEqualTo 2; - private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select _assemblyModeIndex; - TRACE_2("turretLocal",_vehicle,_assemblyMode); + [_vehicle, [0], _assemblyMode, _emptyWeapon] call FUNC(proxyWeapon); - [_vehicle, _assemblyMode, _emptyWeapon] call FUNC(staticWeaponInit_unloadExtraMags); - }, [_vehicle]] call CBA_fnc_execNextFrame; // need to wait a frame to allow setting object vars during assembly -}; -if (_assemblyConfig) then { - [{ - params ["_vehicle"]; - if (!alive _vehicle) exitWith { TRACE_1("dead/deleted",_vehicle); }; - private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_vehicle getVariable [QGVAR(assemblyMode), 3]); + if (!_assemblyMode) exitWith {}; + + [_vehicle, _emptyWeapon] call FUNC(staticWeaponInit_unloadExtraMags); + }; + + if (_assemblyConfig) then { TRACE_2("assemblyConfig present",_vehicle,_assemblyMode); - if (_assemblyMode) then { // Disable vanilla assembly if assemblyMode enabled - [_vehicle, "disableWeaponAssembly", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); - }; - }, [_vehicle]] call CBA_fnc_execNextFrame; // need to wait a frame to allow setting object vars during assembly + // Disable vanilla assembly if assemblyMode enabled + // Need to wait to allow setting object vars during assembly, but since this function runs 1 second after vehicle init, it can run immediately + [_vehicle, "disableWeaponAssembly", QUOTE(ADDON), _assemblyMode] call EFUNC(common,statusEffect_set); + }; }; // Add interactions for players @@ -94,9 +97,17 @@ if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then { }; if (["ace_reload"] call EFUNC(common,isModLoaded)) then { - // move reload's check ammo action to the ammo handling point (remove and re-add) [_typeOf, 0, ["ACE_MainActions", QEGVAR(reload,CheckAmmo)]] call EFUNC(interact_menu,removeActionFromClass); - private _checkAmmoAction = [QGVAR(checkAmmo), LELSTRING(reload,checkAmmo), "", EFUNC(reload,checkAmmo), EFUNC(reload,canCheckAmmo)] call EFUNC(interact_menu,createAction); + + // Replace existing check ammo interaction with one that takes into account if the magazine actions are available + private _checkAmmoAction = [QEGVAR(reload,CheckAmmo), LELSTRING(reload,checkAmmo), "", EFUNC(reload,checkAmmo), { + if !((GVAR(ammoHandling) == 0) && {!([false, true, true, GVAR(defaultAssemblyMode)] select (_target getVariable [QGVAR(assemblyMode), 3]))}) exitWith { false }; + _this call EFUNC(reload,canCheckAmmo) + }] call ace_interact_menu_fnc_createAction; + [_typeOf, 0, ["ACE_MainActions"], _checkAmmoAction] call EFUNC(interact_menu,addActionToClass); + + // Add another check ammo action to the ammo handling point + _checkAmmoAction = [QGVAR(checkAmmo), LELSTRING(reload,checkAmmo), "", EFUNC(reload,checkAmmo), EFUNC(reload,canCheckAmmo)] call EFUNC(interact_menu,createAction); [_typeOf, 0, _ammoActionPath, _checkAmmoAction] call EFUNC(interact_menu,addActionToClass); }; }; diff --git a/addons/csw/functions/fnc_proxyWeapon.sqf b/addons/csw/functions/fnc_proxyWeapon.sqf index 42773dc7ecd..47897c43c22 100644 --- a/addons/csw/functions/fnc_proxyWeapon.sqf +++ b/addons/csw/functions/fnc_proxyWeapon.sqf @@ -21,6 +21,11 @@ params ["_vehicle", "_turret", "_needed", "_emptyWeapon"]; TRACE_4("proxyWeapon",_vehicle,_turret,_needed,_emptyWeapon); +// addWeaponTurret/removeWeaponTurret need to be executed where turret is local +if !(_vehicle turretLocal _turret) exitWith { + WARNING_2("[%1]'s turret [%2] isn't local, skipping proxy weapon change",_vehicle,_turret); +}; + if (_vehicle getVariable [format [QGVAR(proxyHandled_%1), _turret], false]) exitWith { TRACE_1("already handled",typeOf _vehicle); }; private _proxyWeapon = getText (configOf _vehicle >> QUOTE(ADDON) >> "proxyWeapon"); diff --git a/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf b/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf index 3682651aac6..24d21534ee2 100644 --- a/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf +++ b/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf @@ -37,7 +37,7 @@ private _bestMagCount = -1; _bestMagCount = _xAmmo; }; }; - } forEach (getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines")); + } forEach (compatibleMagazines _weapon); } forEach (_vehicle weaponsTurret _turret); TRACE_3("best fit",_desiredAmmo,_bestMag,_bestMagCount); diff --git a/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf b/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf index 1c27a494d51..975d5dbb9c2 100644 --- a/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf +++ b/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf @@ -5,8 +5,7 @@ * * Arguments: * 0: CSW - * 1: Using advanced assembly - * 2: Empty weapon + * 1: Empty weapon * * Return Value: * None @@ -17,9 +16,8 @@ * Public: No */ -params ["_vehicle", "_assemblyMode", "_emptyWeapon"]; -TRACE_3("staticWeaponInit_unloadExtraMags",_vehicle,_assemblyMode,_emptyWeapon); -if (!_assemblyMode) exitWith {}; +params ["_vehicle", "_emptyWeapon"]; +TRACE_2("staticWeaponInit_unloadExtraMags",_vehicle,_emptyWeapon); private _desiredAmmo = getNumber (configOf _vehicle >> QUOTE(ADDON) >> "desiredAmmo"); private _storeExtraMagazines = GVAR(handleExtraMagazines); @@ -62,10 +60,12 @@ private _containerMagazineCount = []; TRACE_1("Remove all loaded magazines",_magsToRemove); { - _vehicle removeMagazinesTurret _x; + [QEGVAR(common,removeMagazinesTurret), [_vehicle, _x select 0, _x select 1], _vehicle, _x select 1] call CBA_fnc_turretEvent; + if ((_loadedMagazineInfo select [0,2]) isEqualTo _x) then { TRACE_1("Re-add the starting mag",_loadedMagazineInfo); - _vehicle addMagazineTurret _loadedMagazineInfo; + + [QEGVAR(common,addMagazineTurret), [_vehicle, _loadedMagazineInfo], _vehicle, _x select 1] call CBA_fnc_turretEvent; }; } forEach _magsToRemove; @@ -83,7 +83,7 @@ if (_secondaryWeaponMagazines isNotEqualTo []) then { // If the magazine can be added to the static weapon, do it now if (_vehicleMag in _compatibleMagazinesTurret) then { - _vehicle addMagazineTurret [_vehicleMag, _turret, _x select 1]; + [QEGVAR(common,addMagazineTurret), [_vehicle, [_vehicleMag, _turret, _x select 1]], _vehicle, _turret] call CBA_fnc_turretEvent; } else { // Find a suitable container to place items in if necessary if (isNull _container) then { diff --git a/addons/csw/initSettings.inc.sqf b/addons/csw/initSettings.inc.sqf index bc157e1164b..4a58ed80b03 100644 --- a/addons/csw/initSettings.inc.sqf +++ b/addons/csw/initSettings.inc.sqf @@ -1,56 +1,53 @@ -private _categoryArray = [format ["ACE %1", localize LSTRING(DisplayName)]]; +private _categoryArray = [format ["ACE %1", LLSTRING(DisplayName)]]; [ - QGVAR(defaultAssemblyMode), "CHECKBOX", + QGVAR(defaultAssemblyMode), + "CHECKBOX", [LSTRING(defaultAssemblyMode_displayName), LSTRING(defaultAssemblyMode_description)], _categoryArray, false, // default value - true, // isGlobal - {[QGVAR(defaultAssemblyMode), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + 1 // isGlobal ] call CBA_fnc_addSetting; [ - QGVAR(handleExtraMagazines), "CHECKBOX", + QGVAR(handleExtraMagazines), + "CHECKBOX", [LSTRING(handleExtraMagazines_displayName), LSTRING(handleExtraMagazines_description)], _categoryArray, true, // default value - true, // isGlobal - {[QGVAR(handleExtraMagazines), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + 1 // isGlobal ] call CBA_fnc_addSetting; [ - QGVAR(handleExtraMagazinesType), "LIST", + QGVAR(handleExtraMagazinesType), + "LIST", [LSTRING(handleExtraMagazinesType_displayName), LSTRING(handleExtraMagazinesType_description)], _categoryArray, [[0, 1], [LSTRING(handleExtraMagazinesType_weaponHolder), LSTRING(handleExtraMagazinesType_ammoBox)], 0], - true, // isGlobal - {[QGVAR(handleExtraMagazinesType), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + 1 // isGlobal ] call CBA_fnc_addSetting; [ - QGVAR(ammoHandling), "LIST", + QGVAR(ammoHandling), + "LIST", [LSTRING(ammoHandling_displayName), LSTRING(ammoHandling_description)], _categoryArray, [[0, 1, 2], [LELSTRING(common,Disabled), LELSTRING(common,playerOnly), LELSTRING(common,playersAndAI)], 2], // [_values, _valueTitles, _defaultIndex] - true, // isGlobal - {[QGVAR(ammoHandling), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + 1 // isGlobal ] call CBA_fnc_addSetting; [ - QGVAR(progressBarTimeCoefficent), "SLIDER", + QGVAR(progressBarTimeCoefficent), + "SLIDER", [LSTRING(progressBarTimeCoefficent_displayName), LSTRING(progressBarTimeCoefficent_description)], _categoryArray, - [0,2,1,2], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true // isGlobal + [0, 2, 1, 2], // [min, max, default value, trailing decimals (-1 for whole numbers only)] + 1 // isGlobal ] call CBA_fnc_addSetting; [ - QGVAR(dragAfterDeploy), "CHECKBOX", + QGVAR(dragAfterDeploy), + "CHECKBOX", [LSTRING(dragAfterDeploy_displayName), LSTRING(dragAfterDeploy_description)], - _categoryArray, - false // default value + _categoryArray ] call CBA_fnc_addSetting; diff --git a/addons/dagr/functions/fnc_menuInit.sqf b/addons/dagr/functions/fnc_menuInit.sqf index fc05185638f..b7433b92aae 100644 --- a/addons/dagr/functions/fnc_menuInit.sqf +++ b/addons/dagr/functions/fnc_menuInit.sqf @@ -584,7 +584,7 @@ GVAR(menuRun) = true; }; GVAR(tmpUpdateRate) = 0.1 max GVAR(tmpUpdateRate) min 2.0; if (!GVAR(busy)) then { - (__dsp displayCtrl __mainText) ctrlSetText (Str(GVAR(tmpUpdateRate) * 1000) + "ms"); + (__dsp displayCtrl __mainText) ctrlSetText (str(GVAR(tmpUpdateRate) * 1000) + "ms"); (__dsp displayCtrl __F1) ctrlSetText "Save"; (__dsp displayCtrl __F3) ctrlSetText "Cancel"; }; diff --git a/addons/dagr/functions/fnc_outputData.sqf b/addons/dagr/functions/fnc_outputData.sqf index b7064ce248a..646f56d1c88 100644 --- a/addons/dagr/functions/fnc_outputData.sqf +++ b/addons/dagr/functions/fnc_outputData.sqf @@ -17,7 +17,7 @@ 135471 cutRsc ["DAGR_DISPLAY", "plain down"]; -#define __display (uiNameSpace getVariable "DAGR_DISPLAY") +#define __display (uiNamespace getVariable "DAGR_DISPLAY") #define __gridControl (__display displayCtrl 266851) #define __speedControl (__display displayCtrl 266852) @@ -62,7 +62,7 @@ GVAR(outputPFH) = [{ }; // Time - private _dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString; + private _dagrTime = [dayTime, "HH:MM"] call bis_fnc_timeToString; // Output __gridControl ctrlSetText _dagrGrid; diff --git a/addons/dagr/functions/fnc_outputVector.sqf b/addons/dagr/functions/fnc_outputVector.sqf index e9bd0ea6c38..816ed2e4b23 100644 --- a/addons/dagr/functions/fnc_outputVector.sqf +++ b/addons/dagr/functions/fnc_outputVector.sqf @@ -17,7 +17,7 @@ 135471 cutRsc ["DAGR_DISPLAY", "plain down"]; -#define __display (uiNameSpace getVariable "DAGR_DISPLAY") +#define __display (uiNamespace getVariable "DAGR_DISPLAY") #define __gridControl (__display displayCtrl 266851) #define __speedControl (__display displayCtrl 266858) @@ -36,7 +36,7 @@ if (_lazPosX < 0) then { _lazPosX = _lazPosX + 99999;}; if (_lazPosY < 0) then {_lazPosY = _lazPosY + 99999;}; // Find laser position -private _xGrid = toArray Str(round _lazPosX); +private _xGrid = toArray str(round _lazPosX); while {count _xGrid < 5} do { _xGrid = [48] + _xGrid; @@ -45,7 +45,7 @@ _xGrid resize 4; _xGrid = toString _xGrid; _xGrid = parseNumber _xGrid; -private _yGrid = toArray Str(round _lazPosY); +private _yGrid = toArray str(round _lazPosY); while {count _yGrid < 5} do { _yGrid = [48] + _yGrid; }; @@ -54,17 +54,17 @@ _yGrid = toString _yGrid; _yGrid = parseNumber _yGrid; private _xCoord = switch true do { - case (_xGrid >= 1000): { "" + Str(_xGrid) }; - case (_xGrid >= 100): { "0" + Str(_xGrid) }; - case (_xGrid >= 10): { "00" + Str(_xGrid) }; - default { "000" + Str(_xGrid) }; + case (_xGrid >= 1000): { "" + str(_xGrid) }; + case (_xGrid >= 100): { "0" + str(_xGrid) }; + case (_xGrid >= 10): { "00" + str(_xGrid) }; + default { "000" + str(_xGrid) }; }; private _yCoord = switch true do { - case (_yGrid >= 1000): { "" + Str(_yGrid) }; - case (_yGrid >= 100): { "0" + Str(_yGrid) }; - case (_yGrid >= 10): { "00" + Str(_yGrid) }; - default { "000" + Str(_yGrid) }; + case (_yGrid >= 1000): { "" + str(_yGrid) }; + case (_yGrid >= 100): { "0" + str(_yGrid) }; + case (_yGrid >= 10): { "00" + str(_yGrid) }; + default { "000" + str(_yGrid) }; }; private _dagrGrid = _xCoord + " " + _yCoord; @@ -74,7 +74,7 @@ private _elevation = floor ((_lazPosZ) + EGVAR(common,mapAltitude)); private _dagrElevation = str _elevation + "m"; // Time -private _dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString; +private _dagrTime = [dayTime, "HH:MM"] call bis_fnc_timeToString; // Bearing private _bearing = GVAR(LAZHEADING); diff --git a/addons/dagr/functions/fnc_outputWP.sqf b/addons/dagr/functions/fnc_outputWP.sqf index 27944f0bb91..9142449dcc8 100644 --- a/addons/dagr/functions/fnc_outputWP.sqf +++ b/addons/dagr/functions/fnc_outputWP.sqf @@ -17,7 +17,7 @@ 135471 cutRsc ["DAGR_DISPLAY", "plain down"]; -#define __display (uiNameSpace getVariable "DAGR_DISPLAY") +#define __display (uiNamespace getVariable "DAGR_DISPLAY") #define __gridControl (__display displayCtrl 266851) #define __speedControl (__display displayCtrl 266858) @@ -48,17 +48,17 @@ GVAR(outputPFH) = [{ private _yGrid2 = DAGR_WP_INFO - _xGrid2 * 10000; _xCoord2 = switch true do { - case (_xGrid2 >= 1000): { "" + Str(_xGrid2) }; - case (_xGrid2 >= 100): { "0" + Str(_xGrid2) }; - case (_xGrid2 >= 10): { "00" + Str(_xGrid2) }; - default { "000" + Str(_xGrid2) }; + case (_xGrid2 >= 1000): { "" + str(_xGrid2) }; + case (_xGrid2 >= 100): { "0" + str(_xGrid2) }; + case (_xGrid2 >= 10): { "00" + str(_xGrid2) }; + default { "000" + str(_xGrid2) }; }; _yCoord2 = switch true do { - case (_yGrid2 >= 1000): { "" + Str(_yGrid2) }; - case (_yGrid2 >= 100): { "0" + Str(_yGrid2) }; - case (_yGrid2 >= 10): { "00" + Str(_yGrid2) }; - default { "000" + Str(_yGrid2) }; + case (_yGrid2 >= 1000): { "" + str(_yGrid2) }; + case (_yGrid2 >= 100): { "0" + str(_yGrid2) }; + case (_yGrid2 >= 10): { "00" + str(_yGrid2) }; + default { "000" + str(_yGrid2) }; }; _dagrGrid2 = _xCoord2 + " " + _yCoord2; diff --git a/addons/disarming/functions/fnc_disarmDropItems.sqf b/addons/disarming/functions/fnc_disarmDropItems.sqf index 6e842e739a4..c95647b82ab 100644 --- a/addons/disarming/functions/fnc_disarmDropItems.sqf +++ b/addons/disarming/functions/fnc_disarmDropItems.sqf @@ -50,7 +50,7 @@ if (!_doNotDropAmmo) then { if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith { _holder = _x; }; - } forEach ((getpos _target) nearObjects [DISARM_CONTAINER, 3]); + } forEach ((getPos _target) nearObjects [DISARM_CONTAINER, 3]); }; //Create a new weapon holder @@ -101,7 +101,7 @@ if !([_targetMagazinesStart, _targetMagazinesEnd, _holderMagazinesStart, _holder }; //Remove Items, Assigned Items and NVG -private _holderItemsStart = getitemCargo _holder; +private _holderItemsStart = getItemCargo _holder; private _targetItemsStart = (assignedItems _target) + (items _target) - (weapons _target); if ((headgear _target) != "") then {_targetItemsStart pushBack (headgear _target);}; if ((goggles _target) != "") then {_targetItemsStart pushBack (goggles _target);}; @@ -131,7 +131,7 @@ private _addToCrateCount = []; _holder addItemCargoGlobal [(_addToCrateClassnames select _forEachIndex), (_addToCrateCount select _forEachIndex)]; } forEach _addToCrateClassnames; -private _holderItemsEnd = getitemCargo _holder; +private _holderItemsEnd = getItemCargo _holder; private _targetItemsEnd = (assignedItems _target) + (items _target) - (weapons _target); if ((headgear _target) != "") then {_targetItemsEnd pushBack (headgear _target);}; if ((goggles _target) != "") then {_targetItemsEnd pushBack (goggles _target);}; @@ -172,7 +172,7 @@ if (_holderIsEmpty) then { private _needToRemoveWeapon = ({_x in _listOfItemsToRemove} count (weapons _target)) > 0; private _needToRemoveMagazines = ({_x in _listOfItemsToRemove} count (magazines _target)) > 0; - private _needToRemoveBackpack = ((backPack _target) != "") && {(backPack _target) in _listOfItemsToRemove}; + private _needToRemoveBackpack = ((backpack _target) != "") && {(backpack _target) in _listOfItemsToRemove}; private _needToRemoveVest = ((vest _target) != "") && {(vest _target) in _listOfItemsToRemove}; private _needToRemoveUniform = ((uniform _target) != "") && {(uniform _target) in _listOfItemsToRemove}; @@ -192,7 +192,7 @@ if (_holderIsEmpty) then { } forEach (magazines _target); //Drop backpack (Keeps variables for ACRE/TFR) - if (_needToRemoveBackpack) then {_target action ["DropBag", _holder, (backPack _target)];}; + if (_needToRemoveBackpack) then {_target action ["DropBag", _holder, (backpack _target)];}; } else { [_pfID] call CBA_fnc_removePerFrameHandler; diff --git a/addons/disarming/functions/fnc_openDisarmDialog.sqf b/addons/disarming/functions/fnc_openDisarmDialog.sqf index 6cf15f4cad1..f12922327a1 100644 --- a/addons/disarming/functions/fnc_openDisarmDialog.sqf +++ b/addons/disarming/functions/fnc_openDisarmDialog.sqf @@ -96,7 +96,7 @@ GVAR(disarmTarget) = _target; if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith { _holder = _x; }; - } forEach ((getpos _target) nearObjects [DISARM_CONTAINER, 3]); + } forEach ((getPos _target) nearObjects [DISARM_CONTAINER, 3]); //If a holder exists, show it's inventory if (!isNull _holder) then { diff --git a/addons/disarming/gui_disarm.hpp b/addons/disarming/gui_disarm.hpp index 4c8ce53e6c0..b6afa26551d 100644 --- a/addons/disarming/gui_disarm.hpp +++ b/addons/disarming/gui_disarm.hpp @@ -7,13 +7,13 @@ class RscActiveText; class RscListBox; //Use the definese from -#define X_BIS(num) (num * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)) -#define Y_BIS(num) (num * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)) -#define W_BIS(num) (num * (((safezoneW / safezoneH) min 1.2) / 40)) -#define H_BIS(num) (num * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)) +#define X_BIS(num) (num * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)) +#define Y_BIS(num) (num * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)) +#define W_BIS(num) (num * (((safeZoneW / safeZoneH) min 1.2) / 40)) +#define H_BIS(num) (num * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)) -#define X_MAKEITBIGGA(num) (num * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)) -#define Y_MAKEITBIGGA(num) (num * (safeZoneH / 30) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)) +#define X_MAKEITBIGGA(num) (num * (safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH)/2)) +#define Y_MAKEITBIGGA(num) (num * (safeZoneH / 30) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2))/2)) #define W_MAKEITBIGGA(num) (num * (safeZoneH / 40)) #define H_MAKEITBIGGA(num) (num * (safeZoneH / 30)) @@ -140,9 +140,9 @@ class GVAR(remoteInventory) { }; class GroundContainer: RscListBox { idc = 632; - sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - sizeEx2 = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - rowHeight = "1.75 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = "0.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + sizeEx2 = "0.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + rowHeight = "1.75 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; canDrag = 0; colorText[] = {1,1,1,1}; colorBackground[] = {0,0,0,0}; diff --git a/addons/dragging/CfgVehicles.hpp b/addons/dragging/CfgVehicles.hpp index 395133e9464..bd9758447bf 100644 --- a/addons/dragging/CfgVehicles.hpp +++ b/addons/dragging/CfgVehicles.hpp @@ -3,6 +3,9 @@ class CBA_Extended_EventHandlers; class CfgVehicles { + class C_man_1; + class GVAR(clone): C_man_1 {}; + // Static weapons class LandVehicle; class StaticWeapon: LandVehicle { diff --git a/addons/dragging/XEH_PREP.hpp b/addons/dragging/XEH_PREP.hpp index 0861c9533d2..aeba3135ab5 100644 --- a/addons/dragging/XEH_PREP.hpp +++ b/addons/dragging/XEH_PREP.hpp @@ -5,6 +5,8 @@ PREP(canDrop_carry); PREP(canRun_carry); PREP(carryObject); PREP(carryObjectPFH); +PREP(createClone); +PREP(deleteClone); PREP(dragObject); PREP(dragObjectPFH); PREP(dropObject); diff --git a/addons/dragging/XEH_postInit.sqf b/addons/dragging/XEH_postInit.sqf index 5c66fe692c8..48655c5833a 100644 --- a/addons/dragging/XEH_postInit.sqf +++ b/addons/dragging/XEH_postInit.sqf @@ -1,9 +1,62 @@ // by PabstMirror, commy2 #include "script_component.hpp" +[QGVAR(moveCorpse), { + params ["_corpse", "_dir", "_posATL"]; + + if (isNull _corpse) exitWith {}; + + // Check if the corpse is already close to the target + // If so, don't teleport + if ((getPosATL _corpse) distance _posATL > 0.25) then { + // Set direction before position + _corpse setDir _dir; + + // Bring corpse back to clone's position + _corpse setPosATL _posATL; + }; + + // Sync the corpse with its position + [{ + _this awake true; + + [{ + _this awake false; + }, _this] call CBA_fnc_execNextFrame; + }, _corpse] call CBA_fnc_execNextFrame; + + // Allow the corpse to be synced for JIP players + if (isServer) exitWith { + GVAR(movedCorpses) pushBackUnique _corpse; + }; +}] call CBA_fnc_addEventHandler; + if (isServer) then { // Release object on disconnection. Function is identical to killed addMissionEventHandler ["HandleDisconnect", LINKFUNC(handleKilled)]; + + GVAR(movedCorpses) = []; + + ["CAManBase", "Deleted", { + GVAR(movedCorpses) deleteAt (GVAR(movedCorpses) find (_this select 0)); + }, true, [], true] call CBA_fnc_addClassEventHandler; + + [QGVAR(disableSyncMovedCorpseOnJIP), { + params ["_corpse"]; + + GVAR(movedCorpses) deleteAt (GVAR(movedCorpses) find _corpse); + }] call CBA_fnc_addEventHandler; + + // Sync position of dead corpse for JIP unit (prevents weird invisible hitboxes on corpses) + [QGVAR(requestSyncMovedCorpsesJIP), { + params ["_clientOwner"]; + + { + [QGVAR(moveCorpse), [_x, getDir _x, getPosATL _x], _clientOwner] call CBA_fnc_ownerEvent; + } forEach GVAR(movedCorpses); + }] call CBA_fnc_addEventHandler; +} else { + [QGVAR(requestSyncMovedCorpsesJIP), clientOwner] call CBA_fnc_serverEvent; }; if (!hasInterface) exitWith {}; @@ -20,6 +73,11 @@ if (isNil QGVAR(maxWeightCarryRun)) then { GVAR(maxWeightCarryRun) = 50; }; +// Extended EH doesn't fire for dead units, so add interactions manually +{ + _x call FUNC(initPerson); +} forEach allDeadMen; + ["isNotDragging", {!((_this select 0) getVariable [QGVAR(isDragging), false])}] call EFUNC(common,addCanInteractWithCondition); ["isNotCarrying", {!((_this select 0) getVariable [QGVAR(isCarrying), false])}] call EFUNC(common,addCanInteractWithCondition); @@ -57,6 +115,14 @@ if (isNil QGVAR(maxWeightCarryRun)) then { // Display event handler ["MouseZChanged", {(_this select 1) call FUNC(handleScrollWheel)}] call CBA_fnc_addDisplayHandler; +// Handle local effect commands for clones +[QGVAR(setCloneFace), { + params ["_clone", "_corpse"]; + + _clone setFace face _corpse; + _clone setMimic "unconscious"; +}] call CBA_fnc_addEventHandler; + // Handle surrendering and handcuffing ["ace_captiveStatusChanged", { params ["_unit", "_state"]; diff --git a/addons/dragging/functions/fnc_canCarry.sqf b/addons/dragging/functions/fnc_canCarry.sqf index be3015868b5..a38f37a02ee 100644 --- a/addons/dragging/functions/fnc_canCarry.sqf +++ b/addons/dragging/functions/fnc_canCarry.sqf @@ -18,7 +18,10 @@ params ["_unit", "_target"]; -if !(alive _target && {_target getVariable [QGVAR(canCarry), false]} && {isNull objectParent _target}) exitWith {false}; +private _alive = alive _target; +private _isPerson = _target isKindOf "CAManBase"; + +if !((_alive || _isPerson) && {_target getVariable [QGVAR(canCarry), false]} && {isNull objectParent _target}) exitWith {false}; if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -26,18 +29,19 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; // The fireman carry animation does not slow down for injured legs, so you could carry and run if ((_unit getHitPointDamage "HitLegs") >= 0.5) exitWith {false}; +// Units need to be unconscious or limping; Units also need to not be in ragdoll if alive, as that causes desync issues +if (_isPerson) exitWith { + ((!_alive) && {missionNamespace getVariable [QGVAR(canMoveDead), true]}) || + {(isAwake _target) && // not ragdolled if alive + {!(_target call EFUNC(common,isAwake)) || + {_target getHitPointDamage "HitLegs" >= 0.5}}} +}; + // Static weapons need to be empty for carrying (ignore UAV AI) if (_target isKindOf "StaticWeapon") exitWith { (crew _target) findIf {!unitIsUAV _x} == -1 }; -// Units need to be unconscious or limping; Units also need to not be in ragdoll, as that causes desync issues -if (_target isKindOf "CAManBase") exitWith { - isAwake _target && // not ragdolled - {lifeState _target == "INCAPACITATED" || - {_target getHitPointDamage "HitLegs" >= 0.5}} -}; - // Check max items for WeaponHolders if (["WeaponHolder", "WeaponHolderSimulated"] findIf {_target isKindOf _x} != -1) exitWith { (count (weaponCargo _target + magazineCargo _target + itemCargo _target)) <= MAX_DRAGGED_ITEMS diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf index 586e23feaf8..2616d6d1447 100644 --- a/addons/dragging/functions/fnc_canDrag.sqf +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -18,22 +18,26 @@ params ["_unit", "_target"]; -if !(alive _target && {_target getVariable [QGVAR(canDrag), false]} && {isNull objectParent _target}) exitWith {false}; +private _alive = alive _target; +private _isPerson = _target isKindOf "CAManBase"; + +if !((_alive || _isPerson) && {_target getVariable [QGVAR(canDrag), false]} && {isNull objectParent _target}) exitWith {false}; if !([_unit, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; +// Units need to be unconscious or limping; Units also need to not be in ragdoll if alive, as that causes desync issues +if (_isPerson) exitWith { + ((!_alive) && {missionNamespace getVariable [QGVAR(canMoveDead), true]}) || + {(isAwake _target) && // not ragdolled if alive + {!(_target call EFUNC(common,isAwake)) || + {_target getHitPointDamage "HitLegs" >= 0.5}}} +}; + // Static weapons need to be empty for dragging (ignore UAV AI) if (_target isKindOf "StaticWeapon") exitWith { (crew _target) findIf {!unitIsUAV _x} == -1 }; -// Units need to be unconscious or limping; Units also need to not be in ragdoll, as that causes desync issues -if (_target isKindOf "CAManBase") exitWith { - isAwake _target && // not ragdolled - {lifeState _target == "INCAPACITATED" || - {_target getHitPointDamage "HitLegs" >= 0.5}} -}; - // Check max items for WeaponHolders if (["WeaponHolder", "WeaponHolderSimulated"] findIf {_target isKindOf _x} != -1) exitWith { (count (weaponCargo _target + magazineCargo _target + itemCargo _target)) <= MAX_DRAGGED_ITEMS diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index 7b2b4faa6b0..d765020f96e 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -71,3 +71,6 @@ if (_UAVCrew isNotEqualTo []) then { // Check everything [LINKFUNC(carryObjectPFH), 0.5, [_unit, _target, CBA_missionTime]] call CBA_fnc_addPerFrameHandler; + +// API +[QGVAR(startedCarry), [_unit, _target]] call CBA_fnc_localEvent; diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index e0a58a26eb8..a615d282521 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -91,7 +91,7 @@ private _previousHint = _unit getVariable [QGVAR(hint), []]; if (_previousHint isEqualType "") exitWith {}; // Mouse hint -private _hintLMB = LLSTRING(Drop); +private _hintLMB = LELSTRING(common,Drop); private _cursorObject = cursorObject; if ( diff --git a/addons/dragging/functions/fnc_createClone.sqf b/addons/dragging/functions/fnc_createClone.sqf new file mode 100644 index 00000000000..6cb4aa0ec69 --- /dev/null +++ b/addons/dragging/functions/fnc_createClone.sqf @@ -0,0 +1,101 @@ +#include "..\script_component.hpp" +/* + * Author: BaerMitUmlaut, johnb43 + * Creates a draggable / carryable clone of a dead unit. + * + * Arguments: + * 0: Unit dragging/carrying + * 1: Dead unit + * + * Return Value: + * Cloned unit + * + * Example: + * [player, cursorObject] call ace_dragging_fnc_createClone; + * + * Public: No + */ + +params ["_unit", "_target"]; + +// Don't sync corpse when a player joins in progress until the corpse is in its proper position +[QGVAR(disableSyncMovedCorpseOnJIP), _target] call CBA_fnc_serverEvent; + +private _posATL = getPosATL _target; + +// Create clone +private _clone = createVehicle [[configOf _target >> QGVAR(cloneClass), "TEXT", QGVAR(clone)] call CBA_fnc_getConfigEntry, _posATL, [], 0, "CAN_COLLIDE"]; + +// Claim the clone +[_unit, _clone] call EFUNC(common,claim); + +// Move unit -10 m below terrain in order to hide it and remove its inventory access +_posATL set [2, -10]; + +// Corpse is desynced, but it doesn't matter here +_target setPosATL _posATL; + +// Hide unit until it can be moved below terrain +private _isObjectHidden = isObjectHidden _target; + +if (!_isObjectHidden) then { + [QEGVAR(common,hideObjectGlobal), [_target, true]] call CBA_fnc_serverEvent; +}; + +// Prevents unit from falling when below terrain +private _simulationEnabled = simulationEnabled _target; + +if (_simulationEnabled) then { + [QEGVAR(common,enableSimulationGlobal), [_target, false]] call CBA_fnc_serverEvent; +}; + +private _isInRemainsCollector = isInRemainsCollector _target; + +// Make sure corpse isn't deleted by engine's garbage collector +if (_isInRemainsCollector) then { + removeFromRemainsCollector [_target]; +}; + +// Make sure clone has the same wound textures as the corpse +_clone setDamage ((damage _target) min 0.99); // Don't kill the clone + +{ + _clone setHitPointDamage [_x, (_target getHitPointDamage _x) min 0.99]; +} forEach ["HitHead", "HitBody", "HitHands", "HitLegs"]; // Relevant hitpoints + +// Disable all damage +_clone allowDamage false; +_clone setVariable [QGVAR(original), [_target, _isInRemainsCollector, _isObjectHidden, _simulationEnabled], true]; + +[_clone, _target call CBA_fnc_getLoadout] call CBA_fnc_setLoadout; + +// Sets the facial expression +[[QGVAR(setCloneFace), [_clone, _target]] call CBA_fnc_globalEventJIP, _clone] call CBA_fnc_removeGlobalEventJIP; + +// API +[QGVAR(cloneCreated), [_clone, _target]] call CBA_fnc_localEvent; + +[{ + params ["_clone", "_target"]; + + // Remove clone from all zeuses + if (["ace_zeus"] call EFUNC(common,isModLoaded)) then { + [QEGVAR(zeus,removeObjects), [[_clone]]] call CBA_fnc_serverEvent; + }; + + // Release claim on corpse + [objNull, _target] call EFUNC(common,claim); +}, [_clone, _target], 0.25] call CBA_fnc_waitAndExecute; + +// Save which curators had this object as editable +if (["ace_zeus"] call EFUNC(common,isModLoaded)) then { + private _objectCurators = objectCurators _target; + + _target setVariable [QGVAR(objectCurators), _objectCurators, true]; + + if (_objectCurators isEqualTo []) exitWith {}; + + [QEGVAR(zeus,removeObjects), [[_target], _objectCurators]] call CBA_fnc_serverEvent; +}; + +_clone diff --git a/addons/dragging/functions/fnc_deleteClone.sqf b/addons/dragging/functions/fnc_deleteClone.sqf new file mode 100644 index 00000000000..148b88a3a31 --- /dev/null +++ b/addons/dragging/functions/fnc_deleteClone.sqf @@ -0,0 +1,80 @@ +#include "..\script_component.hpp" +/* + * Author: BaerMitUmlaut, johnb43 + * Drops a draggable / carryable clone of a dead unit. + * + * Arguments: + * 0: Unit dragging / carrying + * 1: Clone + * 2: If unit is in building + * + * Return Value: + * Original unit + * + * Example: + * [player, cursorObject, false] call ace_dragging_fnc_deleteClone; + * + * Public: No + */ + +params ["_unit", "_clone", "_inBuilding"]; + +(_clone getVariable [QGVAR(original), []]) params [ + ["_target", objNull], + ["_isInRemainsCollector", true], + ["_isObjectHidden", false], + ["_simulationEnabled", true] +]; + +// API +[QGVAR(cloneDeleted), [_clone, _target]] call CBA_fnc_localEvent; + +// Check if unit was deleted +if (!isNull _target) then { + private _posATL = getPosATL _clone; + + if (_inBuilding) then { + _posATL = _posATL vectorAdd [0, 0, 0.05]; + }; + + // Make sure position isn't underground + if (_posATL select 2 < 0.05) then { + _posATL set [2, 0.05]; + }; + + // Move the unit globally (important, as it desyncs the corpse position otherwise) + [QGVAR(moveCorpse), [_target, getDir _unit + 180, _posATL]] call CBA_fnc_globalEvent; + + // Unhide unit + if (!_isObjectHidden) then { + [QEGVAR(common,hideObjectGlobal), [_target, false]] call CBA_fnc_serverEvent; + }; + + // Enable simulation again + if (_simulationEnabled) then { + [QEGVAR(common,enableSimulationGlobal), [_target, true]] call CBA_fnc_serverEvent; + }; + + // Detach first to prevent objNull in attachedObjects + detach _clone; + deleteVehicle _clone; + + // Get which curators had this object as editable + if (["ace_zeus"] call EFUNC(common,isModLoaded)) then { + private _objectCurators = _target getVariable [QGVAR(objectCurators), []]; + + if (_objectCurators isEqualTo []) exitWith {}; + + [QEGVAR(zeus,addObjects), [[_target], _objectCurators]] call CBA_fnc_serverEvent; + }; + + if (_isInRemainsCollector) then { + addToRemainsCollector [_target]; + }; +} else { + // Detach first to prevent objNull in attachedObjects + detach _clone; + deleteVehicle _clone; +}; + +_target diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index e7bf706f9f9..3169db26795 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -57,7 +57,7 @@ GVAR(releaseActionID) = [0xF1, [false, false, false], { }, "keydown", "", false, 0] call CBA_fnc_addKeyHandler; // Show mouse hint -["", LLSTRING(Drop)] call EFUNC(interaction,showMouseHint); +["", LELSTRING(common,Drop)] call EFUNC(interaction,showMouseHint); // Block firing if (!GVAR(dragAndFire)) then { @@ -87,3 +87,6 @@ if (_UAVCrew isNotEqualTo []) then { // Fixes not being able to move when in combat pace [_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + +// API +[QGVAR(startedDrag), [_unit, _target]] call CBA_fnc_localEvent; diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index 249f3866bb5..13400aa349f 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -62,3 +62,8 @@ if (_target isKindOf "StaticWeapon" && {((crew _target) - (_target getVariable [ _idPFH call CBA_fnc_removePerFrameHandler; }; + +// Clones can die of drowning if oxygen is under 0.5, so refill their oxygen from time to time +if (_target isKindOf QGVAR(clone) && {getOxygenRemaining _target < 0.8}) then { + _target setOxygenRemaining 1; +}; diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 119eaf415af..049f8228168 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -31,6 +31,12 @@ if (!GVAR(dragAndFire)) then { }; private _inBuilding = _unit call FUNC(isObjectOnObject); +private _isClone = _target isKindOf QGVAR(clone); + +// Drop cloned dead units +if (_isClone) then { + _target = [_unit, _target, _inBuilding] call FUNC(deleteClone); +}; // Play release animation if (_unit call EFUNC(common,isAwake)) then { @@ -57,7 +63,7 @@ _unit removeWeapon "ACE_FakePrimaryWeapon"; [_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); // Prevent object from flipping inside buildings -if (_inBuilding) then { +if (_inBuilding && {!_isClone}) then { _target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]); TRACE_2("setPos",getPosASL _unit,getPosASL _target); }; @@ -101,3 +107,6 @@ private _mass = _target getVariable [QGVAR(originalMass), 0]; if (_mass != 0) then { [QEGVAR(common,setMass), [_target, _mass]] call CBA_fnc_globalEvent; // Force global sync }; + +// API +[QGVAR(stoppedDrag), [_unit, _target]] call CBA_fnc_localEvent; diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index d244d93a2ee..525a150bcff 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -25,6 +25,12 @@ TRACE_1("params",_this); _unit setVariable [QGVAR(releaseActionID), nil]; private _inBuilding = _unit call FUNC(isObjectOnObject); +private _isClone = _target isKindOf QGVAR(clone); + +// Drop cloned dead units +if (_isClone) then { + _target = [_unit, _target, _inBuilding] call FUNC(deleteClone); +}; // Prevent collision damage [QEGVAR(common,fixCollision), _unit] call CBA_fnc_localEvent; @@ -72,8 +78,9 @@ if (!isNil "_previousWeaponState") then { [_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); // Prevent object from flipping inside buildings -if (_inBuilding) then { +if (_inBuilding && {!_isClone}) then { _target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]); + TRACE_2("setPos",getPosASL _unit,getPosASL _target); }; _unit setVariable [QGVAR(isCarrying), false, true]; @@ -122,6 +129,12 @@ if (_loadCargo) then { } else { [_unit, _target, _cursorObject] call EFUNC(common,loadPerson); }; + + // Repurpose variable for flag used in event below + _loadCargo = true; }; }; }; + +// API +[QGVAR(stoppedCarry), [_unit, _target, _loadCargo]] call CBA_fnc_localEvent; diff --git a/addons/dragging/functions/fnc_handleAnimChanged.sqf b/addons/dragging/functions/fnc_handleAnimChanged.sqf index 24b8f582057..f89790d2e61 100644 --- a/addons/dragging/functions/fnc_handleAnimChanged.sqf +++ b/addons/dragging/functions/fnc_handleAnimChanged.sqf @@ -5,7 +5,7 @@ * * Arguments: * 0: Unit - * 1: Animaion + * 1: Animation * * Return Value: * None diff --git a/addons/dragging/functions/fnc_handleScrollWheel.sqf b/addons/dragging/functions/fnc_handleScrollWheel.sqf index c7641a8ffa7..065701bbd44 100644 --- a/addons/dragging/functions/fnc_handleScrollWheel.sqf +++ b/addons/dragging/functions/fnc_handleScrollWheel.sqf @@ -42,7 +42,7 @@ if (!CBA_events_control) then { // Uses this method of selecting position because setPosATL did not have immediate effect private _positionChange = _position vectorDiff (getPosASL _carriedItem); - private _selectionPosition = _unit worldToModel (ASLtoAGL getPosWorld _carriedItem); + private _selectionPosition = _unit worldToModel (ASLToAGL getPosWorld _carriedItem); _selectionPosition = _selectionPosition vectorAdd _positionChange; _carriedItem attachTo [_unit, _selectionPosition]; diff --git a/addons/dragging/functions/fnc_resumeDrag.sqf b/addons/dragging/functions/fnc_resumeDrag.sqf index d0fea988fb8..7ae7c1a8f3c 100644 --- a/addons/dragging/functions/fnc_resumeDrag.sqf +++ b/addons/dragging/functions/fnc_resumeDrag.sqf @@ -29,4 +29,4 @@ GVAR(releaseActionID) = [0xF1, [false, false, false], { }, "keydown", "", false, 0] call CBA_fnc_addKeyHandler; // Show mouse hint -["", LLSTRING(Drop)] call EFUNC(interaction,showMouseHint); +["", LELSTRING(common,Drop)] call EFUNC(interaction,showMouseHint); diff --git a/addons/dragging/functions/fnc_setCarryable.sqf b/addons/dragging/functions/fnc_setCarryable.sqf index c9850d6f579..977d88aff88 100644 --- a/addons/dragging/functions/fnc_setCarryable.sqf +++ b/addons/dragging/functions/fnc_setCarryable.sqf @@ -99,7 +99,7 @@ private _carryAction = [ private _dropAction = [ QGVAR(drop_carry), - LLSTRING(Drop), + LELSTRING(common,Drop), "", { [_player, _target] call FUNC(dropObject_carry) diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf index 8ff6cecf35e..a568543958e 100644 --- a/addons/dragging/functions/fnc_setDraggable.sqf +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -99,7 +99,7 @@ private _dragAction = [ private _dropAction = [ QGVAR(drop), - LLSTRING(Drop), + LELSTRING(common,Drop), "", { [_player, _target] call FUNC(dropObject); diff --git a/addons/dragging/functions/fnc_startCarry.sqf b/addons/dragging/functions/fnc_startCarry.sqf index 3e2cc17efde..99652fc263d 100644 --- a/addons/dragging/functions/fnc_startCarry.sqf +++ b/addons/dragging/functions/fnc_startCarry.sqf @@ -15,6 +15,7 @@ * * Public: No */ + params ["_unit", "_target"]; // Try to claim the object diff --git a/addons/dragging/functions/fnc_startCarryLocal.sqf b/addons/dragging/functions/fnc_startCarryLocal.sqf index 0f679f2d499..cf17dfb311d 100644 --- a/addons/dragging/functions/fnc_startCarryLocal.sqf +++ b/addons/dragging/functions/fnc_startCarryLocal.sqf @@ -41,6 +41,11 @@ private _timer = CBA_missionTime + 5; // Handle objects vs. persons if (_target isKindOf "CAManBase") then { + // Create clone for dead units + if (!alive _target) then { + _target = [_unit, _target] call FUNC(createClone); + }; + private _primaryWeapon = primaryWeapon _unit; // Add a primary weapon if the unit has none @@ -94,3 +99,6 @@ if (_mass > 1) then { _target setVariable [QGVAR(originalMass), _mass, true]; [QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync }; + +// API +[QGVAR(setupCarry), [_unit, _target]] call CBA_fnc_localEvent; diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf index 8dd6db6dee5..d65f218acd7 100644 --- a/addons/dragging/functions/fnc_startDrag.sqf +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -15,6 +15,7 @@ * * Public: No */ + params ["_unit", "_target"]; // Try to claim the object diff --git a/addons/dragging/functions/fnc_startDragLocal.sqf b/addons/dragging/functions/fnc_startDragLocal.sqf index 20d5e007dbe..f0468f133ba 100644 --- a/addons/dragging/functions/fnc_startDragLocal.sqf +++ b/addons/dragging/functions/fnc_startDragLocal.sqf @@ -90,6 +90,11 @@ if !(_unit call EFUNC(common,isSwimming)) then { // Move a bit closer and adjust direction when trying to pick up a person if (_target isKindOf "CAManBase") then { + // Create clone for dead units + if (!alive _target) then { + _target = [_unit, _target] call FUNC(createClone); + }; + [QEGVAR(common,setDir), [_target, getDir _unit + 180], _target] call CBA_fnc_targetEvent; _target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit vectorMultiply 1.5)); @@ -111,3 +116,6 @@ if (_mass > 1) then { _target setVariable [QGVAR(originalMass), _mass, true]; [QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync }; + +// API +[QGVAR(setupDrag), [_unit, _target]] call CBA_fnc_localEvent; diff --git a/addons/dragon/CfgAmmo.hpp b/addons/dragon/CfgAmmo.hpp index 22630e03b00..3a5a4a1ed6d 100644 --- a/addons/dragon/CfgAmmo.hpp +++ b/addons/dragon/CfgAmmo.hpp @@ -1,3 +1,4 @@ +class ace_missileguidance_type_Dragon; class CfgAmmo { class ammo_Penetrator_Base; class M_Scalpel_AT; @@ -37,41 +38,7 @@ class CfgAmmo { EGVAR(vehicle_damage,incendiary) = 1.0; - class ace_missileguidance { - pitchRate = 0; - yawRate = 0; - - canVanillaLock = 0; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "LineOfSight"; - navigationTypes[] = { "LineOfSight" }; - - seekLastTargetPos = 0; - seekerAngle = 30; - seekerAccuracy = 1; - - seekerMinRange = 65; - seekerMaxRange = 1000; - - correctionDistance = 30; - missileLeadDistance = 0; - offsetFromCrosshair[] = { 0, 0, 0 }; - - serviceInterval = 0.33; // how many seconds between pops - serviceCharges = 32; // how many charges are in this missile - serviceChargeAcceleration = 6.5; - dragonSpeed = 100; // meters per second - - defaultAttackProfile = "DRAGON"; - attackProfiles[] = {"DRAGON"}; - }; + class ace_missileguidance: ace_missileguidance_type_Dragon {}; }; class GVAR(super): GVAR(dragonBase) { @@ -81,36 +48,11 @@ class CfgAmmo { submunitionParentSpeedCoef = 0; submunitionInitialOffset[] = { 0, 0, -0.2 }; - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance { enabled = 1; - - pitchRate = 0; - yawRate = 0; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - seekLastTargetPos = 0; - seekerAngle = 30; - seekerAccuracy = 1; - seekerMinRange = 30; seekerMaxRange = 1500; - - correctionDistance = 30; - missileLeadDistance = 0; - - serviceInterval = 0.33; // how many seconds between pops serviceCharges = 60; // how many charges are in this missile - serviceChargeAcceleration = 6.5; - dragonSpeed = 100; // meters per second - - defaultAttackProfile = "DRAGON"; - attackProfiles[] = {"DRAGON"}; }; }; diff --git a/addons/dragon/CfgVehicles.hpp b/addons/dragon/CfgVehicles.hpp index 13441c6c26a..9cc60771b51 100644 --- a/addons/dragon/CfgVehicles.hpp +++ b/addons/dragon/CfgVehicles.hpp @@ -107,7 +107,7 @@ class CfgVehicles { soundGetIn[] = {"A3\sounds_f\dummysound",0.00031622776,1,5}; armorStructural = 10.0; - class ACE_CSW { + class ace_csw { disassembleTo = QGVAR(super); }; diff --git a/addons/dragon/CfgWeapons.hpp b/addons/dragon/CfgWeapons.hpp index 9cb58e2c1f4..0bdd53e34f2 100644 --- a/addons/dragon/CfgWeapons.hpp +++ b/addons/dragon/CfgWeapons.hpp @@ -19,7 +19,7 @@ class CfgWeapons { descriptionShort = CSTRING(dragonDescription); scope = 2; - class ACE_CSW { + class ace_csw { type = "mount"; deployTime = 2; pickupTime = 2; @@ -75,7 +75,7 @@ class CfgWeapons { opticsZoomMin = 0.055; opticsZoomMax = 0.055; scope = 2; - class ACE_CSW { + class ace_csw { type = "weapon"; deployTime = 2; pickupTime = 1; diff --git a/addons/dragon/functions/fnc_attackProfile_DRAGON.sqf b/addons/dragon/functions/fnc_attackProfile_DRAGON.sqf index 58e3844c882..6642d7d7de0 100644 --- a/addons/dragon/functions/fnc_attackProfile_DRAGON.sqf +++ b/addons/dragon/functions/fnc_attackProfile_DRAGON.sqf @@ -23,7 +23,7 @@ _attackProfileStateParams params ["_maxCorrectableDistance", "_wireCut", "_seeke private _projectilePos = getPosASL _projectile; private _distanceToProjectile = (getPosASL _shooter) vectorDistanceSqr _projectilePos; -private _retPos = _projectilePos vectorAdd (AGLtoASL (_projectile vectorModelToWorld [0, 50, 0])); +private _retPos = _projectilePos vectorAdd (AGLToASL (_projectile vectorModelToWorld [0, 50, 0])); // _shooter returns the vehicle that shot it. If the launcher dies, the wire would probably be cut so assume it if ((_distanceToProjectile > _seekerMaxRangeSqr) || _wireCut || { !alive _shooter }) exitWith { diff --git a/addons/explosives/ExplosivesUI.hpp b/addons/explosives/ExplosivesUI.hpp index ef32c0c04b6..1b14ba5e887 100644 --- a/addons/explosives/ExplosivesUI.hpp +++ b/addons/explosives/ExplosivesUI.hpp @@ -12,10 +12,10 @@ class Rsc_ACE_CallScreen_Edit: RscEdit { text = ""; style = "0x00 + 0x40 + 0x200"; shadow = 1; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 20) * 1)"; - x = "0.288594 * safezoneW + safezoneX"; - w = "0.0825 * safezoneW"; - h = "0.044 * safezoneH"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 20) * 1)"; + x = "0.288594 * safeZoneW + safeZoneX"; + w = "0.0825 * safeZoneW"; + h = "0.044 * safeZoneH"; }; class Rsc_ACE_HiddenButton: RscButton { colorText[] = {0, 0, 0, 0}; @@ -40,175 +40,175 @@ class Rsc_ACE_PhoneInterface { class RscPicture_1200: RscPicture { idc = 1200; text = QPATHTOF(Data\UI\Cellphone_Background.paa); - x = "0.231875 * safezoneW + safezoneX"; - y = "0.104 * safezoneH + safezoneY"; - w = "0.195937 * safezoneW"; - h = "0.704 * safezoneH"; + x = "0.231875 * safeZoneW + safeZoneX"; + y = "0.104 * safeZoneH + safeZoneY"; + w = "0.195937 * safeZoneW"; + h = "0.704 * safeZoneH"; }; class numkey_1: Rsc_ACE_NumKeyButton { idc = 1600; - x = "0.278281 * safezoneW + safezoneX"; - y = "0.533 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.278281 * safeZoneW + safeZoneX"; + y = "0.533 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "1"; action = "ctrlSetText [1400,((ctrlText 1400) + '1')];"; }; class numkey_2: Rsc_ACE_NumKeyButton { idc = 1601; - x = "0.314375 * safezoneW + safezoneX"; - y = "0.533 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.314375 * safeZoneW + safeZoneX"; + y = "0.533 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "2"; action = "ctrlSetText [1400,((ctrlText 1400) + '2')];"; }; class numkey_3: Rsc_ACE_NumKeyButton { idc = 1602; - x = "0.350469 * safezoneW + safezoneX"; - y = "0.533 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.350469 * safeZoneW + safeZoneX"; + y = "0.533 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "3"; action = "ctrlSetText [1400,((ctrlText 1400) + '3')];"; }; class numkey_4: Rsc_ACE_NumKeyButton { idc = 1603; - x = "0.278281 * safezoneW + safezoneX"; - y = "0.577 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.278281 * safeZoneW + safeZoneX"; + y = "0.577 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "4"; action = "ctrlSetText [1400,((ctrlText 1400) + '4')];"; }; class numkey_5: Rsc_ACE_NumKeyButton { idc = 1604; - x = "0.314375 * safezoneW + safezoneX"; - y = "0.577 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.314375 * safeZoneW + safeZoneX"; + y = "0.577 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "5"; action = "ctrlSetText [1400,((ctrlText 1400) + '5')];"; }; class numkey_6: Rsc_ACE_NumKeyButton { idc = 1605; - x = "0.350469 * safezoneW + safezoneX"; - y = "0.577 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.350469 * safeZoneW + safeZoneX"; + y = "0.577 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "6"; action = "ctrlSetText [1400,((ctrlText 1400) + '6')];"; }; class numkey_7: Rsc_ACE_NumKeyButton { idc = 1606; - x = "0.278281 * safezoneW + safezoneX"; - y = "0.621 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.278281 * safeZoneW + safeZoneX"; + y = "0.621 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "7"; action = "ctrlSetText [1400,((ctrlText 1400) + '7')];"; }; class numkey_8: Rsc_ACE_NumKeyButton { idc = 1607; - x = "0.314375 * safezoneW + safezoneX"; - y = "0.621 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.314375 * safeZoneW + safeZoneX"; + y = "0.621 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "8"; action = "ctrlSetText [1400,((ctrlText 1400) + '8')];"; }; class numkey_9: Rsc_ACE_NumKeyButton { idc = 1608; - x = "0.350469 * safezoneW + safezoneX"; - y = "0.621 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.350469 * safeZoneW + safeZoneX"; + y = "0.621 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "9"; action = "ctrlSetText [1400,((ctrlText 1400) + '9')];"; }; class numkey_0: Rsc_ACE_NumKeyButton { idc = 1609; - x = "0.314375 * safezoneW + safezoneX"; - y = "0.676 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.314375 * safeZoneW + safeZoneX"; + y = "0.676 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = "0"; action = "ctrlSetText [1400,((ctrlText 1400) + '0')];"; }; class speedDialAdd: Rsc_ACE_NumKeyButton { idc = 1610; - x = "0.278281 * safezoneW + safezoneX"; - y = "0.676 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.278281 * safeZoneW + safeZoneX"; + y = "0.676 * safeZoneH + safeZoneY"; + w = "0.0309375 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = CSTRING(Phone_AddToSpeedDial); action = QUOTE([ARR_2(ctrlText 1401,ctrlText 1400)] call FUNC(addToSpeedDial)); }; class clear: Rsc_ACE_HiddenButton { idc = 1610; - x = "0.278281 * safezoneW + safezoneX"; - y = "0.445 * safezoneH + safezoneY"; - w = "0.020625 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.278281 * safeZoneW + safeZoneX"; + y = "0.445 * safeZoneH + safeZoneY"; + w = "0.020625 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = CSTRING(Clear); action = QUOTE(ctrlSetText [ARR_2(1400,'')];[ctrlText 1401] call FUNC(removeFromSpeedDial);ctrlSetText [ARR_2(1401,'')];); }; class dial: Rsc_ACE_HiddenButton { idc = 1611; - x = "0.309219 * safezoneW + safezoneX"; - y = "0.445 * safezoneH + safezoneY"; - w = "0.04125 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.309219 * safeZoneW + safeZoneX"; + y = "0.445 * safeZoneH + safeZoneY"; + w = "0.04125 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = CSTRING(Phone_Dial); action = QUOTE([ARR_2(ace_player,ctrlText 1400)] call FUNC(dialPhone)); }; class up: Rsc_ACE_HiddenButton { idc = 1612; - x = "0.360781 * safezoneW + safezoneX"; - y = "0.445 * safezoneH + safezoneY"; - w = "0.020625 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.360781 * safeZoneW + safeZoneX"; + y = "0.445 * safeZoneH + safeZoneY"; + w = "0.020625 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = CSTRING(Phone_Up); action = QUOTE([true] call FUNC(setSpeedDial)); }; class down: Rsc_ACE_HiddenButton { idc = 1613; - x = "0.345312 * safezoneW + safezoneX"; - y = "0.485 * safezoneH + safezoneY"; - w = "0.020625 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.345312 * safeZoneW + safeZoneX"; + y = "0.485 * safeZoneH + safeZoneY"; + w = "0.020625 * safeZoneW"; + h = "0.033 * safeZoneH"; tooltip = CSTRING(Phone_Down); action = QUOTE([false] call FUNC(setSpeedDial)); }; class speedDial_Text: RscText { idc = 1405; - y = "0.302 * safezoneH + safezoneY"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 22) * 1)"; - x = "0.288594 * safezoneW + safezoneX"; - w = "0.0825 * safezoneW"; - h = "0.044 * safezoneH"; + y = "0.302 * safeZoneH + safeZoneY"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 22) * 1)"; + x = "0.288594 * safeZoneW + safeZoneX"; + w = "0.0825 * safeZoneW"; + h = "0.044 * safeZoneH"; text = "Name"; }; class speedDial_edit: Rsc_ACE_CallScreen_Edit { idc = 1401; - y = "0.302 * safezoneH + safezoneY"; - x = "0.318 * safezoneW + safezoneX"; + y = "0.302 * safeZoneH + safeZoneY"; + x = "0.318 * safeZoneW + safeZoneX"; w = "0.1"; }; class numberEdit_Text: RscText { idc = 1406; - y = "0.348 * safezoneH + safezoneY"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 22) * 1)"; - x = "0.288594 * safezoneW + safezoneX"; - w = "0.0825 * safezoneW"; - h = "0.044 * safezoneH"; + y = "0.348 * safeZoneH + safeZoneY"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 22) * 1)"; + x = "0.288594 * safeZoneW + safeZoneX"; + w = "0.0825 * safeZoneW"; + h = "0.044 * safeZoneH"; text = "#"; }; class number_edit: Rsc_ACE_CallScreen_Edit { canModify = 0; idc = 1400; - y = "0.348 * safezoneH + safezoneY"; - x = "0.3 * safezoneW + safezoneX"; + y = "0.348 * safeZoneH + safeZoneY"; + x = "0.3 * safeZoneW + safeZoneX"; }; }; }; diff --git a/addons/explosives/functions/fnc_addClacker.sqf b/addons/explosives/functions/fnc_addClacker.sqf index 794aec0a107..ace01a15265 100644 --- a/addons/explosives/functions/fnc_addClacker.sqf +++ b/addons/explosives/functions/fnc_addClacker.sqf @@ -34,7 +34,7 @@ private _detonators = [_unit] call FUNC(getDetonators); } forEach _requiredItems; if !(_hasRequired) exitWith {}; -private _config = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> configName _config; +private _config = configFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> configName _config; private _clacker = _unit getVariable [QGVAR(Clackers), []]; GVAR(PlacedCount) = GVAR(PlacedCount) + 1; diff --git a/addons/explosives/functions/fnc_addDetonateActions.sqf b/addons/explosives/functions/fnc_addDetonateActions.sqf index 0001edffcb0..388b2cf7048 100644 --- a/addons/explosives/functions/fnc_addDetonateActions.sqf +++ b/addons/explosives/functions/fnc_addDetonateActions.sqf @@ -19,16 +19,16 @@ params ["_unit", "_detonator"]; TRACE_2("params",_unit,_detonator); -private _range = getNumber (ConfigFile >> "CfgWeapons" >> _detonator >> QGVAR(Range)); +private _range = getNumber (configFile >> "CfgWeapons" >> _detonator >> QGVAR(Range)); private _result = [_unit] call FUNC(getPlacedExplosives); private _children = []; private _explosivesList = []; { if (!isNull(_x select 0)) then { - private _required = getArray (ConfigFile >> "ACE_Triggers" >> (_x select 4) >> "requires"); + private _required = getArray (configFile >> "ACE_Triggers" >> (_x select 4) >> "requires"); if (_detonator in _required) then { - private _item = ConfigFile >> "CfgMagazines" >> (_x select 3); + private _item = configFile >> "CfgMagazines" >> (_x select 3); _explosivesList pushBack _x; diff --git a/addons/explosives/functions/fnc_addTransmitterActions.sqf b/addons/explosives/functions/fnc_addTransmitterActions.sqf index 043c9db661f..d225aeda056 100644 --- a/addons/explosives/functions/fnc_addTransmitterActions.sqf +++ b/addons/explosives/functions/fnc_addTransmitterActions.sqf @@ -21,7 +21,7 @@ TRACE_1("params",_unit); private _detonators = [_unit] call FUNC(getDetonators); private _children = []; { - private _config = ConfigFile >> "CfgWeapons" >> _x; + private _config = configFile >> "CfgWeapons" >> _x; _children pushBack [ [ diff --git a/addons/explosives/functions/fnc_addTriggerActions.sqf b/addons/explosives/functions/fnc_addTriggerActions.sqf index b6b6e0ce415..8be63fbc4f9 100644 --- a/addons/explosives/functions/fnc_addTriggerActions.sqf +++ b/addons/explosives/functions/fnc_addTriggerActions.sqf @@ -22,7 +22,7 @@ TRACE_2("params",_magazine,_explosive); private _isAttached = !isNull (attachedTo _explosive); private _detonators = [ACE_player] call FUNC(getDetonators); private _triggerTypes = [_magazine] call FUNC(triggerType); -private _magTriggers = ConfigFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers"; +private _magTriggers = configFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers"; private _children = []; { private _required = getArray (_x >> "requires"); diff --git a/addons/explosives/functions/fnc_defuseExplosive.sqf b/addons/explosives/functions/fnc_defuseExplosive.sqf index 049fff88469..1c8b687c8f3 100644 --- a/addons/explosives/functions/fnc_defuseExplosive.sqf +++ b/addons/explosives/functions/fnc_defuseExplosive.sqf @@ -19,7 +19,7 @@ params ["_unit", "_explosive"]; TRACE_2("params",_unit,_explosive); -if (GVAR(ExplodeOnDefuse) && {(random 1.0) < (getNumber (ConfigFile >> "CfgAmmo" >> typeOf _explosive >> QGVAR(explodeOnDefuseChance)))}) exitWith { +if (GVAR(ExplodeOnDefuse) && {(random 1.0) < (getNumber (configFile >> "CfgAmmo" >> typeOf _explosive >> QGVAR(explodeOnDefuseChance)))}) exitWith { TRACE_1("exploding on defuse",_explosive); [_unit, -1, [_explosive, 1], "#ExplodeOnDefuse"] call FUNC(detonateExplosive); [QGVAR(explodeOnDefuse), [_explosive, _unit]] call CBA_fnc_globalEvent; diff --git a/addons/explosives/functions/fnc_getPlacedExplosives.sqf b/addons/explosives/functions/fnc_getPlacedExplosives.sqf index 867bae2275f..37ecd334bd4 100644 --- a/addons/explosives/functions/fnc_getPlacedExplosives.sqf +++ b/addons/explosives/functions/fnc_getPlacedExplosives.sqf @@ -23,7 +23,7 @@ TRACE_1("params",_unit); private _filter = nil; if (count _this > 1) then { - _filter = ConfigFile >> "ACE_Triggers" >> (_this select 1); + _filter = configFile >> "ACE_Triggers" >> (_this select 1); }; private _clackerList = []; private _adjustedList = false; @@ -34,7 +34,7 @@ private _list = []; _clackerList set [_forEachIndex, "X"]; _adjustedList = true; } else { - if (isNil "_filter" || {(ConfigFile >> "ACE_Triggers" >> (_x select 4)) == _filter}) then { + if (isNil "_filter" || {(configFile >> "ACE_Triggers" >> (_x select 4)) == _filter}) then { _list pushBack _x; }; }; diff --git a/addons/explosives/functions/fnc_onInventoryChanged.sqf b/addons/explosives/functions/fnc_onInventoryChanged.sqf index 7cf01c2a142..d5f1077dc2d 100644 --- a/addons/explosives/functions/fnc_onInventoryChanged.sqf +++ b/addons/explosives/functions/fnc_onInventoryChanged.sqf @@ -23,7 +23,7 @@ TRACE_3("params",_receiver,_giver,_item); if ((_receiver != ace_player) && {_giver != ace_player}) exitWith {}; -private _config = ConfigFile >> "CfgWeapons" >> _item; +private _config = configFile >> "CfgWeapons" >> _item; if (isClass _config && {getNumber(_config >> QGVAR(Detonator)) == 1}) then { private _clackerItems = _giver getVariable [QGVAR(Clackers), []]; _receiver setVariable [QGVAR(Clackers), (_receiver getVariable [QGVAR(Clackers), []]) + _clackerItems, true]; diff --git a/addons/explosives/functions/fnc_openTimerUI.sqf b/addons/explosives/functions/fnc_openTimerUI.sqf index c8d3707ed19..391c71b3b24 100644 --- a/addons/explosives/functions/fnc_openTimerUI.sqf +++ b/addons/explosives/functions/fnc_openTimerUI.sqf @@ -64,14 +64,14 @@ _display displayAddEventHandler ["MouseZChanged", { [{ params ["_display", "_pfhID"]; - // Make sure explosive still exists and is near player - if ((!isNull _display) && {!alive ACE_player} || {!alive GVAR(explosive)} || {(ACE_player distance GVAR(explosive)) > 5}) exitWith { - INFO_2("%1's explosive %2 became invalid",ACE_player,GVAR(explosive)); - closeDialog 0; + if (isNull _display || {!alive ACE_player}) exitWith { _pfhID call CBA_fnc_removePerFrameHandler; }; - if (isNull _display) exitWith { + // Make sure explosive still exists and is near player + if (!alive GVAR(explosive) || {(ACE_player distance GVAR(explosive)) > 5}) exitWith { + INFO_2("%1's explosive %2 became invalid",ACE_player,GVAR(explosive)); + closeDialog 0; _pfhID call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/explosives/functions/fnc_placeExplosive.sqf b/addons/explosives/functions/fnc_placeExplosive.sqf index ec19a6f6fd9..bb6fcea6ab3 100644 --- a/addons/explosives/functions/fnc_placeExplosive.sqf +++ b/addons/explosives/functions/fnc_placeExplosive.sqf @@ -37,15 +37,15 @@ if (isNil "_triggerConfig") exitWith { objNull }; -private _magazineTrigger = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> _triggerConfig; -_triggerConfig = ConfigFile >> "ACE_Triggers" >> _triggerConfig; +private _magazineTrigger = configFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> _triggerConfig; +_triggerConfig = configFile >> "ACE_Triggers" >> _triggerConfig; if (isNil "_triggerConfig") exitWith { ERROR_1("Config not found in PlaceExplosive: %1",_this); objNull }; -private _ammo = getText(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ammo"); +private _ammo = getText(configFile >> "CfgMagazines" >> _magazineClass >> "ammo"); if (isText(_magazineTrigger >> "ammo")) then { _ammo = getText (_magazineTrigger >> "ammo"); }; diff --git a/addons/explosives/functions/fnc_selectTrigger.sqf b/addons/explosives/functions/fnc_selectTrigger.sqf index 7c7d5e58d46..0a864a77c48 100644 --- a/addons/explosives/functions/fnc_selectTrigger.sqf +++ b/addons/explosives/functions/fnc_selectTrigger.sqf @@ -20,7 +20,7 @@ params ["_explosive", "_magazine", "_trigger"]; TRACE_3("params",_explosive,_magazine,_trigger); -private _config = ConfigFile >> "ACE_Triggers" >> _trigger; +private _config = configFile >> "ACE_Triggers" >> _trigger; // Make selected trigger the active one (for keybind) if it's the first to be connected private _activeTrigger = GVAR(activeTrigger); diff --git a/addons/explosives/functions/fnc_setupExplosive.sqf b/addons/explosives/functions/fnc_setupExplosive.sqf index d25e5d3276a..9214b999146 100644 --- a/addons/explosives/functions/fnc_setupExplosive.sqf +++ b/addons/explosives/functions/fnc_setupExplosive.sqf @@ -78,7 +78,7 @@ GVAR(TweakedAngle) = 0; { private _testPos = _testBase vectorAdd [0.1 * (_x select 0) * (cos _cameraAngle), 0.1 * (_x select 0) * (sin _cameraAngle), 0.1 * (_x select 1)]; #ifdef DEBUG_MODE_FULL - drawLine3d [(eyePos _unit) call EFUNC(common,ASLToPosition), (_testPos) call EFUNC(common,ASLToPosition), [1,0,0,1]]; + drawLine3D [(eyePos _unit) call EFUNC(common,ASLToPosition), (_testPos) call EFUNC(common,ASLToPosition), [1,0,0,1]]; #endif if ((lineIntersectsSurfaces [eyePos _unit, _testPos, _unit]) isNotEqualTo []) exitWith {_return = false;}; } forEach [[0,0], [-1,-1], [1,-1], [-1,1], [1,1]]; @@ -167,7 +167,7 @@ GVAR(TweakedAngle) = 0; if (isNull _attachVehicle) then { _placeAngle = _cameraAngle - GVAR(TweakedAngle) + 180; - _expSetupVehicle setPosAsl _virtualPosASL; + _expSetupVehicle setPosASL _virtualPosASL; _expSetupVehicle setDir _placeAngle; _placeAngle = _placeAngle + 180; //CfgAmmos seem to be 180 for some reason } else { diff --git a/addons/explosives/functions/fnc_startDefuse.sqf b/addons/explosives/functions/fnc_startDefuse.sqf index e023592547c..ef3efac885f 100644 --- a/addons/explosives/functions/fnc_startDefuse.sqf +++ b/addons/explosives/functions/fnc_startDefuse.sqf @@ -25,8 +25,8 @@ private _fnc_DefuseTime = { params ["_specialist", "_target"]; TRACE_2("defuseTime",_specialist,_target); private _defuseTime = 5; - if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> QGVAR(DefuseTime))) then { - _defuseTime = getNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> QGVAR(DefuseTime)); + if (isNumber(configFile >> "CfgAmmo" >> typeOf (_target) >> QGVAR(DefuseTime))) then { + _defuseTime = getNumber(configFile >> "CfgAmmo" >> typeOf (_target) >> QGVAR(DefuseTime)); }; if (!_specialist && {GVAR(PunishNonSpecialists)}) then { _defuseTime = _defuseTime * 1.5; @@ -34,7 +34,7 @@ private _fnc_DefuseTime = { _defuseTime }; private _actionToPlay = "MedicOther"; -if (STANCE _unit == "Prone") then { +if (stance _unit == "Prone") then { _actionToPlay = "PutDown"; }; diff --git a/addons/explosives/functions/fnc_triggerType.sqf b/addons/explosives/functions/fnc_triggerType.sqf index 0fba459491b..aa890c049f2 100644 --- a/addons/explosives/functions/fnc_triggerType.sqf +++ b/addons/explosives/functions/fnc_triggerType.sqf @@ -19,10 +19,10 @@ params ["_magazineClassname"]; TRACE_1("params",_magazineClassname); private _result = []; -private _config = getArray (ConfigFile >> "CfgMagazines" >> _magazineClassname >> "ACE_Triggers" >> "SupportedTriggers"); +private _config = getArray (configFile >> "CfgMagazines" >> _magazineClassname >> "ACE_Triggers" >> "SupportedTriggers"); private _count = count _config; for "_index" from 0 to (_count - 1) do { - _result set [_index, ConfigFile >> "ACE_Triggers" >> (_config select _index)]; + _result set [_index, configFile >> "ACE_Triggers" >> (_config select _index)]; }; _result diff --git a/addons/fastroping/XEH_postInit.sqf b/addons/fastroping/XEH_postInit.sqf index 1daecbb715b..0cfeee67bd9 100644 --- a/addons/fastroping/XEH_postInit.sqf +++ b/addons/fastroping/XEH_postInit.sqf @@ -54,7 +54,7 @@ addMissionEventHandler ["Draw3D", { if !(cursorObject isKindOf "Helicopter") exitWith {}; private _config = configOf cursorObject; private _enabled = getNumber (_config >> QGVAR(enabled)); - drawIcon3D ["", [.5,.5,1,1], (ASLtoAGL getPosASL cursorObject), 0.5, 0.5, 0, format ["%1 = %2", typeOf cursorObject, _enabled], 0.5, 0.025, "TahomaB"]; + drawIcon3D ["", [.5,.5,1,1], (ASLToAGL getPosASL cursorObject), 0.5, 0.5, 0, format ["%1 = %2", typeOf cursorObject, _enabled], 0.5, 0.025, "TahomaB"]; if (_enabled > 0) then { { private _hookAttachment = cursorObject getVariable [QGVAR(FRIES), cursorObject]; diff --git a/addons/fastroping/functions/fnc_deployRopes.sqf b/addons/fastroping/functions/fnc_deployRopes.sqf index eea81a77461..c4e999db17c 100644 --- a/addons/fastroping/functions/fnc_deployRopes.sqf +++ b/addons/fastroping/functions/fnc_deployRopes.sqf @@ -26,7 +26,7 @@ private _ropeOrigins = getArray (_config >> QGVAR(ropeOrigins)); private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; private _hookAttachment = _vehicle getVariable [QGVAR(FRIES), _vehicle]; -private _ropeLength = getNumber (configfile >> "CfgWeapons" >> _ropeClass >> QEGVAR(logistics_rope,length)); +private _ropeLength = getNumber (configFile >> "CfgWeapons" >> _ropeClass >> QEGVAR(logistics_rope,length)); if (_ropeLength <= 0) then { _ropeLength = DEFAULT_ROPE_LENGTH; diff --git a/addons/fcs/CfgOptics.hpp b/addons/fcs/CfgOptics.hpp index f8770d7327d..551a965a60d 100644 --- a/addons/fcs/CfgOptics.hpp +++ b/addons/fcs/CfgOptics.hpp @@ -26,7 +26,7 @@ class RscInGameUI { }; }; class Rsc_ACE_Helo_UI_Turret: RscUnitInfo { // RscOptics_Heli_Attack_01_gunner - onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; + onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call (uiNamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; class CA_IGUI_elements_group: RscControlsGroup { class controls { MACRO_RANGEFINDER diff --git a/addons/fcs/functions/fnc_getAngle.sqf b/addons/fcs/functions/fnc_getAngle.sqf index 9a856d46c97..03e8b4fdc8e 100644 --- a/addons/fcs/functions/fnc_getAngle.sqf +++ b/addons/fcs/functions/fnc_getAngle.sqf @@ -21,7 +21,7 @@ * Public: No */ -#define PRECISION 0.1 +#define VAR_PRECISION 0.1 params ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep"]; @@ -69,9 +69,9 @@ private _it2 = 0; _data set [7, _maxElev]; private _f1 = _data call _fnc_traceBullet; -if (abs _f1 <= PRECISION) exitWith {0}; +if (abs _f1 <= VAR_PRECISION) exitWith {0}; -while {abs _f1 > PRECISION} do { +while {abs _f1 > VAR_PRECISION} do { _data set [7, _angle2]; private _f2 = _data call _fnc_traceBullet; diff --git a/addons/field_rations/functions/fnc_getActionOffset.sqf b/addons/field_rations/functions/fnc_getActionOffset.sqf index dd7658dfda1..763654c6559 100644 --- a/addons/field_rations/functions/fnc_getActionOffset.sqf +++ b/addons/field_rations/functions/fnc_getActionOffset.sqf @@ -18,11 +18,11 @@ params ["_object"]; private _configOf = configOf _object; -if !(isNull _configOf) then { +if (isNull _configOf) then { + // Check for offset corresponding to p3d list + GVAR(waterSourceOffsets) param [GVAR(waterSourceP3ds) find (getModelInfo _object select 0), [0, 0, 0], [[]]]; +} else { // Check for offset in config since we have valid typeOf private _offset = getArray (_configOf >> QXGVAR(offset)); if (_offset isEqualTo []) then {[0, 0, 0]} else {_offset}; -} else { - // Check for offset corresponding to p3d list - GVAR(waterSourceOffsets) param [GVAR(waterSourceP3ds) find (getModelInfo _object select 0), [0, 0, 0], [[]]]; }; diff --git a/addons/field_rations/functions/fnc_getRemainingWater.sqf b/addons/field_rations/functions/fnc_getRemainingWater.sqf index 253fd62285d..1011136e0ce 100644 --- a/addons/field_rations/functions/fnc_getRemainingWater.sqf +++ b/addons/field_rations/functions/fnc_getRemainingWater.sqf @@ -23,7 +23,10 @@ private _water = _source getVariable QGVAR(currentWaterSupply); if (isNil "_water") then { private _configOf = configOf _source; - if !(isNull _configOf) then { + if (isNull _configOf) then { + // Check the p3d name against list + _water = if ((getModelInfo _source select 0) in GVAR(waterSourceP3ds)) then {REFILL_WATER_INFINITE} else {REFILL_WATER_DISABLED}; + } else { // Check for waterSupply entry since we have valid typeOf _water = getNumber (_configOf >> QXGVAR(waterSupply)); if (_water == 0) then {_water = REFILL_WATER_DISABLED}; @@ -35,9 +38,6 @@ if (isNil "_water") then { _source setVariable [QGVAR(currentWaterSupply), _water, true]; }; }; - } else { - // Check the p3d name against list - _water = if ((getModelInfo _source select 0) in GVAR(waterSourceP3ds)) then {REFILL_WATER_INFINITE} else {REFILL_WATER_DISABLED}; }; }; diff --git a/addons/fieldmanual/stringtable.xml b/addons/fieldmanual/stringtable.xml index af748b91eb4..9cf2290de2d 100644 --- a/addons/fieldmanual/stringtable.xml +++ b/addons/fieldmanual/stringtable.xml @@ -169,6 +169,7 @@ %3IV 輸液%4は失われた血液を回復します。血液、血漿、生理食塩水は機能的には同じです。<br/><br/>%3使用方法:%4<br/>%2[%3%13%4] または [%3%14%4] を使って四肢を選択します。<br/>%2希望の%3IV 輸液%4の種類を選択して、血液量を復元します。 %%3Внутривенные жидкости%4восстанавливают потерянный объем крови. Кровь, плазма и физраствор функционально идентичны.<br/><br/>%3 Использование:%4<br/>%2 Используйте [%3%13%4] или [%3%14%4] и выберите добавку.<br/>%2 Восстановите объем крови выбрав желаемый %4тип %3жидкости Los %3Fluidos IV%4 restauran el volumen de sangre. Sangre, Plasma, y Salino funcionan de manera similar.<br/><br/>%3Uso:%4<br/>%2Uso [%3%13%4] o [%3%14%4] y seleccionar una extremidad.<br/>%2Restaura el volumen de sangre seleccionando el tipo de %3Fluido IV%4 elegido. + %3IV fluides%4 restaurer le volume sanguin perdu. Sang, Plasma, and Saline fonctionnent de la même manière.<br/><br/>%3Utilisation:%4<br/>%2Utiliser [%3%13%4] ou [%3%14%4] et sélectionner un appendice.<br/>%2Restaurer le volume sanguin en sélectionnant le volume désiré %3IV Fluide%4 type. Increase Heart Rate | Wake Up Faster diff --git a/addons/finger/functions/fnc_keyPress.sqf b/addons/finger/functions/fnc_keyPress.sqf index 2445986d15b..16dca938b34 100644 --- a/addons/finger/functions/fnc_keyPress.sqf +++ b/addons/finger/functions/fnc_keyPress.sqf @@ -29,8 +29,8 @@ if (diag_tickTime < (GVAR(lastFPTime) + FP_ACTION_TIMEOUT)) exitWith {true}; GVAR(lastFPTime) = diag_tickTime; // Find where is the finger pointing -private _originASL = AGLtoASL positionCameraToWorld [0, 0, 0]; -private _fingerPosASL = AGLtoASL positionCameraToWorld [0, 0, FP_DISTANCE]; +private _originASL = AGLToASL positionCameraToWorld [0, 0, 0]; +private _fingerPosASL = AGLToASL positionCameraToWorld [0, 0, FP_DISTANCE]; private _intersections = lineIntersectsSurfaces [_originASL, _fingerPosASL, ACE_player, vehicle ACE_player, true, 1]; if (_intersections isNotEqualTo []) then { _fingerPosASL = _intersections select 0 select 0; diff --git a/addons/finger/functions/fnc_perFrameEH.sqf b/addons/finger/functions/fnc_perFrameEH.sqf index 4af4f6b643e..36acea8a447 100644 --- a/addons/finger/functions/fnc_perFrameEH.sqf +++ b/addons/finger/functions/fnc_perFrameEH.sqf @@ -39,7 +39,7 @@ private _iconBaseSize = GVAR(sizeCoef) * BASE_SIZE * 0.10713 * (call EFUNC(commo _iconSize = _iconSize * linearConversion [0, GVAR(maxRange), (getPosASL ACE_player) vectorDistance (getPosASL _sourceUnit), 0.25, 2, true]; }; - drawIcon3D [QPATHTOF(UI\fp_icon2.paa), _drawColor, ASLtoAGL _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "RobotoCondensed"]; + drawIcon3D [QPATHTOF(UI\fp_icon2.paa), _drawColor, ASLToAGL _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "RobotoCondensed"]; }; } forEach GVAR(fingersHash); diff --git a/addons/fortify/CfgWeapons.hpp b/addons/fortify/CfgWeapons.hpp index 66ff7f52d88..82396288721 100644 --- a/addons/fortify/CfgWeapons.hpp +++ b/addons/fortify/CfgWeapons.hpp @@ -10,6 +10,7 @@ class CfgWeapons { picture = QPATHTOF(UI\hammer_ca.paa); scope = 2; ACE_isTool = 1; + GVAR(fortifyTool) = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0; }; diff --git a/addons/fortify/XEH_preInit.sqf b/addons/fortify/XEH_preInit.sqf index 382fc805660..50f641f9cf7 100644 --- a/addons/fortify/XEH_preInit.sqf +++ b/addons/fortify/XEH_preInit.sqf @@ -13,6 +13,8 @@ GVAR(locations) = []; // Custom deploy handlers GVAR(deployHandlers) = []; +GVAR(fortifyTools) = keys (uiNamespace getVariable QGVAR(fortifyTools)); + #include "initSettings.inc.sqf" ADDON = true; diff --git a/addons/fortify/XEH_preStart.sqf b/addons/fortify/XEH_preStart.sqf index 022888575ed..4da9eeb40da 100644 --- a/addons/fortify/XEH_preStart.sqf +++ b/addons/fortify/XEH_preStart.sqf @@ -1,3 +1,9 @@ #include "script_component.hpp" #include "XEH_PREP.hpp" + +private _fortifyTools = (QUOTE(getNumber (_x >> QQGVAR(fortifyTool)) > 0) configClasses (configFile >> "CfgWeapons") apply {configName _x}); +_fortifyTools append (QUOTE(getNumber (_x >> QQGVAR(fortifyTool)) > 0) configClasses (configFile >> "CfgVehicles") apply {configName _x}); +TRACE_1("",_fortifyTools); + +uiNamespace setVariable [QGVAR(fortifyTools), compileFinal (_fortifyTools createHashMapFromArray [])]; diff --git a/addons/fortify/functions/fnc_addActions.sqf b/addons/fortify/functions/fnc_addActions.sqf index 4802effa01d..7ac07d1693a 100644 --- a/addons/fortify/functions/fnc_addActions.sqf +++ b/addons/fortify/functions/fnc_addActions.sqf @@ -21,7 +21,7 @@ private _side = side group _player; private _objects = missionNamespace getVariable [format [QGVAR(Objects_%1), _side], []]; private _actions = []; private _infiniteBudget = ([side group _player] call FUNC(getBudget)) == -1; -private _subActions = createHashmap; +private _subActions = createHashMap; { _x params ["_classname", "_cost", ["_category", ""]]; diff --git a/addons/fortify/functions/fnc_buildLocationModule.sqf b/addons/fortify/functions/fnc_buildLocationModule.sqf index c777b80d4e4..497af641f41 100644 --- a/addons/fortify/functions/fnc_buildLocationModule.sqf +++ b/addons/fortify/functions/fnc_buildLocationModule.sqf @@ -18,7 +18,7 @@ params ["_logic"]; TRACE_1("buildLocations",_logic); -private _area = _logic getvariable ["objectArea",[0,0,0,false,0]]; // seems to be set via the canSetArea config +private _area = _logic getVariable ["objectArea",[0,0,0,false,0]]; // seems to be set via the canSetArea config if ((_area param [0, 0]) == 0) exitWith {WARNING_1("Bad size? %1",_area);}; private _locationArray = [_logic]; _locationArray append _area; diff --git a/addons/fortify/functions/fnc_canFortify.sqf b/addons/fortify/functions/fnc_canFortify.sqf index 3a382bc98c9..ad676a91031 100644 --- a/addons/fortify/functions/fnc_canFortify.sqf +++ b/addons/fortify/functions/fnc_canFortify.sqf @@ -19,8 +19,12 @@ params ["_player", ["_cost", 0]]; (missionNamespace getVariable [QGVAR(fortifyAllowed), true]) && -{"ACE_Fortify" in (_player call EFUNC(common,uniqueItems))} && { + private _items = _player call EFUNC(common,uniqueItems); + _items append weapons _player; + _items pushBack backpack _player; + GVAR(fortifyTools) findAny _items != -1 +} && { private _budget = [side group _player] call FUNC(getBudget); ((_budget == -1) || {_budget >= _cost}) } && { diff --git a/addons/fortify/functions/fnc_getPlaceableSet.sqf b/addons/fortify/functions/fnc_getPlaceableSet.sqf index d5e610d0475..dfe5a01a1b8 100644 --- a/addons/fortify/functions/fnc_getPlaceableSet.sqf +++ b/addons/fortify/functions/fnc_getPlaceableSet.sqf @@ -20,7 +20,7 @@ TRACE_1("getPlaceableSet",_preset); private _config = missionConfigFile >> "ACEX_Fortify_Presets" >> _preset; if (!isClass _config) then { - _config = configfile >> "ACEX_Fortify_Presets" >> _preset; + _config = configFile >> "ACEX_Fortify_Presets" >> _preset; }; if (!isClass _config) exitWith { private _msg = format ["Could not find [%1]", _preset]; diff --git a/addons/frag/CfgAmmo.hpp b/addons/frag/CfgAmmo.hpp index 7a124833b3c..acad0a0ed0b 100644 --- a/addons/frag/CfgAmmo.hpp +++ b/addons/frag/CfgAmmo.hpp @@ -4,272 +4,16 @@ class CfgAmmo { - // ~~~~ Bombs: - class ammo_Bomb_LaserGuidedBase; - class Bo_GBU12_LGB: ammo_Bomb_LaserGuidedBase { - GVAR(enabled) = 1; + #include "CfgAmmoBaseClasses.hpp" - GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; - GVAR(metal) = 140000; - GVAR(charge) = 87000; - GVAR(gurney_c) = 2320; - GVAR(gurney_k) = "1/2"; - }; - class Bomb_04_F: ammo_Bomb_LaserGuidedBase { - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; - GVAR(metal) = 140000; - GVAR(charge) = 87000; - GVAR(gurney_c) = 2320; - GVAR(gurney_k) = "1/2"; - }; - class BombCore; - class Bo_Mk82: BombCore { - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; - GVAR(metal) = 140000; - GVAR(charge) = 87000; - GVAR(gurney_c) = 2320; - GVAR(gurney_k) = "1/2"; - }; - - // ~~~~ Grenades: - class GrenadeBase; - class Grenade; - class GrenadeHand: Grenade { - GVAR(enabled) = 1; - - GVAR(skip) = 0; - GVAR(force) = 1; - // This is a good high-drag frag type for grenades. - GVAR(classes)[] = {QGVAR(tiny_HD)}; - /* - These values are based on the M67 Grenade, should be tweaked for - individual grenades. - */ - GVAR(metal) = 210; // metal in grams - GVAR(charge) = 185; // explosive in grams - GVAR(gurney_c) = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations - GVAR(gurney_k) = "3/5"; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations - }; - class GrenadeHand_stone: GrenadeHand { - GVAR(skip) = 1; - }; - class SmokeShell: GrenadeHand { - GVAR(skip) = 1; - }; - class G_40mm_HE: GrenadeBase { - // Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M441 - GVAR(enabled) = 1; - GVAR(force) = 1; - - GVAR(classes)[] = {QGVAR(tiny_HD)}; - GVAR(metal) = 200; - GVAR(charge) = 32; - GVAR(gurney_c) = 2700; - GVAR(gurney_k) = "1/2"; - }; - class G_40mm_HEDP: G_40mm_HE { - // Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M433 - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(tiny_HD)}; - GVAR(metal) = 200; - GVAR(charge) = 45; - GVAR(gurney_c) = 2830; - GVAR(gurney_k) = "1/2"; - }; - - class ACE_G_40mm_HEDP: G_40mm_HEDP {}; - class ACE_G_40mm_HE: G_40mm_HE {}; - class ACE_G_40mm_Practice: ACE_G_40mm_HE { - GVAR(skip) = 1; - GVAR(force) = 0; - EGVAR(vehicle_damage,incendiary) = 0; - }; - class ACE_G40mm_HE_VOG25P: G_40mm_HE { - GVAR(skip) = 0; - GVAR(force) = 1; - }; - - - // ~~~~ RPGs: - class MissileBase; - class R_PG32V_F; - class R_TBG32V_F: R_PG32V_F { // HE - GVAR(enabled) = 1; - GVAR(metal) = 400; - GVAR(charge) = 210; - GVAR(gurney_c) = 2800; - GVAR(gurney_k) = "3/5"; - GVAR(classes)[] = {"ACE_frag_medium_HD"}; - }; - class M_Titan_AA: MissileBase { - GVAR(skip) = 1; - }; - class M_Titan_AT: MissileBase { - GVAR(skip) = 1; - }; - class M_Titan_AP: M_Titan_AT { // "anti personnel" - GVAR(skip) = 0; - GVAR(enabled) = 1; - GVAR(metal) = 400; - GVAR(charge) = 210; - GVAR(gurney_c) = 2800; - GVAR(gurney_k) = "3/5"; - GVAR(classes)[] = {"ACE_frag_medium_HD"}; - }; - - // https://ofb.gov.in/product/products/product-details/84-mm-he-round-ffv-441-b - // https://armypubs.army.mil/epubs/DR_pubs/DR_a/pdf/web/ARN18072_TC%203-22x84%20FINAL%20WEB.pdf (page 99, Table A-6. HE 441D RS, 84-mm projectile) - class R_MRAAWS_HEAT_F; - class R_MRAAWS_HE_F: R_MRAAWS_HEAT_F { - GVAR(enabled) = 1; - GVAR(metal) = 2300; - GVAR(charge) = 590; - GVAR(gurney_c) = 2800; - GVAR(gurney_k) = "1/2"; - GVAR(classes)[] = {"ACE_frag_small"}; - }; - - - // ~~~~ Missiles: - class M_PG_AT; - class M_AT: M_PG_AT { // DAR (Hydra 70) - // Source: http://fas.org/man/dod-101/sys/missile/hydra-70.htm - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 3850; - GVAR(charge) = 1040; - GVAR(gurney_c) = 2700; - GVAR(gurney_k) = "1/2"; - }; - class RocketBase; - class R_80mm_HE: RocketBase { - GVAR(skip) = 1; - }; - class Missile_AGM_02_F: MissileBase { - // Source: http://fas.org/man/dod-101/sys/smart/agm-65.htm - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 56250; - GVAR(charge) = 39000; - GVAR(gurney_c) = 2700; - GVAR(gurney_k) = "1/2"; - }; - class Rocket_04_HE_F: MissileBase { // Shrieker (Hydra 70) - GVAR(enabled) = 1; - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 3850; - GVAR(charge) = 1040; - GVAR(gurney_c) = 2700; - GVAR(gurney_k) = "1/2"; - }; - class M_Scalpel_AT: MissileBase { // 9K121 Vikhr - GVAR(enabled) = 1; - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 10000; - GVAR(charge) = 3000; - GVAR(gurney_c) = 2700; - GVAR(gurney_k) = "1/2"; - }; - class ACE_Hellfire_AGM114K: M_Scalpel_AT { - // Source: http://www.designation-systems.net/dusrm/m-114.html - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 8000; - GVAR(charge) = 2400; - GVAR(gurney_c) = 2700; - GVAR(gurney_k) = "1/2"; - }; - class M_Air_AA: MissileBase { - GVAR(skip) = 1; - }; - class Missile_AA_04_F: MissileBase { - GVAR(skip) = 1; - }; - - // curator ammo entries - class ShellBase; - class Sh_125mm_HEAT; - class Sh_155mm_AMOS: ShellBase { - // Source: http://www.globalsecurity.org/military/systems/munitions/m795.htm - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; - GVAR(metal) = 36000; - GVAR(charge) = 9979; - GVAR(gurney_c) = 2440; - GVAR(gurney_k) = "1/2"; - }; - class Sh_82mm_AMOS: Sh_155mm_AMOS { - // Source: http://www.arsenal-bg.com/defense_police/mortar_bombs_82mm.htm - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 3200; - GVAR(charge) = 420; - GVAR(gurney_c) = 2440; - GVAR(gurney_k) = "1/2"; - }; - class ModuleOrdnanceMortar_F_Ammo: Sh_82mm_AMOS { - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 800; - GVAR(charge) = 4200; - GVAR(gurney_c) = 2320; - GVAR(gurney_k) = "1/2"; - }; - class Sh_105mm_HEAT_MP: Sh_125mm_HEAT { - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 11400; - GVAR(charge) = 7100; - GVAR(gurney_c) = 2800; - GVAR(gurney_k) = "1/2"; - }; - class Sh_120mm_HE: ShellBase { - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 23000; - GVAR(charge) = 3148; - GVAR(gurney_c) = 2830; - GVAR(gurney_k) = "1/2"; - }; - class Sh_125mm_HE: Sh_120mm_HE { - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 16000; - GVAR(charge) = 3200; - GVAR(gurney_c) = 2440; - GVAR(gurney_k) = "1/2"; - }; - class ModuleOrdnanceHowitzer_F_ammo: Sh_155mm_AMOS { - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; - GVAR(metal) = 1950; - GVAR(charge) = 15800; - GVAR(gurney_c) = 2320; - GVAR(gurney_k) = "1/2"; - }; - - - class B_65x39_Caseless; + class B_65x39_Caseless: BulletBase {}; class GVAR(base): B_65x39_Caseless { ACE_damageType = "grenade"; // compatibility with medical_damage, shrapnel should produce grenade wounds - timeToLive = 12; + timeToLive = 4; typicalSpeed = 1500; + maxSpeed = 1200; deflecting = 65; + GVAR(skip) = 1; }; class GVAR(tiny): GVAR(base) { @@ -317,7 +61,7 @@ class CfgAmmo { }; class GVAR(large_HD): GVAR(large) { - hit = 28; + hit = 28; indirectHit = 2; indirectHitRange = 0.25; airFriction = QUOTE(BASE_DRAG_HD*0.65); @@ -340,21 +84,6 @@ class CfgAmmo { caliber = 2.8; }; - class GVAR(spall_small): GVAR(small) { - timeToLive = 0.1; - }; - - class GVAR(spall_medium): GVAR(medium) { - timeToLive = 0.15; - }; - - class GVAR(spall_large): GVAR(large) { - timeToLive = 0.25; - }; - - class GVAR(spall_huge): GVAR(huge) { - timeToLive = 0.3; - }; - - #include "CfgAmmoReflections.hpp" + #include "CfgAmmoSpall.hpp" + #include "CfgAmmoFragParameters.hpp" }; diff --git a/addons/frag/CfgAmmoBaseClasses.hpp b/addons/frag/CfgAmmoBaseClasses.hpp new file mode 100644 index 00000000000..413dfe3dd93 --- /dev/null +++ b/addons/frag/CfgAmmoBaseClasses.hpp @@ -0,0 +1,47 @@ +// We need this since autocannons generally inherit from BulletBase +class BulletCore; +class BulletBase: BulletCore {}; + +class GrenadeCore; +class GrenadeBase: GrenadeCore {}; + +class LaserBombCore; +class ammo_Bomb_LaserGuidedBase: LaserBombCore {}; + +class MissileCore; +class MissileBase: MissileCore {}; + +class RocketCore; +class RocketBase: RocketCore { + GVAR(skip) = 1; +}; + +class ArtilleryRocketCore: RocketCore {}; + +class ShellCore; +class ShellBase: ShellCore {}; + +class ShotDeployCore; +class ShotDeployBase: ShotDeployCore { + GVAR(skip) = 1; +}; + +class ShotgunCore; +class ShotgunBase: ShotgunCore {}; + +class SubmunitionCore; +class SubmunitionBase: SubmunitionCore { + GVAR(skip) = 1; +}; + +class BoundingMineCore; +class BoundingMineBase: BoundingMineCore {}; + +class PipeBombCore; +class PipeBombBase: PipeBombCore {}; + +class DirectionalBombCore; +class DirectionalBombBase: DirectionalBombCore {}; + +class MineCore; +class MineBase: MineCore {}; diff --git a/addons/frag/CfgAmmoFragParameters.hpp b/addons/frag/CfgAmmoFragParameters.hpp new file mode 100644 index 00000000000..8d6402c3772 --- /dev/null +++ b/addons/frag/CfgAmmoFragParameters.hpp @@ -0,0 +1,796 @@ +// ~~~~ Autocannons +class B_19mm_HE: BulletBase { + GVAR(skip) = 1; +}; + +class B_20mm: BulletBase { + // Used in Weisel/AWC Nyx, which makes it a Rheinmetall Mk 20 Rh-202 + // Based on jane's ammunition handbook ~2002 (archive.org) + GVAR(skip) = 1; + GVAR(charge) = 6; + GVAR(metal) = 114; + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(tiny)}; +}; + +class B_20mm_AP: BulletBase { + GVAR(skip) = 1; +}; + +class ammo_Gun20mmAABase: BulletBase { // 20x139mm + GVAR(skip) = 1; + GVAR(charge) = 6; + GVAR(metal) = 114; + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(tiny)}; +}; + +class ammo_Gun30mmAABase: BulletBase { // 30x210mm HEI + GVAR(skip) = 0; + GVAR(charge) = 40; + GVAR(metal) = 410; + GVAR(gurney_k) = "1/2"; + GVAR(gurney_c) = 2901; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(tiny), QGVAR(small)}; + +}; + +class B_30mm_HE: B_19mm_HE { + // Used in Gorgon (Pandur II), assuming it's a L21A1 RARDEN, specifically HEI-T due to tracers + // https://ordtech-industries.com/30x170-mm-ammunition-for-cannons-oerlikon-kcb-hispano-hs831l-l21-rarden/ + GVAR(skip) = 0; + GVAR(charge) = 25; + GVAR(metal) = 320; + GVAR(gurney_c) = 2552; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(tiny), QGVAR(small)}; +}; +class B_30mm_MP: B_30mm_HE { + // Used in Mora (FV510 Warrior), assuming it's a Mk44 Bushmaster II, specifically HEI-T due to tracers + // http://www.navweaps.com/Weapons/WNUS_30mm_BushmasterII.php + GVAR(metal) = 388; + GVAR(charge) = 56; + GVAR(gurney_c) = 2600; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(tiny), QGVAR(small)}; +}; + +class Gatling_30mm_HE_Plane_CAS_01_F: BulletBase { + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(small)}; + GVAR(metal) = 388; + GVAR(charge) = 56; + GVAR(gurney_c) = 2600; // guessed + GVAR(gurney_k) = "1/2"; +}; + +class ammo_Gun35mmAABase: BulletBase { + // Gepard uses an Oerlikon GDF and the AA vehicles mimics it like it + // https://en.wikipedia.org/wiki/Oerlikon_GDF#Ammunition + // https://www.nammo.com/product/our-products/ammunition/medium-caliber-ammunition/35-mm-series/35-mm-x-228-hei-sd-and-hei-t-sd/ + GVAR(skip) = 0; + GVAR(charge) = 98; + GVAR(metal) = 400; + GVAR(gurney_k) = "1/2"; + GVAR(gurney_c) = 2700; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(tiny), QGVAR(small)}; +}; + +class B_35mm_AA: BulletBase { + // Gepard uses an Oerlikon GDF and the AA vehicles mimics it like it + // https://en.wikipedia.org/wiki/Oerlikon_GDF#Ammunition + // https://www.nammo.com/product/our-products/ammunition/medium-caliber-ammunition/35-mm-series/35-mm-x-228-hei-sd-and-hei-t-sd/ + GVAR(skip) = 0; + GVAR(charge) = 98; + GVAR(metal) = 400; + GVAR(gurney_k) = "1/2"; + GVAR(gurney_c) = 2700; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(tiny), QGVAR(small)}; +}; + +class B_40mm_GPR: B_30mm_HE { + // Based on noted 40mm Autocannons, base ROF, and ammo names, looks to be a CTAS40, specifically GPR-PD-T + // https://www.cta-international.com/ammunition/ + // https://ndiastorage.blob.core.usgovcloudapi.net/ndia/2002/gun/leslie.pdf + GVAR(classes)[] = {QGVAR(tiny), QGVAR(small)}; + GVAR(metal) = 750; + GVAR(charge) = 120; + GVAR(gurney_c) = 2700; // guessed + GVAR(gurney_k) = "1/2"; +}; +class UnderwaterMine_Range_Ammo: MineBase { + GVAR(skip) = 1; +}; + +// ~~~~ Bombs: +class Bo_GBU12_LGB: ammo_Bomb_LaserGuidedBase { + GVAR(skip) = 0; + GVAR(charge) = 87000; + GVAR(metal) = 140000; + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; +}; +class Bomb_03_F: ammo_Bomb_LaserGuidedBase { + GVAR(skip) = 0; + GVAR(charge) = 100000; + GVAR(metal) = 150000; + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; +}; +class Bomb_04_F: ammo_Bomb_LaserGuidedBase { + GVAR(skip) = 0; + GVAR(charge) = 87000; + GVAR(metal) = 140000; + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; +}; +class BombCluster_01_Ammo_F: Bomb_04_F { + GVAR(skip) = 1; +}; +class ammo_Bomb_SmallDiameterBase: ammo_Bomb_LaserGuidedBase { + GVAR(skip) = 0; + GVAR(charge) = 160; // kg + GVAR(metal) = 113; // kg + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium), QGVAR(large), QGVAR(large), QGVAR(huge), QGVAR(huge_HD)}; +}; + +class BombCore; +class Bo_Mk82: BombCore { + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; + GVAR(metal) = 140000; + GVAR(charge) = 87000; + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = "1/2"; +}; + +class Mo_cluster_AP: ShellBase { + GVAR(skip) = 1; + GVAR(force) = 0; +}; +class Mo_cluster_Bomb_01_F: Mo_cluster_AP { // Mk 118 Rockeye + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(small)}; + GVAR(metal) = 400; + GVAR(charge) = 180; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; +}; +class Mo_cluster_Bomb_02_F: Mo_cluster_Bomb_01_F { // ShOAB-0.5 + GVAR(classes)[] = {QGVAR(small)}; + GVAR(metal) = 400; + GVAR(charge) = 100; + GVAR(gurney_c) = 2700; +}; +class Mo_cluster_Bomb_03_F: Mo_cluster_Bomb_01_F { // idk, @lambda.tiger on the ace discord if you find out + GVAR(classes)[] = {QGVAR(small)}; + GVAR(metal) = 400; + GVAR(charge) = 140; + GVAR(gurney_c) = 2400; +}; + +// ~~~~ Grenades: +class Grenade; +class GrenadeHand: Grenade { + GVAR(skip) = 0; + GVAR(force) = 1; + /* + These values are based on the M67 Grenade, should be tweaked for + individual grenades. + */ + GVAR(classes)[] = {QGVAR(tiny)}; + GVAR(metal) = 210; // metal in grams + GVAR(charge) = 185; // explosive in grams + GVAR(gurney_c) = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations + GVAR(gurney_k) = "3/5"; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations +}; +class mini_Grenade: GrenadeHand { + GVAR(classes)[] = {QGVAR(tiny)}; + GVAR(metal) = 104; + GVAR(charge) = 36; +}; +class GrenadeHand_stone: GrenadeHand { + GVAR(skip) = 1; +}; +class SmokeShell: GrenadeHand { + GVAR(skip) = 1; +}; +class G_40mm_HE: GrenadeBase { + // Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M441 + GVAR(skip) = 0; + GVAR(force) = 1; + GVAR(classes)[] = {QGVAR(small), QGVAR(tiny), QGVAR(small)}; + GVAR(metal) = 200; + GVAR(charge) = 32; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "3/5"; // interior fragmenter/charge is a sphere +}; +class G_20mm_HE: G_40mm_HE { + GVAR(classes)[] = {QGVAR(tiny)}; + GVAR(metal) = 50; + GVAR(charge) = 8; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "3/5"; // interior fragmenter/charge is a sphere +}; +class G_40mm_HEDP: G_40mm_HE { + // Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M433 + GVAR(classes)[] = {QGVAR(tiny), QGVAR(small), QGVAR(small_HD)}; + GVAR(metal) = 200; + GVAR(charge) = 45; + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = "1/2"; +}; + +class ACE_G_40mm_HEDP: G_40mm_HEDP {}; +class ACE_G_40mm_HE: G_40mm_HE {}; +class ACE_G_40mm_Practice: ACE_G_40mm_HE { + GVAR(skip) = 1; + GVAR(force) = 0; + EGVAR(vehicle_damage,incendiary) = 0; +}; + +// ~~~~ Mines & UXO +class ATMine_Range_Ammo: MineBase { + GVAR(skip) = 1; +}; + +class APERSMine_Range_Ammo: MineBase { // VS-50 + GVAR(skip) = 0; + GVAR(force) = 0; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(tiny), QGVAR(small)}; + GVAR(metal) = 100; + GVAR(charge) = 50; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/3"; +}; + +class APERSBoundingMine_Range_Ammo: BoundingMineBase { + GVAR(skip) = 1; + GVAR(force) = 0; + GVAR(classes)[] = {QGVAR(tiny)}; + GVAR(metal) = 80; + GVAR(charge) = 170; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "3/5"; +}; + +class TrainingMine_Ammo: APERSMine_Range_Ammo { + GVAR(skip) = 1; +}; + +class SLAMDirectionalMine_Wire_Ammo: DirectionalBombBase { + GVAR(skip) = 1; +}; + +class APERSTripMine_Wire_Ammo: DirectionalBombBase { + GVAR(skip) = 0; + GVAR(force) = 0; + GVAR(classes)[] = {QGVAR(tiny)}; + GVAR(metal) = 210; + GVAR(charge) = 185; + GVAR(gurney_c) = 2843; + GVAR(gurney_k) = "3/5"; +}; + +class IEDUrbanBig_Remote_Ammo: PipeBombBase { + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; + GVAR(metal) = 36000; + GVAR(charge) = 9979; + GVAR(gurney_c) = 2440; + GVAR(gurney_k) = "3/5"; +}; +class IEDLandBig_Remote_Ammo: PipeBombBase { + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; + GVAR(metal) = 36000; + GVAR(charge) = 9979; + GVAR(gurney_c) = 2440; + GVAR(gurney_k) = "3/5"; +}; +class IEDUrbanSmall_Remote_Ammo: PipeBombBase { + GVAR(skip) = 0; + GVAR(metal) = 23000; + GVAR(charge) = 3148; + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = "3/5"; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(medium_HD)}; +}; +class IEDLandSmall_Remote_Ammo: PipeBombBase { + GVAR(skip) = 0; + GVAR(metal) = 23000; + GVAR(charge) = 3148; + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = "3/5"; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(medium_HD)}; +}; + +class APERSMineDispenser_Ammo: PipeBombBase { + GVAR(skip) = 1; +}; + +class UXO1_Ammo_Base_F: APERSMine_Range_Ammo { // Mk 118 Rockeye + GVAR(skip) = 0; + GVAR(charge) = 180; + GVAR(metal) = 400; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(small)}; +}; + +class UXO2_Ammo_Base_F: UXO1_Ammo_Base_F { + GVAR(charge) = 100; + GVAR(classes)[] = {QGVAR(small), QGVAR(tiny)}; +}; + +class APERSMineDispenser_Mine_Ammo: APERSMine_Range_Ammo { + GVAR(skip) = 1; +}; + +class UXO_deploy_base_f: SubmunitionBase {}; + +class ClaymoreDirectionalMine_Remote_Ammo: DirectionalBombBase { + GVAR(skip) = 1; +}; + +class SatchelCharge_Remote_Ammo: PipeBombBase { + GVAR(skip) = 1; +}; + +class DemoCharge_Remote_Ammo: PipeBombBase { + GVAR(skip) = 1; +}; + +class Drone_explosive_ammo: MineBase { + GVAR(skip) = 1; +}; + +class BombDemine_01_Ammo_F: BombCore { + GVAR(skip) = 1; +}; + +class BombDemine_01_SubAmmo_F: ShellBase { + GVAR(skip) = 1; +}; + +// ~~~~ Rockets: +class R_PG7_F: RocketBase { + GVAR(skip) = 0; + GVAR(force) = 0; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(small)}; + GVAR(metal) = 100; + GVAR(charge) = 560; + GVAR(gurney_c) = 2730; + GVAR(gurney_k) = "1/2"; +}; + +class R_PG32V_F: RocketBase { + GVAR(skip) = 1; +}; +class R_TBG32V_F: R_PG32V_F { // Thermobaric + GVAR(skip) = 0; + GVAR(metal) = 400; + GVAR(charge) = 210; + GVAR(gurney_c) = 2800; + GVAR(gurney_k) = "3/5"; + GVAR(classes)[] = {QGVAR(medium_HD)}; +}; + +class M_SPG9_HEAT: RocketBase { + GVAR(skip) = 0; + GVAR(metal) = 4150; + GVAR(charge) = 340; + GVAR(gurney_c) = 2970; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(small_HD), QGVAR(medium_HD)}; +}; +class M_SPG9_HE: M_SPG9_HEAT { + GVAR(metal) = 4695; + GVAR(charge) = 655; + GVAR(gurney_c) = 2800; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(small), QGVAR(tiny), QGVAR(medium), QGVAR(medium)}; +}; + +// https://armypubs.army.mil/epubs/DR_pubs/DR_a/pdf/web/ARN18072_TC%203-22x84%20FINAL%20WEB.pdf +class R_MRAAWS_HEAT_F: RocketBase { // Table A-20. HEAT 751 + GVAR(skip) = 0; + GVAR(metal) = 2265; + GVAR(charge) = 635; + GVAR(gurney_c) = 2970; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(small)}; + +}; +class R_MRAAWS_HEAT55_F: R_MRAAWS_HEAT_F { // Table A-16. HEAT 551C + GVAR(metal) = 1940; + GVAR(charge) = 460; +}; +class R_MRAAWS_HE_F: R_MRAAWS_HEAT_F { // Table A-6. HE 441D RS + GVAR(metal) = 2300; + GVAR(charge) = 590; + GVAR(gurney_c) = 2800; + GVAR(gurney_k) = "3/5"; + GVAR(classes)[] = {QGVAR(small)}; +}; + +class R_80mm_HE: RocketBase { // S-8D + GVAR(skip) = 0; + GVAR(charge) = 2150; + GVAR(metal) = 1650; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(small), QGVAR(tiny), QGVAR(tiny)}; +}; +class R_60mm_HE: R_80mm_HE { // no idea but looks like a FFAR so made it weaker + GVAR(metal) = 1040; + GVAR(charge) = 3850; +}; + +class m_70mm_saami: MissileBase { + GVAR(skip) = 0; + GVAR(charge) = 2150; + GVAR(metal) = 1650; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(small), QGVAR(tiny), QGVAR(tiny)}; +}; + +class Rocket_04_HE_F: MissileBase { // Shrieker (Hydra 70) + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(metal) = 3850; + GVAR(charge) = 1040; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; +}; +class Rocket_03_HE_F: Rocket_04_HE_F { // S-8DM makes the most sense + GVAR(metal) = 1800; + GVAR(charge) = 2000; + GVAR(gurney_c) = 2300; +}; +class Rocket_04_AP_F: Rocket_04_HE_F { + GVAR(skip) = 1; +}; + +class ammo_Missile_CannonLaunchedBase: MissileBase { + GVAR(skip) = 1; +}; + +class R_230mm_fly: ShellBase { + GVAR(skip) = 0; + GVAR(charge) = 100; // kg + GVAR(metal) = 150; // kg + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = "3/5"; + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; +}; + +class M_PG_AT: MissileBase { // DAGR M247 warhead + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(small), QGVAR(small), QGVAR(medium)}; + GVAR(charge) = 910; + GVAR(metal) = 3085; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; +}; +class M_AT: M_PG_AT { // DAR (Hydra 70) M151 warhead + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(charge) = 1040; + GVAR(metal) = 3850; + GVAR(gurney_c) = 2700; +}; + +// ~~~~ Missiles: +class Missile_AGM_02_F: MissileBase { + // Source: http://fas.org/man/dod-101/sys/smart/agm-65.htm + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(metal) = 56250; + GVAR(charge) = 39000; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; +}; +class Missile_AGM_01_F: Missile_AGM_02_F { // Kh-25MTP !!! fix me +}; +class M_Jian_AT: Missile_AGM_01_F { // imaginary missile? Not simiklar to any modern HJ-x or otherwise +}; + +class M_Titan_AA: MissileBase { + GVAR(skip) = 0; + GVAR(metal) = 1980; + GVAR(charge) = 1020; + GVAR(gurney_c) = 2501; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(tiny), QGVAR(small)}; +}; +class M_Titan_AT: MissileBase { + GVAR(skip) = 1; +}; +class M_Titan_AP: M_Titan_AT { + GVAR(skip) = 0; + GVAR(metal) = 400; + GVAR(charge) = 210; + GVAR(gurney_c) = 2800; + GVAR(gurney_k) = "3/5"; + GVAR(classes)[] = {QGVAR(medium_HD)}; +}; + +class M_Scalpel_AT: MissileBase { // 9K121 Vikhr + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(medium_HD)}; + GVAR(metal) = 10000; + GVAR(charge) = 3000; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; +}; +class ACE_Hellfire_AGM114K: M_Scalpel_AT { + // Source: http://www.designation-systems.net/dusrm/m-114.html + GVAR(skip) = 0; + + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(metal) = 8000; + GVAR(charge) = 2400; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; +}; + +class ammo_Missile_CruiseBase: MissileBase {}; +class ammo_missile_cruise_01: ammo_Missile_CruiseBase { + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(large)}; + GVAR(metal) = 700000; + GVAR(charge) = 110000; + GVAR(gurney_c) = 2600; + GVAR(gurney_k) = "3/5"; +}; +class ammo_Missile_Cruise_01_Cluster: ammo_missile_cruise_01 {}; + +class ammo_Missile_AntiRadiationBase: MissileBase { + GVAR(gurney_k) = "1/2"; + GVAR(gurney_c) = 2400; +}; +class ammo_Missile_HARM: ammo_Missile_AntiRadiationBase { + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(large)}; + GVAR(charge) = 10000; + GVAR(metal) = 58000; +}; +class ammo_Missile_KH58: ammo_Missile_AntiRadiationBase { + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(large)}; + GVAR(charge) = 20000; + GVAR(metal) = 129000; +}; + +class M_Zephyr: M_Titan_AA { // model is an AMRAAM- WDU-41/B warhead + GVAR(skip) = 0; + GVAR(metal) = 12800; + GVAR(charge) = 4000; + GVAR(gurney_c) = 2900; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(medium), QGVAR(small), QGVAR(small)}; +}; + +class M_Air_AA: MissileBase { // Looks not real, maybe r-73 inspired? + GVAR(skip) = 0; + GVAR(charge) = 2450; + GVAR(metal) = 4950; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(medium), QGVAR(small), QGVAR(small)}; +}; + +class Missile_AA_04_F: MissileBase { + GVAR(skip) = 0; + GVAR(charge) = 4400; + GVAR(metal) = 5000; + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = "1/2"; +}; +class Missile_AA_03_F: Missile_AA_04_F { + GVAR(charge) = 2450; + GVAR(metal) = 4950; + GVAR(gurney_c) = 2700; +}; + +class ammo_Missile_ShortRangeAABase: MissileBase { + GVAR(gurney_k) = "1/2"; +}; +class ammo_Missile_rim116: ammo_Missile_ShortRangeAABase { + GVAR(skip) = 0; + GVAR(charge) = 400; + GVAR(metal) = 730; + GVAR(gurney_c) = 2400; + GVAR(classes)[] = {QGVAR(tiny), QGVAR(small)}; +}; +class ammo_Missile_BIM9X: ammo_Missile_ShortRangeAABase { + GVAR(skip) = 0; + GVAR(charge) = 440; + GVAR(metal) = 500; + GVAR(gurney_c) = 2900; + GVAR(classes)[] = {QGVAR(small), QGVAR(tiny)}; +}; +class ammo_Missile_AA_R73: ammo_Missile_ShortRangeAABase { + GVAR(skip) = 0; + GVAR(charge) = 2450; + GVAR(metal) = 4950; + GVAR(gurney_c) = 2700; + GVAR(classes)[] = {QGVAR(small), QGVAR(small), QGVAR(tiny)}; +}; + +class ammo_Missile_MediumRangeAABase: MissileBase { + GVAR(gurney_c) = 2900; + GVAR(gurney_k) = "1/2"; +}; +class ammo_Missile_rim162: ammo_Missile_MediumRangeAABase { + GVAR(skip) = 0; + GVAR(charge) = 138; // dg + GVAR(metal) = 252; // dg + GVAR(gurney_c) = 2400; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(medium), QGVAR(large)}; +}; +class ammo_Missile_AMRAAM_C: ammo_Missile_MediumRangeAABase { + GVAR(skip) = 0; + GVAR(charge) = 70; // dg + GVAR(metal) = 128; // dg + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(medium)}; +}; +class ammo_Missile_AMRAAM_D: ammo_Missile_MediumRangeAABase { + GVAR(skip) = 0; + GVAR(charge) = 70; // dg + GVAR(metal) = 128; // dg + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(medium)}; +}; +class ammo_Missile_AA_R77: ammo_Missile_MediumRangeAABase { + GVAR(skip) = 0; + GVAR(charge) = 80; // dg + GVAR(metal) = 145; // dg + GVAR(gurney_c) = 2700; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(large), QGVAR(large)}; +}; + +class M_Vorona_HEAT: MissileBase { + // tandem shaped charges + GVAR(skip) = 1; +}; +class M_Vorona_HE: M_Vorona_HEAT { + // All signs point to this being a thermobaric round so low frag count + GVAR(skip) = 0; + GVAR(metal) = 13800; + GVAR(charge) = 4950; + GVAR(gurney_c) = 2800; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(tiny)}; +}; + +class M_127mm_Firefist_AT: MissileBase { // HOT missile + GVAR(skip) = 1; +}; + +class M_NLAW_AT_F: MissileBase { + GVAR(skip) = 1; +}; + +// ~~~~ Shell +class Sh_75mm_Railgun_APFSDS: ShellBase { + GVAR(skip) = 1; +}; +class Sh_120mm_APFSDS: ShellBase { + GVAR(skip) = 1; +}; +class Sh_125mm_APFSDS: Sh_120mm_APFSDS { + GVAR(skip) = 1; +}; + +class Sh_155mm_AMOS: ShellBase { + // Source: http://www.globalsecurity.org/military/systems/munitions/m795.htm + GVAR(skip) = 0; + GVAR(charge) = 9979; + GVAR(metal) = 36000; + GVAR(gurney_c) = 2440; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; +}; + +class Sh_82mm_AMOS: Sh_155mm_AMOS { // VO-832DU + GVAR(charge) = 420; + GVAR(metal) = 2680; + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; +}; + +class Sh_120mm_HE: ShellBase { + GVAR(skip) = 0; + GVAR(charge) = 3148; + GVAR(metal) = 23000; + GVAR(gurney_c) = 2830; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(medium), QGVAR(medium_HD)}; +}; +class Sh_120mm_HEAT_MP: ShellBase { + GVAR(skip) = 0; + GVAR(charge) = 2500; + GVAR(metal) = 5000; + GVAR(gurney_c) = 2500; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(medium), QGVAR(medium_HD)}; +}; + +class ammo_ShipCannon_120mm_HE: Sh_155mm_AMOS { + GVAR(charge) = 3148; + GVAR(metal) = 23000; + GVAR(gurney_c) = 2830; + GVAR(classes)[] = {QGVAR(small), QGVAR(small), QGVAR(medium), QGVAR(large)}; +}; + +class Sh_125mm_HE: Sh_120mm_HE { + GVAR(metal) = 19900; + GVAR(charge) = 3400; + GVAR(gurney_c) = 2901; +}; + +class Sh_125mm_HEAT: Sh_125mm_HE { + GVAR(skip) = 1; + GVAR(metal) = 16760; + GVAR(charge) = 1640; + GVAR(gurney_c) = 2901; +}; + +class Sh_105mm_HEAT_MP: Sh_125mm_HEAT { + GVAR(skip) = 0; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(medium), QGVAR(medium_HD)}; + GVAR(metal) = 11400; + GVAR(charge) = 7100; + GVAR(gurney_c) = 2800; +}; + +class ModuleOrdnanceHowitzer_F_ammo: Sh_155mm_AMOS { + GVAR(skip) = 0; + GVAR(metal) = 1950; + GVAR(charge) = 15800; + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = "1/2"; + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; +}; +class ammo_Penetrator_Base: ShellBase { + GVAR(skip) = 1; +}; + +// ~~~~ Special +class ProbingBeam_01_F: BulletBase { + GVAR(skip) = 1; +}; + +class IRStrobeBase: GrenadeCore { + GVAR(skip) = 1; +}; +class FlareCore: GrenadeCore { // flares shouldn't have EH, but in case + GVAR(skip) = 1; +}; + +class Default; +class Laserbeam: Default { + GVAR(skip) = 1; +}; + +class FuelExplosion: Default { + GVAR(skip) = 1; +}; + +class HelicopterExploSmall: ShellBase { + GVAR(skip) = 1; +}; + +class LightningBolt: ShellBase { + GVAR(skip) = 1; +}; + +class M_Mo_82mm_AT: MissileBase { + GVAR(skip) = 1; +}; diff --git a/addons/frag/CfgAmmoSpall.hpp b/addons/frag/CfgAmmoSpall.hpp new file mode 100644 index 00000000000..b3214fc4b04 --- /dev/null +++ b/addons/frag/CfgAmmoSpall.hpp @@ -0,0 +1,15 @@ +class GVAR(spall_small): GVAR(small) { + timeToLive = 0.1; +}; + +class GVAR(spall_medium): GVAR(medium) { + timeToLive = 0.15; +}; + +class GVAR(spall_large): GVAR(large) { + timeToLive = 0.25; +}; + +class GVAR(spall_huge): GVAR(huge) { + timeToLive = 0.3; +}; diff --git a/addons/frag/README.md b/addons/frag/README.md index ca62771f00e..797e652b207 100644 --- a/addons/frag/README.md +++ b/addons/frag/README.md @@ -1,4 +1,4 @@ ace_frag ======== -Shrapnel system for explosives. +Explosive fragmentation, round spalling, and explosive reflection diff --git a/addons/frag/XEH_PREP.hpp b/addons/frag/XEH_PREP.hpp index a7fb8ff8c34..758cbff8956 100644 --- a/addons/frag/XEH_PREP.hpp +++ b/addons/frag/XEH_PREP.hpp @@ -1,25 +1,19 @@ +PREP(addBlackList); +PREP(dev_clearTraces); PREP(dev_debugAmmo); - +PREP(dev_drawTrace); +PREP(dev_fragCalcDump); +PREP(dev_sphereDraw); +PREP(dev_trackHitBox); +PREP(dev_trackObj); +PREP(doExplosions); +PREP(doReflections); PREP(doSpall); +PREP(findReflections); PREP(fired); PREP(frago); -PREP(spallTrack); - -// * Other */ -PREP(addBlackList); -PREP(dev_addTrack); -PREP(dev_drawTraces); -PREP(spallHP); -PREP(dev_startTracing); -PREP(dev_stopTracing); -PREP(dev_trackTrace); - -// New tracking mechanisms -PREP(masterPFH); -PREP(pfhRound); -PREP(addPfhRound); - -// Explosive Reflection -PREP(findReflections); -PREP(doExplosions); -PREP(doReflections); +PREP(getFragInfo); +PREP(getSpallInfo); +PREP(setClassBlacklisted); +PREP(shouldFrag); +PREP(shouldSpall); diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index cc58e1d15b2..eb270095ba9 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -1,32 +1,56 @@ #include "script_component.hpp" -if (isServer) then { - GVAR(lastFragTime) = -1; - [QGVAR(frag_eh), LINKFUNC(frago)] call CBA_fnc_addEventHandler; -}; - ["CBA_settingsInitialized", { - if (!GVAR(enabled)) exitWith {}; + [{ + params ["_projectile", "_posASL"]; + + if (_projectile getVariable [QGVAR(blacklisted), false]) exitWith {}; + + private _ammo = typeOf _projectile; + if (GVAR(reflectionsEnabled)) then { + [_posASL, _ammo] call FUNC(doReflections); + }; + if (GVAR(enabled) && _ammo call FUNC(shouldFrag)) then { + // only let a unit make a frag event once per second + private _shotParents = getShotParents _projectile; + private _instigator = _shotParents select !isNull (_shotParents#1); + if (CBA_missionTime < (_instigator getVariable [QGVAR(nextFragEvent), -1])) exitWith {}; + _instigator setVariable [QGVAR(nextFragEvent), CBA_missionTime + ACE_FRAG_FRAG_UNIT_HOLDOFF]; + + // Wait a frame to make sure it doesn't target the dead + [{ + [QGVAR(frag_eh), _this] call CBA_fnc_serverEvent + }, [_posASL, _ammo, [objNull, _instigator]]] call CBA_fnc_execNextFrame; + }; + }] call EFUNC(common,addExplosionEventHandler); - // Register fire event handler ["ace_firedPlayer", LINKFUNC(fired)] call CBA_fnc_addEventHandler; ["ace_firedNonPlayer", LINKFUNC(fired)] call CBA_fnc_addEventHandler; ["ace_firedPlayerVehicle", LINKFUNC(fired)] call CBA_fnc_addEventHandler; ["ace_firedNonPlayerVehicle", LINKFUNC(fired)] call CBA_fnc_addEventHandler; - - addMissionEventHandler ["EachFrame", {call FUNC(masterPFH)}]; -}] call CBA_fnc_addEventHandler; - -// Cache for ammo type configs -GVAR(cacheRoundsTypesToTrack) = createHashMap; - - -// Debug stuff: - -#ifdef DRAW_FRAG_INFO -[] call FUNC(dev_startTracing); +#ifdef DEBUG_MODE_DRAW + [QGVAR(dev_clearTraces), LINKFUNC(dev_clearTraces)] call CBA_fnc_addEventHandler; + + if (!hasInterface) exitWith {}; + ["ace_firedPlayerVehicleNonLocal", LINKFUNC(dev_fired)] call CBA_fnc_addEventHandler; + ["ace_firedPlayerNonLocal", LINKFUNC(dev_fired)] call CBA_fnc_addEventHandler; + GVAR(dev_drawPFEH) = [LINKFUNC(dev_drawTrace), 0] call CBA_fnc_addPerFrameHandler; + ["ace_interact_menu_newControllableObject", { + params ["_type"]; + + private _action = [ + QGVAR(debugReset), + "Reset ACE Frag traces", + "", + {[QGVAR(dev_clearTraces), []] call CBA_fnc_globalEvent;}, + {GVAR(dev_trackLines) isNotEqualTo createHashMap} + ] call EFUNC(interact_menu,createAction); + + [_type, 1, ["ACE_SelfActions"], _action, true] call EFUNC(interact_menu,addActionToClass); + }] call CBA_fnc_addEventHandler; #endif +}] call CBA_fnc_addEventHandler; -#ifdef DEBUG_MODE_FULL +#ifdef LOG_FRAG_INFO [true, true, 30] call FUNC(dev_debugAmmo); #endif diff --git a/addons/frag/XEH_preInit.sqf b/addons/frag/XEH_preInit.sqf index dc616917b88..50353d88dc2 100644 --- a/addons/frag/XEH_preInit.sqf +++ b/addons/frag/XEH_preInit.sqf @@ -6,20 +6,30 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; -GVAR(blackList) = []; -GVAR(traceFrags) = false; +GVAR(spallInfoCache) = createHashMap; +GVAR(shouldSpallCache) = createHashMap; -GVAR(spallHPData) = []; -GVAR(spallIsTrackingCount) = 0; - -GVAR(traceID) = -1; -GVAR(traces) = []; -GVAR(tracesStarted) = false; - -GVAR(lastIterationIndex) = 0; -GVAR(objects) = []; -GVAR(arguments) = []; +GVAR(shouldFragCache) = createHashMap; +GVAR(fragInfoCache) = createHashMap; +GVAR(lastFragTime) = -1; #include "initSettings.inc.sqf" +GVAR(dev_trackLines) = createHashMap; +GVAR(dev_hitBoxes) = createHashMap; +GVAR(dev_eventSpheres) = []; +GVAR(dev_drawPFEH) = -1; + +#ifdef DEBUG_MODE_DRAW +#include "initSettingsDebug.inc.sqf" +#else +GVAR(debugOptions) = false; +GVAR(dbgSphere) = false; +GVAR(drawHitBox) = false; +#endif + +if (isServer) then { + [QGVAR(frag_eh), LINKFUNC(frago)] call CBA_fnc_addEventHandler; +}; + ADDON = true; diff --git a/addons/frag/config.cpp b/addons/frag/config.cpp index f3b409dbd03..488b72c5070 100644 --- a/addons/frag/config.cpp +++ b/addons/frag/config.cpp @@ -8,7 +8,7 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author = ECSTRING(common,ACETeam); - authors[] = {"Nou"}; + authors[] = {"Nou", "johnb43", "Lambda.Tiger"}; url = ECSTRING(main,URL); VERSION_CONFIG; }; diff --git a/addons/frag/functions/fnc_addBlackList.sqf b/addons/frag/functions/fnc_addBlackList.sqf deleted file mode 100644 index d0cc127d059..00000000000 --- a/addons/frag/functions/fnc_addBlackList.sqf +++ /dev/null @@ -1,21 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: Jaynus, NouberNou - * Adds a round to the blacklist (will be ignored). - * - * Arguments: - * 0: Projectile - * - * Return Value: - * None - * - * Example: - * [bullet] call ace_frag_fnc_addBlackList - * - * Public: No - */ - -params ["_round"]; -TRACE_1("addBlackList",_round); - -GVAR(blackList) pushBack _round; diff --git a/addons/frag/functions/fnc_addBlacklist.sqf b/addons/frag/functions/fnc_addBlacklist.sqf new file mode 100644 index 00000000000..d1936376524 --- /dev/null +++ b/addons/frag/functions/fnc_addBlacklist.sqf @@ -0,0 +1,32 @@ +#include "..\script_component.hpp" +/* + * Author: Jaynus, NouberNou, Lambda.Tiger + * Adds a round to the blacklist (will be ignored) and removes any ace_frag event handlers added to it. + * Once blacklisted a projectile can not be "unblacklisted." + * + * Arguments: + * 0: Projectile to be blacklisted + * + * Return Value: + * Was the projectile blacklisted + * + * Example: + * [_projectile] call ace_frag_fnc_addBlackList + * + * Public: Yes + */ + +params [["_projectile", objNull, [objNull]]]; +TRACE_2("addBlackList",_projectile,typeOf projectile); + +if (isNull _projectile || {!isClass (configFile >> "CfgAmmo" >> (typeOf _projectile))}) exitWith { + TRACE_1("Invalid projectile",_this); + false +}; + +_projectile setVariable [QGVAR(blacklisted), true]; +_projectile removeEventHandler [ + "HitPart", + _projectile getVariable [QGVAR(hitPartEventHandler), -1] +]; +true diff --git a/addons/frag/functions/fnc_addPfhRound.sqf b/addons/frag/functions/fnc_addPfhRound.sqf deleted file mode 100644 index 358a9ee71ea..00000000000 --- a/addons/frag/functions/fnc_addPfhRound.sqf +++ /dev/null @@ -1,77 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: Jaynus, NouberNou - * Starts tracking a round that will frag. - * Should only be called once per round. - * - * Arguments: - * 0: Shooter - * 1: Ammo classname - * 2: Projectile - * - * Return Value: - * None - * - * Example: - * [player, "handGrenade", bullet] call ace_frag_fnc_addPfhRound - * - * Public: No - */ - -params ["_gun", "_type", "_round"]; -TRACE_3("addPfhRound",_gun,_type,_round); - -if (!GVAR(enabled)) exitWith {TRACE_1("setting disabled",_this);}; - -if (!alive _round) exitWith {TRACE_1("round dead?",_this);}; - -if (_round in GVAR(blackList)) exitWith { - TRACE_1("round in blackList",_this); - REM(GVAR(blackList),_round); -}; - -// Exit on max track -if ((count GVAR(objects)) >= GVAR(maxTrack)) exitWith {TRACE_1("maxTrack limit",count GVAR(objects));}; - -private _doSpall = false; -if (GVAR(SpallEnabled)) then { - if (GVAR(spallIsTrackingCount) <= 0) then { - GVAR(spallHPData) = []; - }; - if (GVAR(spallIsTrackingCount) > 5) then { - TRACE_1("At Spall Limit",GVAR(spallIsTrackingCount)); - } else { - _doSpall = true; - INC(GVAR(spallIsTrackingCount)); - }; - TRACE_2("",_doSpall,GVAR(spallIsTrackingCount)); -}; - -#ifdef DRAW_FRAG_INFO -[ACE_player, _round, [0, 1, 0, 1]] call FUNC(dev_addTrack); -#endif - -// We only do the single track object check here. -// We should do an {!(_round in GVAR(objects))} -// But we leave that out here for optimization. So this cannot be a framework function -// Otherwise, it should only be added once and from the FiredEH -if (alive _round) then { - private _spallTrack = []; - private _spallTrackID = []; - - private _args = [ - _round, getPosASL _round, velocity _round, _type, diag_frameno, getPosASL _round, _doSpall, _spallTrack, _spallTrackID, - getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip)), - getNumber (configFile >> "CfgAmmo" >> _type >> "explosive"), - getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"), - getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force)), - getNumber (configFile >> "CfgAmmo" >> _type >> "indirecthit") * (sqrt (getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"))) - ]; - TRACE_1("Initializing track",_round); - GVAR(objects) pushBack _round; - GVAR(arguments) pushBack _args; - - if (_doSpall) then { - [_round, 1, _spallTrack, _spallTrackID] call FUNC(spallTrack); - }; -}; diff --git a/addons/frag/functions/fnc_dev_addTrack.sqf b/addons/frag/functions/fnc_dev_addTrack.sqf deleted file mode 100644 index 0e75a9fb994..00000000000 --- a/addons/frag/functions/fnc_dev_addTrack.sqf +++ /dev/null @@ -1,26 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_dev_addTrack - * - * Public: No - */ - -params ["_origin", "_obj", ["_color", [1, 0, 0, 1]]]; - -private _positions = []; -private _objSpd = vectorMagnitude (velocity _obj); -_positions pushBack [getPos _obj, _objSpd]; -private _data = [_origin, typeOf _origin, typeOf _obj, _objSpd, _positions, _color]; - -private _index = GVAR(traces) pushBack _data; -[DFUNC(dev_trackTrace), 0, [_obj, _index, CBA_missionTime]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/frag/functions/fnc_dev_clearTraces.sqf b/addons/frag/functions/fnc_dev_clearTraces.sqf new file mode 100644 index 00000000000..6e2b820bacb --- /dev/null +++ b/addons/frag/functions/fnc_dev_clearTraces.sqf @@ -0,0 +1,25 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * Clears all dev spheres and traces. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_dev_clearTraces + * + * Public: No + */ + +{ + deleteVehicle _x; +} forEach GVAR(dev_eventSpheres); + +GVAR(dev_eventSpheres) = []; + +GVAR(dev_trackLines) = createHashMap; +GVAR(dev_hitBoxes) = createHashMap; diff --git a/addons/frag/functions/fnc_dev_debugAmmo.sqf b/addons/frag/functions/fnc_dev_debugAmmo.sqf index 4484edbdc43..fe868df3428 100644 --- a/addons/frag/functions/fnc_dev_debugAmmo.sqf +++ b/addons/frag/functions/fnc_dev_debugAmmo.sqf @@ -1,11 +1,15 @@ -#define DEBUG_MODE_FULL #include "..\script_component.hpp" /* - * Author: ACE-Team - * + * Author: ACE-Team, Lambda.Tiger + * This function will dump every ammo config that would generate ace_frag + * fragments that could be fired from a weapon. * * Arguments: - * None + * 0: Log ammo types that wouldn't normally frag (default: false) + * 1: Only print ammo without ACE_frag entries, inherited or otherwise (default: true) + * 2: Only export ammo classes of classes referenced in CfgMagazines and their + * submunitions (default: false) + * 3: Force a CSV format on debug print. (default: false) * * Return Value: * None @@ -17,65 +21,90 @@ */ params [ - ["_debugMissing", true, [false]], - ["_debugForce", false, [false]], - ["_debugSkippedFragPower", 30, [0]] + ["_logAll", false, [false]], + ["_printOnlyIncomplete", true, [true]], + ["_onlyShotAmmoTypes", false, [false]], + ["_csvFormat", false, [false]] ]; diag_log text format ["~~~~~~~~~~~~~Start [%1]~~~~~~~~~~~~~", _this]; +if (_csvFormat) then { + diag_log text format ["ammo,gurney_c,gurney_m,gurney_k,gurney_gC,skip,Inheritance"]; +}; -private _allMagsConfigs = configProperties [configFile >> "CfgMagazines", "isClass _x", true]; -private _processedCfgAmmos = []; - -{ - private _ammo = toLowerANSI getText (_x >> "ammo"); - if (_ammo != "" && {!(_ammo in _processedCfgAmmos)}) then { - _processedCfgAmmos pushBack _ammo; - - //Ignore mines/bombs - if (_ammo isKindOf "TimeBombCore") exitWith {}; - - _ammoConfig = configFile >> "CfgAmmo" >> _ammo; - - //Read configs and test if it would actually cause a frag, using same logic as FUNC(pfhRound) - private _skip = getNumber (_ammoConfig >> QGVAR(skip)); - private _explosive = getNumber (_ammoConfig >> "explosive"); - private _indirectRange = getNumber (_ammoConfig >> "indirectHitRange"); - private _force = getNumber (_ammoConfig >> QGVAR(force)); - private _fragPower = getNumber (_ammoConfig >> "indirecthit") * (sqrt ((getNumber (_ammoConfig >> "indirectHitRange")))); +// Gather all configs, either those that could be created from firing or all classes +private _allAmmoConfigs = createHashMap; +if (_onlyShotAmmoTypes) then { + private _configSearchFunction = { + params [ + ["_ammo", "", [""]] + ]; + if (_ammo isEqualTo "" || {_ammo in _allAmmoConfigs}) exitWith {}; + _allAmmoConfigs set [_ammo, 1]; + private _cfgAmmoRoot = configFile >> "CfgAmmo"; + private _submunitionConfig = _cfgAmmoRoot >> _ammo >> "submunitionAmmo"; + if (isArray _submunitionConfig) then { + private _subMunition = getArray _submunitionConfig; + for "_i" from 0 to count _subMunition - 1 do { + if (_i mod 2 == 0) then { + configName (_cfgAmmoRoot >> (_subMunition#_i)) call _configSearchFunction; + }; + }; + } else { + private _subMunition = getText _submunitionConfig; + if (_subMunition isNotEqualTo "") then { + configName (_cfgAmmoRoot >> _subMunition) call _configSearchFunction; + }; + }; + }; + private _allMagazineConfigs = configProperties [configFile >> "CfgMagazines", "isClass _x", true]; + private _cfgAmmoCfgPath = configFile >> "CfgAmmo"; + { + private _magAmmo = getText (_x >> "ammo"); + configName (_cfgAmmoCfgPath >> _magAmmo) call _configSearchFunction; + } forEach _allMagazineConfigs; + _allAmmoConfigs = keys _allAmmoConfigs; +} else { + _allAmmoConfigs = configProperties [configFile >> "CfgAmmo", "isClass _x && !('ace_frag' in configName _x)", true] apply {configName _x}; +}; - private _shouldAdd = (_skip == 0) && {(_force == 1) || {_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}}}; +private _processedCfgAmmos = 0; +private _printCount = 0; +{ // Begin forEach to check each ammo type + private _ammo = _x; + if (_ammo isNotEqualTo "") then { + INC(_processedCfgAmmos); - if (_shouldAdd) then { - if (_debugForce && {((getNumber(_ammoConfig >> "hit")) < 5) || {_fragPower < 10}}) then { - diag_log text format ["Ammo [%1] from Mag [%2] - Weak but will still frag!", _ammo, configName _x]; - diag_log text format [" - _force=%1,_fragPower=%2", _force, _fragPower]; - }; + private _ammoConfig = configFile >> "CfgAmmo" >> _ammo; + _ammo call FUNC(shouldFrag) params ["_shouldFrag"]; - private _warn = false; + if (_shouldFrag || _logAll) then { - _fragTypes = getArray (_ammoConfig >> QGVAR(CLASSES)); - if (_fragTypes isEqualTo []) then {_warn = true;}; - _c = getNumber(_ammoConfig >> QGVAR(CHARGE)); - if (_c == 0) then {_warn = true;}; - _m = getNumber(_ammoConfig >> QGVAR(METAL)); - if (_m == 0) then {_warn = true;}; - _k = getNumber(_ammoConfig >> QGVAR(GURNEY_K)); - if (_k == 0) then {_warn = true;}; - _gC = getNumber(_ammoConfig >> QGVAR(GURNEY_C)); - if (_gC == 0) then {_warn = true;}; + private _print = false; + private _skip = getNumber (_ammoConfig >> QGVAR(skip)); + private _fragTypes = getArray (_ammoConfig >> QGVAR(classes)); + if (_fragTypes isEqualTo []) then {_print = true;}; + private _c = getNumber (_ammoConfig >> QGVAR(charge)); + if (_c == 0) then {_print = true;}; + private _m = getNumber (_ammoConfig >> QGVAR(metal)); + if (_m == 0) then {_print = true;}; + private _k = getNumber (_ammoConfig >> QGVAR(gurney_k)); + if (_k == 0) then {_print = true;}; + private _gC = getNumber (_ammoConfig >> QGVAR(gurney_c)); + if (_gC == 0) then {_print = true;}; - if (_debugMissing && {_warn}) then { - diag_log text format ["Ammo [%1] from Mag [%2] MISSING frag configs:", _ammo, configName _x]; - diag_log text format [" - _c=%1,_m=%2,_k=%3,_gC=%4,_fragTypes=%5", _c, _m, _k, _gC, _fragTypes]; - }; - } else { - if ((_fragPower > _debugSkippedFragPower) && {isArray (_ammoConfig >> QGVAR(CLASSES))}) then { - diag_log text format ["Ammo [%1] from Mag [%2] has frag configs but will NOT frag:", _ammo, configName _x]; - diag_log text format ["- skip=%1,explosive=%2,indirectHitRange=%3,force=%4,fragPower=%5", _skip, _explosive, _indirectRange, _force, _fragPower]; + if (!_printOnlyIncomplete || {_print && _skip != 0}) then { + INC(_printCount); + if (_csvFormat) then { + diag_log text format ["%6,%1,%2,%3,%4,%5,%8,%7", _c, _m, _k, _gC, _skip, _ammo, [_ammoConfig, true] call BIS_fnc_returnParents, _shouldFrag]; + } else { + diag_log text format ["Ammo [%1] MISSING frag configs:", _ammo]; + diag_log text format ["_c=%1,_m=%2,_k=%3,_gC=%4,_skip=%5,_fragTypes=%6", _c, _m, _k, _gC, _skip, _fragTypes]; + }; }; }; }; -} forEach _allMagsConfigs; +} forEach _allAmmoConfigs; -diag_log text format ["~~~~~~~~~~~~~End [%1-%2]~~~~~~~~~~~~~", count _allMagsConfigs, count _processedCfgAmmos]; +diag_log text format ["~~~~~~~~~~~~~~End [%1-%2]~~~~~~~~~~~~~~", count _allAmmoConfigs, _processedCfgAmmos]; +diag_log text format ["~~~~~~~~~~~~~~Printed: %1~~~~~~~~~~~", _printCount]; diff --git a/addons/frag/functions/fnc_dev_drawTrace.sqf b/addons/frag/functions/fnc_dev_drawTrace.sqf new file mode 100644 index 00000000000..8b027e1f3ca --- /dev/null +++ b/addons/frag/functions/fnc_dev_drawTrace.sqf @@ -0,0 +1,45 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * This function draws all development traces and is intended to be called on each frame. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_dev_drawTrace + * + * Public: No + */ + +#define HITBOX_DRAW_PATH [[3, 2, 1, 5, 6, 7, 3, 0, 4, 5], [0, 1], [2, 6], [7, 4]] + +if (!GVAR(debugOptions)) exitWith {}; + +{ + _y params ["_posArray", "_color"]; + if (count _posArray > 1) then { + for "_j" from 1 to count _posArray - 1 do { + drawLine3D [_posArray#(_j - 1), _posArray#_j, _color]; + }; + }; +} forEach GVAR(dev_trackLines); + +if (GVAR(drawHitBox)) then { + { + _y params ["_object", "_boxPoints", "_color"]; + if (!alive _object) then { + GVAR(dev_hitBoxes) deleteAt _x; + continue; + }; + + { + for "_i" from 1 to count _x - 1 do { + drawLine3D [_object modelToWorld (_boxPoints#(_x#_i)), _object modelToWorld (_boxPoints#(_x#(_i - 1))), _color]; + }; + } forEach HITBOX_DRAW_PATH; + } forEach GVAR(dev_hitBoxes); +}; diff --git a/addons/frag/functions/fnc_dev_drawTraces.sqf b/addons/frag/functions/fnc_dev_drawTraces.sqf deleted file mode 100644 index 7fcca3c48fe..00000000000 --- a/addons/frag/functions/fnc_dev_drawTraces.sqf +++ /dev/null @@ -1,37 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_dev_drawTraces - * - * Public: No - */ - -{ - _x params ["", "", "", "", "_positions", "_color"]; - private _index = 0; - private _max = count _positions; - // private _lastSpd = []; - private _lastPos = []; - while {_index < _max} do { - _data1 = _positions select _index; - _data2 = _positions select ([_index + ACE_TRACE_DRAW_INC, _max - 1] select (_index + ACE_TRACE_DRAW_INC >= _max)); - - _pos1 = _data1 select 0; - _pos2 = _data2 select 0; - ADD(_index,ACE_TRACE_DRAW_INC); - - drawLine3D [_pos1, _pos2, _color]; - _lastPos = _pos2; - // _lastSpd = _data1 select 1; - }; - // drawIcon3D ["", [1,0,0,1], _lastPos, 0, 0, 0, format ["%1m/s", _lastSpd], 1, 0.05, "RobotoCondensed"]; -} forEach GVAR(traces); diff --git a/addons/frag/functions/fnc_dev_fragCalcDump.sqf b/addons/frag/functions/fnc_dev_fragCalcDump.sqf new file mode 100644 index 00000000000..88be643c258 --- /dev/null +++ b/addons/frag/functions/fnc_dev_fragCalcDump.sqf @@ -0,0 +1,56 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger, based on fnc_dev_debugAmmo by "ACE-Team" + * Dumps all ammo types to see if there's any reason to spawn fragments given hit power and distance. + * Good for grasping the values used in shouldFrag to cull non-fragmenting rounds. + * + * Arguments: + * 0: Display rounds that will never frag (default: false) + * + * Return Value: + * None + * + * Example: + * false call ace_frag_fnc_dev_fragCalcDump + * + * Public: No + */ + +params [["_logAll", false, [false]]]; + +private _allAmmoConfigs = configProperties [configFile >> "CfgAmmo", "isClass _x && !('ace_frag' in configName _x)", true]; +private _processedCfgAmmos = createHashMap; + +private _numberPrinted = 0; + +diag_log text "//****************** fragCalcDump Beg ******************//"; +{ // Begin _allAmmoConfigs forEach + private _ammo = configName _x; + + if (_ammo isEqualTo "" || {_ammo in _processedCfgAmmos}) then { + continue; + }; + + _ammo call FUNC(shouldFrag) params ["_shouldFrag"]; + if (_shouldFrag || _logAll) then { + private _fragInfo = _ammo call FUNC(getFragInfo); + _fragInfo params ["_fragRange", "_fragMaxSpeed"]; + private _ammoConfig = configFile >> "CfgAmmo" >> _ammo; + private _indirectHitRange = getNumber (_ammoConfig >> "indirectHitRange"); + private _indirectHit = getNumber (_ammoConfig >> "indirectHit"); + private _fragPowerSpeedRange = [0.5, 1] vectorMultiply _fragMaxSpeed; + + diag_log text format ["Ammo type: %1 | Should frag: %2", _ammo, _shouldFrag]; + diag_log text format [" Indirect hit range: %1", _indirectHitRange]; + diag_log text format [" Indirect hit: %1", _indirectHit]; + diag_log text format [" Max frag speed: %1", _fragMaxSpeed]; + diag_log text format [" Frag range: %1", _fragRange]; + diag_log text format [" Frag speed range: %1", _fragPowerSpeedRange]; + INC(_numberPrinted); + }; + + _processedCfgAmmos set [_ammo, 1]; +} forEach _allAmmoConfigs; + +diag_log text "//****************** fragCalcDump End ******************//"; +diag_log text format ["//********************** printed %1 *********************//", _numberPrinted]; diff --git a/addons/frag/functions/fnc_dev_sphereDraw.sqf b/addons/frag/functions/fnc_dev_sphereDraw.sqf new file mode 100644 index 00000000000..31a1393991e --- /dev/null +++ b/addons/frag/functions/fnc_dev_sphereDraw.sqf @@ -0,0 +1,41 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * Add a colored sphere at a specified point. + * + * Arguments: + * 0: Position (posASL) to add sphere + * 1: Color of sphere (default: "blue") + * + * Return Value: + * The created sphere object + * + * Example: + * [getPosASL player, "red"] call ace_frag_fnc_dev_sphereDraw + * + * Public: No + */ + +params ["_posASL", ["_color", "blue"]]; + +if (!isServer) exitWith {}; + +if (_color select [0,1] != "(") then { + _color = switch (toLowerANSI _color) do { + case "blue": {"(0,0,0.8,0.5)"}; + case "black": {"(1,1,1,0.5)"}; + case "white": {"(0,0,0,0.5)"}; + case "red": {"(0.8,0,0,0.5)"}; + case "green": {"(0,0.8,0,0.5)"}; + case "yellow": {"(0.8,0.8,0,0.5)"}; + case "orange": {"(0.8,0.518,0,0.5)"}; + default {"(0.8,0.8,0,0.5)"}; + }; +}; +private _colorString = "#(argb,8,8,3)color" + _color; + +private _sphere = createVehicle ["Sign_Sphere10cm_F", ASLToATL _posASL, [], 0, "CAN_COLLIDE"]; +_sphere setObjectTextureGlobal [0, _colorString]; +GVAR(dev_eventSpheres) pushBack _sphere; + +_sphere // return diff --git a/addons/frag/functions/fnc_dev_startTracing.sqf b/addons/frag/functions/fnc_dev_startTracing.sqf deleted file mode 100644 index 897dde3011e..00000000000 --- a/addons/frag/functions/fnc_dev_startTracing.sqf +++ /dev/null @@ -1,23 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_dev_startTracing - * - * Public: No - */ - -if (GVAR(tracesStarted)) exitWith {}; - -INFO("Starting Trace Drawing"); - -GVAR(tracesStarted) = true; -GVAR(traceID) = [LINKFUNC(dev_drawTraces), 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/frag/functions/fnc_dev_stopTracing.sqf b/addons/frag/functions/fnc_dev_stopTracing.sqf deleted file mode 100644 index 949d3cd55d6..00000000000 --- a/addons/frag/functions/fnc_dev_stopTracing.sqf +++ /dev/null @@ -1,23 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * Dev things - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * None - * - * Public: No - */ - -if (!GVAR(tracesStarted)) exitWith {}; - -INFO("Ending Trace Drawing"); - -GVAR(tracesStarted) = false; -[GVAR(traceID)] call CBA_fnc_removePerFrameHandler; diff --git a/addons/frag/functions/fnc_dev_trackHitBox.sqf b/addons/frag/functions/fnc_dev_trackHitBox.sqf new file mode 100644 index 00000000000..327e45cf0d3 --- /dev/null +++ b/addons/frag/functions/fnc_dev_trackHitBox.sqf @@ -0,0 +1,75 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * Add a hit box outline to an object. + * + * Arguments: + * 0: Object that should have it's hit box drawn (default: objNull) + * 1: Add sphere at object origin (default: true) + * + * Return Value: + * None + * + * Example: + * player call ace_frag_fnc_dev_trackHitBox + * + * Public: No + */ + +params [ + ["_object", objNull], + ["_addSphere", true] +]; +TRACE_2("Adding hitbox",_object,_addSphere); + +if (isNull _object) exitWith {}; + +// Grab the right hitBox +private _boundingBox = []; +if (_object isKindOf "CAManBase") then { + if (isNull objectParent _object) then { + _boundingBox = 0 boundingBox _object; + } else { + _boundingBox = boundingBoxReal [_object, "Geometry"]; + }; +} else { + _boundingBox = boundingBoxReal [_object, "FireGeometry"]; +}; +_boundingBox params ["_lowerPoint", "_upperPoint"]; + +// adjust with stance +switch (stance _object) do { + case "STAND": {_upperPoint set [2, 1.9];}; + case "CROUCH": {_upperPoint set [2, 1.3];}; + case "PRONE": {_upperPoint set [2, 0.8];}; +}; +private _centerPoint = ASLToAGL getPosASL _object; + +if (GVAR(dbgSphere) && _addSphere && {isNull objectParent _object}) then { + private _centerSphere = [getPosASL _object, "yellow"] call FUNC(dev_sphereDraw); + _centerSphere attachTo [_object, _object worldToModel _centerPoint]; +}; + +// create an optimized outline +_upperPoint params ["_x1","_y1","_z1"]; +_lowerPoint params ["_x2","_y2","_z2"]; +private _p1 = _upperPoint; +private _p7 = _lowerPoint; +private _points = [ + _upperPoint, + [_x1, _y2, _z1], + [_x2, _y2, _z1], + [_x2, _y1, _z1], + [_x1, _y1, _z2], + [_x1, _y2, _z2], + _lowerPoint, + [_x2, _y1, _z2] +]; + +private _color = switch (side _object) do { + case east: {[0.8, 0, 0, 1]}; + case resistance: {[0, 0.8, 0, 1]}; + default {[0, 0, 0.8, 1]}; +}; + +GVAR(dev_hitBoxes) set [getObjectID _object, [_object, _points, _color]]; diff --git a/addons/frag/functions/fnc_dev_trackObj.sqf b/addons/frag/functions/fnc_dev_trackObj.sqf new file mode 100644 index 00000000000..88b298fa0b8 --- /dev/null +++ b/addons/frag/functions/fnc_dev_trackObj.sqf @@ -0,0 +1,87 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * This function adds an object to have its course tracked (every frame). + * + * Arguments: + * 0: Object to draw track (default: objNull) + * 1: Color of trace (default: "blue") + * 2: Whether the object is a projectile or whether to add projectile EHs (default: false) + * + * Return Value: + * None + * + * Example: + * player call ace_frag_fnc_dev_trackObj + * + * Public: No + */ + +params [ + ["_object", objNull], + ["_color", "blue"], + ["_isProj", false] +]; +TRACE_3("devDraw",_object,_color,_isProj); + +// pick color and add it to the array +private _colorArray = switch (toLowerANSI _color) do { + case "purple": {[0.8, 0, 0.8, 1]}; + case "blue": {[0, 0, 0.8, 1]}; + case "green": {[0, 0.8, 0, 1]}; + case "orange": {[0.8, 0.518, 0, 1]}; + case "yellow": {[0.8, 0.8, 0, 1]}; + case "red": {[0.8, 0, 0, 1]}; + case "black": {[1, 1, 1, 1]}; + case "white": {[0, 0, 0, 1]}; + default {[0, 0.8, 0.8, 1]}; +}; +GVAR(dev_trackLines) set [getObjectID _object, [[getPosATL _object], _colorArray]]; + +// event handler to track round and cleanup when round is "dead" +[{ + if (isGamePaused || accTime == 0) exitWith {}; + params ["_object", "_handle"]; + + if (!alive _object) exitWith { + _handle call CBA_fnc_removePerFrameHandler; + }; + + private _objectArray = GVAR(dev_trackLines) get (getObjectID _object); + + if (isNil "_objectArray") exitWith { + _handle call CBA_fnc_removePerFrameHandler; + }; + + (_objectArray#0) pushBack getPosATL _object; +}, 0, _object] call CBA_fnc_addPerFrameHandler; + +// Projectile event handlers that add spheres and points for more accurate round tracking +if (!_isProj) exitWith {}; + +_object addEventHandler ["HitPart", { + params ["_projectile", "", "", "_posASL"]; + private _posArr = (GVAR(dev_trackLines) get (getObjectID _projectile))#0; + _posArr pushBack ASLToATL _posASL; + if (GVAR(dbgSphere)) then { + [_posASL, "green"] call FUNC(dev_sphereDraw); + }; +}]; + +_object addEventHandler ["Explode", { + params ["_projectile", "_posASL"]; + private _posArr = (GVAR(dev_trackLines) get (getObjectID _projectile))#0; + _posArr pushBack ASLToATL _posASL; + if (GVAR(dbgSphere)) then { + [_posASL, "red"] call FUNC(dev_sphereDraw); + }; +}]; + +_object addEventHandler ["Deflected", { + params ["_projectile", "_posASL"]; + private _posArr = (GVAR(dev_trackLines) get (getObjectID _projectile))#0; + _posArr pushBack ASLToATL _posASL; + if (GVAR(dbgSphere)) then { + [_posASL, "blue"] call FUNC(dev_sphereDraw); + }; +}]; diff --git a/addons/frag/functions/fnc_dev_trackTrace.sqf b/addons/frag/functions/fnc_dev_trackTrace.sqf deleted file mode 100644 index 6c010bdb631..00000000000 --- a/addons/frag/functions/fnc_dev_trackTrace.sqf +++ /dev/null @@ -1,27 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * Dev things - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_dev_trackTrace - * - * Public: No - */ - -params ["_args", "_pfhID"]; -_args params ["_tracerObj", "_index"]; - -if (alive _tracerObj && {GVAR(traces) isNotEqualTo []}) then { - private _data = GVAR(traces) select _index; - private _positions = _data select 4; - _positions pushBack [getPos _tracerObj, vectorMagnitude (velocity _tracerObj)]; -} else { - [_pfhID] call CBA_fnc_removePerFrameHandler; -}; diff --git a/addons/frag/functions/fnc_doExplosions.sqf b/addons/frag/functions/fnc_doExplosions.sqf index a5a687aa538..74e191532a5 100644 --- a/addons/frag/functions/fnc_doExplosions.sqf +++ b/addons/frag/functions/fnc_doExplosions.sqf @@ -21,7 +21,7 @@ _args params ["_explosions", "_index"]; for "_i" from _index to ((_index + 2) min (count _explosions)) do { private _exp = _explosions select _i; _exp params ["_refExp", "_bpos", "_hit", "_distance", "_indirectHitRange", "_depth"]; - _refExp createVehicle (ASLtoATL _bpos); + _refExp createVehicle (ASLToATL _bpos); // if (_hit >= 150 && _distance > _indirectHitRange) then { // [_bpos, _refExp, _depth] call FUNC(doReflections); // }; diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf index b206c701b21..0c5e7e39a1f 100644 --- a/addons/frag/functions/fnc_doSpall.sqf +++ b/addons/frag/functions/fnc_doSpall.sqf @@ -1,139 +1,121 @@ #include "..\script_component.hpp" /* - * Author: ACE-Team - * Dev things + * Author: Jaynus, NouberNou, Lambda.Tiger, + * This function check whether a spall event has occured and generates spall. * * Arguments: - * None + * 0: The object a projectile hit + * 1: The config name of the projectile + * 2: The projectile that should cause spalling + * 3: The position (ASL) the projectile hit the object + * 4: The old velocity of the projectile + * 5: The projectile's instigator, or the second argument of a projectile's shotParents * * Return Value: * None * * Example: - * call ace_frag_fnc_doSpall + * [editorPlacedHouse_0, typeOf _projectile, _projectile, [1000, 40, 60], [0, 1000, 0], [objNull, ace_player]] call ace_frag_fnc_doSpall * * Public: No */ - #define WEIGHTED_SIZE [QGVAR(spall_small), 4, QGVAR(spall_medium), 3, QGVAR(spall_large), 2, QGVAR(spall_huge), 1] +params ["_objectHit", "_roundType", "_round", "_oldPosASL", "_oldVelocity", "_instigator"]; -params ["_hitData", "_hitPartDataIndex"]; -private _initialData = GVAR(spallHPData) select (_hitData select 0); -_initialData params ["_hpId", "_object", "_roundType", "_round", "_curPos", "_velocity"]; - -private _hpData = (_hitData select 1) select _hitPartDataIndex; -private _objectHit = _hpData param [0, objNull]; -TRACE_1("",_objectHit); -if ((isNil "_objectHit") || {isNull _objectHit}) exitWith {WARNING_1("Problem with hitPart data - bad object [%1]",_objectHit);}; -_objectHit removeEventHandler ["HitPart", _hpId]; +TRACE_6("",_objectHit,_roundType,_round,_oldPosASL,_oldVelocity,_instigator); +if ((isNil "_objectHit") || {isNull _objectHit}) exitWith { + TRACE_1("Problem with hitPart data - bad object [%1]",_objectHit); +}; -private _caliber = getNumber (configFile >> "CfgAmmo" >> _roundType >> "caliber"); -private _explosive = getNumber (configFile >> "CfgAmmo" >> _roundType >> "explosive"); -private _idh = getNumber (configFile >> "CfgAmmo" >> _roundType >> "indirectHitRange"); +_roundType call FUNC(getSpallInfo) params ["_caliber", "_explosive", "_idh"]; -if !(_caliber >= 2.5 || {(_explosive > 0 && {_idh >= 1})}) exitWith {}; -// ACE_player sideChat format ["BBBB"]; private _exit = false; -private _vm = 1; +private _velocityModifier = 1; -private _oldVelocity = vectorMagnitude _velocity; -private _curVelocity = vectorMagnitude (velocity _round); +private _curVelocity = velocity _round; +private _oldSpeed = vectorMagnitude _oldVelocity; +private _curSpeed = vectorMagnitude _curVelocity; if (alive _round) then { - private _diff = _velocity vectorDiff (velocity _round); + private _diff = _oldVelocity vectorDiff _curVelocity; private _polar = _diff call CBA_fnc_vect2polar; - // ACE_player sideChat format ["polar: %1", _polar]; + if (abs (_polar select 1) > 45 || {abs (_polar select 2) > 45}) then { if (_caliber < 2.5) then { - // ACE_player sideChat format ["exit!"]; _exit = true; } else { - SUB(_vm,_curVelocity / _oldVelocity); + SUB(_velocityModifier,_curSpeed / _oldSpeed); }; }; }; -if (_exit) exitWith {}; - -private _unitDir = vectorNormalized _velocity; -private _pos = _hpData select 3; -private _spallPos = []; -if ((isNil "_pos") || {!(_pos isEqualTypeArray [0,0,0])}) exitWith {WARNING_1("Problem with hitPart data - bad pos [%1]",_pos);}; -for "_i" from 0 to 100 do { - private _pos1 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * _i)); - private _pos2 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * (_i + 1))); - // _data = [nil, nil, nil, 1, [[ASLtoATL _pos1, 1], [ASLtoATL _pos2, 1]]]; - // NOU_TRACES pushBack _data; - - if (!lineIntersects [_pos1, _pos2]) exitWith { - // ACE_player sideChat format ["FOUND!"]; - _spallPos = _pos2; - }; +if (_exit) exitWith { + TRACE_1("exit alive",_caliber); }; -if (_spallPos isEqualTo []) exitWith {}; -private _spallPolar = _velocity call CBA_fnc_vect2polar; + +private _unitDir = vectorNormalized _oldVelocity; + +if ((isNil "_oldPosASL") || {!(_oldPosASL isEqualTypeArray [0,0,0])}) exitWith {WARNING_1("Problem with hitPart data - bad pos [%1]",_oldPosASL);}; +private _pos1 = _oldPosASL; +private _spallPosAGL = _pos1; +private _searchStepSize = _unitDir vectorMultiply 0.05; +for "_i" from 0 to 20 do { + _spallPosAGL = _pos1 vectorAdd _searchStepSize; + if (!lineIntersects [_pos1, _spallPosAGL]) exitWith {}; + _pos1 = _spallPosAGL; +}; +if (_spallPosAGL isEqualTo _pos1) exitWith { + TRACE_1("can't find other side",_oldPosASL); +}; +_spallPosAGL = ASLToAGL _spallPosAGL; + +_instigator setVariable [QGVAR(nextSpallEvent), CBA_missionTime + ACE_FRAG_SPALL_UNIT_HOLDOFF]; +private _oldVelocitySpherical = _oldVelocity call CBA_fnc_vect2polar; if (_explosive > 0) then { - // ACE_player sideChat format ["EXPLOSIVE!"]; - private _warn = false; - private _c = getNumber (configFile >> "CfgAmmo" >> _roundType >> QGVAR(CHARGE)); - if (_c == 0) then {_c = 1; _warn = true;}; - private _m = getNumber (configFile >> "CfgAmmo" >> _roundType >> QGVAR(METAL)); - if (_m == 0) then {_m = 2; _warn = true;}; - private _k = getNumber (configFile >> "CfgAmmo" >> _roundType >> QGVAR(GURNEY_K)); - if (_k == 0) then {_k = 1 / 2; _warn = true;}; - private _gC = getNumber (configFile >> "CfgAmmo" >> _roundType >> QGVAR(GURNEY_C)); - if (_gC == 0) then {_gC = 2440; _warn = true;}; - - // if (_warn) then { - // WARNING_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_roundType); //TODO: turn this off when we get closer to release - // }; - - private _fragPower = (((_m / _c) + _k) ^ - (1 / 2)) * _gC; - _spallPolar set [0, _fragPower * 0.66]; + _roundType call FUNC(getFragInfo) params ["", "_fragVelocity"]; + _oldVelocitySpherical set [0, _fragVelocity * 0.66]; }; +TRACE_2("spallPosandVel",_spallPosAGL,_oldVelocitySpherical); -// diag_log text format ["SPALL POWER: %1", _spallPolar select 0]; private _spread = 15 + (random 25); private _spallCount = 5 + (random 10); TRACE_1("",_spallCount); for "_i" from 1 to _spallCount do { - private _elev = ((_spallPolar select 2) - _spread) + (random (_spread * 2)); - private _dir = ((_spallPolar select 1) - _spread) + (random (_spread * 2)); - if (abs _elev > 90) then { - ADD(_dir,180); + private _fragmentElevation = ((_oldVelocitySpherical select 2) - _spread) + (random (_spread * 2)); + private _fragmentAzimuth = ((_oldVelocitySpherical select 1) - _spread) + (random (_spread * 2)); + if (abs _fragmentElevation > 90) then { + ADD(_fragmentAzimuth,180); }; - _dir = _dir % 360; - private _vel = (_spallPolar select 0) * 0.33 * _vm; - _vel = (_vel - (_vel * 0.25)) + (random (_vel * 0.5)); + _fragmentAzimuth = _fragmentAzimuth % 360; + private _fragmentSpeed = (_oldVelocitySpherical select 0) * 0.33 * _velocityModifier; + _fragmentSpeed = _fragmentSpeed * (0.75 + random 0.5); - private _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; - private _fragment = (selectRandomWeighted WEIGHTED_SIZE) createVehicleLocal [0,0,10000]; - _fragment setPosASL _spallPos; + private _spallFragVect = [_fragmentSpeed, _fragmentAzimuth, _fragmentElevation] call CBA_fnc_polar2vect; + private _fragment = createVehicleLocal [selectRandomWeighted WEIGHTED_SIZE, _spallPosAGL, [], 0, "CAN_COLLIDE"]; _fragment setVelocity _spallFragVect; - #ifdef DRAW_FRAG_INFO - [ACE_player, _fragment, [1, 0.5, 0, 1]] call FUNC(dev_addTrack); + #ifdef DEBUG_MODE_DRAW + [_fragment, "orange", true] call FUNC(dev_trackObj); #endif }; _spread = 5 + (random 5); _spallCount = 3 + (random 5); for "_i" from 1 to _spallCount do { - private _elev = ((_spallPolar select 2) - _spread) + (random (_spread * 2)); - private _dir = ((_spallPolar select 1) - _spread) + (random (_spread * 2)); - if (abs _elev > 90) then { - ADD(_dir,180); + private _fragmentElevation = ((_oldVelocitySpherical select 2) - _spread) + (random (_spread * 2)); + private _fragmentAzimuth = ((_oldVelocitySpherical select 1) - _spread) + (random (_spread * 2)); + if (abs _fragmentElevation > 90) then { + ADD(_fragmentAzimuth,180); }; - _dir = _dir % 360; - private _vel = (_spallPolar select 0) * 0.55 * _vm; - _vel = (_vel - (_vel * 0.25)) + (random (_vel * 0.5)); + _fragmentAzimuth = _fragmentAzimuth % 360; + private _fragmentSpeed = (_oldVelocitySpherical select 0) * 0.55 * _velocityModifier; + _fragmentSpeed = _fragmentSpeed * (0.75 + random 0.5); - private _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; - private _fragment = (selectRandomWeighted WEIGHTED_SIZE) createVehicleLocal [0, 0, 10000]; - _fragment setPosASL _spallPos; + private _spallFragVect = [_fragmentSpeed, _fragmentAzimuth, _fragmentElevation] call CBA_fnc_polar2vect; + private _fragment = createVehicleLocal [selectRandomWeighted WEIGHTED_SIZE, _spallPosAGL, [], 0, "CAN_COLLIDE"]; _fragment setVelocity _spallFragVect; - #ifdef DRAW_FRAG_INFO - [ACE_player, _fragment, [1, 0, 0, 1]] call FUNC(dev_addTrack); + #ifdef DEBUG_MODE_DRAW + [_fragment, "purple", true] call FUNC(dev_trackObj); #endif }; diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index 03d2fab6096..4f2a97740ab 100644 --- a/addons/frag/functions/fnc_fired.sqf +++ b/addons/frag/functions/fnc_fired.sqf @@ -1,14 +1,14 @@ #include "..\script_component.hpp" /* - * Author: nou, jaynus, PabstMirror - * Called from the unified fired EH for all. - * If spall is not enabled (default), then cache and only track those that will actually trigger fragmentation. + * Author: nou, jaynus, Lambda.Tiger, PabstMirror + * Add "Exploded" eventhandler to a projectile if it will produce fragments + * and a "HitPart" eventhandler if it will produce spall. * * Arguments: - * None. Parameters inherited from EFUNC(common,firedEH) + * Parameters inherited from EFUNC(common,firedEH) * * Return Value: - * None + * Nothing Useful * * Example: * [clientFiredBIS-XEH] call ace_frag_fnc_fired @@ -19,40 +19,41 @@ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); -private _shouldAdd = GVAR(cacheRoundsTypesToTrack) get _ammo; -if (isNil "_shouldAdd") then { - TRACE_1("no cache for round",_ammo); +if (_ammo isEqualTo "" || {isNull _projectile} || + !(if (isNil "_gunner") then {local _unit} else {local _gunner}) || + {_projectile getVariable [QGVAR(blacklisted), false]}) exitWith { + TRACE_2("bad ammo or projectile, or blackList",_ammo,_projectile); +}; - //Read configs and test if it would actually cause a frag, using same logic as FUNC(pfhRound) - private _skip = getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(skip)); - private _explosive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosive"); - private _indirectRange = getNumber (configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange"); - private _force = getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(force)); - private _fragPower = getNumber (configFile >> "CfgAmmo" >> _ammo >> "indirecthit") * (sqrt (getNumber (configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange"))); +#ifdef DEBUG_MODE_DRAW +if (GVAR(debugOptions) && {_ammo call FUNC(shouldFrag) || {_ammo call FUNC(shouldSpall)}}) then { + [_projectile, "red", true] call FUNC(dev_trackObj); +}; +#endif - _shouldAdd = (_skip == 0) && {(_force == 1) || {_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}}}; +if (!GVAR(spallEnabled) || {!(_ammo call FUNC(shouldSpall))}) exitWith { + TRACE_2("No spall",GVAR(spallEnabled),_ammo call FUNC(shouldSpall)); +}; - if (GVAR(spallEnabled) && {!_shouldAdd}) then { - private _caliber = getNumber (configFile >> "CfgAmmo" >> _ammo >> "caliber"); - if !(_caliber >= 2.5 || {(_explosive > 0 && {_indirectRange >= 1})}) exitWith {}; // from check in doSpall: line 34 - TRACE_1("Won't frag, but will spall",_caliber); - _shouldAdd = true; - }; +private _hitPartEventHandler = _projectile addEventHandler ["HitPart", { + params ["_projectile", "_hitObject", "", "_posASL", "_velocity"]; - TRACE_6("Setting Cache",_skip,_explosive,_indirectRange,_force,_fragPower,_shouldAdd); - GVAR(cacheRoundsTypesToTrack) set [_ammo, _shouldAdd]; -}; + // get rid of _shot parents starting after v2.18 is released and instead use the instigator EH parameter + // The "explode" EH does not get the same parameter + private _instigator = (getShotParents _projectile)#1; + private _ammo = typeOf _projectile; -if (_shouldAdd) then { - // firedMan will have nil "_gunner", so just check _unit; for firedVehicle we want to check _gunner - private _localShooter = if (isNil "_gunner") then {local _unit} else {local _gunner}; - TRACE_4("",_localShooter,_unit,_ammo,_projectile); - if (!_localShooter) exitWith {}; - if (_weapon == "Put") exitWith {}; // Ignore explosives placed without ace_explosives + /* + * Wait a frame to see what happens to the round, may result in + * multiple hits / slowdowns getting shunted to the first hit + */ + [{ + // only let a unit make a spall once per ACE_FRAG_SPALL_UNIT_HOLDOFF + if (CBA_missionTime < (_this#5) getVariable [QGVAR(nextSpallEvent), -1]) exitWith {}; - // Skip if less than 0.5 second from last shot - if ((CBA_missionTime - (_unit getVariable [QGVAR(lastTrack), -1])) < 0.5) exitWith {}; - _unit setVariable [QGVAR(lastTrack), CBA_missionTime]; + _this call FUNC(doSpall); + }, [_hitObject, _ammo, _projectile, _posASL, _velocity, _instigator]] call CBA_fnc_execNextFrame; +}]; +_projectile setVariable [QGVAR(hitPartEventHandler), _hitPartEventHandler]; - [_unit, _ammo, _projectile] call FUNC(addPfhRound); -}; +TRACE_1("firedExit",_ammo); diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index 8fd77dbc739..0284d3249ae 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -1,15 +1,15 @@ #include "..\script_component.hpp" /* - * Author: Jaynus, NouberNou + * Author: Jaynus, NouberNou, Lambda.Tiger * Server func to create the fragmentation for a round. * * Arguments: - * 0: Last Position (ASL) - * 1: Velocity - * 2: Ammo Classname + * 0: ASL position projetile is fragmenting at + * 1: Projectile ammo classname + * 2: Projectile shot parents * * Return Value: - * None + * The number of fragments created * * Example: * [[], [], "handGrenade"] call ace_frag_fnc_frago @@ -17,139 +17,109 @@ * Public: No */ -#define FRAG_VEC_VAR 0.004 -#define MAX_FRAG_COUNT 50 +#define FRAG_VEC_VAR 0.008 BEGIN_COUNTER(frago); -params ["_lastPos", "_lastVel", "_shellType"]; -TRACE_3("frago",_lastPos,_lastVel,_shellType); +params ["_fragPosASL", "_shellType", "_shotParents"]; +TRACE_3("frago",_fragPosASL,_shellType,_shotParents); // Limit max frag count if there was a recent frag -private _maxFrags = round (MAX_FRAG_COUNT * linearConversion [0.1, 1.5, (CBA_missionTime - GVAR(lastFragTime)), 0.1, 1, true]); +private _maxFrags = round linearConversion [ + ACE_FRAG_COUNT_MIN_TIME, + ACE_FRAG_COUNT_MAX_TIME, + (CBA_missionTime - GVAR(lastFragTime)), + ACE_FRAG_COUNT_MIN, + ACE_FRAG_COUNT_MAX, + true +]; TRACE_2("",_maxFrags,CBA_missionTime - GVAR(lastFragTime)); GVAR(lastFragTime) = CBA_missionTime; -private _fragTypes = [ - QGVAR(tiny), QGVAR(tiny), QGVAR(tiny), - QGVAR(tiny_HD), QGVAR(tiny_HD), QGVAR(tiny_HD), - QGVAR(small), QGVAR(small), QGVAR(small), QGVAR(small), - QGVAR(small_HD), QGVAR(small_HD), QGVAR(small_HD), QGVAR(small_HD), - QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD) -]; - -private _warn = false; -if (isArray (configFile >> "CfgAmmo" >> _shellType >> QGVAR(CLASSES))) then { - _fragTypes = getArray (configFile >> "CfgAmmo" >> _shellType >> QGVAR(CLASSES)); -} else { - _warn = true; -}; - -private _indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _shellType >> "indirecthitrange"); -private _fragRange = 20 * _indirectHitRange * 4; -// _c = 185; // grams of comp-b -// _m = 210; // grams of fragmentating metal -// _k = 3/5; // spherical K factor -// _gC = 2843; // Gurney constant of comp-b in /ms - -// _c = 429; // grams of tritonal -// _m = 496; // grams of fragmentating metal -// _k = 1/2; // spherical K factor -// _gC = 2320; // Gurney constant of tritonal in /ms - -private _c = getNumber (configFile >> "CfgAmmo" >> _shellType >> QGVAR(CHARGE)); -if (_c == 0) then {_c = 1; _warn = true;}; -private _m = getNumber (configFile >> "CfgAmmo" >> _shellType >> QGVAR(METAL)); -if (_m == 0) then {_m = 2; _warn = true;}; -private _k = getNumber (configFile >> "CfgAmmo" >> _shellType >> QGVAR(GURNEY_K)); -if (_k == 0) then {_k = 0.5; _warn = true;}; -private _gC = getNumber (configFile >> "CfgAmmo" >> _shellType >> QGVAR(GURNEY_C)); -if (_gC == 0) then {_gC = 2440; _warn = true;}; - -if (_warn) then { - INFO_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_shellType); -}; - -// Gunery equation is for a non-fragmenting metal, imperical value of 80% represents fragmentation -private _fragPower = 0.8 * (((_m / _c) + _k) ^ - (1 / 2)) * _gC; - -private _atlPos = ASLtoATL _lastPos; +_shellType call FUNC(getFragInfo) params ["_fragRange", "_fragVelocity", "_fragTypes", "_metalMassModifier"]; -private _fragPowerRandom = _fragPower * 0.5; -if ((_atlPos select 2) < 0.5) then { - _lastPos vectorAdd [0, 0, 0.5]; +private _fragPosAGL = ASLToAGL _fragPosASL; +TRACE_5("fragValues",_fragPosASL,_fragPosAGL,_fragRange,_fragVelocity,_metalMassModifier); +// Post 2.18 change - uncomment line 43, modify lines 45, and remove lines 44, 51-57, 64-66 +// private _targets = [ASLToAGL _fragPosAGL, _fragRange, _fragRange, 0, false, _fragRange] nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], false, true, true]; +private _objects = _fragPosAGL nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], _fragRange]; +if (_objects isEqualTo []) exitWith { + TRACE_2("No nearby targets",_fragPosAGL,_fragRange); + 0 }; -private _objects = _atlPos nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], _fragRange]; -// Add unique crews in faster way +// grab crews and add them in so that targets stay approx. sorted by distance +TRACE_1("",_objects); +private _targets = []; { - { - _objects pushBackUnique _x; - } forEach (crew _x); + private _crew = crew _x; + _crew pushBackUnique _x; + _targets append _crew; } forEach _objects; -TRACE_2("",_fragRange,count _objects); +TRACE_2("",_fragRange,count _targets); private _fragCount = 0; private _fragArcs = []; _fragArcs set [360, 0]; -private _doRandom = true; -if (_objects isNotEqualTo []) then { +if (_targets isNotEqualTo []) then { if (GVAR(reflectionsEnabled)) then { - [_lastPos, _shellType] call FUNC(doReflections); + [_fragPosASL, _shellType] call FUNC(doReflections); }; { private _target = _x; - if (alive _target) then { + if (alive _target && {getNumber ((configOf _target) >> "isPlayableLogic") == 0}) then { (boundingBox _target) params ["_boundingBoxA", "_boundingBoxB"]; private _cubic = ((abs (_boundingBoxA select 0)) + (_boundingBoxB select 0)) * ((abs (_boundingBoxA select 1)) + (_boundingBoxB select 1)) * ((abs (_boundingBoxA select 2)) + (_boundingBoxB select 2)); if (_cubic <= 1) exitWith {}; - // _doRandom = true; private _targetVel = velocity _target; private _targetPos = getPosASL _target; - private _distance = _targetPos vectorDistance _lastPos; - private _add = ((_boundingBoxB select 2) / 2) + ((((_distance - (_fragpower / 8)) max 0) / _fragPower) * 10); + private _distance = _target distance _fragPosAGL; + private _add = ((_boundingBoxB select 2) / 2) + ((((_distance - (_fragVelocity / 8)) max 0) / _fragVelocity) * 10); _targetPos = _targetPos vectorAdd [ - (_targetVel select 0) * (_distance / _fragPower), - (_targetVel select 1) * (_distance / _fragPower), - _add + (_targetVel select 0) * (_distance / _fragVelocity), + (_targetVel select 1) * (_distance / _fragVelocity), + _add ]; - private _baseVec = _lastPos vectorFromTo _targetPos; + private _baseVec = _fragPosASL vectorFromTo _targetPos; private _dir = floor (_baseVec call CBA_fnc_vectDir); private _currentCount = RETDEF(_fragArcs select _dir,0); if (_currentCount < 10) then { - private _count = ceil (random (sqrt (_m / 1000))); + private _count = ceil (random _metalMassModifier); private _vecVar = FRAG_VEC_VAR; - if !(_target isKindOf "Man") then { + if !(_target isKindOf "CAManBase") then { ADD(_vecVar,(sqrt _cubic) / 2000); if ((crew _target) isEqualTo [] && {_count > 0}) then { _count = 0 max (_count / 2); }; }; + private _vecVarHalf = _vecVar / 2; for "_i" from 1 to _count do { - private _vec = _baseVec vectorDiff [ - (_vecVar / 2) + (random _vecVar), - (_vecVar / 2) + (random _vecVar), - (_vecVar / 2) + (random _vecVar) + private _vectorDir = _baseVec vectorDiff [ + _vecVarHalf - (random _vecVar), + _vecVarHalf - (random _vecVar), + _vecVarHalf - (random _vecVar) ]; - private _fp = _fragPower - (random (_fragPowerRandom)); - private _vel = _vec vectorMultiply _fp; - - private _fragObj = (selectRandom _fragTypes) createVehicleLocal [0,0,10000]; - // TRACE_4("targeted",_fp,typeOf _fragObj,_lastPos vectorDistance _targetPos,typeOf _x); - _fragObj setPosASL _lastPos; - _fragObj setVectorDir _vec; - _fragObj setVelocity _vel; - #ifdef DRAW_FRAG_INFO - [ACE_player, _fragObj, [1,0,0,1]] call FUNC(dev_addTrack); + private _fragObjSpeed = _fragVelocity * (1 - random 0.5); + private _fragObjVelocity = _vectorDir vectorMultiply _fragObjSpeed; + + private _fragObj = createVehicleLocal [selectRandom _fragTypes, _fragPosAGL, [], 0, "CAN_COLLIDE"]; + _fragObj setVectorDir _vectorDir; + _fragObj setVelocity _fragObjVelocity; + _fragObj setShotParents _shotParents; + #ifdef DEBUG_MODE_DRAW + [_fragObj, "green", true] call FUNC(dev_trackObj); + if (GVAR(dbgSphere)) then { + [_targetPos, "(0.88,0.36,0.92,0.8)"] call FUNC(dev_sphereDraw); + }; #endif INC(_fragCount); INC(_currentCount); @@ -158,34 +128,32 @@ if (_objects isNotEqualTo []) then { }; }; if (_fragCount > _maxFrags) exitWith {}; - } forEach _objects; + } forEach _targets; TRACE_1("targeted",_fragCount); if (_fragCount > _maxFrags) exitWith {}; private _randomCount = ceil ((_maxFrags - _fragCount) * 0.35); TRACE_1("",_randomCount); private _sectorSize = 360 / (_randomCount max 1); - if (_doRandom) then { - for "_i" from 1 to _randomCount do { - // Distribute evenly - private _sectorOffset = 360 * (_i - 1) / (_randomCount max 1); - private _randomDir = random (_sectorSize); - _vec = [cos (_sectorOffset + _randomDir), sin (_sectorOffset + _randomDir), sin (30 - (random 45))]; + for "_i" from 1 to _randomCount do { + // Distribute evenly + private _sectorOffset = 360 * (_i - 1) / (_randomCount max 1); + private _randomDir = random (_sectorSize); + private _vectorDir = [cos (_sectorOffset + _randomDir), sin (_sectorOffset + _randomDir), sin (30 - (random 45))]; - _fp = (_fragPower - (random (_fragPowerRandom))); + private _fragObjSpeed = _fragVelocity * (1 - random 0.5); - _vel = _vec vectorMultiply _fp; + _fragObjVelocity = _vectorDir vectorMultiply _fragObjSpeed; - _fragObj = (selectRandom _fragTypes) createVehicleLocal [0, 0, 10000]; - _fragObj setPosASL _lastPos; - _fragObj setVectorDir _vec; - _fragObj setVelocity _vel; + private _fragObj = createVehicleLocal [selectRandom _fragTypes, _fragPosAGL, [], 0, "CAN_COLLIDE"]; + _fragObj setVectorDir _vectorDir; + _fragObj setVelocity _fragObjVelocity; + _fragObj setShotParents _shotParents; - #ifdef DRAW_FRAG_INFO - [ACE_player, _fragObj, [1,0.5,0,1]] call FUNC(dev_addTrack); - #endif - INC(_fragCount); - }; + #ifdef DEBUG_MODE_DRAW + [_fragObj, "blue", true] call FUNC(dev_trackObj); + #endif + INC(_fragCount); }; }; diff --git a/addons/frag/functions/fnc_getFragInfo.sqf b/addons/frag/functions/fnc_getFragInfo.sqf new file mode 100644 index 00000000000..77222234235 --- /dev/null +++ b/addons/frag/functions/fnc_getFragInfo.sqf @@ -0,0 +1,96 @@ +#include "..\script_component.hpp" +/* + * Author: Jaynus, NouberNou, Lambda.Tiger + * This function returns fragmentation parameters for a specific ammo type. + * + * Arguments: + * 0: Ammo classname + * + * Return Value: + * _ammoInfo + * 0: Search range for fragments in meters + * 1: Gurney equation calculated speed + * 2: Array of fragment types + * 3: Mass of fragmenting metal modified for frag count + * + * Example: + * "B_556x45_Ball" call ace_frag_fnc_getFragInfo + * + * Public: No + */ + +params ["_ammo"]; + +GVAR(fragInfoCache) getOrDefaultCall [_ammo, { + private _ammoConfig = configFile >> "CfgAmmo" >> _ammo; + private _fragTypes = ACE_FRAG_DEFAULT_FRAG_TYPES; + private _notifyMissingEntries = false; + if (isArray (_ammoConfig >> QGVAR(classes))) then { + _fragTypes = getArray (_ammoConfig >> QGVAR(classes)); + } else { + _notifyMissingEntries = true; + }; + + /************ Gurney equation notes *****************//* + * see https://en.wikipedia.org/wiki/Gurney_equations + * + * gurney_k is the geometry constant added to _metalMass/_chargeMass + * gurney_c = sqrt(2E) + * + * _chargeMass = 185; - grams of comp-b + * _metalMass = 210; - grams of metal are accelerated by explosion + * _geometryCoefficient = 3/5; - spherical K factor + * _gurneyConstant = 2843; - Gurney constant of comp-b in /ms + * + * _chargeMass = 429; - grams of tritonal + * _metalMass = 496; - grams of metal are accelerated by explosion + * _geometryCoefficient = 1/2; - cylindrical K factor + * _gurneyConstant = 2320; - Gurney constant of tritonal in m/s + * Equation - 0.8 for empirical 80% speed + * 0.8 * (((_metalMass / _chargeMass) + _geometryCoefficient) ^ - (1 / 2)) * _gurneyConstant; + * or 0.8 * _gurneyConstant * sqrt (_chargeMass /(_metalMass + _chargeMass * _geometryCoefficient)); (slightly faster to compute) + */ + + private _chargeMass = getNumber (_ammoConfig >> QGVAR(charge)); + if (_chargeMass == 0) then { + _chargeMass = 1; + _notifyMissingEntries = true; + }; + + private _metalMass = getNumber (_ammoConfig >> QGVAR(metal)); + if (_metalMass == 0) then { + _metalMass = 2; + _notifyMissingEntries = true; + }; + + private _geometryCoefficient = getNumber (_ammoConfig >> QGVAR(gurney_k)); + if (_geometryCoefficient == 0) then { + _geometryCoefficient = 0.5; + _notifyMissingEntries = true; + }; + + private _gurneyConstant = getNumber (_ammoConfig >> QGVAR(gurney_c)); + if (_gurneyConstant == 0) then { + _gurneyConstant = 2440; + _notifyMissingEntries = true; + }; + + if (_notifyMissingEntries) then { + INFO_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_ammo); + }; + + private _indirectHitRange = getNumber (_ammoConfig >> "indirecthitrange"); + + /********************** _ammoInfo format *************************//* + * 0: _fragRange - search range for fragments + * 1: _fragVelocity - gurney equation calculated velocity + * 2: _fragTypes - array of fragment types + * 3: _metalMassModified - mass of fragmenting metal modified for frag count + */ + [ + 80 * _indirectHitRange, + ACE_FRAG_IMPERIC_VELOCITY_CONSTANT * _gurneyConstant * sqrt (_chargeMass / (_metalMass + _chargeMass * _geometryCoefficient)), + _fragTypes, + sqrt (_metalMass / 1000) + ] // return +}, true] diff --git a/addons/frag/functions/fnc_getSpallInfo.sqf b/addons/frag/functions/fnc_getSpallInfo.sqf new file mode 100644 index 00000000000..7bb566064ba --- /dev/null +++ b/addons/frag/functions/fnc_getSpallInfo.sqf @@ -0,0 +1,30 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * This function returns spalling parameters for a specific ammo type. + * + * Arguments: + * 0: Ammo classname + * + * Return Value: + * _ammoInfo + * 0: Caliber config value + * 1: What part of the hit damage is from ballistic vs explosive energy (1 for all explosive) + * 2: Indirect hit damage + * + * Example: + * "B_556x45_Ball" call ace_frag_fnc_getSpallInfo + * + * Public: No + */ + +params ["_ammo"]; + +GVAR(spallInfoCache) getOrDefaultCall [_ammo, { + private _ammoConfig = configFile >> "CfgAmmo" >> _ammo; + private _caliber = getNumber (_ammoConfig >> "caliber"); + private _explosive = getNumber (_ammoConfig >> "explosive"); + private _indirectHit = getNumber (_ammoConfig >> "indirectHitRange"); + + [_caliber, _explosive, _indirectHit] // return +}, true] diff --git a/addons/frag/functions/fnc_masterPFH.sqf b/addons/frag/functions/fnc_masterPFH.sqf deleted file mode 100644 index 004af9a9ce5..00000000000 --- a/addons/frag/functions/fnc_masterPFH.sqf +++ /dev/null @@ -1,56 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: jaynus - * Master single PFH abstraction for all rounds being tracked by frag/spall. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_masterPFH - * - * Public: No - */ - -BEGIN_COUNTER(PFH); - -// Fast exit if nothing to do -if (GVAR(objects) isEqualTo []) exitWith {END_COUNTER(PFH);}; - -private _gcIndex = []; - -private _iter = 0; -private _objectCount = count GVAR(objects); -while {_objectCount > 0 && {_iter < (GVAR(maxTrackPerFrame) min _objectCount)}} do { - - if (GVAR(lastIterationIndex) >= _objectCount) then { - GVAR(lastIterationIndex) = 0; - }; - private _object = GVAR(objects) select GVAR(lastIterationIndex); - - if (!isNil "_object") then { - private _args = GVAR(arguments) select GVAR(lastIterationIndex); - - if !(_args call FUNC(pfhRound)) then { - _gcIndex pushBack GVAR(lastIterationIndex); // Add it to the GC if it returns false - }; - }; - INC(_iter); - INC(GVAR(lastIterationIndex)); -}; - -// Clean up dead object references -private _deletionCount = 0; -{ - TRACE_1("GC Projectile",_x); - private _deleteIndex = _x - _deletionCount; - GVAR(objects) deleteAt _deleteIndex; - GVAR(arguments) deleteAt _deleteIndex; - - INC(_deletionCount); -} forEach _gcIndex; - -END_COUNTER(PFH); diff --git a/addons/frag/functions/fnc_pfhRound.sqf b/addons/frag/functions/fnc_pfhRound.sqf deleted file mode 100644 index 0c261dcffba..00000000000 --- a/addons/frag/functions/fnc_pfhRound.sqf +++ /dev/null @@ -1,59 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_pfhRound - * - * Public: No - */ - -params ["_round", "_lastPos", "_lastVel", "_shellType", "_firedFrame", "_firedPos", "_doSpall", "_spallTrack", "_foundObjectHPIds", "_skip", "_explosive", "_indirectRange", "_force", "_fragPower"]; - -if (_round in GVAR(blackList)) exitWith { - false -}; - -if (!alive _round) exitWith { - if ((diag_frameno - _firedFrame) > 1) then { //skip if deleted within a single frame - if (_skip == 0) then { - if ((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1}) then { - // shotbullet, shotShell don't seem to explode when touching water, so don't create frags - if ((surfaceIsWater _lastPos) && {(toLowerANSI getText (configFile >> "CfgAmmo" >> _shellType >> "simulation")) in ["shotbullet", "shotshell"]}) exitWith {}; - private _fuseDist = getNumber(configFile >> "CfgAmmo" >> _shellType >> "fuseDistance"); - private _isArmed = _firedPos vectorDistance _lastPos >= _fuseDist; // rounds explode at exactly fuseDistance, so check inclusive - TRACE_2("",_fuseDist,_isArmed); - if (!_isArmed) exitWith {TRACE_1("round not armed",_this);}; - TRACE_3("Sending frag event to server",_lastPos,_lastVel,_shellType); - [QGVAR(frag_eh), [_lastPos,_lastVel,_shellType]] call CBA_fnc_serverEvent; - }; - }; - }; - if (_doSpall) then { - DEC(GVAR(spallIsTrackingCount)); - TRACE_1("doSpall",_foundObjectHPIds); - { - if (!isNil "_x") then { - _x removeEventHandler ["HitPart", _foundObjectHPIds select _forEachIndex]; - }; - } forEach _spallTrack; - }; - false -}; - -_this set [1, getPosASL _round]; -_this set [2, velocity _round]; - -if (_doSpall) then { - private _scale = ((count GVAR(objects)) / GVAR(maxTrackPerFrame)) max 0.1; - [_round, _scale, _spallTrack, _foundObjectHPIds] call FUNC(spallTrack); -}; - -true diff --git a/addons/frag/functions/fnc_setClassBlacklisted.sqf b/addons/frag/functions/fnc_setClassBlacklisted.sqf new file mode 100644 index 00000000000..03a13500258 --- /dev/null +++ b/addons/frag/functions/fnc_setClassBlacklisted.sqf @@ -0,0 +1,49 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * Blacklist an ammo class preventing it from producing fragments and/or spall. + * This function will not allow you to force a projectile to produce fragments or spall. + * Once an ammo class has been blacklisted, it can be removed from the blacklist using this function without restarting the mission. + * + * Arguments: + * 0: Class name of the ammo to be blacklisted + * 1: Should a projectile be blacklisted from producing fragments (default: true) + * 2: Should a projectile be blacklisted from producing spall (default: true) + * + * Return Value: + * Were the changes properly applied + * + * Example: + * // Stop "ACE_20mm_HE" from producing spall + * ["ACE_20mm_HE", false, true] call ace_frag_fnc_setClassBlacklisted; + * + * Public: Yes + */ +params [ + ["_ammo", "", [""]], + ["_blacklistFrag", true, [true]], + ["_blacklistSpall", true, [true]] +]; +TRACE_3("addBlackListClass",_ammo,_blacklistFrag,_blacklistSpall); + +if (_ammo isEqualTo "" || {!isClass (configFile >> "CfgAmmo" >> _ammo)}) exitWith { + INFO_1("Invalid ammo class [%1]",_ammo); + false +}; + +if (_blacklistFrag) then { + GVAR(shouldFragCache) set [_ammo, false]; +} else { + GVAR(shouldFragCache) deleteAt _ammo; + _ammo call FUNC(shouldFrag); +}; + + +if (_blacklistSpall) then { + GVAR(shouldSpallCache) set [_ammo, false]; +} else { + GVAR(shouldSpallCache) deleteAt _ammo; + _ammo call FUNC(shouldSpall); +}; + +true diff --git a/addons/frag/functions/fnc_shouldFrag.sqf b/addons/frag/functions/fnc_shouldFrag.sqf new file mode 100644 index 00000000000..8cc62f3dac0 --- /dev/null +++ b/addons/frag/functions/fnc_shouldFrag.sqf @@ -0,0 +1,46 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * This function checks whether an ammunition type should create fragments. + * + * Arguments: + * 0: Ammo classname + * + * Return Value: + * Could the ammo class generate fragments + * + * Example: + * "B_556x45_Ball" call ace_frag_fnc_shouldFrag + * + * Public: No + */ + +params ["_ammo"]; + +GVAR(shouldFragCache) getOrDefaultCall [_ammo, { + private _shouldFrag = true; + + private _ammoConfig = configFile >> "CfgAmmo" >> _ammo; + private _skip = getNumber (_ammoConfig >> QGVAR(skip)); + if (_skip == 1) then { + _shouldFrag = false; + TRACE_1("No frag: skip",_skip); + }; + + private _force = getNumber (_ammoConfig >> QGVAR(force)); + if (_shouldFrag && _force == 0) then { + private _explosive = getNumber (_ammoConfig >> "explosive"); + if (_explosive < 0.5) exitWith { + _shouldFrag = false; + TRACE_3("No frag: _explosive",_skip,_force,_explosive); + }; + private _indirectHit = getNumber (_ammoConfig >> "indirectHit"); + private _indirectRange = getNumber (_ammoConfig >> "indirectHitRange"); + if (_indirectRange < 4.5 || {_indirectHit * sqrt(_indirectRange) < 35}) then { + _shouldFrag = false; + TRACE_5("No frag",_ammo,_skip,_explosive,_indirectRange,_indirectHit); + }; + }; + + _shouldFrag +}, true] diff --git a/addons/frag/functions/fnc_shouldSpall.sqf b/addons/frag/functions/fnc_shouldSpall.sqf new file mode 100644 index 00000000000..430a4da8229 --- /dev/null +++ b/addons/frag/functions/fnc_shouldSpall.sqf @@ -0,0 +1,24 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * This function checks whether an ammunition type should cause spalling. + * + * Arguments: + * 0: Ammo classname + * + * Return Value: + * Whether the round type could spall when hitting an object + * + * Example: + * "B_556x45_Ball" call ace_frag_fnc_shouldSpall + * + * Public: No + */ + +params ["_ammo"]; + +GVAR(shouldSpallCache) getOrDefaultCall [_ammo, { + (_ammo call FUNC(getSpallInfo)) params ["_caliber", "_explosive", "_indirectHit"]; + + _caliber >= 2.5 || (_explosive > 0 && _indirectHit >= 1) // return +}, true] diff --git a/addons/frag/functions/fnc_spallHP.sqf b/addons/frag/functions/fnc_spallHP.sqf deleted file mode 100644 index 367bea76449..00000000000 --- a/addons/frag/functions/fnc_spallHP.sqf +++ /dev/null @@ -1,42 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * Handles the HitPart event - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_spallHP - * - * Public: No - */ - -//player sideChat format ["f: %1 c: %2", (_this select 0), (count GVAR(spallHPData))]; - -params ["_index", "_hitPartData"]; - -private _initialData = GVAR(spallHPData) param [_index, []]; -if (_initialData isEqualTo []) exitWith {}; - -private _hpRound = (_hitPartData select 0) select 2; -private _round = _initialData select 3; -private _hpDirect = (_hitPartData select 0) select 10; - -if (_hpDirect && {_round == _hpRound}) then { - { - // diag_log text format ["HPDUMP-------------------------------------"]; - // { - // _hp = _x; - // diag_log text format ["%1 --", _forEachIndex]; - // { - // diag_log text format ["%1: %2", _forEachIndex, _x]; - // } forEach _hp; - // } forEach (_this select 1); - [DFUNC(doSpall), [_this, _forEachIndex]] call CBA_fnc_execNextFrame; - // player sideChat "WEEE"; - } forEach _hitPartData; -}; diff --git a/addons/frag/functions/fnc_spallTrack.sqf b/addons/frag/functions/fnc_spallTrack.sqf deleted file mode 100644 index 50ca64b6ec4..00000000000 --- a/addons/frag/functions/fnc_spallTrack.sqf +++ /dev/null @@ -1,39 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: ACE-Team - * Add HitPart EventHandler to objects in the projectile's path - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_frag_fnc_spallTrack - * - * Public: No - */ - -params ["_round", "_multiplier", "_foundObjects", "_foundObjectHPIds"]; - -private _delta = (1 / diag_fps) * _multiplier; -private _curPos = getPosASL _round; -private _velocity = velocity _round; - -private _velocityStep = _velocity vectorMultiply _delta; -private _forwardPos = _curPos vectorAdd _velocityStep; - - -private _intersectsWith = lineIntersectsWith [_curPos, _forwardPos]; - -if (_intersectsWith isEqualTo []) exitWith {}; -{ - // diag_log text format ["Adding HP: %1", _x]; - private _index = count GVAR(spallHPData); - private _hpId = _x addEventHandler ["HitPart", compile format ["[%1, _this] call " + QFUNC(spallHP), _index]]; - _foundObjects pushBack _x; - _foundObjectHPIds pushBack _hpId; - private _data = [_hpId, _x, typeOf _round, _round, _curPos, _velocity, 0, _foundObjects, _foundObjectHPIds]; - GVAR(spallHPData) pushBack _data; -} forEach (_intersectsWith select {!(_x in _foundObjects)}); diff --git a/addons/frag/initSettings.inc.sqf b/addons/frag/initSettings.inc.sqf index 421d5d45664..b05f3280dd2 100644 --- a/addons/frag/initSettings.inc.sqf +++ b/addons/frag/initSettings.inc.sqf @@ -22,19 +22,3 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; false, 1 ] call CBA_fnc_addSetting; - -[ - QGVAR(maxTrack), "SLIDER", - [LSTRING(MaxTrack), LSTRING(MaxTrack_Desc)], - _category, - [0, 50, 10, -1], - 1 -] call CBA_fnc_addSetting; - -[ - QGVAR(maxTrackPerFrame), "SLIDER", - [LSTRING(MaxTrackPerFrame), LSTRING(MaxTrackPerFrame_Desc)], - _category, - [0, 50, 10, -1], - 1 -] call CBA_fnc_addSetting; diff --git a/addons/frag/initSettingsDebug.inc.sqf b/addons/frag/initSettingsDebug.inc.sqf new file mode 100644 index 00000000000..a1528a446cf --- /dev/null +++ b/addons/frag/initSettingsDebug.inc.sqf @@ -0,0 +1,25 @@ +private _category = format ["ACE %1", LLSTRING(Module_DisplayName)]; + +[ + QGVAR(debugOptions), + "CHECKBOX", + [LSTRING(EnableDebugTrace), LSTRING(EnableDebugTrace_Desc)], + [_category, LSTRING(Debug)], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(dbgSphere), + "CHECKBOX", + [LSTRING(HitSphereEnable), LSTRING(HitSphereEnable_Desc)], + [_category, LSTRING(Debug)], + false +] call CBA_fnc_addSetting; + +[ + QGVAR(drawHitBox), + "CHECKBOX", + [LSTRING(DrawHitBox), LSTRING(DrawHitBox_Desc)], + [_category, LSTRING(Debug)], + true +] call CBA_fnc_addSetting; diff --git a/addons/frag/script_component.hpp b/addons/frag/script_component.hpp index 0215e9f4d74..bb2476f3c3c 100644 --- a/addons/frag/script_component.hpp +++ b/addons/frag/script_component.hpp @@ -2,13 +2,15 @@ #define COMPONENT_BEAUTIFIED Frag #include "\z\ace\addons\main\script_mod.hpp" -// #define DRAW_FRAG_INFO +// #define LOG_FRAG_INFO // #define DEBUG_MODE_FULL +// #define DEBUG_MODE_DRAW // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS #ifdef DEBUG_ENABLED_FRAG #define DEBUG_MODE_FULL + #define DEBUG_MODE_DRAW #endif #ifdef DEBUG_SETTINGS_FRAG @@ -17,4 +19,19 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define ACE_TRACE_DRAW_INC 1 +// Mimimum hold-off time between frag events per unit +#define ACE_FRAG_FRAG_UNIT_HOLDOFF 0.5 +#define ACE_FRAG_SPALL_UNIT_HOLDOFF 0.5 +// Scaling for the min/max # of fragments since last frag event +#define ACE_FRAG_COUNT_MIN_TIME 0.1 +#define ACE_FRAG_COUNT_MIN 5 +#define ACE_FRAG_COUNT_MAX_TIME 1.5 +#define ACE_FRAG_COUNT_MAX 50 +#define ACE_FRAG_IMPERIC_VELOCITY_CONSTANT 0.8 +#define ACE_FRAG_DEFAULT_FRAG_TYPES [\ + QGVAR(tiny), QGVAR(tiny), QGVAR(tiny),\ + QGVAR(tiny_HD), QGVAR(tiny_HD), QGVAR(tiny_HD),\ + QGVAR(small), QGVAR(small), QGVAR(small), QGVAR(small),\ + QGVAR(small_HD), QGVAR(small_HD), QGVAR(small_HD), QGVAR(small_HD),\ + QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD)\ +] diff --git a/addons/frag/stringtable.xml b/addons/frag/stringtable.xml index f88877448d8..8da69da0867 100644 --- a/addons/frag/stringtable.xml +++ b/addons/frag/stringtable.xml @@ -111,101 +111,28 @@ 啟用ACE模擬爆炸反射 Povolit ACE simulaci odrazu exploze - - Maximum Projectiles Tracked - Máximos proyectiles rastreados - Maks. liczba śledzonych pocisków - Maximalzahl der verfolgten Projektile - Maximální počet sledovaných projektilů - Máximo de projéteis rastreados - Nombre maximum de projectiles suivis - Maximum követett repeszek - Макс. количество отслеживаемых снарядов - Numero massimo di Proiettili Tracciati - 飛翔体最大追跡数 - 최대 발사체 추적수 - 最大破片粒子追踪数量 - 最大碎片/剝落粒子追蹤數量 + + Debug - - 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) - Este ajuste controla la cantidad máxima de proyectiles del sistema de fragmentación y astillamiento de los que se hará un seguimiento en cualquier momento dado. Si se disparan más proyectiles, no serán rastreados. Baja esta opción si no deseas una bajada de FPS en escenarios con muchos proyectiles (>200 proyectiles en el aire a la vez) - To ustawienie kontroluje maksymalną ilość pocisków, jakie fragmentacja i odpryski symulują w danym momencie. Jeżeli więcej pocisków będzie wystrzelonych, wtedy nie będą one śledzone. Zmniejsz tą opcję jeżeli nie chcesz odczuwać spadków FPS podczas ciężkiej wymiany ognia (więcej niż 200 pocisków w powietrzu na raz). - 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) - Ce paramètre contrôle le nombre maximum de projectiles et d'éclats résultant de la fragmentation, que le système peut suivre à chaque instant.\nSi plus de projectiles sont générés, ils ne seront pas pris en compte. Baissez ce réglage si vous ne voulez pas de chute de FPS en cas de nombre important de projectiles (>200 éclats en même temps). - 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) - Эта настройка контролирует максимальное количество снарядов, которок отслеживает система осколков и обломков в каждый момент времени. /nСнаряды, выстреленные сверх этого числа, отслеживаться не будут. Уменьшите это значение, если вы не хотите падения FPS при большом количестве снарядов в одной перестрелке (> 200 одновременно летящих снарядов) - Questo parametro controlla il numero massimo di proiettili che la frammentazione e il sistema di spalling tracciano in ogni momento. Se vengono sparati ulteriori proiettili, non verranno tracciati. Abbassa questo parametro se non vuoi cali di FPS in scenari con molti proiettili (>200 proiettili in aria contemporaneamente) - この設定では、断片化および剥離システムが常に追跡する飛翔体の最大量を制御します。 この値より多くの飛翔体が発射された場合、それらは追跡されません。 弾数が多いシナリオでFPSを低下させたくない場合は、この設定を下げてください。 (一度に200発以上が空中に発射されます) - 이 설정은 탄환파편 및 파편 시스템으로 인해 생긴 발사체의 수를 결정합니다. 만약 더 많은 발사체가 나올 경우 정해진 수 이외에는 추적하지 않습니다. 이 설정을 낮춤으로써 파편이 많은 시나리오를 실행할때 더욱 원활히 진행할 수 있습니다 (한 번에 200개 이하) - 设定在指定时间内,系统最大可追踪的破片粒子数量。如有更多的碎片在这之后产生,这些粒子将不会被追踪。如果你想要维持好的帧数,此设定勿调的过高。( >一次200颗粒子) - 設定在指定時間內,系統最大可追蹤的碎片/剝落粒子數量。如有更多的碎片在這之後產生,這些粒子將不會被追蹤。如果你想要維持好的幀數,此設定勿調的過高。( >一次200顆粒子) + + Frag/Spall Debug Tracing + Splitter-/Explosions-Debug-Verfolgung - - Maximum Projectiles Per Frame - Máximos proyectiles por cuadro - Maximale Anzahl an Projektilen pro Frame - Maks. liczba pocisków na klatkę - Maximální počet projektilů za jeden snímek - Projéteis máximos por quadro - Nombre maximal de projectiles par image - Maximum repesz/képkocka - Макс. количество снарядов за кадр - Numero massimo di proiettili per Frame - フレームごとの飛翔体最大数 - 프레임 당 최대 발사체 수 - 每帧最大破片粒子数量 - 每一幀數(FPS)最大碎片/剝落粒子數量 + + Enables visual tracing of fragmentation and spalling rounds. + Splitter-/Explosions-Debugging - - 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. - Ilość obliczeń wykonywanych przez symulację odprysków w danej klatce. Ta opcja pomaga rozprzestrzenić obliczenia odprysków na więcej klatek, zmniejszając spadek FPS jeszcze bardziej. - Gibt die Anzahl der Explosionverfolgungsberechnungen an, die gleichzeitig ausgeführt werden. Das kann dabei helfen den FPS-Einfluss abzuschwächen, wenn Teile über mehrere Frames hinweg verfolgt werden. - 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. - Le nombre de calculs de suivi à effectuer pour chaque image. Cela aide à répartir l'impact des calculs sur plusieurs images, limitant ainsi encore davantage l'impact sur les FPS. - 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. - Число обрабатываемых осколков за кадр. Это позволяет распределить нагрузку по отслеживанию осколков между несколькими кадрами, чтобы предотвратить падение FPS. - Il numero di calcoli per tracciamento di spalling ad ogni frame. Questo aiuta a distribuire l'impatto del tracciamento dello spalling su più frame, riducendolo ulteriormente. - 任意のフレームごとに追跡される剥離飛翔体の数。剥離による飛翔体を追跡することによるFPSへの影響を複数フレームに分散させ抑えることが出来ます。 - 가능한 프레임마다 파편을 추적 및 계산합니다. 여러 프레임에 걸쳐 파편난 발사체를 추적하여 FPS에 도움을 줍니다. 이를 제한함으로써 더욱 큰 효과를 볼 수 있습니다. - 设定在每一帧数内,系统最大可追踪的破片粒子数量。此设定可有效帮助系统减低计算压力。 - 設定在每一幀數內,系統最大可追蹤的碎片/剝落粒子數量。此設定可有效幫助系統減低計算壓力 + + Draw Event Spheres - - (SP Only) Frag/Spall Debug Tracing - (Solo SP) Seguimiento de depuración de Fragmentación/Astillamiento - (Tylko SP) Wizualny debug odł./odpr. - (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 - (SP uniquement) Fragmentation/éclat debug - (Csak SP) Repesz/Pattogzás debug követés - (Только для одиночной игры) Отслеживаение/отладка осколков - (Solo SP) Debug Tracciamento Frag/Spall - (SP のみ) 破片/剥離のデバッグ用表示 - (싱글플레이 전용) 탄환파편/파편 디버그 추적화 - (仅单人)追踪显示破片粒子 - (僅在單人模式) 碎片/剝落除錯追蹤 + + Draw color coded spheres at any event for tracked rounds. - - (SP Only) Requires a mission/editor restart. Enables visual tracing of fragmentation and spalling rounds in SP game mode only. - (Solo SP) Requiere un reinicio misión/editor. Permite el seguimiento visual de la fragmentación y astillamientos de los proyectiles en modo SP. - (Tylko SP) Wymaga restartu misji/edytora. Aktywuje wizualne śledzenie odłamków oraz odprysków w trybie gry Single Player. - (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. - (SP seulement) Requiert un redémarrage de mission ou de l'éditeur. Active les traceurs visuels de fragmentation et d'éclats en mode solo seulement. - (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. - (Только для одиночной игры) Требует перезапуска миссии/редактора. Включает визуальные следы от осколков и обломков в режиме одиночной игры. - (Solo SP) Richiede un restart editor/missione. Abilita il tracciamento visivo di schegge da frammentazione/spalling in modalità Giocatore Singolo. - (SP のみ) ミッションとエディタの再起動が必要です。有効化すると、シングルプレイでのみ破片と剥離の飛翔体が見えるようになります。 - (仅单人)激活后,只有在单人模式下才可观察到破片粒子的移动轨迹。 - (僅在單人模式) 讓你在單人模式下可觀察到碎片/剝落粒子的移動軌跡 - (SP 전용) 임무 / 편집자가 다시 시작해야합니다. SP 게임 모드에서만 파편화 및 탄환파편의 시각적 추적을 가능하게 합니다. + + Draw Hitboxes + + + Draw hitboxes on objects that were targeted. diff --git a/addons/goggles/define.hpp b/addons/goggles/define.hpp index 81d3fcb6896..4e641b692c4 100644 --- a/addons/goggles/define.hpp +++ b/addons/goggles/define.hpp @@ -18,8 +18,8 @@ class RscPicture { fixedWidth = 0; shadow = 0; text = ""; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; + x = "safeZoneX"; + y = "safeZoneY"; + w = "safeZoneW"; + h = "safeZoneH"; }; diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirtEffect.sqf index 38fc57f0ce6..a246f1293fc 100644 --- a/addons/goggles/functions/fnc_applyDirtEffect.sqf +++ b/addons/goggles/functions/fnc_applyDirtEffect.sqf @@ -33,6 +33,7 @@ if ([_unit] call FUNC(isGogglesVisible)) then { private _effectBrightness = linearConversion [0,1,([] call EFUNC(common,ambientBrightness)),0.25,1]; (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetTextColor [_effectBrightness, _effectBrightness, _effectBrightness, 1]; + [QGVAR(effect), [_unit, "dirt"]] call CBA_fnc_localEvent; TRACE_1("dirt",_effectBrightness); }; }; diff --git a/addons/goggles/functions/fnc_applyDustEffect.sqf b/addons/goggles/functions/fnc_applyDustEffect.sqf index 93bcbad1d6b..210a488df65 100644 --- a/addons/goggles/functions/fnc_applyDustEffect.sqf +++ b/addons/goggles/functions/fnc_applyDustEffect.sqf @@ -68,6 +68,7 @@ GVAR(DustHandler) = [{ GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [1, 1, 1, 1], [1, 1, 1, 0]]; GVAR(PostProcessEyes) ppEffectCommit 2; + [QGVAR(effect), [_unit, "dust"]] call CBA_fnc_localEvent; [{ if (GVAR(DustHandler) == -1) then { diff --git a/addons/goggles/functions/fnc_applyRainEffect.sqf b/addons/goggles/functions/fnc_applyRainEffect.sqf index 0058209acd6..bf1d6fd04aa 100644 --- a/addons/goggles/functions/fnc_applyRainEffect.sqf +++ b/addons/goggles/functions/fnc_applyRainEffect.sqf @@ -52,6 +52,7 @@ if (GVAR(RainLastLevel) != rain) then { GVAR(RainDrops) setParticleClass "ACERainEffect"; GVAR(RainDrops) setDropInterval (0.07 * (1.1 - GVAR(RainLastLevel))); GVAR(RainDrops) attachTo [vehicle _unit, [0,0,0]]; + [QGVAR(effect), [_unit, "rain"]] call CBA_fnc_localEvent; }; } else { if (GVAR(RainLastLevel) > 0.05) then { diff --git a/addons/goggles/functions/fnc_applyRotorWashEffect.sqf b/addons/goggles/functions/fnc_applyRotorWashEffect.sqf index 85b7e60934d..b2369d15107 100644 --- a/addons/goggles/functions/fnc_applyRotorWashEffect.sqf +++ b/addons/goggles/functions/fnc_applyRotorWashEffect.sqf @@ -64,18 +64,18 @@ if !(_safe) then { if !([_unit] call FUNC(isGogglesVisible)) exitWith {}; if (GETDUSTT(DAMOUNT) < 2) then { - if !(GETDUSTT(DACTIVE)) then { - SETDUST(DACTIVE,true); - - call FUNC(applyDustEffect); - } else { + if (GETDUSTT(DACTIVE)) then { if (_rotorWash select 1 > 0.5) then { call FUNC(applyDustEffect); }; + } else { + SETDUST(DACTIVE,true); + + call FUNC(applyDustEffect); }; }; - _safe = getNumber (ConfigFile >> "CfgGlasses" >> goggles _unit >> "ACE_Protection") == 1; + _safe = getNumber (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_Protection") == 1; }; // quit if protected by goggles or helmet @@ -101,5 +101,6 @@ if (_rotorWash select 1 > 0) then { GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [_scale, _scale, _scale, _scale], [1, 1, 1, 0]]; GVAR(PostProcessEyes) ppEffectCommit 0.5; GVAR(PostProcessEyes) ppEffectEnable true; + [QGVAR(effect), [_unit, "rotorWash"]] call CBA_fnc_localEvent; }; }; diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index 33c4bdffc21..ef5d6bc4a7d 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -20,7 +20,7 @@ TRACE_1("params",_grenadePosASL); // Affect local AI (players are not local, except for ACE_player) // @todo: Affect units in static weapons, turned out, etc -private _affected = ((ASLtoAGL _grenadePosASL) nearEntities ["CAManBase", 20]) - [ACE_player]; +private _affected = ((ASLToAGL _grenadePosASL) nearEntities ["CAManBase", 20]) - [ACE_player]; { private _unit = _x; @@ -69,7 +69,7 @@ private _affected = ((ASLtoAGL _grenadePosASL) nearEntities ["CAManBase", 20]) - if (!hasInterface) exitWith {}; // Create flash to illuminate environment -private _light = "#lightpoint" createVehicleLocal ASLtoAGL _grenadePosASL; +private _light = "#lightpoint" createVehicleLocal ASLToAGL _grenadePosASL; _light setPosASL _grenadePosASL; _light setLightBrightness 20; @@ -122,7 +122,7 @@ _strength = 1 - (((_eyePos vectorDistance _grenadePosASL) min 25) / 25) ^ 0.4; _strength = _strength * _losCoefficient; // Account for people looking away by slightly reducing the effect for visual effects. -private _eyeDir = ((AGLtoASL positionCameraToWorld [0, 0, 1]) vectorDiff (AGLtoASL positionCameraToWorld [0, 0, 0])); +private _eyeDir = ((AGLToASL positionCameraToWorld [0, 0, 1]) vectorDiff (AGLToASL positionCameraToWorld [0, 0, 0])); private _dirToUnitVector = _eyePos vectorFromTo _grenadePosASL; private _angleDiff = acos (_eyeDir vectorDotProduct _dirToUnitVector); TRACE_2("",_angleDiff,((1 - (_angleDiff - 45) / (120 - 45)) max 0)); diff --git a/addons/gunbag/functions/fnc_calculateMass.sqf b/addons/gunbag/functions/fnc_calculateMass.sqf index 6dd6a5a660d..b614d95f587 100644 --- a/addons/gunbag/functions/fnc_calculateMass.sqf +++ b/addons/gunbag/functions/fnc_calculateMass.sqf @@ -23,7 +23,7 @@ private _mass = getNumber (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlots { _mass = _mass + getNumber (configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "mass"); -} foreach _items; +} forEach _items; { _mass = _mass + getNumber (configFile >> "CfgMagazines" >> _x >> "mass"); diff --git a/addons/hearing/XEH_postInit.sqf b/addons/hearing/XEH_postInit.sqf index 93a86f73497..f9fb2043334 100644 --- a/addons/hearing/XEH_postInit.sqf +++ b/addons/hearing/XEH_postInit.sqf @@ -16,16 +16,19 @@ if (isServer) then { // Only install event handler if combat deafness is enabled if (!GVAR(enableCombatDeafness)) exitWith {}; - addMissionEventHandler ["ProjectileCreated", { - params ["_projectile"]; - - if (!local _projectile) exitWith {}; - - // Rockets only explode on local clients - _projectile addEventHandler ["Explode", { - [QGVAR(explosion), _this] call CBA_fnc_globalEvent; - }]; - }]; + [{ // Convert ace_common's local explosion to a hearing global explosion event + params ["_projectile", "_pos"]; + TRACE_1("Explode",_this); + + // If projectile is local only, don't raise event globally + // TODO: netId always returns valid after 2.18 + // use _projectile getShotInfo 5 (https://community.bistudio.com/wiki/getShotInfo) + if (isMultiplayer && {(netId _projectile) == "0:0"}) then { + [QGVAR(explosion), [_projectile, _pos]] call CBA_fnc_localEvent; + } else { + [QGVAR(explosion), [_projectile, _pos]] call CBA_fnc_globalEvent; + }; + }] call EFUNC(common,addExplosionEventHandler); }] call CBA_fnc_addEventHandler; if (!hasInterface) exitWith {}; diff --git a/addons/hearing/functions/fnc_explosion.sqf b/addons/hearing/functions/fnc_explosion.sqf index 159f6660114..b5a6f14a69c 100644 --- a/addons/hearing/functions/fnc_explosion.sqf +++ b/addons/hearing/functions/fnc_explosion.sqf @@ -6,13 +6,12 @@ * Arguments: * 0: Projectile * 1: Explosion position ASL - * 2: Velocity (unused) * * Return Value: * None * * Example: - * [_projectile, [0, 0, 0], [0, 0, 0]] call ace_hearing_fnc_explosion + * [_projectile, [0, 0, 0]] call ace_hearing_fnc_explosion * * Public: No */ diff --git a/addons/hellfire/CfgAmmo.hpp b/addons/hellfire/CfgAmmo.hpp index 02346deac3d..8789be711ce 100644 --- a/addons/hellfire/CfgAmmo.hpp +++ b/addons/hellfire/CfgAmmo.hpp @@ -1,3 +1,4 @@ +class ace_missileguidance_type_Hellfire; class CfgAmmo { class M_Scalpel_AT; @@ -23,47 +24,8 @@ class CfgAmmo { EGVAR(rearm,caliber) = 178; - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance_type_Hellfire { enabled = 1; - - pitchRate = 30; // degrees per second - yawRate = 30; - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "SALH"; - seekerTypes[] = { "SALH", "LIDAR", "SARH", "Optic", "Thermal", "GPS", "SACLOS", "MCLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Direct"; - navigationTypes[] = { "Direct", "ZeroEffortMiss" }; - - seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 70; // Angle in front of the missile which can be searched - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 1; - seekerMaxRange = 8000; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "hellfire"; - attackProfiles[] = {"hellfire", "hellfire_hi", "hellfire_lo"}; - - class navigationStates { - class initial { - transitionCondition = QFUNC(midCourseTransition); - navigationType = "Direct"; - }; - class terminal { - transitionCondition = ""; - navigationType = "ZeroEffortMiss"; - }; - // transitions from initial -> termimal - states[] = {"initial", "terminal"}; - }; }; }; class ACE_Hellfire_AGM114N: ACE_Hellfire_AGM114K { diff --git a/addons/hellfire/functions/fnc_attackProfile.sqf b/addons/hellfire/functions/fnc_attackProfile.sqf index 221d99e7ae2..aa457d02fa5 100644 --- a/addons/hellfire/functions/fnc_attackProfile.sqf +++ b/addons/hellfire/functions/fnc_attackProfile.sqf @@ -32,7 +32,7 @@ if (_attackProfileStateParams isEqualTo []) then { _attackProfileStateParams params ["_attackStage", "_configLaunchHeightClear", "_missileStateData"]; private _projectilePos = getPosASL _projectile; -private _distanceFromLaunch2d = _launchPos distance2d _projectilePos; +private _distanceFromLaunch2d = _launchPos distance2D _projectilePos; private _heightAboveLaunch = (_projectilePos select 2) - (_launchPos select 2); // Add height depending on distance for compensate @@ -45,7 +45,7 @@ if (_returnTargetPos isEqualTo [0, 0, 0]) then { private _closingRate = vectorMagnitude velocity _projectile; // subtract 500 meters to account for the fact that we don't want to be at the perfect pitch exactly when we cross the target // 500 seemed good in testing -private _timeToGo = ((_projectilePos distance2d _seekerTargetPos) - 500) / _closingRate; +private _timeToGo = ((_projectilePos distance2D _seekerTargetPos) - 500) / _closingRate; // we could do stuff like desired attack angle, but I'm not going that far today private _los = _projectilePos vectorFromTo _seekerTargetPos; @@ -64,14 +64,14 @@ switch (_attackStage) do { if (_heightAboveLaunch > _configLaunchHeightClear) then { _attackProfileStateParams set [0, STAGE_SEEK_CRUISE]; - _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2d _projectilePos]]; + _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2D _projectilePos]]; TRACE_2("New Stage: STAGE_SEEK_CRUISE",_distanceFromLaunch2d,_heightAboveLaunch); }; if (_atMinRotationAngle) then { _attackProfileStateParams set [0, STAGE_ATTACK_TERMINAL]; - _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2d _projectilePos]]; + _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2D _projectilePos]]; TRACE_2("New Stage: STAGE_ATTACK_TERMINAL",_distanceToTarget2d,_currentHeightOverTarget); }; }; @@ -84,7 +84,7 @@ switch (_attackStage) do { if (_seekerTargetPos isNotEqualTo [0,0,0]) then { _attackProfileStateParams set [0, STAGE_ATTACK_CRUISE]; - _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2d _projectilePos]]; + _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2D _projectilePos]]; TRACE_1("New Stage: STAGE_ATTACK_CRUISE",_distanceFromLaunch2d); }; }; @@ -92,7 +92,7 @@ switch (_attackStage) do { _missileStateData params ["_heightBeforeStateSwitch", "_initialDistanceToTarget"]; private _currentHeightOverTarget = (_projectilePos select 2) - (_seekerTargetPos select 2); - private _distanceToTarget2d = _seekerTargetPos distance2d _projectilePos; + private _distanceToTarget2d = _seekerTargetPos distance2D _projectilePos; _returnTargetPos set [2, _heightBeforeStateSwitch + (_initialDistanceToTarget * sin 7)]; @@ -100,7 +100,7 @@ switch (_attackStage) do { if (_atMinRotationAngle || {(_currentHeightOverTarget atan2 _distanceToTarget2d) > 15}) then { // Wait until we can come down at a sharp angle _attackProfileStateParams set [0, STAGE_ATTACK_TERMINAL]; - _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2d _projectilePos]]; + _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2D _projectilePos]]; TRACE_2("New Stage: STAGE_ATTACK_TERMINAL",_distanceToTarget2d,_currentHeightOverTarget); }; }; diff --git a/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf b/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf index b032c44d233..d9e1c23b205 100644 --- a/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf +++ b/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf @@ -44,7 +44,7 @@ _attackProfileStateParams set [0, _startingStage]; _attackProfileStateParams set [1, _configLaunchHeightClear]; _attackProfileStateParams set [2, [ _projectilePos select 2, - _seekerTargetPos distance2d _projectilePos + _seekerTargetPos distance2D _projectilePos ]]; TRACE_1("new shot settings",_attackProfileStateParams); diff --git a/addons/hellfire/functions/fnc_midCourseTransition.sqf b/addons/hellfire/functions/fnc_midCourseTransition.sqf index ee567734103..034bd25d61a 100644 --- a/addons/hellfire/functions/fnc_midCourseTransition.sqf +++ b/addons/hellfire/functions/fnc_midCourseTransition.sqf @@ -15,6 +15,7 @@ * Public: No */ +params ["_args", "_timestep"]; _args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams", "_targetData", "_navigationStateData"]; _firedEH params ["_shooter","","","","_ammo","","_projectile"]; _launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo","_navigationType"]; diff --git a/addons/hot/CfgAmmo.hpp b/addons/hot/CfgAmmo.hpp index c5978b6d923..6f91d241fb9 100644 --- a/addons/hot/CfgAmmo.hpp +++ b/addons/hot/CfgAmmo.hpp @@ -1,3 +1,4 @@ +class ace_missileguidance_type_Hot; class CfgAmmo { class M_Scalpel_AT; class ammo_Penetrator_Base; @@ -55,43 +56,8 @@ class CfgAmmo { EGVAR(rearm,caliber) = 178; EGVAR(vehicle_damage,incendiary) = 1.0; - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance_type_Hot { enabled = 1; - - pitchRate = 45; // Minium flap deflection for guidance - yawRate = 45; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 7; - lineGainD = 6; - - initialPitch = 2; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 4000; // Range from the missile which the seeker can visually search - - offsetFromCrosshair[] = { 0, 0, 0.5 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "WIRE"; - attackProfiles[] = {"WIRE"}; }; }; @@ -143,6 +109,7 @@ class CfgAmmo { class ace_missileguidance: ace_missileguidance { enabled = 1; seekerMaxRange = 4300; + offsetFromCrosshair[] = { 0, 0, 0.5 }; // where the missile wants to stay in relation to the center of the crosshair. }; }; }; diff --git a/addons/huntir/functions/fnc_cam.sqf b/addons/huntir/functions/fnc_cam.sqf index 65542c66e87..4a80a4819e9 100644 --- a/addons/huntir/functions/fnc_cam.sqf +++ b/addons/huntir/functions/fnc_cam.sqf @@ -31,10 +31,10 @@ GVAR(ELEVAT) = 0.01; HUNTIR_BACKGROUND_LAYER_ID cutText["","PLAIN"]; -closedialog 0; +closeDialog 0; createDialog QGVAR(cam_dialog); -uiNameSpace setVariable [QGVAR(monitor), findDisplay 18880]; -(uiNameSpace getVariable QGVAR(monitor)) displaySetEventHandler ["Keydown", QUOTE(_this call FUNC(keyPressed))]; +uiNamespace setVariable [QGVAR(monitor), findDisplay 18880]; +(uiNamespace getVariable QGVAR(monitor)) displaySetEventHandler ["Keydown", QUOTE(_this call FUNC(keyPressed))]; ctrlSetText [4, "0X"]; @@ -68,7 +68,7 @@ GVAR(no_cams) sort true; } forEach GVAR(no_cams); [{ //Close monitor if we no longer have the item: - if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNameSpace getVariable [QGVAR(monitor), displayNull])}) then { + if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNamespace getVariable [QGVAR(monitor), displayNull])}) then { closeDialog 0; [QGVAR(monitorClosed), [ACE_player]] call CBA_fnc_localEvent; }; @@ -105,11 +105,11 @@ GVAR(no_cams) sort true; GVAR(NV) = 0; setAperture -1; - closedialog 0; - titletext [" ", "BLACK IN", 4]; + closeDialog 0; + titleText [" ", "BLACK IN", 4]; ACE_player switchCamera "INTERNAL"; - GVAR(cam) CameraEffect ["Terminate", "Back"]; - CamDestroy GVAR(cam); + GVAR(cam) cameraEffect ["Terminate", "Back"]; + camDestroy GVAR(cam); deleteVehicle GVAR(logic); if (player != ACE_player) then { player remoteControl ACE_player; @@ -119,19 +119,19 @@ GVAR(no_cams) sort true; switch (GVAR(ZOOM)) do { case 0: { - GVAR(cam) camsetFOV 0.7; + GVAR(cam) camSetFov 0.7; GVAR(cam) camSetFocus [GVAR(pos) select 2, 1]; }; case 1: { - GVAR(cam) camsetFOV 0.35; + GVAR(cam) camSetFov 0.35; GVAR(cam) camSetFocus [(GVAR(pos) select 2)/2, 1]; }; case 2: { - GVAR(cam) camsetFOV 0.17; + GVAR(cam) camSetFov 0.17; GVAR(cam) camSetFocus [(GVAR(pos) select 2)/4, 1]; }; case 3: { - GVAR(cam) camsetFOV 0.1; + GVAR(cam) camSetFov 0.1; GVAR(cam) camSetFocus [(GVAR(pos) select 2)/8, 1]; }; }; @@ -139,7 +139,7 @@ GVAR(no_cams) sort true; GVAR(logic) setPosATL (GVAR(pos) vectorAdd [0, 0, -5]); GVAR(logic) setDir GVAR(ROTATE); GVAR(logic) setVectorUp [0.0001, 0.0001, 1]; - GVAR(cam) CameraEffect ["internal", "BACK"]; + GVAR(cam) cameraEffect ["internal", "BACK"]; private _cam_coord_y = GVAR(ELEVAT) * cos(GVAR(ROTATE)); private _cam_coord_x = GVAR(ELEVAT) * sin(GVAR(ROTATE)); GVAR(cam) camSetRelPos [_cam_coord_x, _cam_coord_y, 2]; diff --git a/addons/huntir/functions/fnc_huntir.sqf b/addons/huntir/functions/fnc_huntir.sqf index efb9e139d12..c54d193d9e3 100644 --- a/addons/huntir/functions/fnc_huntir.sqf +++ b/addons/huntir/functions/fnc_huntir.sqf @@ -34,7 +34,7 @@ createDialog QGVAR(cam_dialog_off); }; closeDialog 0; createDialog QGVAR(cam_dialog_inactive); - uiNameSpace setVariable [QGVAR(monitor), findDisplay 18881]; + uiNamespace setVariable [QGVAR(monitor), findDisplay 18881]; [{ GVAR(startTime) = CBA_missionTime; GVAR(done) = false; @@ -46,7 +46,7 @@ createDialog QGVAR(cam_dialog_off); [QGVAR(monitorStarted), [ACE_player]] call CBA_fnc_localEvent; [{ //Close monitor if we no longer have item: - if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNameSpace getVariable [QGVAR(monitor), displayNull])}) then { + if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNamespace getVariable [QGVAR(monitor), displayNull])}) then { closeDialog 0; [QGVAR(monitorClosed), [ACE_player]] call CBA_fnc_localEvent; }; @@ -108,7 +108,7 @@ createDialog QGVAR(cam_dialog_off); ctrlSetText [1, "No GDS System detected"]; [{ GVAR(done) = true; - closedialog 0; + closeDialog 0; HUNTIR_BACKGROUND_LAYER_ID cutText ["", "PLAIN"]; [QGVAR(monitorClosed), [ACE_player]] call CBA_fnc_localEvent; }, [], 3, 0] call CBA_fnc_waitAndExecute; diff --git a/addons/interact_menu/CursorMenus.hpp b/addons/interact_menu/CursorMenus.hpp index 79f1109598c..82cb9e79e66 100644 --- a/addons/interact_menu/CursorMenus.hpp +++ b/addons/interact_menu/CursorMenus.hpp @@ -28,10 +28,10 @@ class RscTitles { size = 1; colorBackground[] = {0, 0, 0, 0.65}; colorText[] = {0, 0, 0, 0}; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; + x = "safeZoneX"; + y = "safeZoneY"; + w = "safeZoneW"; + h = "safeZoneH"; }; }; }; diff --git a/addons/interact_menu/functions/fnc_addActionToClass.sqf b/addons/interact_menu/functions/fnc_addActionToClass.sqf index 91197d02d92..d2167c8079c 100644 --- a/addons/interact_menu/functions/fnc_addActionToClass.sqf +++ b/addons/interact_menu/functions/fnc_addActionToClass.sqf @@ -30,7 +30,7 @@ private _useInheritance = _this param [4, false, [false]]; private _excludedClasses = _this param [5, [], [[]]]; TRACE_6("addActionToClass",_objectType,_typeNum,_parentPath,_action,_useInheritance,_excludedClasses); -if (_useInheritance) exitwith { +if (_useInheritance) exitWith { BEGIN_COUNTER(addAction); private _cfgVehicles = configFile >> "CfgVehicles"; // store this so we don't resolve for every element _excludedClasses = (_excludedClasses apply {configName (_cfgVehicles >> _x)}) - [""]; // ends up being faster than toLower'ing everything else diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 2ae39bff26b..d87f6cfa3ba 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -84,8 +84,8 @@ if (GVAR(useCursorMenu)) then { } else { createDialog QGVAR(cursorMenu); }; - (finddisplay 91919) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}]; - (finddisplay 91919) displayAddEventHandler ["KeyDown", { + (findDisplay 91919) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}]; + (findDisplay 91919) displayAddEventHandler ["KeyDown", { // Handle the escape key being pressed with menu open: if ((_this select [1,4]) isEqualTo [1,false,false,false]) exitWith { // escape key with no modifiers [displayNull] call FUNC(handleEscapeMenu); @@ -102,8 +102,8 @@ if (GVAR(useCursorMenu)) then { _ctrl ctrlCommit 0; // handles Mouse moving and LMB in cursor mode when action on keyrelease is disabled - ((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; - ((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; + ((findDisplay 91919) displayCtrl 9922) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; + ((findDisplay 91919) displayCtrl 9922) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; setMousePosition [0.5, 0.5]; } else { if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then { @@ -111,18 +111,12 @@ if (GVAR(useCursorMenu)) then { }; }; -GVAR(selfMenuOffset) = (AGLtoASL (positionCameraToWorld [0, 0, 2])) vectorDiff (AGLtoASL (positionCameraToWorld [0, 0, 0])); +GVAR(selfMenuOffset) = (AGLToASL (positionCameraToWorld [0, 0, 2])) vectorDiff (AGLToASL (positionCameraToWorld [0, 0, 0])); //Auto expand the first level when self, mounted vehicle or zeus (skips the first animation as there is only one choice) if (GVAR(openedMenuType) == 0) then { if (isNull curatorCamera) then { - if !(isNull (ACE_controlledUAV select 0)) then { - GVAR(menuDepthPath) = [["ACE_SelfActions", (ACE_controlledUAV select 0)]]; - GVAR(expanded) = true; - GVAR(expandedTime) = diag_tickTime; - GVAR(lastPath) = +GVAR(menuDepthPath); - GVAR(startHoverTime) = -1000; - } else { + if (isNull (ACE_controlledUAV select 0)) then { if (vehicle ACE_player != ACE_player) then { GVAR(menuDepthPath) = [["ACE_SelfActions", (vehicle ACE_player)]]; GVAR(expanded) = true; @@ -130,6 +124,12 @@ if (GVAR(openedMenuType) == 0) then { GVAR(lastPath) = +GVAR(menuDepthPath); GVAR(startHoverTime) = -1000; }; + } else { + GVAR(menuDepthPath) = [["ACE_SelfActions", (ACE_controlledUAV select 0)]]; + GVAR(expanded) = true; + GVAR(expandedTime) = diag_tickTime; + GVAR(lastPath) = +GVAR(menuDepthPath); + GVAR(startHoverTime) = -1000; }; } else { GVAR(menuDepthPath) = [["ACE_ZeusActions", (getAssignedCuratorLogic player)]]; diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index e4ee0d63575..2089f6b1060 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -38,7 +38,7 @@ if (GVAR(openedMenuType) >= 0) then { private _closestSelection = -1; { _x params ["", "_sPos"]; - private _distanceFromCursor = _cursorScreenPos distance2d _sPos; + private _distanceFromCursor = _cursorScreenPos distance2D _sPos; if ((_distanceFromCursor < 0.1118) && {_distanceFromCursor < _closestDistance}) then { _closestDistance = _distanceFromCursor; _closestSelection = _forEachIndex; diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 62d29be91f4..502e4de6f94 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -19,8 +19,8 @@ GVAR(currentOptions) = []; private _player = ACE_player; -GVAR(cameraPosASL) = AGLtoASL (positionCameraToWorld [0, 0, 0]); -GVAR(cameraDir) = (AGLtoASL (positionCameraToWorld [0, 0, 1])) vectorDiff GVAR(cameraPosASL); +GVAR(cameraPosASL) = AGLToASL (positionCameraToWorld [0, 0, 0]); +GVAR(cameraDir) = (AGLToASL (positionCameraToWorld [0, 0, 1])) vectorDiff GVAR(cameraPosASL); private _fnc_renderNearbyActions = { // Render all nearby interaction menus @@ -97,11 +97,11 @@ private _fnc_renderSelfActions = { // Iterate through base level class actions and render them if appropiate private _classActions = GVAR(ActSelfNamespace) get typeOf _target; - private _pos = if !(GVAR(useCursorMenu)) then { - //Convert to ASL, add offset and then convert back to AGL (handles waves when over water) - ASLtoAGL ((AGLtoASL (positionCameraToWorld [0, 0, 0])) vectorAdd GVAR(selfMenuOffset)); - } else { + private _pos = if (GVAR(useCursorMenu)) then { [0.5, 0.5] + } else { + //Convert to ASL, add offset and then convert back to AGL (handles waves when over water) + ASLToAGL ((AGLToASL (positionCameraToWorld [0, 0, 0])) vectorAdd GVAR(selfMenuOffset)); }; { @@ -123,10 +123,7 @@ GVAR(collectedActionPoints) resize 0; // Render nearby actions, unit self actions or vehicle self actions as appropiate if (GVAR(openedMenuType) == 0) then { if (isNull curatorCamera) then { - if !(isNull (ACE_controlledUAV select 0)) then { - // Render UAV self actions when in control of UAV AI - (ACE_controlledUAV select 0) call _fnc_renderSelfActions; - } else { + if (isNull (ACE_controlledUAV select 0)) then { if (vehicle ACE_player == ACE_player) then { if (diag_tickTime > GVAR(lastTimeSearchedActions) + 0.20) then { // Once every 0.2 secs, collect nearby objects active and visible action points and render them @@ -139,6 +136,10 @@ if (GVAR(openedMenuType) == 0) then { // Render vehicle self actions when in vehicle (vehicle ACE_player) call _fnc_renderSelfActions; }; + } else { + // Render UAV self actions when in control of UAV AI + (ACE_controlledUAV select 0) call _fnc_renderSelfActions; + }; } else { // Render zeus actions when zeus open @@ -160,7 +161,7 @@ if (count GVAR(collectedActionPoints) > 1) then { private _delta = vectorNormalized ((GVAR(collectedActionPoints) select _i select 1) vectorDiff (GVAR(collectedActionPoints) select _j select 1)); // If _i is inside a cone with 20º half angle with origin on _j - if ((_delta select 2 > 0.94) && {((GVAR(collectedActionPoints) select _i select 1) distance2d (GVAR(collectedActionPoints) select _j select 1)) < 0.1}) exitWith { + if ((_delta select 2 > 0.94) && {((GVAR(collectedActionPoints) select _i select 1) distance2D (GVAR(collectedActionPoints) select _j select 1)) < 0.1}) exitWith { GVAR(collectedActionPoints) deleteAt _i; }; }; diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index 9e3aaa53a92..5af5afcc7ca 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -46,7 +46,7 @@ if ((GVAR(openedMenuType) == 0) && {isNull (ACE_controlledUAV select 0)} && {veh if ((_distanceToBasePoint > 1.2) && {!(_params select 4)}) exitWith { // If distance to action is greater than 1.2 m and check isn't disabled in params, check LOS - lineIntersects [AGLtoASL _headPos, AGLtoASL _pos, _object, ACE_player] + lineIntersects [AGLToASL _headPos, AGLToASL _pos, _object, ACE_player] }; false }) exitWith {false}; @@ -91,7 +91,7 @@ if (_activeActionTree isEqualTo []) exitWith {false}; BEGIN_COUNTER(fnc_renderMenus); if (count _pos > 2) then { - _sPos pushBack (((AGLtoASL _pos) vectorDiff GVAR(cameraPosASL)) vectorDotProduct GVAR(cameraDir)); + _sPos pushBack (((AGLToASL _pos) vectorDiff GVAR(cameraPosASL)) vectorDotProduct GVAR(cameraDir)); } else { _sPos pushBack 0; }; diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index 78b709472a3..a1118b77b0c 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -27,8 +27,8 @@ if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { private _displayNum = [[46, 12] select visibleMap, 91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]); GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021 + GVAR(iconCount)]); if (GVAR(useCursorMenu)) then { - ((finddisplay _displayNum) displayctrl (54021 + GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; - ((finddisplay _displayNum) displayctrl (54021 + GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; + ((findDisplay _displayNum) displayCtrl (54021 + GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; + ((findDisplay _displayNum) displayCtrl (54021 + GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; }; }; private _ctrl = GVAR(iconCtrls) select GVAR(iconCount); @@ -48,9 +48,9 @@ _text = if ([GVAR(useListMenu), GVAR(useListMenuSelf)] select GVAR(keyDownSelfAc GVAR(iconCount) = GVAR(iconCount) + 1; private _pos = if ([GVAR(useListMenu), GVAR(useListMenuSelf)] select GVAR(keyDownSelfAction)) then { - [(_sPos select 0) - (0.0095 * SafeZoneW), (_sPos select 1) - (0.0095 * SafeZoneW), 0.20 * SafeZoneW, 0.035 * SafeZoneW] + [(_sPos select 0) - (0.0095 * safeZoneW), (_sPos select 1) - (0.0095 * safeZoneW), 0.20 * safeZoneW, 0.035 * safeZoneW] } else { - [(_sPos select 0) - (0.0750 * SafeZoneW), (_sPos select 1) - (0.0095 * SafeZoneW), 0.15 * SafeZoneW, 0.100 * SafeZoneW] + [(_sPos select 0) - (0.0750 * safeZoneW), (_sPos select 1) - (0.0095 * safeZoneW), 0.15 * safeZoneW, 0.100 * safeZoneW] }; diff --git a/addons/interact_menu/functions/fnc_renderSelector.sqf b/addons/interact_menu/functions/fnc_renderSelector.sqf index bf719299244..27170d9fa83 100644 --- a/addons/interact_menu/functions/fnc_renderSelector.sqf +++ b/addons/interact_menu/functions/fnc_renderSelector.sqf @@ -22,8 +22,8 @@ if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { private _displayNum = [[46, 12] select visibleMap,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]); GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]); if (GVAR(useCursorMenu)) then { - ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; - ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; + ((findDisplay _displayNum) displayCtrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; + ((findDisplay _displayNum) displayCtrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; }; }; @@ -31,10 +31,10 @@ private _ctrl = GVAR(iconCtrls) select GVAR(iconCount); private _pos = if (GVAR(UseListMenu)) then { [_ctrl, GVAR(iconCount), format ["", _icon, GVAR(selectorColorHex)]] call FUNC(ctrlSetParsedTextCached); - [(_sPos select 0)-(0.014*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.05*SafeZoneW, 0.035*SafeZoneW] + [(_sPos select 0)-(0.014*safeZoneW), (_sPos select 1)-(0.014*safeZoneW), 0.05*safeZoneW, 0.035*safeZoneW] } else { [_ctrl, GVAR(iconCount), format ["", _icon, GVAR(selectorColorHex)]] call FUNC(ctrlSetParsedTextCached); - [(_sPos select 0)-(0.050*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.1*SafeZoneW, 0.035*SafeZoneW] + [(_sPos select 0)-(0.050*safeZoneW), (_sPos select 1)-(0.014*safeZoneW), 0.1*safeZoneW, 0.035*safeZoneW] }; GVAR(iconCount) = GVAR(iconCount) + 1; diff --git a/addons/interaction/RscTitles.hpp b/addons/interaction/RscTitles.hpp index ec7856c62cb..d2f2f0ef92c 100644 --- a/addons/interaction/RscTitles.hpp +++ b/addons/interaction/RscTitles.hpp @@ -13,8 +13,8 @@ class ACE_Interaction_Button_Base { style = 2; x = 0; y = 0; - w = "2.0 / 16 * safezoneW"; - h = "0.3 / 9 * safezoneH"; + w = "2.0 / 16 * safeZoneW"; + h = "0.3 / 9 * safeZoneH"; offsetX = 0.003; offsetY = 0.003; diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index dc1c167d7c1..2bf3546f591 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -180,7 +180,7 @@ private _action = [ nil, nil, nil, nil, nil, { params ["_target", "", "", "_actionData"]; - _actionData set [1, format [localize "STR_ACTION_TAKE_BAG", getText (configfile >> "CfgWeapons" >> weaponCargo _target select 0 >> "displayName")]]; + _actionData set [1, format [localize "STR_ACTION_TAKE_BAG", getText (configFile >> "CfgWeapons" >> weaponCargo _target select 0 >> "displayName")]]; } ] call EFUNC(interact_menu,createAction); diff --git a/addons/interaction/dev/initReplaceTerrainCursorObject.sqf b/addons/interaction/dev/initReplaceTerrainCursorObject.sqf index 3f71954acb5..6dadf678b7c 100644 --- a/addons/interaction/dev/initReplaceTerrainCursorObject.sqf +++ b/addons/interaction/dev/initReplaceTerrainCursorObject.sqf @@ -49,7 +49,7 @@ DFUNC(replaceTerrainModelsAdd) = { [{ private _object = cursorObject; - if (isNull _object) exitwith {}; + if (isNull _object) exitWith {}; [_object, true, nil, nil, nil, true] call EFUNC(dragging,setCarryable); [_object, true, nil, nil, nil, true] call EFUNC(dragging,setDraggable); diff --git a/addons/interaction/functions/fnc_modifyJoinGroupAction.sqf b/addons/interaction/functions/fnc_modifyJoinGroupAction.sqf index eef77dfd37d..9eeda7ee3c4 100644 --- a/addons/interaction/functions/fnc_modifyJoinGroupAction.sqf +++ b/addons/interaction/functions/fnc_modifyJoinGroupAction.sqf @@ -20,7 +20,7 @@ params ["_target", "_player", "", "_actionData"]; -private _actionText = format ["%1: %2", localize LSTRING(JoinGroup), groupID group _target]; +private _actionText = format ["%1: %2", localize LSTRING(JoinGroup), groupId group _target]; TRACE_3("",_target,group _target,_actionText); _actionData set [1, _actionText]; diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index 11b9c67c918..f83cc88b1ec 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -89,9 +89,9 @@ GVAR(usedScrollWheel) = false; }; // this allows for holding the door in it's current state. - if (CBA_missionTime > _time && {diag_frameno > _frame}) then { + if (CBA_missionTime > _time && {diag_frameNo > _frame}) then { GVAR(usedScrollWheel) = true; }; // do incremental door opening {_house animate [_x, GVAR(doorTargetPhase)]} forEach _animations; -}, 0.1, [_house, _animations, getPosASL ACE_player, CBA_missionTime + 0.2, diag_frameno + 2, _door]] call CBA_fnc_addPerFrameHandler; +}, 0.1, [_house, _animations, getPosASL ACE_player, CBA_missionTime + 0.2, diag_frameNo + 2, _door]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/interaction/functions/fnc_passMagazine.sqf b/addons/interaction/functions/fnc_passMagazine.sqf index 87500785026..757700ce8ba 100644 --- a/addons/interaction/functions/fnc_passMagazine.sqf +++ b/addons/interaction/functions/fnc_passMagazine.sqf @@ -34,7 +34,7 @@ private _magToPassIndex = 0; _magToPass = _x; _magToPassIndex = _forEachIndex; }; -} foreach _filteredMags; +} forEach _filteredMags; //remove the magazine from _player and add it to _target _magToPass params ["_magToPassClassName", "_magToPassAmmoCount"]; diff --git a/addons/interaction/functions/fnc_renameGroup.sqf b/addons/interaction/functions/fnc_renameGroup.sqf index 4ffff5771a1..8ad606a1eb1 100644 --- a/addons/interaction/functions/fnc_renameGroup.sqf +++ b/addons/interaction/functions/fnc_renameGroup.sqf @@ -20,12 +20,12 @@ params [ ["_group", grpNull, [grpNull]], ["_newName", "", [""]] ]; -if (_newName isEqualTo (groupID _group)) exitWith {true}; +if (_newName isEqualTo (groupId _group)) exitWith {true}; private _lowerName = toLower _newName; // Case insensitive name search private _nameAlreadyTaken = allGroups findIf { side _x isEqualTo side _group - && {_lowerName isEqualTo toLower (groupID _x)} + && {_lowerName isEqualTo toLower (groupId _x)} && {_group != _x} } != -1; diff --git a/addons/interaction/functions/fnc_renameGroupUI.sqf b/addons/interaction/functions/fnc_renameGroupUI.sqf index 5d891b0cf8e..9e0973327da 100644 --- a/addons/interaction/functions/fnc_renameGroupUI.sqf +++ b/addons/interaction/functions/fnc_renameGroupUI.sqf @@ -21,7 +21,7 @@ private _display = findDisplay 46 createDisplay QGVAR(groupNameDisplay); private _textCtrl = _display displayCtrl 451; - _textCtrl ctrlSetText (groupID group _unit); + _textCtrl ctrlSetText (groupId group _unit); _display setVariable [QGVAR(renamedGroup), group _unit]; _display displayAddEventHandler ["Unload", { params ["_display", "_exitCode"]; diff --git a/addons/interaction/groupRename_GUI.hpp b/addons/interaction/groupRename_GUI.hpp index 20684b0e463..977b9b3efda 100644 --- a/addons/interaction/groupRename_GUI.hpp +++ b/addons/interaction/groupRename_GUI.hpp @@ -1,4 +1,4 @@ -#define FONT_H (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) +#define FONT_H (((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 1) #define FONT_W (FONT_H / pixelH * pixelW) #define GAP_W (pixelW * 2) #define GAP_H (pixelH * 2) diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 89a263f651a..8dc3f006284 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -584,9 +584,13 @@ Remote Squad Management + Gestion à distance de l'escouade + Дистанционное управление отрядом Allow dropping and changing team colors of any unit in player's squad + Permettre d'abandonner et de changer les couleurs de n'importe quelle unité de l'escouade du joueur + Позволяет сбрасывать и менять командные цвета любого подразделения в отряде игрока Squad @@ -1367,14 +1371,20 @@ Interact With Enemy Crew 敵乗員がいる状態でのインタラクト + Interagir avec l'équipage ennemi + Взаимодействие с вражеским экипажем Limit some interactions on vehicles crewed by enemy factions. 敵性力の乗員が乗っている車両へのインタラクションを一部制限します。 + Limiter certaines interactions sur les véhicules dont l'équipage appartient à des factions ennemies. + Ограничьте некоторые взаимодействия на транспортных средствах, управляемых вражеской стороной. Allow for Static Weapons 固定火器への許可 + Autoriser les armes statiques + Разрешить использование статического оружия diff --git a/addons/inventory/RscDisplayInventory.hpp b/addons/inventory/RscDisplayInventory.hpp index 91e68f5fb1c..06752dcfec5 100644 --- a/addons/inventory/RscDisplayInventory.hpp +++ b/addons/inventory/RscDisplayInventory.hpp @@ -17,13 +17,13 @@ class RscStructuredText; class RscActiveText; class RscCombo; -#define X_BIS(num) (num * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)) -#define Y_BIS(num) (num * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)) -#define W_BIS(num) (num * (((safezoneW / safezoneH) min 1.2) / 40)) -#define H_BIS(num) (num * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)) +#define X_BIS(num) (num * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)) +#define Y_BIS(num) (num * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)) +#define W_BIS(num) (num * (((safeZoneW / safeZoneH) min 1.2) / 40)) +#define H_BIS(num) (num * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)) -#define X_MAKEITBIGGA(num) (num * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)) -#define Y_MAKEITBIGGA(num) (num * (safeZoneH / 30) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)) +#define X_MAKEITBIGGA(num) (num * (safeZoneH / 40) + (safeZoneX + (safeZoneW - safeZoneH)/2)) +#define Y_MAKEITBIGGA(num) (num * (safeZoneH / 30) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2))/2)) #define W_MAKEITBIGGA(num) (num * (safeZoneH / 40)) #define H_MAKEITBIGGA(num) (num * (safeZoneH / 30)) diff --git a/addons/javelin/functions/fnc_getTarget.sqf b/addons/javelin/functions/fnc_getTarget.sqf index 6fd4686eb8d..926e400a18b 100644 --- a/addons/javelin/functions/fnc_getTarget.sqf +++ b/addons/javelin/functions/fnc_getTarget.sqf @@ -20,8 +20,8 @@ params ["_lastTarget", "_maxRange"]; scopeName "main"; -private _viewASL = AGLtoASL positionCameraToWorld [0,0,0]; -private _viewDir = _viewASL vectorFromTo (AGLtoASL positionCameraToWorld [0,0,1]); +private _viewASL = AGLToASL positionCameraToWorld [0,0,0]; +private _viewDir = _viewASL vectorFromTo (AGLToASL positionCameraToWorld [0,0,1]); // Attempt to lock onto current target if it is still valid if (!isNull _lastTarget) then { @@ -65,7 +65,7 @@ if ((cursorTarget isKindOf "AllVehicles") && {(cursorObject distance ace_player) // Attempt to scan using multiple rayscasts - This is expensive (n^2) and care should be given to balance accuracy vs speed for "_xOffset" from -14 to 14 step 2 do { for "_yOffset" from -12 to 12 step 4 do { - private _testPosASL = AGLtoASL (positionCameraToWorld [_xOffset, _yOffset, _maxRange]); + private _testPosASL = AGLToASL (positionCameraToWorld [_xOffset, _yOffset, _maxRange]); private _intersectionsToCursorTarget = lineIntersectsSurfaces [_viewASL, _testPosASL, ace_player, vehicle ace_player, true, 1]; // drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [[0,1,0,1], [1,0,0,1]] select (count _intersectionsToCursorTarget), (ASLtoAGL _testPosASL), 0.25, 0.25, 0, "", 0.5, 0.025, "TahomaB"]; if (_intersectionsToCursorTarget isNotEqualTo []) then { diff --git a/addons/javelin/functions/fnc_mapHelperDraw.sqf b/addons/javelin/functions/fnc_mapHelperDraw.sqf index 4f7ac84b4a6..e8b917a933e 100644 --- a/addons/javelin/functions/fnc_mapHelperDraw.sqf +++ b/addons/javelin/functions/fnc_mapHelperDraw.sqf @@ -25,7 +25,7 @@ if (isNil QGVAR(arguments)) then { _currentShooter setVariable ["ace_missileguidance_target", nil, false]; GVAR(arguments) = [ - diag_frameno, // Last run frame + diag_frameNo, // Last run frame objNull, // currentTargetObject 0, // Lock Start Time 0, // Next Sound timer @@ -37,7 +37,7 @@ if (isNil QGVAR(arguments)) then { [{ if (isNull (uiNamespace getVariable ["ACE_RscOptics_javelin", displayNull])) exitWith {true}; GVAR(arguments) params ["_lastRunFrame"]; - (diag_frameno < _lastRunFrame) || {diag_frameno > (_lastRunFrame + 1)} + (diag_frameNo < _lastRunFrame) || {diag_frameNo > (_lastRunFrame + 1)} }, { TRACE_1("old/null display - ending optic draw",_this); private _fireDisabledEH = GVAR(arguments) param [4, -1]; diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index aacc4f5fa1f..9dfb7d2e484 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -53,7 +53,7 @@ if ((_ammoCount == 0) || // No ammo loaded __JavelinIGUISeek ctrlSetTextColor __ColorGray; _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); - _this set [0, diag_frameno]; + _this set [0, diag_frameNo]; _this set [4, _fireDisabledEH]; // Fix weapon being in top-attack when loading AP magazine (https://feedback.bistudio.com/T171012) @@ -194,7 +194,7 @@ if (isNull _newTarget) then { }; // Save arguments for next run -_this set [0, diag_frameno]; +_this set [0, diag_frameNo]; _this set [1, _currentTarget]; _this set [2, _lockStartTime]; _this set [3, _soundNextPlayTime]; diff --git a/addons/javelin/script_component.hpp b/addons/javelin/script_component.hpp index 3e9ad4ebfc1..b5cf7bea3ce 100644 --- a/addons/javelin/script_component.hpp +++ b/addons/javelin/script_component.hpp @@ -18,7 +18,7 @@ // Javelin IGUI defines -#define __JavelinIGUI (uinamespace getVariable "ACE_RscOptics_javelin") +#define __JavelinIGUI (uiNamespace getVariable "ACE_RscOptics_javelin") // Custom controls #define __JavelinIGUITargeting (__JavelinIGUI displayCtrl 6999) diff --git a/addons/kestrel4500/RscTitles.hpp b/addons/kestrel4500/RscTitles.hpp index faae6a8f32b..ffb44de9132 100644 --- a/addons/kestrel4500/RscTitles.hpp +++ b/addons/kestrel4500/RscTitles.hpp @@ -64,7 +64,7 @@ class Kestrel4500_Display { SizeEX=0.025; idc=74000; style=48; - x="safezoneX"; + x="safeZoneX"; y = DIALOG_SAFE_Y(0); w="1.024"; h="1.024*4/3"; @@ -74,7 +74,7 @@ class Kestrel4500_Display { }; class POWER: Kestrel4500_RscButton { idc=-1; - x="safezoneX+0.385"; + x="safeZoneX+0.385"; y = DIALOG_SAFE_Y(1.125); w="0.042"; h="0.042*4/3"; @@ -83,7 +83,7 @@ class Kestrel4500_Display { }; class ENTER: POWER { idc=-1; - x="safezoneX+0.46"; + x="safeZoneX+0.46"; y = DIALOG_SAFE_Y(1.0); w=0.1; action=QUOTE(0 call FUNC(buttonPressed)); @@ -91,7 +91,7 @@ class Kestrel4500_Display { }; class TOP: Kestrel4500_RscButton { idc=-1; - x="safezoneX+0.46"; + x="safeZoneX+0.46"; y = DIALOG_SAFE_Y(0.93); w=0.1; h=0.03; @@ -106,7 +106,7 @@ class Kestrel4500_Display { }; class LEFT: Kestrel4500_RscButton { idc=-1; - x="safezoneX+0.4"; + x="safeZoneX+0.4"; y = DIALOG_SAFE_Y(0.97); w=0.046; h=0.11; @@ -115,13 +115,13 @@ class Kestrel4500_Display { }; class RIGHT: LEFT { idc=-1; - x="safezoneX+0.58"; + x="safeZoneX+0.58"; action=QUOTE(4 call FUNC(buttonPressed)); onMouseButtonDown = "playSound 'kestrel4500_right_button_click'"; }; class MEMORY: Kestrel4500_RscButton { idc=-1; - x="safezoneX+0.395"; + x="safeZoneX+0.395"; y = DIALOG_SAFE_Y(0.87); w=0.05; h="0.045*4/3"; @@ -129,13 +129,13 @@ class Kestrel4500_Display { }; class BACKLIGHT: MEMORY { idc=-1; - x="safezoneX+0.585"; + x="safeZoneX+0.585"; action=QUOTE(6 call FUNC(buttonPressed)); }; class TEXT_TOP: Kestrel4500_RscText { idc=74100; - x="safezoneX+0.40"; + x="safeZoneX+0.40"; y = DIALOG_SAFE_Y(0.58); w=0.22; h=0.04; @@ -236,7 +236,7 @@ class RscTitles { font="TahomaB"; SizeEX=".025*0.75"; style=48; - x="safezoneX+0.14"; + x="safeZoneX+0.14"; y = DISPLAY_SAFE_Y(0); w="0.512*0.75"; h="1.024*4/3*0.75"; @@ -246,7 +246,7 @@ class RscTitles { }; class RscTextTop: Kestrel4500_RscText { idc=75100; - x="safezoneX-0.05+0.40*0.75"; + x="safeZoneX-0.05+0.40*0.75"; y = DISPLAY_SAFE_Y(0.58*0.75); w="0.22*0.75"; h="0.04*0.75"; diff --git a/addons/kestrel4500/functions/fnc_generateOutputData.sqf b/addons/kestrel4500/functions/fnc_generateOutputData.sqf index 59bb3056dd1..1aeac9a182a 100644 --- a/addons/kestrel4500/functions/fnc_generateOutputData.sqf +++ b/addons/kestrel4500/functions/fnc_generateOutputData.sqf @@ -89,7 +89,7 @@ if (GVAR(referenceHeadingMenu) == 0) then { private _monthString = localize (["str_january","str_february","str_march","str_april","str_may","str_june","str_july","str_august","str_september","str_october","str_november","str_december"] select (_month - 1)); _textTop = _dayString; _textCenter = format["%1 %2 %3", _day, _monthString, _year]; - _textBottomBig = [daytime, "HH:MM:SS"] call bis_fnc_timeToString; + _textBottomBig = [dayTime, "HH:MM:SS"] call bis_fnc_timeToString; }; case 1: { // Direction if (!GVAR(MinAvgMax)) then { @@ -105,7 +105,7 @@ if (GVAR(referenceHeadingMenu) == 0) then { }; case 2: { // Wind SPD if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_windSpeed * 10) / 10); + _textCenterBig = str(round(_windSpeed * 10) / 10); } else { _textCenterLine1Left = "Max"; _textCenterLine2Left = "Avg"; @@ -116,13 +116,13 @@ if (GVAR(referenceHeadingMenu) == 0) then { _textInfoLine2 = "- average"; }; case 1: { - _textCenterLine1Right = Str(round((GVAR(Max) select 2) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 2) / (GVAR(Entries) select 2) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Max) select 2) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 2) / (GVAR(Entries) select 2) * 10) / 10); _textInfoLine2 = "- stop"; }; case 2: { - _textCenterLine1Right = Str(round((GVAR(Max) select 2) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 2) / (GVAR(Entries) select 2) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Max) select 2) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 2) / (GVAR(Entries) select 2) * 10) / 10); _textInfoLine2 = "- clear"; }; }; @@ -131,10 +131,10 @@ if (GVAR(referenceHeadingMenu) == 0) then { case 3: { // CROSSWIND if (!GVAR(MinAvgMax)) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - _textCenterBig = Str(round(abs(sin(GVAR(RefHeading) - _playerDir) * _windSpeed) * 10) / 10); + _textCenterBig = str(round(abs(sin(GVAR(RefHeading) - _playerDir) * _windSpeed) * 10) / 10); _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(_playerDir)]; } else { - _textCenterBig = Str(round(abs(sin(GVAR(RefHeading) - _windDir) * _windSpeed) * 10) / 10); + _textCenterBig = str(round(abs(sin(GVAR(RefHeading) - _windDir) * _windSpeed) * 10) / 10); _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(180 + _windDir)]; }; _textInfoLine2 = "- set heading"; @@ -148,13 +148,13 @@ if (GVAR(referenceHeadingMenu) == 0) then { _textInfoLine2 = "- average"; }; case 1: { - _textCenterLine1Right = Str(round((GVAR(Max) select 3) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 3) / (GVAR(Entries) select 3) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Max) select 3) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 3) / (GVAR(Entries) select 3) * 10) / 10); _textInfoLine2 = "- stop"; }; case 2: { - _textCenterLine1Right = Str(round((GVAR(Max) select 3) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 3) / (GVAR(Entries) select 3) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Max) select 3) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 3) / (GVAR(Entries) select 3) * 10) / 10); _textInfoLine2 = "- clear"; }; }; @@ -163,10 +163,10 @@ if (GVAR(referenceHeadingMenu) == 0) then { case 4: { // HEADWIND if (!GVAR(MinAvgMax)) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - _textCenterBig = Str(round(cos(GVAR(RefHeading) - _playerDir) * _windSpeed * 10) / 10); + _textCenterBig = str(round(cos(GVAR(RefHeading) - _playerDir) * _windSpeed * 10) / 10); _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(_playerDir)]; } else { - _textCenterBig = Str(round(-cos(GVAR(RefHeading) - _windDir) * _windSpeed * 10) / 10); + _textCenterBig = str(round(-cos(GVAR(RefHeading) - _windDir) * _windSpeed * 10) / 10); _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(180 + _windDir)]; }; _textInfoLine2 = "- set heading"; @@ -180,13 +180,13 @@ if (GVAR(referenceHeadingMenu) == 0) then { _textInfoLine2 = "- average"; }; case 1: { - _textCenterLine1Right = Str(round((GVAR(Max) select 4) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 4) / (GVAR(Entries) select 4) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Max) select 4) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 4) / (GVAR(Entries) select 4) * 10) / 10); _textInfoLine2 = "- stop"; }; case 2: { - _textCenterLine1Right = Str(round((GVAR(Max) select 4) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 4) / (GVAR(Entries) select 4) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Max) select 4) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 4) / (GVAR(Entries) select 4) * 10) / 10); _textInfoLine2 = "- clear"; }; }; @@ -194,124 +194,124 @@ if (GVAR(referenceHeadingMenu) == 0) then { }; case 5: { // TEMP if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_temperature * 10) / 10); + _textCenterBig = str(round(_temperature * 10) / 10); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 5) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 5) / (GVAR(Entries) select 5) * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 5) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Min) select 5) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 5) / (GVAR(Entries) select 5) * 10) / 10); + _textCenterLine3Right = str(round((GVAR(Max) select 5) * 10) / 10); }; }; case 6: { // CHILL if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_chill * 10) / 10); + _textCenterBig = str(round(_chill * 10) / 10); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 6) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 6) / (GVAR(Entries) select 6) * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 6) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Min) select 6) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 6) / (GVAR(Entries) select 6) * 10) / 10); + _textCenterLine3Right = str(round((GVAR(Max) select 6) * 10) / 10); }; }; case 7: { // HUMIDITY if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_humidity * 100 * 10) / 10); + _textCenterBig = str(round(_humidity * 100 * 10) / 10); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 7) * 100 * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 7) / (GVAR(Entries) select 7) * 100 * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 7) * 100 * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Min) select 7) * 100 * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 7) / (GVAR(Entries) select 7) * 100 * 10) / 10); + _textCenterLine3Right = str(round((GVAR(Max) select 7) * 100 * 10) / 10); }; }; case 8: { // HEAT INDEX if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_heatIndex * 10) / 10); + _textCenterBig = str(round(_heatIndex * 10) / 10); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 8) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 8) / (GVAR(Entries) select 8) * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 8) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Min) select 8) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 8) / (GVAR(Entries) select 8) * 10) / 10); + _textCenterLine3Right = str(round((GVAR(Max) select 8) * 10) / 10); }; }; case 9: { // DEW POINT if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_dewPoint * 10) / 10); + _textCenterBig = str(round(_dewPoint * 10) / 10); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 9) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 9) / (GVAR(Entries) select 9) * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 9) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Min) select 9) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 9) / (GVAR(Entries) select 9) * 10) / 10); + _textCenterLine3Right = str(round((GVAR(Max) select 9) * 10) / 10); }; }; case 10: { // WET BULB if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_wetBulb * 10) / 10); + _textCenterBig = str(round(_wetBulb * 10) / 10); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 10) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 10) / (GVAR(Entries) select 10) * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 10) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Min) select 10) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 10) / (GVAR(Entries) select 10) * 10) / 10); + _textCenterLine3Right = str(round((GVAR(Max) select 10) * 10) / 10); }; }; case 11: { // BARO if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_barometricPressure * 10) / 10); + _textCenterBig = str(round(_barometricPressure * 10) / 10); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 11) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 11) / (GVAR(Entries) select 11) * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 11) * 10) / 10); + _textCenterLine1Right = str(round((GVAR(Min) select 11) * 10) / 10); + _textCenterLine2Right = str(round((GVAR(Total) select 11) / (GVAR(Entries) select 11) * 10) / 10); + _textCenterLine3Right = str(round((GVAR(Max) select 11) * 10) / 10); }; }; case 12: { // ALTITUDE if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(EGVAR(common,mapAltitude) + _playerAltitude)); + _textCenterBig = str(round(EGVAR(common,mapAltitude) + _playerAltitude)); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round(GVAR(Min) select 12)); - _textCenterLine2Right = Str(round((GVAR(Total) select 12) / (GVAR(Entries) select 12))); - _textCenterLine3Right = Str(round(GVAR(Max) select 12)); + _textCenterLine1Right = str(round(GVAR(Min) select 12)); + _textCenterLine2Right = str(round((GVAR(Total) select 12) / (GVAR(Entries) select 12))); + _textCenterLine3Right = str(round(GVAR(Max) select 12)); }; }; case 13: { // DENSITY ALTITUDE if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_densityAltitude)); + _textCenterBig = str(round(_densityAltitude)); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round(GVAR(Min) select 13)); - _textCenterLine2Right = Str(round((GVAR(Total) select 13) / (GVAR(Entries) select 13))); - _textCenterLine3Right = Str(round(GVAR(Max) select 13)); + _textCenterLine1Right = str(round(GVAR(Min) select 13)); + _textCenterLine2Right = str(round((GVAR(Total) select 13) / (GVAR(Entries) select 13))); + _textCenterLine3Right = str(round(GVAR(Max) select 13)); }; }; case 14: { // User Screen 1 - _textCenterLine1Left = Str(round(_playerDir)); - _textCenterLine2Left = Str(round(EGVAR(common,mapAltitude) + _playerAltitude)); - _textCenterLine3Left = Str(round(abs(_windSpeed) * 10) / 10); + _textCenterLine1Left = str(round(_playerDir)); + _textCenterLine2Left = str(round(EGVAR(common,mapAltitude) + _playerAltitude)); + _textCenterLine3Left = str(round(abs(_windSpeed) * 10) / 10); _textCenterLine1Right = GVAR(Directions) select GVAR(Direction); _textCenterLine2Right = "m"; _textCenterLine3Right = "m/s"; }; case 15: { // User Screen 2 - _textCenterLine1Left = Str(round(_temperature * 10) / 10); - _textCenterLine2Left = Str(round(_humidity * 100 * 10) / 10); - _textCenterLine3Left = Str(round((_playerAltitude call EFUNC(weather,calculateBarometricPressure)) * 10) / 10); + _textCenterLine1Left = str(round(_temperature * 10) / 10); + _textCenterLine2Left = str(round(_humidity * 100 * 10) / 10); + _textCenterLine3Left = str(round((_playerAltitude call EFUNC(weather,calculateBarometricPressure)) * 10) / 10); _textCenterLine1Right = "C"; _textCenterLine2Right = "%"; _textCenterLine3Right = "hPA"; @@ -322,7 +322,7 @@ if (GVAR(referenceHeadingMenu) == 0) then { switch (GVAR(referenceHeadingMenu)) do { case 1: { _textCenterLine1 = "MAGNETIC HEADING"; - _textCenterLine2 = Str(round(GVAR(RefHeading))); + _textCenterLine2 = str(round(GVAR(RefHeading))); _textCenterLine3 = "Auto Set "; _textCenterLine4 = "Manual Set "; _textCenterLine5 = "================"; @@ -330,7 +330,7 @@ if (GVAR(referenceHeadingMenu) == 0) then { }; case 2: { _textCenterLine1 = "MAGNETIC HEADING"; - _textCenterLine2 = Str(round(_playerDir)); + _textCenterLine2 = str(round(_playerDir)); _textCenterLine3 = "Point Down the"; _textCenterLine4 = "Runway or Range"; _textCenterLine5 = "================"; @@ -338,7 +338,7 @@ if (GVAR(referenceHeadingMenu) == 0) then { }; case 3: { _textCenterLine1 = "MAGNETIC HEADING"; - _textCenterLine2 = Str(round(GVAR(TmpHeading))); + _textCenterLine2 = str(round(GVAR(TmpHeading))); _textCenterLine3 = "Press < and >"; _textCenterLine4 = "to Adjust"; _textCenterLine5 = "================"; diff --git a/addons/killtracker/XEH_postInit.sqf b/addons/killtracker/XEH_postInit.sqf index 35050d1dc30..bf944c930e0 100644 --- a/addons/killtracker/XEH_postInit.sqf +++ b/addons/killtracker/XEH_postInit.sqf @@ -16,7 +16,7 @@ * Public: No */ -if ((getText (missionconfigfile >> "CfgDebriefingSections" >> QUOTE(XADDON) >> "variable")) != QXGVAR(outputText)) exitWith { +if ((getText (missionConfigFile >> "CfgDebriefingSections" >> QUOTE(XADDON) >> "variable")) != QXGVAR(outputText)) exitWith { TRACE_1("no mission debriefing config",_this); }; @@ -65,7 +65,7 @@ GVAR(killCount) = 0; private _killInfo = []; if (!isNull _killer) then { - if !(_killer isKindof "CAManBase") then { // If killer is a vehicle log the vehicle type + if !(_killer isKindOf "CAManBase") then { // If killer is a vehicle log the vehicle type _killInfo pushBack format [LLSTRING(Vehicle), getText ((configOf _killer) >> "displayName")]; }; if (isNull _instigator) then { diff --git a/addons/laser/RscTitles.hpp b/addons/laser/RscTitles.hpp index 7421246181b..c63b601ab77 100644 --- a/addons/laser/RscTitles.hpp +++ b/addons/laser/RscTitles.hpp @@ -9,10 +9,10 @@ class RscTitles { class controls { class ModeControlGroup: RscControlsGroupNoScrollbars { idc = IDC_MODECONTROLGROUP; - x = "3.8 * (((safezoneW / safezoneH) min 1.2) / 40) + (profilenamespace getvariable ['IGUI_GRID_WEAPON_X',((safezoneX + safezoneW) - (10 * (((safezoneW / safezoneH) min 1.2) / 40)) - 4.3 * (((safezoneW / safezoneH) min 1.2) / 40))])"; - y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (profilenamespace getVariable ['IGUI_GRID_WEAPON_Y', (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])"; - w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "3.8 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (profilenamespace getvariable ['IGUI_GRID_WEAPON_X',((safeZoneX + safeZoneW) - (10 * (((safeZoneW / safeZoneH) min 1.2) / 40)) - 4.3 * (((safeZoneW / safeZoneH) min 1.2) / 40))])"; + y = "2.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (profilenamespace getVariable ['IGUI_GRID_WEAPON_Y', (safeZoneY + 0.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25))])"; + w = "10 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; class controls { class AttackMode: RscText { @@ -21,29 +21,29 @@ class RscTitles { colorBackground[] = {0, 0, 0, 0}; x = "0"; y = "0"; - w = "(2.6) * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "(2.6) * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + sizeEx = "0.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LaserCode: RscText { idc = IDC_LASERCODE; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0, 0, 0, 0}; - x = "(3.6) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "(3.6) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; y = "0"; - w = "(2.5) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - h = "(1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "(2.5) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + h = "(1) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + sizeEx = "0.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LaserIcon: RscPictureKeepAspect { idc = IDC_LASERICON; colorText[] = {1, 0, 0, 1}; colorBackground[] = {0, 0, 0, 0}; text = "\a3\Ui_F_Curator\Data\CfgCurator\laser_ca.paa"; - x = "(6.1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "(6.1) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; y = "0"; - w = "(1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - h = "(1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "(1) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + h = "(1) * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; }; }; diff --git a/addons/laser/XEH_postInit.sqf b/addons/laser/XEH_postInit.sqf index 768752bee2e..eb4cb247ed7 100644 --- a/addons/laser/XEH_postInit.sqf +++ b/addons/laser/XEH_postInit.sqf @@ -21,10 +21,10 @@ if (hasInterface) then { ["ACE_controlledUAV", { params ["_UAV", "_seatAI", "_turret", "_position"]; TRACE_4("ACE_controlledUAV EH",_UAV,_seatAI,_turret,_position); - if (!isNull _seatAI) then { - [_seatAI] call FUNC(showVehicleHud); - } else { + if (isNull _seatAI) then { [ace_player] call FUNC(showVehicleHud); + } else { + [_seatAI] call FUNC(showVehicleHud); }; }] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler; diff --git a/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf b/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf index 4c57a613252..294a0262385 100644 --- a/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf +++ b/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf @@ -35,8 +35,8 @@ private _testSeekerDir = vectorDirVisual _seekerVehicle; private _resultPos = _results select 0; if (!isNil "_resultPos") then { // Draw lock results - drawLine3D [ASLtoAGL _testSeekerPosASL, ASLtoAGL _resultPos, [0,0,1,1]]; - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [0,0,1,1], (ASLtoAGL _resultPos), 1.5, 1.5, 45, format ["%1 from %2", _code, _results select 1], 0.5, 0.025, "TahomaB"]; + drawLine3D [ASLToAGL _testSeekerPosASL, ASLToAGL _resultPos, [0,0,1,1]]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [0,0,1,1], (ASLToAGL _resultPos), 1.5, 1.5, 45, format ["%1 from %2", _code, _results select 1], 0.5, 0.025, "TahomaB"]; }; } forEach [ACE_DEFAULT_LASER_CODE, 1688]; // Scan at codes 1111 and 1688 @@ -51,29 +51,29 @@ private _testSeekerDir = vectorDirVisual _seekerVehicle; if (_laserMethod isEqualTo QFUNC(findLaserSource)) then { // Normal vanilla laserTarget func private _targetObject = _obj getVariable [QGVAR(targetObject), objNull]; private _targetPosASL = getPosASL _targetObject; - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLtoAGL _targetPosASL), 0.5, 0.5, 0, "", 0.5, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLToAGL _targetPosASL), 0.5, 0.5, 0, "", 0.5, 0.025, "TahomaB"]; (_y call FUNC(findLaserSource)) params ["_laserPosASL", "_laserDir"]; private _resultsRay = [_laserPosASL, _laserDir, _obj] call FUNC(shootRay); private _rayPos = _resultsRay select 0; if (isNil "_rayPos") then { - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLtoAGL _targetPosASL), 2, 2, 0, "Nil Ray", 0.5, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLToAGL _targetPosASL), 2, 2, 0, "Nil Ray", 0.5, 0.025, "TahomaB"]; } else { private _diff = _rayPos vectorDistance (getPosASL _targetObject); // Diff from ray position compared to actual - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLtoAGL _rayPos), 2, 2, 0, format ["Diff %1",_diff], 0.5, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLToAGL _rayPos), 2, 2, 0, format ["Diff %1",_diff], 0.5, 0.025, "TahomaB"]; }; }; // Draw array weapon lasers [YELLOW] if ((_laserMethod isEqualType []) && {(count _laserMethod) == 2}) then { _laserMethod params ["_modelPosition", "_weaponName"]; private _laserPosASL = _obj modelToWorldVisualWorld _modelPosition; - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,1,0,1], (ASLtoAGL _laserPosASL), 0.5, 0.5, 0, _weaponName, 0.5, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,1,0,1], (ASLToAGL _laserPosASL), 0.5, 0.5, 0, _weaponName, 0.5, 0.025, "TahomaB"]; private _laserDir = _obj weaponDirection _weaponName; private _resultsRay = [_laserPosASL, _laserDir, _obj] call FUNC(shootRay); private _rayPos = _resultsRay select 0; if (!isNil "_rayPos") then { - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,1,0,1], (ASLtoAGL _rayPos), 2, 2, 0, _weaponName, 0.5, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,1,0,1], (ASLToAGL _rayPos), 2, 2, 0, _weaponName, 0.5, 0.025, "TahomaB"]; }; }; } forEach GVAR(laserEmitters); diff --git a/addons/laser/functions/fnc_handleLaserTargetCreation.sqf b/addons/laser/functions/fnc_handleLaserTargetCreation.sqf index f7db74793fb..4d5a7164b75 100644 --- a/addons/laser/functions/fnc_handleLaserTargetCreation.sqf +++ b/addons/laser/functions/fnc_handleLaserTargetCreation.sqf @@ -22,13 +22,13 @@ TRACE_1("params",_this); // Only handle locally created lasers if(!(local _targetObject)) exitWith {TRACE_1("not local",_targetObject);}; - private _owners = allUnits select {(lasertarget _x) == _targetObject}; + private _owners = allUnits select {(laserTarget _x) == _targetObject}; if (count _owners == 1) exitWith { TRACE_2("Laser target owner [allUnits]",_targetObject,_owners select 0); [_targetObject, _owners select 0] call FUNC(addLaserTarget); }; - _owners = vehicles select {(lasertarget _x) == _targetObject}; + _owners = vehicles select {(laserTarget _x) == _targetObject}; if (count _owners == 1) exitWith { TRACE_2("Laser target owner [vehicles]",_targetObject,_owners select 0); [_targetObject, _owners select 0] call FUNC(addLaserTarget); diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index a14b3a8b183..cf805f7496f 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -192,10 +192,10 @@ END_COUNTER(seekerFindLaserSpot); #ifdef DRAW_LASER_INFO if (isNil "_finalPos") then { - drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconMan_ca.paa", [0.9,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _seekerCode], 0.5, 0.025, "TahomaB"]; + drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconMan_ca.paa", [0.9,1,0,1], (ASLToAGL _posASL), 1, 1, 0, format ["Seeker: %1", _seekerCode], 0.5, 0.025, "TahomaB"]; } else { - drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconManAT_ca.paa", [0.5,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _seekerCode], 0.5, 0.025, "TahomaB"]; - drawLine3D [ASLtoAGL _posASL, ASLtoAGL _finalPos, [0.5,1,0,1]]; + drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconManAT_ca.paa", [0.5,1,0,1], (ASLToAGL _posASL), 1, 1, 0, format ["Seeker: %1", _seekerCode], 0.5, 0.025, "TahomaB"]; + drawLine3D [ASLToAGL _posASL, ASLToAGL _finalPos, [0.5,1,0,1]]; }; #endif diff --git a/addons/laser/functions/fnc_shootRay.sqf b/addons/laser/functions/fnc_shootRay.sqf index 862e972dd1b..9b8341909c3 100644 --- a/addons/laser/functions/fnc_shootRay.sqf +++ b/addons/laser/functions/fnc_shootRay.sqf @@ -48,8 +48,8 @@ TRACE_3("",_resultPos,_distance,_intersects); #ifdef DRAW_LASER_INFO if (!isNil "_resultPos") then { private _text = [_distance, 4, 0] call CBA_fnc_formatNumber; - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0, 1, 0, 1], ASLtoAGL _resultPos, 0.5, 0.5, 0, _text, 0.4, 0.025, "TahomaB"]; - drawLine3D [ASLtoAGL _posASL, ASLtoAGL _resultPos, [0,1,0,1]]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0, 1, 0, 1], ASLToAGL _resultPos, 0.5, 0.5, 0, _text, 0.4, 0.025, "TahomaB"]; + drawLine3D [ASLToAGL _posASL, ASLToAGL _resultPos, [0,1,0,1]]; }; #endif diff --git a/addons/laser/functions/fnc_showVehicleHud.sqf b/addons/laser/functions/fnc_showVehicleHud.sqf index 35120a294d6..856030bf8cb 100644 --- a/addons/laser/functions/fnc_showVehicleHud.sqf +++ b/addons/laser/functions/fnc_showVehicleHud.sqf @@ -68,7 +68,7 @@ GVAR(pfID) = [{ if (_adjustDown) then { private _ctrl = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_MODECONTROLGROUP; private _pos = ctrlPosition _ctrl; - _pos set [1, (_pos select 1) + ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)]; + _pos set [1, (_pos select 1) + ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)]; _ctrl ctrlSetPosition _pos; _ctrl ctrlCommit 0; }; diff --git a/addons/map/config.cpp b/addons/map/config.cpp index 943a63c228e..a4d086d6029 100644 --- a/addons/map/config.cpp +++ b/addons/map/config.cpp @@ -119,16 +119,16 @@ class RscDisplayDiary { onButtonClick = ""; }; class CA_PlayerName: RscText { - x = "2 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + x = "2 * ( ((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class ProfilePicture: RscPicture { - x = "13.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + x = "13.5 * ( ((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class ProfileBackground: RscText { - x = "13.3 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + x = "13.3 * ( ((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class Separator1: RscPicture { - x = "14.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + x = "14.5 * ( ((safeZoneW / safeZoneH) min 1.2) / 40)"; }; }; }; diff --git a/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf b/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf index f533f9df345..c5577fb7e88 100644 --- a/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf +++ b/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf @@ -22,7 +22,7 @@ if (!params [["_group", "", [grpNull, ""]], ["_leadColor", [1,1,1,1], [[]], 4], }; TRACE_3("params",_group,_leadColor,_unitColor); -if (_group isEqualType grpNull) then {_group = groupID _group}; +if (_group isEqualType grpNull) then {_group = groupId _group}; if (_group == "") exitWith {ERROR("Group ID is blank, which is not valid.")}; if !([_leadColor] call FUNC(isValidColorArray)) exitWith {ERROR("leadColor is not a valid color array.")}; diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf index 0a69c1924b8..35b462910a8 100644 --- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf +++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf @@ -41,7 +41,7 @@ private _players = [_positions, FUNC(getProximityPlayers), missionNamespace, QGV }; // If color settings for the group exist, then use those, otherwise fall back to the default colors - private _colorMap = GVAR(GroupColorCfgMappingNew) getOrDefault [toLower groupID (group _x), [GVAR(defaultLeadColor), GVAR(defaultColor)]]; + private _colorMap = GVAR(GroupColorCfgMappingNew) getOrDefault [toLower groupId (group _x), [GVAR(defaultLeadColor), GVAR(defaultColor)]]; private _color = _colorMap select (_x != leader _x); TRACE_2("",_colorMap,_color); diff --git a/addons/map_gestures/functions/fnc_initDisplaySpectator.sqf b/addons/map_gestures/functions/fnc_initDisplaySpectator.sqf index dbbd31ae65c..7c1f09bbf53 100644 --- a/addons/map_gestures/functions/fnc_initDisplaySpectator.sqf +++ b/addons/map_gestures/functions/fnc_initDisplaySpectator.sqf @@ -23,11 +23,11 @@ _mapCtrl ctrlAddEventHandler ["Draw", { private _aceSpectatorFocus = missionNamespace getVariable [QEGVAR(spectator,camFocus), objNull]; if (!isNull _aceSpectatorFocus) then { - _targets pushback [_aceSpectatorFocus, GVAR(maxRange)]; + _targets pushBack [_aceSpectatorFocus, GVAR(maxRange)]; }; private _vanillaSpectatorFocus = uiNamespace getVariable ["RscEGSpectator_focus", objNull]; if (!isNull _vanillaSpectatorFocus) then { - _targets pushback [_vanillaSpectatorFocus, GVAR(maxRange)]; + _targets pushBack [_vanillaSpectatorFocus, GVAR(maxRange)]; }; [_this select 0, _targets] call FUNC(drawMapGestures); }]; diff --git a/addons/maptools/functions/fnc_drawLinesOnRoamer.sqf b/addons/maptools/functions/fnc_drawLinesOnRoamer.sqf index 782d8762a07..652edf8768b 100644 --- a/addons/maptools/functions/fnc_drawLinesOnRoamer.sqf +++ b/addons/maptools/functions/fnc_drawLinesOnRoamer.sqf @@ -73,11 +73,11 @@ switch (true) do { GVAR(freeDrawingData) = ["left", _currentMousePos, _currentMousePos]; } else { if ((GVAR(freeDrawingData) select 0) == "left") then { // We are already drawing on this line, find best spot - if ((_currentMousePos distance2d _posTopLeft) < ((GVAR(freeDrawingData) select 1) distance2d _posTopLeft)) then { + if ((_currentMousePos distance2D _posTopLeft) < ((GVAR(freeDrawingData) select 1) distance2D _posTopLeft)) then { GVAR(freeDrawingData) set [1, _currentMousePos]; }; - if ((_currentMousePos distance2d _posBottomLeft) < ((GVAR(freeDrawingData) select 2) distance2d _posBottomLeft)) then { + if ((_currentMousePos distance2D _posBottomLeft) < ((GVAR(freeDrawingData) select 2) distance2D _posBottomLeft)) then { GVAR(freeDrawingData) set [2, _currentMousePos]; }; }; @@ -95,11 +95,11 @@ switch (true) do { GVAR(freeDrawingData) = ["top", _currentMousePos, _currentMousePos]; } else { if ((GVAR(freeDrawingData) select 0) == "top") then { // We are already drawing on this line, find best spot - if ((_currentMousePos distance2d _posTopLeft) < ((GVAR(freeDrawingData) select 1) distance2d _posTopLeft)) then { + if ((_currentMousePos distance2D _posTopLeft) < ((GVAR(freeDrawingData) select 1) distance2D _posTopLeft)) then { GVAR(freeDrawingData) set [1, _currentMousePos]; }; - if ((_currentMousePos distance2d _posTopRight) < ((GVAR(freeDrawingData) select 2) distance2d _posTopRight)) then { + if ((_currentMousePos distance2D _posTopRight) < ((GVAR(freeDrawingData) select 2) distance2D _posTopRight)) then { GVAR(freeDrawingData) set [2, _currentMousePos]; }; }; @@ -117,11 +117,11 @@ switch (true) do { GVAR(freeDrawingData) = ["right", _currentMousePos, _currentMousePos]; } else { if ((GVAR(freeDrawingData) select 0) == "right") then { // We are already drawing on this line, find best spot - if ((_currentMousePos distance2d _posTopRight) < ((GVAR(freeDrawingData) select 1) distance2d _posTopRight)) then { + if ((_currentMousePos distance2D _posTopRight) < ((GVAR(freeDrawingData) select 1) distance2D _posTopRight)) then { GVAR(freeDrawingData) set [1, _currentMousePos]; }; - if ((_currentMousePos distance2d _posBottomRight) < ((GVAR(freeDrawingData) select 2) distance2d _posBottomRight)) then { + if ((_currentMousePos distance2D _posBottomRight) < ((GVAR(freeDrawingData) select 2) distance2D _posBottomRight)) then { GVAR(freeDrawingData) set [2, _currentMousePos]; }; }; @@ -139,11 +139,11 @@ switch (true) do { GVAR(freeDrawingData) = ["bottom", _currentMousePos, _currentMousePos]; } else { if ((GVAR(freeDrawingData) select 0) == "bottom") then { // We are already drawing on this line, find best spot - if ((_currentMousePos distance2d _posBottomLeft) < ((GVAR(freeDrawingData) select 1) distance2d _posBottomLeft)) then { + if ((_currentMousePos distance2D _posBottomLeft) < ((GVAR(freeDrawingData) select 1) distance2D _posBottomLeft)) then { GVAR(freeDrawingData) set [1, _currentMousePos]; }; - if ((_currentMousePos distance2d _posBottomRight) < ((GVAR(freeDrawingData) select 2) distance2d _posBottomRight)) then { + if ((_currentMousePos distance2D _posBottomRight) < ((GVAR(freeDrawingData) select 2) distance2D _posBottomRight)) then { GVAR(freeDrawingData) set [2, _currentMousePos]; }; }; diff --git a/addons/marker_flags/XEH_preStart.sqf b/addons/marker_flags/XEH_preStart.sqf index 2a2bc521616..e671b522a4c 100644 --- a/addons/marker_flags/XEH_preStart.sqf +++ b/addons/marker_flags/XEH_preStart.sqf @@ -2,5 +2,5 @@ #include "XEH_PREP.hpp" -private _weapons = (configProperties [configfile >> "CfgWeapons", QUOTE(isClass _x && {isText (_x >> QQGVAR(vehicle))}), true]) apply {configName _x}; +private _weapons = (configProperties [configFile >> "CfgWeapons", QUOTE(isClass _x && {isText (_x >> QQGVAR(vehicle))}), true]) apply {configName _x}; uiNamespace setVariable [QGVAR(flagItems), compileFinal str _weapons]; diff --git a/addons/markers/XEH_preInit.sqf b/addons/markers/XEH_preInit.sqf index 142dedb89a1..605920b7770 100644 --- a/addons/markers/XEH_preInit.sqf +++ b/addons/markers/XEH_preInit.sqf @@ -12,7 +12,7 @@ PREP_RECOMPILE_END; if (isNil QGVAR(MarkersCache)) then { GVAR(MarkersCache) = []; - private _config = configfile >> "CfgMarkers"; + private _config = configFile >> "CfgMarkers"; for "_a" from 0 to (count _config - 1) do { private _marker = _config select _a; @@ -31,7 +31,7 @@ if (isNil QGVAR(MarkersCache)) then { if (isNil QGVAR(MarkerColorsCache)) then { GVAR(MarkerColorsCache) = []; - private _config = configfile >> "CfgMarkerColors"; + private _config = configFile >> "CfgMarkerColors"; for "_a" from 0 to (count _config - 1) do { private _marker = _config select _a; diff --git a/addons/markers/functions/fnc_initInsertMarker.sqf b/addons/markers/functions/fnc_initInsertMarker.sqf index a102502b24c..2a3804959f2 100644 --- a/addons/markers/functions/fnc_initInsertMarker.sqf +++ b/addons/markers/functions/fnc_initInsertMarker.sqf @@ -19,7 +19,7 @@ #define BORDER 0.005 [{ - disableserialization; + disableSerialization; params ["_display"]; TRACE_1("params",_display); @@ -29,24 +29,24 @@ }; //BIS Controls: - private _text = _display displayctrl IDC_INSERT_MARKER; - private _picture = _display displayctrl IDC_INSERT_MARKER_PICTURE; - private _channel = _display displayctrl IDC_INSERT_MARKER_CHANNELS; - private _buttonOK = _display displayctrl IDC_OK; - private _buttonCancel = _display displayctrl IDC_CANCEL; - private _description = _display displayctrl 1100; - private _title = _display displayctrl 1001; - private _descriptionChannel = _display displayctrl 1101; + private _text = _display displayCtrl IDC_INSERT_MARKER; + private _picture = _display displayCtrl IDC_INSERT_MARKER_PICTURE; + private _channel = _display displayCtrl IDC_INSERT_MARKER_CHANNELS; + private _buttonOK = _display displayCtrl IDC_OK; + private _buttonCancel = _display displayCtrl IDC_CANCEL; + private _description = _display displayCtrl 1100; + private _title = _display displayCtrl 1001; + private _descriptionChannel = _display displayCtrl 1101; //ACE Controls: private _ctrlTimestamp = _display displayCtrl IDC_ACE_INSERT_MARKER_TIMESTAMP; private _ctrlTimestampText = _display displayCtrl IDC_ACE_INSERT_MARKER_TIMESTAMP_TEXT; - private _aceShapeLB = _display displayctrl IDC_ACE_INSERT_MARKER_SHAPE; - private _aceColorLB = _display displayctrl IDC_ACE_INSERT_MARKER_COLOR; - private _aceAngleSlider = _display displayctrl IDC_ACE_INSERT_MARKER_ANGLE; - private _aceAngleSliderText = _display displayctrl IDC_ACE_INSERT_MARKER_ANGLE_TEXT; - private _aceScaleSlider = _display displayctrl IDC_ACE_INSERT_MARKER_SCALE; - private _aceScaleSliderText = _display displayctrl IDC_ACE_INSERT_MARKER_SCALE_TEXT; + private _aceShapeLB = _display displayCtrl IDC_ACE_INSERT_MARKER_SHAPE; + private _aceColorLB = _display displayCtrl IDC_ACE_INSERT_MARKER_COLOR; + private _aceAngleSlider = _display displayCtrl IDC_ACE_INSERT_MARKER_ANGLE; + private _aceAngleSliderText = _display displayCtrl IDC_ACE_INSERT_MARKER_ANGLE_TEXT; + private _aceScaleSlider = _display displayCtrl IDC_ACE_INSERT_MARKER_SCALE; + private _aceScaleSliderText = _display displayCtrl IDC_ACE_INSERT_MARKER_SCALE_TEXT; private _mapDisplay = displayParent _display; if (isNull _mapDisplay) exitWith {ERROR("No Map");}; @@ -102,7 +102,7 @@ ctrlSetFocus _text; //--- Background - private _pos = ctrlposition _text; + private _pos = ctrlPosition _text; _pos params ["_posX", "_posY", "_posW", "_posH"]; _posX = _posX + 0.01; _posY = _posY min ((safeZoneH + safeZoneY) - (11 * _posH + 11 * BORDER)); //prevent buttons being placed below bottom edge of screen diff --git a/addons/markers/functions/fnc_mapDisplayInitEH.sqf b/addons/markers/functions/fnc_mapDisplayInitEH.sqf index e5242b9067c..6d26d3dab81 100644 --- a/addons/markers/functions/fnc_mapDisplayInitEH.sqf +++ b/addons/markers/functions/fnc_mapDisplayInitEH.sqf @@ -18,14 +18,14 @@ params ["_display"]; TRACE_1("params",_display); -private _bisShapeLB = _display displayctrl 1091; +private _bisShapeLB = _display displayCtrl 1091; private _curSelShape = missionNamespace getVariable [QGVAR(curSelMarkerShape), 0]; TRACE_2("shape",_bisShapeLB,_curSelShape); _bisShapeLB ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedShape)}]; _bisShapeLB lbSetCurSel _curSelShape; -private _bisColorLB = _display displayctrl 1090; +private _bisColorLB = _display displayCtrl 1090; private _curSelColor = missionNamespace getVariable [QGVAR(curSelMarkerColor), 0]; TRACE_2("color",_bisColorLB,_curSelColor); _bisColorLB ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedColor)}]; diff --git a/addons/markers/functions/fnc_placeMarker.sqf b/addons/markers/functions/fnc_placeMarker.sqf index fdd758be5e1..1899dff5fd5 100644 --- a/addons/markers/functions/fnc_placeMarker.sqf +++ b/addons/markers/functions/fnc_placeMarker.sqf @@ -35,7 +35,7 @@ if (_closeNum isEqualTo 1) then { private _newestMarkerDist = 1e10; { - private _distX = GVAR(currentMarkerPosition) distance2d (getMarkerPos _x); + private _distX = GVAR(currentMarkerPosition) distance2D (getMarkerPos _x); if (_distX < _newestMarkerDist) then { _newestMarker = _x; _newestMarkerDist = _distX; diff --git a/addons/markers/functions/fnc_setMarkerJIP.sqf b/addons/markers/functions/fnc_setMarkerJIP.sqf index 12dfe5de77d..fe4a1b68ae5 100644 --- a/addons/markers/functions/fnc_setMarkerJIP.sqf +++ b/addons/markers/functions/fnc_setMarkerJIP.sqf @@ -27,7 +27,7 @@ TRACE_2("params",_allMapMarkers,_allMapMarkersProperties); private _data = _allMapMarkersProperties select _index; _data params ["_markerClassname", "_colorClassname", "_pos", "_dir", "_scale"]; - private _config = (configfile >> "CfgMarkers") >> _markerClassname; + private _config = (configFile >> "CfgMarkers") >> _markerClassname; if (!isClass _config) then { WARNING("CfgMarker not found, changed to milDot"); @@ -36,7 +36,7 @@ TRACE_2("params",_allMapMarkers,_allMapMarkersProperties); _x setMarkerTypeLocal configName _config; - _config = configfile >> "CfgMarkerColors" >> _colorClassname; + _config = configFile >> "CfgMarkerColors" >> _colorClassname; if (!isClass _config) then { WARNING("CfgMarkerColors not found, changed to Default"); diff --git a/addons/markers/functions/fnc_setMarkerNetwork.sqf b/addons/markers/functions/fnc_setMarkerNetwork.sqf index 7d0cc0e8271..94c66f40789 100644 --- a/addons/markers/functions/fnc_setMarkerNetwork.sqf +++ b/addons/markers/functions/fnc_setMarkerNetwork.sqf @@ -21,7 +21,7 @@ params ["_marker", "_data"]; TRACE_2("params",_marker,_data); _data params ["_markerClassname", "_colorClassname", "_pos", "_dir", "_scale"]; -private _config = configfile >> "CfgMarkers" >> _markerClassname; +private _config = configFile >> "CfgMarkers" >> _markerClassname; if (!isClass _config) then { WARNING("CfgMarker not found, changed to milDot"); @@ -30,7 +30,7 @@ if (!isClass _config) then { _marker setMarkerTypeLocal configName _config; -_config = configfile >> "CfgMarkerColors" >> _colorClassname; +_config = configFile >> "CfgMarkerColors" >> _colorClassname; if (!isClass _config) then { WARNING("CfgMarkerColors not found, changed to Default"); diff --git a/addons/maverick/CfgAmmo.hpp b/addons/maverick/CfgAmmo.hpp index 7e66e2edee0..dbf847b10d6 100644 --- a/addons/maverick/CfgAmmo.hpp +++ b/addons/maverick/CfgAmmo.hpp @@ -1,3 +1,4 @@ +class ace_missileguidance_type_Maverick; class CfgAmmo { class MissileCore; class MissileBase: MissileCore { @@ -9,32 +10,8 @@ class CfgAmmo { author = "Dani (TCVM)"; missileLockMaxDistance = 14000; maneuvrability = 0; - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance_type_Maverick { enabled = 1; - - pitchRate = 15; - yawRate = 15; - - canVanillaLock = 1; - - defaultSeekerType = "Optic"; - seekerTypes[] = {"Optic"}; - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = {"LOBL"}; - - defaultNavigationType = "AugmentedProportionalNavigation"; - navigationTypes[] = { "AugmentedProportionalNavigation" }; - - seekLastTargetPos = 1; - seekerAngle = 60; - seekerAccuracy = 1; - - seekerMinRange = 1; - seekerMaxRange = 14000; - - defaultAttackProfile = "maverick"; - attackProfiles[] = {"maverick"}; }; }; @@ -52,32 +29,15 @@ class CfgAmmo { manualControl = 0; missileLockMaxDistance = 16000; weaponLockSystem = 4; - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance_type_Maverick { enabled = 1; - - pitchRate = 15; - yawRate = 15; - - canVanillaLock = 0; - defaultSeekerType = "SALH"; seekerTypes[] = {"SALH"}; defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = {"LOAL","LOBL"}; - - defaultNavigationType = "AugmentedProportionalNavigation"; - navigationTypes[] = { "AugmentedProportionalNavigation" }; - - seekLastTargetPos = 1; - seekerAngle = 60; - seekerAccuracy = 1; + seekerLockModes[] = {"LOAL"}; - seekerMinRange = 1; seekerMaxRange = 16000; - - defaultAttackProfile = "maverick"; - attackProfiles[] = {"maverick"}; }; }; @@ -87,32 +47,19 @@ class CfgAmmo { irLock = 0; missileLockMaxDistance = 10000; weaponLockSystem = 4; - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance_type_Maverick { enabled = 1; - pitchRate = 20; yawRate = 20; - canVanillaLock = 0; - defaultSeekerType = "SALH"; seekerTypes[] = {"SALH"}; defaultSeekerLockMode = "LOAL"; seekerLockModes[] = {"LOAL"}; - defaultNavigationType = "AugmentedProportionalNavigation"; - navigationTypes[] = { "AugmentedProportionalNavigation" }; - - seekLastTargetPos = 1; seekerAngle = 40; - seekerAccuracy = 1; - - seekerMinRange = 1; seekerMaxRange = 10000; - - defaultAttackProfile = "maverick"; - attackProfiles[] = {"maverick"}; }; }; }; diff --git a/addons/maverick/stringtable.xml b/addons/maverick/stringtable.xml index 60af8c830f8..591111f9a85 100644 --- a/addons/maverick/stringtable.xml +++ b/addons/maverick/stringtable.xml @@ -113,24 +113,38 @@ AGM-65 Maverick D + AGM-65 Maverick D + AGM-65 Maverick D AGM-65 Maverick G + AGM-65 Maverick G + AGM-65 Maverick G AGM-65 Maverick D [ACE] + AGM-65 Maverick D [ACE] + AGM-65 Maverick D [ACE] 3x AGM-65 Maverick D [ACE] + 3x AGM-65 Maverick D [ACE] + 3x AGM-65 Maverick D [ACE] AGM-65 Maverick G [ACE] + AGM-65 Maverick G [ACE] + AGM-65 Maverick G [ACE] 2x AGM-65 Maverick G [ACE] + 2x AGM-65 Maverick G [ACE] + 2x AGM-65 Maverick G [ACE] 3x AGM-65 Maverick G [ACE] + 3x AGM-65 Maverick G [ACE] + 3x AGM-65 Maverick G [ACE] diff --git a/addons/medical/initSettings.inc.sqf b/addons/medical/initSettings.inc.sqf index 3c54f47cee1..adc53c2ea83 100644 --- a/addons/medical/initSettings.inc.sqf +++ b/addons/medical/initSettings.inc.sqf @@ -34,7 +34,7 @@ "SLIDER", [LSTRING(SpontaneousWakeUpChance_DisplayName), LSTRING(SpontaneousWakeUpChance_Description)], LSTRING(Category), - [0, 1, 0.05, 2, true], + [0, 1, 0.1, 2, true], true ] call CBA_fnc_addSetting; @@ -43,6 +43,6 @@ "SLIDER", [LSTRING(spontaneousWakeUpEpinephrineBoost_DisplayName), LSTRING(spontaneousWakeUpEpinephrineBoost_Description)], LSTRING(Category), - [1, 30, 1, 1], + [1, 30, 1.5, 1], true ] call CBA_fnc_addSetting; diff --git a/addons/medical_ai/XEH_preStart.sqf b/addons/medical_ai/XEH_preStart.sqf index ccb92538b74..3782a3eab78 100644 --- a/addons/medical_ai/XEH_preStart.sqf +++ b/addons/medical_ai/XEH_preStart.sqf @@ -25,4 +25,4 @@ private _itemHash = createHashMap; ["morphine", ["morphine"]], ["epinephrine", ["epinephrine"]] ]; -uinamespace setVariable [QGVAR(itemHash), compileFinal _itemHash]; +uiNamespace setVariable [QGVAR(itemHash), compileFinal _itemHash]; diff --git a/addons/medical_ai/functions/fnc_addHealingCommandActions.sqf b/addons/medical_ai/functions/fnc_addHealingCommandActions.sqf index cc91ca7eb3c..9228cd3ad51 100644 --- a/addons/medical_ai/functions/fnc_addHealingCommandActions.sqf +++ b/addons/medical_ai/functions/fnc_addHealingCommandActions.sqf @@ -30,7 +30,7 @@ private _action = [ [ [ QGVAR(medicHeal_) + str _x, - format ["%1: (%2)", [_x, false, true] call EFUNC(common,getName), groupID _x], + format ["%1: (%2)", [_x, false, true] call EFUNC(common,getName), groupId _x], "", {}, {true}, @@ -41,7 +41,7 @@ private _action = [ [ [ QGVAR(healUnit_) + str _x, - format [localize "str_action_heal_soldier", ([_x, false, true] call EFUNC(common,getName)) + " (" + str groupID _x + ")"], + format [localize "str_action_heal_soldier", ([_x, false, true] call EFUNC(common,getName)) + " (" + str groupId _x + ")"], "", { (_this select 2) params ["_healer", "_target"]; diff --git a/addons/medical_damage/functions/fnc_debug_explosiveTest.sqf b/addons/medical_damage/functions/fnc_debug_explosiveTest.sqf index d17b268c157..a867a654707 100644 --- a/addons/medical_damage/functions/fnc_debug_explosiveTest.sqf +++ b/addons/medical_damage/functions/fnc_debug_explosiveTest.sqf @@ -34,7 +34,7 @@ params [ _distances params [["_min", 1], ["_max", 10], ["_step", 1]]; -if (isNil "_center") exitwith {}; +if (isNil "_center") exitWith {}; _max = _max max _min; private _nSteps = 0 max ceil ((_max - _min) / _step); diff --git a/addons/medical_engine/functions/fnc_handleDamage.sqf b/addons/medical_engine/functions/fnc_handleDamage.sqf index 168203366c2..591e68e2533 100644 --- a/addons/medical_engine/functions/fnc_handleDamage.sqf +++ b/addons/medical_engine/functions/fnc_handleDamage.sqf @@ -94,7 +94,7 @@ if ( GET_NUMBER(_ammoCfg >> "explosive",0) > 0 || {GET_NUMBER(_ammoCfg >> "indirectHit",0) > 0} } -) exitwith { +) exitWith { TRACE_5("Vehicle hit",_unit,_shooter,_instigator,_damage,_newDamage); _unit setVariable [QEGVAR(medical,lastDamageSource), _shooter]; @@ -165,7 +165,11 @@ if (_context == 2) then { if (_environmentDamage) then { // Any collision with terrain/vehicle/object has a shooter // Check this first because burning can happen at any velocity - if !(isNull _shooter) then { + if (isNull _shooter) then { + // Anything else is almost guaranteed to be fire damage + _ammo = "fire"; + TRACE_5("Fire Damage",_unit,_shooter,_instigator,_damage,_allDamages); + } else { /* If shooter != unit then they hit unit, otherwise it could be: - Unit hitting anything at speed @@ -180,10 +184,6 @@ if (_context == 2) then { _ammo = "collision"; TRACE_5("Collision",_unit,_shooter,_instigator,_damage,_allDamages); }; - } else { - // Anything else is almost guaranteed to be fire damage - _ammo = "fire"; - TRACE_5("Fire Damage",_unit,_shooter,_instigator,_damage,_allDamages); }; }; diff --git a/addons/medical_engine/functions/fnc_updateDamageEffects.sqf b/addons/medical_engine/functions/fnc_updateDamageEffects.sqf index 7dc73e04f47..f4a18094a60 100644 --- a/addons/medical_engine/functions/fnc_updateDamageEffects.sqf +++ b/addons/medical_engine/functions/fnc_updateDamageEffects.sqf @@ -67,7 +67,7 @@ if (!_isLimping && {EGVAR(medical,limping) > 0}) then { (_xAmountOf > 0) && {_xDamage > LIMPING_DAMAGE_THRESHOLD} // select _causeLimping from woundDetails - && {(EGVAR(medical_damage,woundDetails) get (_xClassID / 10)) select 3} + && {(EGVAR(medical_damage,woundDetails) get (floor (_xClassID / 10))) select 3} ) exitWith { TRACE_1("limping because of wound",_x); _isLimping = true; diff --git a/addons/medical_gui/functions/fnc_displayPatientInformation.sqf b/addons/medical_gui/functions/fnc_displayPatientInformation.sqf index 65660eec798..abea0ec07bb 100644 --- a/addons/medical_gui/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical_gui/functions/fnc_displayPatientInformation.sqf @@ -40,6 +40,7 @@ if (isNull _display) then { if (ACE_player distance _target > MAX_DISTANCE && {vehicle _target != vehicle ACE_player}) exitWith { [_pfhID] call CBA_fnc_removePerFrameHandler; QGVAR(RscPatientInfo) cutFadeOut 0.3; + if (((getPosATL _target) # 2) < -9) exitWith {}; // handle dragging corpse/clone [[ELSTRING(medical,DistanceToFar), _target call EFUNC(common,getName)], 2] call EFUNC(common,displayTextStructured); }; diff --git a/addons/medical_gui/functions/fnc_menuPFH.sqf b/addons/medical_gui/functions/fnc_menuPFH.sqf index b3d51c2dc9c..0e213eaf5ec 100644 --- a/addons/medical_gui/functions/fnc_menuPFH.sqf +++ b/addons/medical_gui/functions/fnc_menuPFH.sqf @@ -23,6 +23,8 @@ if !( closeDialog 0; // Show hint if distance condition failed if ((ACE_player distance GVAR(target) > GVAR(maxDistance)) && {vehicle ACE_player != vehicle GVAR(target)}) then { + if (((getPosATL GVAR(target)) # 2) < -9) exitWith {}; // handle dragging corpse/clone + [[ELSTRING(medical,DistanceToFar), GVAR(target) call EFUNC(common,getName)], 2] call EFUNC(common,displayTextStructured); }; }; diff --git a/addons/medical_status/functions/fnc_addInventoryActions.sqf b/addons/medical_status/functions/fnc_addInventoryActions.sqf index 8041eb06135..e4e65a31649 100644 --- a/addons/medical_status/functions/fnc_addInventoryActions.sqf +++ b/addons/medical_status/functions/fnc_addInventoryActions.sqf @@ -46,5 +46,6 @@ _unit addAction ["OpenBag", { {!lockedInventory _backpackContainer} && {maxLoad _backpackContainer > 0} && {getNumber (_backpackConfig >> "disableInventory") != 1} && + {!(_target isKindOf QEGVAR(dragging,clone))} && {_target setUserActionText [_actionId, format [localize "STR_ACTION_OPEN_BAG", getText (_backpackConfig >> "displayName")]]; true} }, 2]; diff --git a/addons/medical_treatment/XEH_postInit.sqf b/addons/medical_treatment/XEH_postInit.sqf index 0752e67ddf4..63d2f7d0967 100644 --- a/addons/medical_treatment/XEH_postInit.sqf +++ b/addons/medical_treatment/XEH_postInit.sqf @@ -80,7 +80,7 @@ if (["ace_trenches"] call EFUNC(common,isModLoaded)) then { {!isNil {_target getVariable QGVAR(headstoneData)}} ] call EFUNC(interact_menu,createAction); - [missionNameSpace getVariable [QGVAR(graveClassname), "ACE_Grave"], 0, [], _checkHeadstoneAction] call EFUNC(interact_menu,addActionToClass); + [missionNamespace getVariable [QGVAR(graveClassname), "ACE_Grave"], 0, [], _checkHeadstoneAction] call EFUNC(interact_menu,addActionToClass); }; if (isServer) then { diff --git a/addons/medical_treatment/functions/fnc_hasItem.sqf b/addons/medical_treatment/functions/fnc_hasItem.sqf index e0ef4c8a4fe..8faea65652f 100644 --- a/addons/medical_treatment/functions/fnc_hasItem.sqf +++ b/addons/medical_treatment/functions/fnc_hasItem.sqf @@ -31,7 +31,7 @@ private _fnc_checkItems = { _unitItems append (itemCargo _unitVehicle); _unitItems append (magazineCargo _unitVehicle); }; - _items findIf {_x in _unitItems} != -1 + _items findAny _unitItems != -1 }; _medic call _fnc_checkItems || {GVAR(allowSharedEquipment) != 2 && {_patient call _fnc_checkItems}} diff --git a/addons/medical_treatment/functions/fnc_ivBagLocal.sqf b/addons/medical_treatment/functions/fnc_ivBagLocal.sqf index 80f06fc11e0..dc416f90c50 100644 --- a/addons/medical_treatment/functions/fnc_ivBagLocal.sqf +++ b/addons/medical_treatment/functions/fnc_ivBagLocal.sqf @@ -23,7 +23,7 @@ params ["_patient", "_bodyPart", "_classname"]; private _bloodVolume = GET_BLOOD_VOLUME(_patient); if (_bloodVolume >= DEFAULT_BLOOD_VOLUME) exitWith {}; -private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; +private _partIndex = ALL_BODY_PARTS find toLowerANSI _bodyPart; // Get attributes for the used IV private _defaultConfig = configFile >> QUOTE(ADDON) >> "IV"; diff --git a/addons/medical_treatment/functions/fnc_medicationLocal.sqf b/addons/medical_treatment/functions/fnc_medicationLocal.sqf index 0b23b365e84..18ef4e4d680 100644 --- a/addons/medical_treatment/functions/fnc_medicationLocal.sqf +++ b/addons/medical_treatment/functions/fnc_medicationLocal.sqf @@ -49,7 +49,7 @@ TRACE_1("Running treatmentMedicationLocal with Advanced configuration for",_pati // Handle tourniquet on body part blocking blood flow at injection site -private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; +private _partIndex = ALL_BODY_PARTS find toLowerANSI _bodyPart; if (HAS_TOURNIQUET_APPLIED_ON(_patient,_partIndex)) exitWith { TRACE_1("unit has tourniquets blocking blood flow on injection site",_tourniquets); diff --git a/addons/medical_treatment/functions/fnc_placeBodyBagInGrave.sqf b/addons/medical_treatment/functions/fnc_placeBodyBagInGrave.sqf index 82cd2bc080b..55908b1e17d 100644 --- a/addons/medical_treatment/functions/fnc_placeBodyBagInGrave.sqf +++ b/addons/medical_treatment/functions/fnc_placeBodyBagInGrave.sqf @@ -29,7 +29,7 @@ TRACE_2("placeBodyBagInGrave",_bodybag,_medic); if (GVAR(graveDiggingMarker)) then { _graveClassname = missionNamespace getVariable [QGVAR(graveClassname), "ACE_Grave"]; }; - private _graveRotation = missionNameSpace getVariable [QGVAR(graveRotation), 0]; + private _graveRotation = missionNamespace getVariable [QGVAR(graveRotation), 0]; [[_medic, _bodybag], _graveClassname, [0,0,0], _graveRotation, true] call FUNC(placeInBodyBagOrGrave); }, diff --git a/addons/medical_treatment/functions/fnc_placeInGrave.sqf b/addons/medical_treatment/functions/fnc_placeInGrave.sqf index 6bea5c6db96..afc6a1fe4a2 100644 --- a/addons/medical_treatment/functions/fnc_placeInGrave.sqf +++ b/addons/medical_treatment/functions/fnc_placeInGrave.sqf @@ -27,7 +27,7 @@ private _graveClassname = ""; if (GVAR(graveDiggingMarker)) then { _graveClassname = missionNamespace getVariable [QGVAR(graveClassname), "ACE_Grave"]; }; -private _graveRotation = missionNameSpace getVariable [QGVAR(graveRotation), 0]; +private _graveRotation = missionNamespace getVariable [QGVAR(graveRotation), 0]; [_this, _graveClassname, [0,0,0], _graveRotation, true] call FUNC(placeInBodyBagOrGrave) diff --git a/addons/medical_treatment/functions/fnc_splintLocal.sqf b/addons/medical_treatment/functions/fnc_splintLocal.sqf index ee15a63bf0c..4861f428cdd 100644 --- a/addons/medical_treatment/functions/fnc_splintLocal.sqf +++ b/addons/medical_treatment/functions/fnc_splintLocal.sqf @@ -20,7 +20,7 @@ params ["_medic", "_patient", "_bodyPart"]; TRACE_3("splintLocal",_medic,_patient,_bodyPart); -private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; +private _partIndex = ALL_BODY_PARTS find toLowerANSI _bodyPart; private _fractures = GET_FRACTURES(_patient); _fractures set [_partIndex, -1]; diff --git a/addons/medical_treatment/functions/fnc_tourniquetLocal.sqf b/addons/medical_treatment/functions/fnc_tourniquetLocal.sqf index 9a0480bcb01..0ed8afd37c9 100644 --- a/addons/medical_treatment/functions/fnc_tourniquetLocal.sqf +++ b/addons/medical_treatment/functions/fnc_tourniquetLocal.sqf @@ -19,7 +19,7 @@ params ["_patient", "_bodyPart"]; TRACE_2("tourniquetLocal",_patient,_bodyPart); -private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; +private _partIndex = ALL_BODY_PARTS find toLowerANSI _bodyPart; private _tourniquets = GET_TOURNIQUETS(_patient); _tourniquets set [_partIndex, CBA_missionTime]; diff --git a/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf b/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf index 97680353e45..80dab5094cf 100644 --- a/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf +++ b/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf @@ -22,7 +22,7 @@ params ["_medic", "_patient", "_bodyPart"]; TRACE_3("tourniquetRemove",_medic,_patient,_bodyPart); // Remove tourniquet from body part, exit if no tourniquet applied -private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; +private _partIndex = ALL_BODY_PARTS find toLowerANSI _bodyPart; private _tourniquets = GET_TOURNIQUETS(_patient); if (_tourniquets select _partIndex == 0) exitWith { diff --git a/addons/metis/CfgAmmo.hpp b/addons/metis/CfgAmmo.hpp index c070343253a..4a6fe513d23 100644 --- a/addons/metis/CfgAmmo.hpp +++ b/addons/metis/CfgAmmo.hpp @@ -1,3 +1,4 @@ +class ace_missileguidance_type_Metis; class CfgAmmo { class M_Vorona_HEAT; class GVAR(HEAT): M_Vorona_HEAT { @@ -7,42 +8,8 @@ class CfgAmmo { airLock = 0; lockType = 0; - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance_type_Metis { enabled = 1; - - pitchRate = 50; // Minium flap deflection for guidance - yawRate = 50; // Maximum flap deflection for guidance - initialPitch = 2; - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 10; - lineGainD = 9; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 15; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 80; - seekerMaxRange = 2000; // Range from the missile which the seeker can visually search - - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "WIRE"; - attackProfiles[] = {"WIRE"}; }; }; @@ -54,40 +21,8 @@ class CfgAmmo { airLock = 0; lockType = 0; - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance_type_Metis { enabled = 1; - - pitchRate = 25; // Minium flap deflection for guidance - yawRate = 25; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 21; - lineGainD = 18; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 15; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 80; - seekerMaxRange = 2000; // Range from the missile which the seeker can visually search - - correctionDistance = 1; // distance from center of crosshair where missile slows down - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "WIRE"; - attackProfiles[] = {"WIRE"}; }; }; }; diff --git a/addons/microdagr/CfgUIGrids.hpp b/addons/microdagr/CfgUIGrids.hpp index 5d7b921800a..3c5379f879d 100644 --- a/addons/microdagr/CfgUIGrids.hpp +++ b/addons/microdagr/CfgUIGrids.hpp @@ -3,7 +3,7 @@ class CfgUIGrids { class Presets { class Arma3 { class Variables { - grid_ACE_microDagr[] = {{"(safezoneX + safezoneW - 11 * (((safezoneW / safezoneH) min 1.2) / 40))","(safezoneY + safezoneH - 15 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))","(10 * (((safezoneW / safezoneH) min 1.2) / 40))","(10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))"},"(((safezoneW / safezoneH) min 1.2) / 40)","((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"}; + grid_ACE_microDagr[] = {{"(safeZoneX + safeZoneW - 11 * (((safeZoneW / safeZoneH) min 1.2) / 40))","(safeZoneY + safeZoneH - 15 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25))","(10 * (((safeZoneW / safeZoneH) min 1.2) / 40))","(10 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25))"},"(((safeZoneW / safeZoneH) min 1.2) / 40)","((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"}; }; }; }; diff --git a/addons/microdagr/functions/fnc_showApplicationPage.sqf b/addons/microdagr/functions/fnc_showApplicationPage.sqf index 75f817ad3f3..e150bf2261a 100644 --- a/addons/microdagr/functions/fnc_showApplicationPage.sqf +++ b/addons/microdagr/functions/fnc_showApplicationPage.sqf @@ -57,7 +57,7 @@ if (GVAR(currentApplicationPage) == APP_MODE_INFODISPLAY) then { (_display displayCtrl IDC_MAPDETAILS) ctrlShow ((GVAR(currentApplicationPage) == APP_MODE_MAP) && {GVAR(mapShowTexture)}); if (GVAR(currentApplicationPage) == APP_MODE_MAP) then { - _theMap = if (!GVAR(mapShowTexture)) then {_display displayCtrl IDC_MAPPLAIN} else {_display displayCtrl IDC_MAPDETAILS}; + _theMap = if (GVAR(mapShowTexture)) then {_display displayCtrl IDC_MAPDETAILS} else {_display displayCtrl IDC_MAPPLAIN}; _mapSize = (ctrlPosition _theMap) select 3; _theMap ctrlMapAnimAdd [0, (GVAR(mapZoom) / _mapSize), GVAR(mapPosition)]; ctrlMapAnimCommit _theMap; diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index 3e5775b86dc..e5de2b2fe49 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -24,7 +24,7 @@ if (isNull _display) exitWith {ERROR("No Display");}; private _daylight = [] call EFUNC(common,ambientBrightness); (_display displayCtrl IDC_MICRODAGRSHELL) ctrlSetTextColor [_daylight, _daylight, _daylight, 1]; -(_display displayCtrl IDC_CLOCKTEXT) ctrlSetText ([daytime, "HH:MM"] call bis_fnc_timeToString); +(_display displayCtrl IDC_CLOCKTEXT) ctrlSetText ([dayTime, "HH:MM"] call bis_fnc_timeToString); private _waypoints = [] call FUNC(deviceGetWaypoints); @@ -61,7 +61,7 @@ case (APP_MODE_INFODISPLAY): { private _dayString = if ((date select 2) < 10) then {"0" + str (date select 2)} else {str (date select 2)}; (_display displayCtrl IDC_MODEDISPLAY_TIMEDISPLAYGREEN1) ctrlSetText format ["%1-%2-%3", _yearString, _monthSring, _dayString]; //"18-Feb-2010"; - (_display displayCtrl IDC_MODEDISPLAY_TIMEDISPLAYGREEN2) ctrlSetText ([daytime, "HH:MM:SS"] call bis_fnc_timeToString); + (_display displayCtrl IDC_MODEDISPLAY_TIMEDISPLAYGREEN2) ctrlSetText ([dayTime, "HH:MM:SS"] call bis_fnc_timeToString); } else { private _targetPosName = ""; private _targetPosLocationASL = []; diff --git a/addons/microdagr/gui.hpp b/addons/microdagr/gui.hpp index 1404f6b81db..2a3f52deb43 100644 --- a/addons/microdagr/gui.hpp +++ b/addons/microdagr/gui.hpp @@ -40,8 +40,8 @@ class GVAR(RscText): RscText { }; //Redfine Scaling for the Dialog -#define X_PART(num) QUOTE((((60 - 25)/2) + (num)) * (safeZoneH / 64) + (safezoneX + (safezoneW - safeZoneH)/2)) -#define Y_PART(num) QUOTE((0 + (num)) * (safeZoneH / 36) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)) +#define X_PART(num) QUOTE((((60 - 25)/2) + (num)) * (safeZoneH / 64) + (safeZoneX + (safeZoneW - safeZoneH)/2)) +#define Y_PART(num) QUOTE((0 + (num)) * (safeZoneH / 36) + (safeZoneY + (safeZoneH - (safeZoneH / 1.2))/2)) #define W_PART(num) QUOTE((num) * (safeZoneH / 64)) #define H_PART(num) QUOTE((num) * (safeZoneH / 36)) diff --git a/addons/minedetector/XEH_postInit.sqf b/addons/minedetector/XEH_postInit.sqf index f5f5de0ca8a..0671699f9e8 100644 --- a/addons/minedetector/XEH_postInit.sqf +++ b/addons/minedetector/XEH_postInit.sqf @@ -16,9 +16,9 @@ addMissionEventHandler ["Draw3D", { { private _name = format ["%1@%2", typeOf _x, (floor ((_x distance _detectorPointAGL) * 10)) / 10]; if ((getNumber (configOf _x >> QGVAR(detectable))) == 1) then { - drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [1,0,0,1], (ASLtoAGL (getPosASL _x)), 1, 1, 0, _name, 1, 0.02, "PuristaMedium"]; + drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [1,0,0,1], (ASLToAGL (getPosASL _x)), 1, 1, 0, _name, 1, 0.02, "PuristaMedium"]; } else { - drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [1,1,0,1], (ASLtoAGL (getPosASL _x)), 1, 1, 0, _name, 1, 0.02, "PuristaMedium"]; + drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [1,1,0,1], (ASLToAGL (getPosASL _x)), 1, 1, 0, _name, 1, 0.02, "PuristaMedium"]; }; } forEach _mines; }]; diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index d9813fdf772..44e35d40811 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -17,33 +17,8 @@ class CfgAmmo { EGVAR(rearm,caliber) = 70; - class ADDON { + class ADDON: GVAR(type_Dagr) { enabled = 1; - - pitchRate = 40; // degrees per second - yawRate = 40; - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "SALH"; - seekerTypes[] = { "SALH" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "AugmentedProportionalNavigation"; - navigationTypes[] = { "AugmentedProportionalNavigation" }; - - seekerAngle = 90; // Angle in front of the missile which can be searched - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 1; - seekerMaxRange = 2500; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "LIN"; - attackProfiles[] = { "LIN", "DIR", "MID", "HI" }; }; }; @@ -68,53 +43,8 @@ class CfgAmmo { initTime = 0.5; // Begin ACE guidance Configs - class ADDON { + class ADDON: GVAR(type_Javelin) { enabled = 1; - - pitchRate = 100; // degrees per second - yawRate = 100; - stabilityCoefficient = 0.2; - bangBangGuidance = 0; - - canVanillaLock = 0; - - // Guidance type for munitions - defaultSeekerType = "Optic"; - seekerTypes[] = { "Optic" }; - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = { "LOBL" }; - - defaultNavigationType = "Direct"; - navigationTypes[] = { "Direct", "ZeroEffortMiss" }; - - navigationGain = 3; - - seekerAngle = 180; // Angle in front of the missile which can be searched - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 0; - seekerMaxRange = 2500; // Range from the missile which the seeker can visually search - - seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] - - // Attack profile type selection - defaultAttackProfile = "JAV_TOP"; - attackProfiles[] = { "JAV_TOP", "JAV_DIR" }; - useModeForAttackProfile = 1; - - class navigationStates { - class initial { - transitionCondition = QFUNC(javelin_midCourseTransition); - navigationType = "Direct"; - }; - class terminal { - transitionCondition = ""; - navigationType = "ZeroEffortMiss"; - }; - // transitions from initial -> termimal - states[] = {"initial", "terminal"}; - }; }; }; class ACE_Javelin_FGM148_static: ACE_Javelin_FGM148 { @@ -123,6 +53,8 @@ class CfgAmmo { effectsMissileInit = "RocketBackEffectsStaticRPG"; //Explicity add guidance config - class ADDON: ADDON {}; + class ADDON: ADDON { + enabled = 1; + }; }; }; diff --git a/addons/missileguidance/CfgMissileTypesNato.hpp b/addons/missileguidance/CfgMissileTypesNato.hpp new file mode 100644 index 00000000000..ee4c76890e9 --- /dev/null +++ b/addons/missileguidance/CfgMissileTypesNato.hpp @@ -0,0 +1,716 @@ +class GVAR(type_AMRAAM) { + enabled = 0; + + pitchRate = 30; // Minium flap deflection for guidance + yawRate = 30; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "DopplerRadar"; + seekerTypes[] = { "DopplerRadar" }; + lockableTypes[] = {"Air"}; + + minimumSpeedFilter = 25; // filter out targets that have a closing velocity less than this + minimumTimeFilter = 0.0001; // filter out targets that are this close to the ground (speed of light) + maxTerrainCheck = 16000; // How far we should check for terrain + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 50; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR", "LOFT"}; + useModeForAttackProfile = 1; +}; + +class GVAR(type_ASRAAM) { + enabled = 0; + + pitchRate = 100; // Minium flap deflection for guidance + yawRate = 100; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 50; + flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 120; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.98; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 8000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_Dagr) { + enabled = 0; + + pitchRate = 40; // degrees per second + yawRate = 40; + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SALH"; + seekerTypes[] = { "SALH" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekerAngle = 90; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 1; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "LIN"; + attackProfiles[] = { "LIN", "DIR", "MID", "HI" }; +}; + +class GVAR(type_Dragon) { + enabled = 0; + + pitchRate = 0; + yawRate = 0; + + canVanillaLock = 0; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "LineOfSight"; + navigationTypes[] = { "LineOfSight" }; + + seekLastTargetPos = 0; + seekerAngle = 30; + seekerAccuracy = 1; + + seekerMinRange = 65; + seekerMaxRange = 1000; + + correctionDistance = 30; + missileLeadDistance = 0; + offsetFromCrosshair[] = { 0, 0, 0 }; + + serviceInterval = 0.33; // how many seconds between pops + serviceCharges = 32; // how many charges are in this missile + serviceChargeAcceleration = 6.5; + dragonSpeed = 100; // meters per second + + defaultAttackProfile = "DRAGON"; + attackProfiles[] = {"DRAGON"}; +}; + +class GVAR(type_ESSM) { + enabled = 0; + + pitchRate = 15; // Minium flap deflection for guidance + yawRate = 15; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "DopplerRadar"; + seekerTypes[] = { "DopplerRadar" }; + lockableTypes[] = {"Air"}; + + minimumSpeedFilter = 20; // filter out targets that have a closing velocity less than this + minimumTimeFilter = 0.00001; // filter out targets that are this close to the ground (speed of light) + maxTerrainCheck = 16000; // How far we should check for terrain + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 50; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_Hellfire) { + enabled = 0; + + pitchRate = 30; // degrees per second + yawRate = 30; + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SALH"; + seekerTypes[] = { "SALH" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Direct"; + navigationTypes[] = { "Direct", "ZeroEffortMiss" }; + + seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 70; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 1; + seekerMaxRange = 8000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "hellfire"; + attackProfiles[] = {"hellfire", "hellfire_hi", "hellfire_lo"}; + + class navigationStates { + class initial { + transitionCondition = QEFUNC(hellfire,midCourseTransition); + navigationType = "Direct"; + }; + class terminal { + transitionCondition = ""; + navigationType = "ZeroEffortMiss"; + }; + // transitions from initial -> termimal + states[] = {"initial", "terminal"}; + }; +}; + +class GVAR(type_Hot) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 7; + lineGainD = 6; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; + +class GVAR(type_Javelin) { + enabled = 0; + + pitchRate = 120; // degrees per second + yawRate = 120; + stabilityCoefficient = 0.2; + bangBangGuidance = 0; + + canVanillaLock = 0; + + // Guidance type for munitions + defaultSeekerType = "Optic"; + seekerTypes[] = { "Optic" }; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "Direct"; + navigationTypes[] = { "Direct", "ZeroEffortMiss" }; + + navigationGain = 3; + + seekerAngle = 180; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 0; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] + + // Attack profile type selection + defaultAttackProfile = "JAV_TOP"; + attackProfiles[] = { "JAV_TOP", "JAV_DIR" }; + useModeForAttackProfile = 1; + + class navigationStates { + class initial { + transitionCondition = QFUNC(javelin_midCourseTransition); + navigationType = "Direct"; + }; + class terminal { + transitionCondition = ""; + navigationType = "ZeroEffortMiss"; + }; + // transitions from initial -> termimal + states[] = {"initial", "terminal"}; + }; +}; + +class GVAR(type_Jdam) { + enabled = 0; + + pitchRate = 15; + yawRate = 20; + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "GPS"; + seekerTypes[] = { "GPS" }; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "LINE"; + navigationTypes[] = { "LINE" }; + + lineGainP = 50; + lineGainD = 0; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 60; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 5; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "JDAM"; + attackProfiles[] = {"JDAM"}; +}; + +class GVAR(type_Maverick) { + enabled = 0; + + pitchRate = 15; + yawRate = 15; + + canVanillaLock = 1; + + defaultSeekerType = "Optic"; + seekerTypes[] = {"Optic"}; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = {"LOBL"}; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 1; + seekerAngle = 60; + seekerAccuracy = 1; + + seekerMinRange = 1; + seekerMaxRange = 14000; + + defaultAttackProfile = "maverick"; + attackProfiles[] = {"maverick"}; +}; + +class GVAR(type_Milan) { + enabled = 0; + + pitchRate = 60; // Minium flap deflection for guidance + yawRate = 60; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 0; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 25; + lineGainD = 12; + + initialPitch = -0.4; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 5; // Angle from the shooter's view that can track the missile, implemented + seekerAccuracy = 1; // seeker accuracy multiplier, not implemented? + + seekerMinRange = 100; + seekerMaxRange = 2000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; + +class GVAR(type_Nlaw) { + enabled = 0; + + pitchRate = 5; // Minium flap deflection for guidance + yawRate = 10; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = QEGVAR(nlaw,seeker); + seekerTypes[] = {QEGVAR(nlaw,seeker)}; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = {"LOBL"}; + + defaultNavigationType = QEGVAR(nlaw,PLOS); + navigationTypes[] = { QEGVAR(nlaw,PLOS) }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 0; + seekerMaxRange = 10; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = QEGVAR(nlaw,directAttack); + attackProfiles[] = {QEGVAR(nlaw,directAttack), QEGVAR(nlaw,overflyTopAttack)}; + useModeForAttackProfile = 1; + showHintOnCycle = 1; + + // Run once at fired event + onFired = QEFUNC(nlaw,onFired); +}; + +class GVAR(type_Patriot) { + enabled = 0; + + pitchRate = 30; // Minium flap deflection for guidance + yawRate = 30; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "DopplerRadar"; + seekerTypes[] = { "DopplerRadar" }; + lockableTypes[] = {"Air"}; + + minimumSpeedFilter = 10; // filter out targets that have a closing velocity less than this + minimumTimeFilter = 0.00001; // filter out targets that are this close to the ground (speed of light) + maxTerrainCheck = 16000; // How far we should check for terrain + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 50; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_Paveway) { + enabled = 0; + + pitchRate = 5; + yawRate = 5; + + bangBangGuidance = 1; + stabilityCoefficient = 0.4; // how much this projectile likes to "weathervane" (keep direction toward velocity) + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SALH"; + seekerTypes[] = { "SALH" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL" }; + + defaultNavigationType = "ProportionalNavigation"; + navigationTypes[] = { "ProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 60; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 5; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_RAM) { + enabled = 0; + + pitchRate = 50; // Minium flap deflection for guidance + yawRate = 50; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 0.5; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.8; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_RBS70) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 20; + lineGainD = 16; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Redeye) { + enabled = 0; + + pitchRate = 27; // Minium flap deflection for guidance + yawRate = 27; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 2.0; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "ProportionalNavigation"; + navigationTypes[] = { "ProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.4; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 4500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_Sidewinder) { + enabled = 0; + + pitchRate = 25; // Minium flap deflection for guidance + yawRate = 25; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 1.6; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.8; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_Stinger) { + enabled = 0; + + pitchRate = 42; // Minium flap deflection for guidance + yawRate = 42; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 1.3; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.8; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_TOW) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 20; + lineGainD = 7; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 65; + seekerMaxRange = 3750; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; \ No newline at end of file diff --git a/addons/missileguidance/CfgMissileTypesWarsaw.hpp b/addons/missileguidance/CfgMissileTypesWarsaw.hpp new file mode 100644 index 00000000000..4dbe81bbbf5 --- /dev/null +++ b/addons/missileguidance/CfgMissileTypesWarsaw.hpp @@ -0,0 +1,901 @@ +class GVAR(type_Ataka) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 6000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Bastion) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 6000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Drakon) { + enabled = 0; + + pitchRate = 25; // Minium flap deflection for guidance + yawRate = 25; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 9.5; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 3300; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Fagot) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 2000; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Falanga) { + enabled = 0; + + pitchRate = 15; // Minium flap deflection for guidance + yawRate = 15; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "MCLOS"; + seekerTypes[] = { "MCLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 5; + lineGainD = 0; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 0; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + correctionDistance = 0; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; + +class GVAR(type_Fleyta) { + enabled = 0; + + pitchRate = 15; // Minium flap deflection for guidance + yawRate = 15; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "MCLOS"; + seekerTypes[] = { "MCLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 5; + lineGainD = 0; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 0; + seekerMaxRange = 3000; // Range from the missile which the seeker can visually search + + correctionDistance = 0; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; + +class GVAR(type_Igla) { + enabled = 0; + + pitchRate = 30; // Minium flap deflection for guidance + yawRate = 43; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 1.1; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.76; // seeker accuracy multiplier + + seekerMinRange = 5; + seekerMaxRange = 5200; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_KAB) { + enabled = 0; + + pitchRate = 8; + yawRate = 8; + + bangBangGuidance = 1; + stabilityCoefficient = 0.4; // how much this projectile likes to "weathervane" (keep direction toward velocity) + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SALH"; + seekerTypes[] = { "SALH" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL" }; + + defaultNavigationType = "ProportionalNavigation"; + navigationTypes[] = { "ProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 60; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 5; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_KH25) { + enabled = 0; + + pitchRate = 20; + yawRate = 20; + + canVanillaLock = 0; + + defaultSeekerType = "SALH"; + seekerTypes[] = {"SALH"}; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = {"LOAL"}; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 1; + seekerAngle = 40; + seekerAccuracy = 1; + + seekerMinRange = 1; + seekerMaxRange = 10000; + + defaultAttackProfile = "maverick"; + attackProfiles[] = {"maverick"}; +}; + +class GVAR(type_KH29) { + enabled = 0; + + pitchRate = 20; + yawRate = 20; + + canVanillaLock = 0; + + defaultSeekerType = "SALH"; + seekerTypes[] = {"SALH"}; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = {"LOAL"}; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 1; + seekerAngle = 40; + seekerAccuracy = 1; + + seekerMinRange = 1; + seekerMaxRange = 10000; + + defaultAttackProfile = "maverick"; + attackProfiles[] = {"maverick"}; +}; + +class GVAR(type_Kobra) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 9.5; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Konkurs) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 10; + lineGainD = 8.5; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; + +class GVAR(type_Kornet) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Malyutka) { + enabled = 0; + + pitchRate = 15; // Minium flap deflection for guidance + yawRate = 15; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "MCLOS"; + seekerTypes[] = { "MCLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 5; + lineGainD = 0; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 0; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + correctionDistance = 0; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; + +class GVAR(type_Metis) { + enabled = 0; + + pitchRate = 50; // Minium flap deflection for guidance + yawRate = 50; // Maximum flap deflection for guidance + initialPitch = 2; + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 15; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 80; + seekerMaxRange = 1000; // Range from the missile which the seeker can visually search + + correctionDistance = 3; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; + +class GVAR(type_Molniya) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 50; + flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 40; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.85; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_R73) { + enabled = 0; + + pitchRate = 35; // Minium flap deflection for guidance + yawRate = 35; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 50; + flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 40; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.85; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_R74) { + enabled = 1; + + pitchRate = 50; // Minium flap deflection for guidance + yawRate = 50; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 50; + flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 75; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.95; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 8000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_R77) { + enabled = 0; + + pitchRate = 40; // Minium flap deflection for guidance + yawRate = 40; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "DopplerRadar"; + seekerTypes[] = { "DopplerRadar" }; + lockableTypes[] = {"Air"}; + + minimumSpeedFilter = 15; // filter out targets that have a closing velocity less than this + minimumTimeFilter = 0.00005; // filter out targets that are this close to the ground (speed of light) + maxTerrainCheck = 16000; // How far we should check for terrain + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 50; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR", "LOFT"}; + useModeForAttackProfile = 1; +}; + +class GVAR(type_Refleks) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_S400) { + enabled = 0; + + pitchRate = 25; // Minium flap deflection for guidance + yawRate = 25; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "DopplerRadar"; + seekerTypes[] = { "DopplerRadar" }; + lockableTypes[] = {"Air"}; + + minimumSpeedFilter = 5; // filter out targets that have a closing velocity less than this + minimumTimeFilter = 0.000001; // filter out targets that are this close to the ground (speed of light) + maxTerrainCheck = 16000; // How far we should check for terrain + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 50; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_Shturm) { + enabled = 0; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Strela) { + enabled = 0; + + pitchRate = 30; // Minium flap deflection for guidance + yawRate = 30; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 1.6; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "ProportionalNavigation"; + navigationTypes[] = { "ProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.6; // seeker accuracy multiplier + + seekerMinRange = 10; + seekerMaxRange = 3700; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; + +class GVAR(type_Vikhr) { + enabled = 0; + showTrail = 1; + + pitchRate = 60; // Minium flap deflection for guidance + yawRate = 60; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 20; + lineGainD = 16; + correctionDistance = 5; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 15; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 30; + seekerMaxRange = 12000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; + +class GVAR(type_Vympel) { + enabled = 0; + + pitchRate = 35; // Minium flap deflection for guidance + yawRate = 35; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 50; + flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 40; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.85; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; \ No newline at end of file diff --git a/addons/missileguidance/config.cpp b/addons/missileguidance/config.cpp index e98d99ebcbb..4e1f2e3e1f1 100644 --- a/addons/missileguidance/config.cpp +++ b/addons/missileguidance/config.cpp @@ -15,6 +15,8 @@ class CfgPatches { #include "ACE_GuidanceConfig.hpp" +#include "CfgMissileTypesNato.hpp" +#include "CfgMissileTypesWarsaw.hpp" #include "CfgEventhandlers.hpp" #include "CfgAmmo.hpp" #include "CfgMagazines.hpp" diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf index 6b06c0dd915..64895a3e54a 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf @@ -22,6 +22,9 @@ #define STAGE_COAST 3 #define STAGE_TERMINAL 4 +#define CLIMB_ANGLE 12 +#define ATTACK_ANGLE 2 + params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; _args params ["_firedEH"]; _firedEH params ["_shooter","","","","","","_projectile"]; @@ -30,6 +33,7 @@ if (_seekerTargetPos isEqualTo [0,0,0]) exitWith {_seekerTargetPos}; if (_attackProfileStateParams isEqualTo []) then { _attackProfileStateParams set [0, STAGE_LAUNCH]; + _attackProfileStateParams set [1, 0]; }; private _shooterPos = getPosASL _shooter; @@ -44,24 +48,28 @@ TRACE_2("",_distanceToTarget,_distanceToShooter); // Add height depending on distance for compensate private _returnTargetPos = _seekerTargetPos; +private _attackDirection = _seekerTargetPos vectorDiff _projectilePos; +private _horizon = velocity _projectile; +_horizon set [2, 0]; +_horizon = vectorNormalized _horizon; +private _attackAngle = acos (_horizon vectorCos _attackDirection); + switch (_attackProfileStateParams select 0) do { case STAGE_LAUNCH: { TRACE_1("STAGE_LAUNCH",""); if (_distanceToShooter < 6) then { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2]; + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,5]; } else { _attackProfileStateParams set [0, STAGE_CLIMB]; }; }; case STAGE_CLIMB: { TRACE_1("STAGE_CLIMB",""); - // 65 is min range - private _cruisAlt = 60 * ((0 max (_distanceShooterToTarget - 65))/2000); - - if ( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then { + if (_attackAngle >= ATTACK_ANGLE) then { _attackProfileStateParams set [0, STAGE_TERMINAL]; } else { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*1.5]; + private _height = _distanceShooterToTarget * tan CLIMB_ANGLE; + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_height]; }; }; case STAGE_TERMINAL: { @@ -70,5 +78,7 @@ switch (_attackProfileStateParams select 0) do { }; }; +_attackProfileStateParams set [2, _returnTargetPos]; + TRACE_1("Adjusted target position",_returnTargetPos); _returnTargetPos; diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf index 347d1449140..a3ae233eba0 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf @@ -22,6 +22,10 @@ #define STAGE_COAST 3 #define STAGE_TERMINAL 4 +#define CRUISE_ALT 160 +#define CLIMB_ANGLE 22 +#define ATTACK_ANGLE 12 + params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; _args params ["_firedEH"]; _firedEH params ["_shooter","","","","","","_projectile"]; @@ -30,6 +34,7 @@ if (_seekerTargetPos isEqualTo [0,0,0]) exitWith {_seekerTargetPos}; if (_attackProfileStateParams isEqualTo []) then { _attackProfileStateParams set [0, STAGE_LAUNCH]; + _attackProfileStateParams set [1, 0]; }; private _shooterPos = getPosASL _shooter; @@ -44,39 +49,44 @@ TRACE_2("",_distanceToTarget,_distanceToShooter); // Add height depending on distance for compensate private _returnTargetPos = _seekerTargetPos; +private _attackDirection = _seekerTargetPos vectorDiff _projectilePos; +private _horizon = velocity _projectile; +_horizon set [2, 0]; +_horizon = vectorNormalized _horizon; +private _attackAngle = acos (_horizon vectorCos _attackDirection); + switch( (_attackProfileStateParams select 0) ) do { case STAGE_LAUNCH: { TRACE_1("STAGE_LAUNCH",""); if (_distanceToShooter < 10) then { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2]; + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,5]; } else { _attackProfileStateParams set [0, STAGE_CLIMB]; }; }; case STAGE_CLIMB: { TRACE_1("STAGE_CLIMB",""); - private _cruisAlt = 140; - if (_distanceShooterToTarget < 1250) then { - _cruisAlt = 140 * ((0 max (_distanceShooterToTarget - 150))/1250); - TRACE_1("_cruisAlt",_cruisAlt); - }; - if ( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then { - if (_cruisAlt < 140) then { - _attackProfileStateParams set [0, STAGE_TERMINAL]; - } else { + private _altitude = (ASLToAGL _projectilePos) select 2; + switch (true) do { + case (_altitude >= CRUISE_ALT): { _attackProfileStateParams set [0, STAGE_COAST]; }; - } else { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*1.5]; - }; + case (_attackAngle >= ATTACK_ANGLE): { + _attackProfileStateParams set [0, STAGE_TERMINAL]; + }; + default { + private _height = _distanceShooterToTarget * tan CLIMB_ANGLE; + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_height]; + } + } }; case STAGE_COAST: { TRACE_1("STAGE_COAST",""); - TRACE_1("",((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2)); - if (_distanceToTarget < ( ((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2) ) * 2) then { + TRACE_1("",_attackAngle); + if (_attackAngle >= ATTACK_ANGLE) then { _attackProfileStateParams set [0, STAGE_TERMINAL]; } else { - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,(_projectilePos select 2)]; + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,(_projectilePos select 2) min CRUISE_ALT]; }; }; case STAGE_TERMINAL: { @@ -86,5 +96,7 @@ switch( (_attackProfileStateParams select 0) ) do { }; }; +_attackProfileStateParams set [2, _returnTargetPos]; + TRACE_1("Adjusted target position",_returnTargetPos); _returnTargetPos; diff --git a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf index 5462a80a75b..cc823b1e8c3 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf @@ -45,7 +45,7 @@ if (_2dDistance <= 1) then { _addHeight = [0, 0, (_projectilePos#2) + 8]; } else { // Always climb an arc on initial launch if we are close to the round - if ((((ASLtoAGL _projectilePos) select 2) < 5) && {_distanceToShooter < 15}) then { + if ((((ASLToAGL _projectilePos) select 2) < 5) && {_distanceToShooter < 15}) then { _addHeight = _addHeight vectorAdd [0,0,_distanceToTarget]; TRACE_1("climb - near shooter",_addHeight); } else { diff --git a/addons/missileguidance/functions/fnc_attackProfile_LOFT.sqf b/addons/missileguidance/functions/fnc_attackProfile_LOFT.sqf index 1fff2ef8c51..934ac04123a 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_LOFT.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_LOFT.sqf @@ -32,7 +32,7 @@ if (_seekerTargetPos isEqualTo [0, 0, 0]) exitWith { }; private _projectilePos = getPosASLVisual _projectile; -private _distanceToTarget2d = _projectilePos distance2d _seekerTargetPos; +private _distanceToTarget2d = _projectilePos distance2D _seekerTargetPos; private _closingRate = vectorMagnitude velocity _projectile; private _timeToGo = (_projectilePos distance _seekerTargetPos) / _closingRate; diff --git a/addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf b/addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf index 361b0d8fcf5..1733ad10153 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf @@ -30,7 +30,7 @@ if ((_distanceToProjectile > _seekerMaxRangeSqr) || { _wireCut }) exitWith { // wire snap, random direction if !(_wireCut) then { _attackProfileStateParams set [1, true]; - playSound3D ["a3\sounds_f\air\sfx\SL_rope_break.wss", objNull, false, AGLtoASL (_shooter modelToWorld _wireCutSource), 5, 1, 150]; + playSound3D ["a3\sounds_f\air\sfx\SL_rope_break.wss", objNull, false, AGLToASL (_shooter modelToWorld _wireCutSource), 5, 1, 150]; }; _lastInput }; diff --git a/addons/missileguidance/functions/fnc_checkLos.sqf b/addons/missileguidance/functions/fnc_checkLos.sqf index 242b595ab8f..152c7c24074 100644 --- a/addons/missileguidance/functions/fnc_checkLos.sqf +++ b/addons/missileguidance/functions/fnc_checkLos.sqf @@ -34,12 +34,12 @@ private _targetAimPos = aimPos _target; private _seekerPos = getPosASL _seeker; private _return = true; -if (!((terrainIntersectASL [_seekerPos, _targetPos]) && {terrainIntersectASL [_seekerPos, _targetAimPos]})) then { +if ((terrainIntersectASL [_seekerPos, _targetPos]) && {terrainIntersectASL [_seekerPos, _targetAimPos]}) then { + _return = false; +} else { if (lineIntersects [_seekerPos, _targetPos, _seeker, _target]) then { _return = false; }; -} else { - _return = false; }; _return diff --git a/addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf b/addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf index 5073709a27e..bf3a5af67c5 100644 --- a/addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf +++ b/addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf @@ -14,7 +14,7 @@ params ["_projectile"]; private _camera = "camera" camCreate getPosATL _projectile; -_camera camPrepareFOV 0.7; +_camera camPrepareFov 0.7; _camera cameraEffect ["internal", "back"]; _camera camCommitPrepared 0; diff --git a/addons/missileguidance/functions/fnc_doAttackProfile.sqf b/addons/missileguidance/functions/fnc_doAttackProfile.sqf index 3c74ab87c6d..e33d2bfd9be 100644 --- a/addons/missileguidance/functions/fnc_doAttackProfile.sqf +++ b/addons/missileguidance/functions/fnc_doAttackProfile.sqf @@ -30,8 +30,8 @@ if ((isNil "_attackProfilePos") || {_attackProfilePos isEqualTo [0,0,0]}) exitWi }; if (GVAR(debug_drawGuidanceInfo)) then { - drawLine3D [(ASLtoAGL _attackProfilePos), (ASLtoAGL _seekerTargetPos), [0,1,1,1]]; - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,0,1,1], ASLtoAGL _attackProfilePos, 0.5, 0.5, 0, _attackProfileName, 1, 0.025, "TahomaB"]; + drawLine3D [(ASLToAGL _attackProfilePos), (ASLToAGL _seekerTargetPos), [0,1,1,1]]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,0,1,1], ASLToAGL _attackProfilePos, 0.5, 0.5, 0, _attackProfileName, 1, 0.025, "TahomaB"]; }; TRACE_2("return",_attackProfilePos,_attackProfileName); diff --git a/addons/missileguidance/functions/fnc_doSeekerSearch.sqf b/addons/missileguidance/functions/fnc_doSeekerSearch.sqf index b6fd158ce04..fe915d1bb4f 100644 --- a/addons/missileguidance/functions/fnc_doSeekerSearch.sqf +++ b/addons/missileguidance/functions/fnc_doSeekerSearch.sqf @@ -31,7 +31,7 @@ if ((isNil "_seekerTargetPos") || {_seekerTargetPos isEqualTo [0,0,0]}) then { / TRACE_2("seeker returned bad pos - using last known",_seekLastTargetPos,_lastKnownPos); _seekerTargetPos = _lastKnownPos; if (GVAR(debug_drawGuidanceInfo)) then { - drawIcon3D ["\A3\ui_f\data\map\markers\military\unknown_CA.paa", [1,1,0,1], ASLtoAGL _lastKnownPos, 0.25, 0.25, 0, "LastKnownPos", 1, 0.02, "TahomaB"]; + drawIcon3D ["\A3\ui_f\data\map\markers\military\unknown_CA.paa", [1,1,0,1], ASLToAGL _lastKnownPos, 0.25, 0.25, 0, "LastKnownPos", 1, 0.02, "TahomaB"]; }; } else { TRACE_1("seeker returned no pos",_seekerTargetPos); @@ -45,7 +45,7 @@ if ((isNil "_seekerTargetPos") || {_seekerTargetPos isEqualTo [0,0,0]}) then { / }; if (GVAR(debug_drawGuidanceInfo)) then { - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,0,1], ASLtoAGL _seekerTargetPos, 0.5, 0.5, 0, _seekerTypeName, 1, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,0,1], ASLToAGL _seekerTargetPos, 0.5, 0.5, 0, _seekerTypeName, 1, 0.025, "TahomaB"]; }; TRACE_2("return",_seekerTargetPos,_seekerTypeName); diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index 28f677bbdde..8b8df3d5114 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -42,7 +42,7 @@ private _timestep = diag_deltaTime * accTime; // Run seeker function: private _seekerTargetPos = [[0,0,0], _args, _seekerStateParams, _lastKnownPosState, _timestep] call FUNC(doSeekerSearch); // Run attack profile function: -_seekerTargetPos = AGLtoASL ASLToAGL _seekerTargetPos; +_seekerTargetPos = AGLToASL ASLToAGL _seekerTargetPos; private _profileAdjustedTargetPos = [_seekerTargetPos, _args, _attackProfileStateParams, _timestep] call FUNC(doAttackProfile); private _projectilePos = getPosASLVisual _projectile; @@ -54,7 +54,7 @@ if ((_pitchRate != 0 || {_yawRate != 0})) then { private _navigationFunction = getText (configFile >> QGVAR(NavigationTypes) >> _navigationType >> "functionName"); if (_navigationStateData isNotEqualTo []) then { (_navigationStateData select _currentState) params ["_transitionCondition"]; - private _transition = (_args call (missionNamespace getVariable [_transitionCondition, { false }])); + private _transition = ([_args, _timestep] call (missionNamespace getVariable [_transitionCondition, { false }])); if (_transition) then { _currentState = _currentState + 1; _navigationStateParams set [0, _currentState]; @@ -190,15 +190,15 @@ if ((_pitchRate != 0 || {_yawRate != 0})) then { if (GVAR(debug_drawGuidanceInfo)) then { TRACE_3("",_projectilePos,_seekerTargetPos,_profileAdjustedTargetPos); - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLtoAGL _projectilePos, 0.75, 0.75, 0, _ammo, 1, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLToAGL _projectilePos, 0.75, 0.75, 0, _ammo, 1, 0.025, "TahomaB"]; if (!isGamePaused && accTime > 0) then { - private _ps = "#particlesource" createVehicleLocal (ASLtoAGL _projectilePos); + private _ps = "#particlesource" createVehicleLocal (ASLToAGL _projectilePos); _PS setParticleParams [["\A3\Data_f\cl_basic", 8, 3, 1], "", "Billboard", 1, 3.0141, [0, 0, 0], [0, 0, 0], 1, 1.275, 1, 0, [1, 1], [[1, 0, 0, 1], [1, 0, 0, 1], [1, 0, 0, 1]], [1], 1, 0, "", "", nil]; _PS setDropInterval 1.0; }; - drawLine3D [ASLtoAGL _projectilePos, (ASLtoAGL _projectilePos) vectorAdd velocity _projectile, [1, 1, 1, 1]]; + drawLine3D [ASLToAGL _projectilePos, (ASLToAGL _projectilePos) vectorAdd velocity _projectile, [1, 1, 1, 1]]; }; _stateParams set [0, diag_tickTime]; diff --git a/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf b/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf index ad0eca65cba..58995dee31d 100644 --- a/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf +++ b/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf @@ -19,6 +19,10 @@ #define STAGE_COAST 3 #define STAGE_TERMINAL 4 +#define REQUIRED_STABLE_TIME 0.2 +#define REQUIRED_ANGLE 1 + +params ["_args", "_timestep"]; _args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams", "_targetData", "_navigationStateData"]; _firedEH params ["_shooter","","","","_ammo","","_projectile"]; _launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo","_navigationType"]; @@ -28,6 +32,17 @@ _stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateP _seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange", "_seekerMinRange"]; _targetData params ["_targetDirection", "_attackProfileDirection", "_targetRange", "_targetVelocity", "_targetAcceleration"]; -_attackProfileStateParams params ["_state"]; -_state isEqualTo STAGE_TERMINAL +_attackProfileStateParams params ["_state", "_stableTime", "_target"]; +private _projectileDirection = vectorNormalized velocity _projectile; +private _targetDistance = _target vectorDistance getPosASLVisual _projectile; +private _targetDirection = (getPosASLVisual _projectile) vectorFromTo _target; +private _angle = _projectileDirection vectorCos _targetDirection; +if (_angle > cos REQUIRED_ANGLE) then { + _stableTime = _stableTime + _timestep; +} else { + _stableTime = 0; +}; + +_attackProfileStateParams set [1, _stableTime]; +_state isEqualTo STAGE_TERMINAL && _stableTime > REQUIRED_STABLE_TIME diff --git a/addons/missileguidance/functions/fnc_navigationType_direct.sqf b/addons/missileguidance/functions/fnc_navigationType_direct.sqf index 7b4763b44ef..5681c85b9ae 100644 --- a/addons/missileguidance/functions/fnc_navigationType_direct.sqf +++ b/addons/missileguidance/functions/fnc_navigationType_direct.sqf @@ -14,8 +14,23 @@ * * Public: No */ -params ["_args", "", "", "_profileAdjustedTargetPos"]; -_args params ["_firedEH"]; +params ["_args", "_timestep", "", "_profileAdjustedTargetPos"]; +_args params ["_firedEH", "", "_flightParams"]; +_flightParams params ["_pitchRate", "_yawRate"]; _firedEH params ["","","","","","","_projectile"]; -_profileAdjustedTargetPos vectorDiff getPosASLVisual _projectile +private _projectilePos = getPosASLVisual _projectile; + +private _targetDirection = _projectilePos vectorFromTo _profileAdjustedTargetPos; +private _projectileDirection = vectorNormalized velocity _projectile; + +private _deltaDirection = _targetDirection vectorDiff _projectileDirection; +_deltaDirection = _projectile vectorWorldToModelVisual _deltaDirection; +_deltaDirection = _deltaDirection vectorMultiply [_yawRate, 0, _pitchRate]; +_deltaDirection = _projectile vectorModelToWorldVisual _deltaDirection; + +private _iTimestep = 0; +if (_timestep != 0) then { + _iTimestep = 1 / _timestep; +}; +_deltaDirection vectorMultiply _iTimestep // return diff --git a/addons/missileguidance/functions/fnc_seekerType_MWR.sqf b/addons/missileguidance/functions/fnc_seekerType_MWR.sqf index df51acdd8c0..1b7eef07ee7 100644 --- a/addons/missileguidance/functions/fnc_seekerType_MWR.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_MWR.sqf @@ -60,7 +60,7 @@ if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { _seekerBaseRadiusAdjusted = _seekerBaseRadiusAtGround; }; // Look in front of seeker for any targets - private _nearestObjects = nearestObjects [ASLtoAGL _searchPos, _lockTypes, _seekerBaseRadiusAdjusted, false]; + private _nearestObjects = nearestObjects [ASLToAGL _searchPos, _lockTypes, _seekerBaseRadiusAdjusted, false]; _nearestObjects = _nearestObjects apply { // I check both Line of Sight versions to make sure that a single bush doesnt make the target lock dissapear but at the same time ensure that this can see through smoke. Should work 80% of the time if ([_projectile, getPosASL _x, _seekerAngle] call FUNC(checkSeekerAngle) && { ([_projectile, _x, true] call FUNC(checkLOS)) || { ([_projectile, _x, false] call FUNC(checkLOS)) } }) then { @@ -78,8 +78,8 @@ if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { }; private _closestDistance = _seekerBaseRadiusAtGround; { - if ((_x distance2d _searchPos) < _closestDistance) then { - _closestDistance = _x distance2d _searchPos; + if ((_x distance2D _searchPos) < _closestDistance) then { + _closestDistance = _x distance2D _searchPos; _target = _x; }; } forEach _nearestObjects; @@ -105,7 +105,7 @@ if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { }; if (GVAR(debug_drawGuidanceInfo)) then { - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLtoAGL _expectedTargetPos, 0.75, 0.75, 0, "expected target pos", 1, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLToAGL _expectedTargetPos, 0.75, 0.75, 0, "expected target pos", 1, 0.025, "TahomaB"]; }; if !(isNull _target) then { diff --git a/addons/missileguidance/functions/fnc_seekerType_SACLOS.sqf b/addons/missileguidance/functions/fnc_seekerType_SACLOS.sqf index 1641ff4a7df..d9fd444043f 100644 --- a/addons/missileguidance/functions/fnc_seekerType_SACLOS.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_SACLOS.sqf @@ -25,7 +25,10 @@ _seekerStateParams params ["_memoryPointGunnerOptics", "_animationSourceBody", " private _shooterPos = AGLToASL (_shooter modelToWorldVisual (_shooter selectionPosition _memoryPointGunnerOptics)); private _projPos = getPosASL _projectile; -private _lookDirection = if !(_shooter isKindOf "CAManBase" || {_shooter isKindOf "StaticWeapon"}) then { +private _lookDirection = if (_shooter isKindOf "CAManBase" || {_shooter isKindOf "StaticWeapon"}) then { + _shooterPos = eyePos _shooter; + _shooter weaponDirection _weapon +} else { private _finalLookDirection = if (_usePilotCamera) then { _shooterPos = _shooter modelToWorldVisualWorld getPilotCameraPosition _shooter; private _trackingTarget = getPilotCameraTarget _shooter; @@ -43,9 +46,6 @@ private _lookDirection = if !(_shooter isKindOf "CAManBase" || {_shooter isKindO _shooter vectorModelToWorldVisual ([1, _gBody, _gGun] call CBA_fnc_polar2vect); }; _finalLookDirection -} else { - _shooterPos = eyePos _shooter; - _shooter weaponDirection _weapon }; private _distanceToProj = _shooterPos vectorDistance _projPos; diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index 7463b1ab7f4..0980814aae2 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -219,12 +219,18 @@ 6x DAGR [ACE] + 6x DAGR [ACE] + 6x DAGR [ACE] 12x DAGR [ACE] + 12x DAGR [ACE] + 12x DAGR [ACE] 24x DAGR [ACE] + 24x DAGR [ACE] + 24x DAGR [ACE] diff --git a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf index 88e2ba02d56..827c365a346 100644 --- a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf +++ b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf @@ -85,9 +85,9 @@ TRACE_1("",_ambianceSounds); private _newPosASL = if (_followPlayers) then { // Select a target unit at random. private _targetUnit = selectRandom _allUnits; - AGLtoASL (_targetUnit getPos [_minimalDistance + random (_maximalDistance - _minimalDistance), random 360]); + AGLToASL (_targetUnit getPos [_minimalDistance + random (_maximalDistance - _minimalDistance), random 360]); } else { - AGLtoASL (_logic getPos [_minimalDistance + random (_maximalDistance - _minimalDistance), random 360]); + AGLToASL (_logic getPos [_minimalDistance + random (_maximalDistance - _minimalDistance), random 360]); }; TRACE_1("",_newPosASL); diff --git a/addons/mk6mortar/initSettings.inc.sqf b/addons/mk6mortar/initSettings.inc.sqf index fc900295626..15047dee296 100644 --- a/addons/mk6mortar/initSettings.inc.sqf +++ b/addons/mk6mortar/initSettings.inc.sqf @@ -3,41 +3,41 @@ private _category = [format ["ACE %1", localize "str_a3_cfgmarkers_nato_art"], localize LSTRING(DisplayName)]; [ - QGVAR(airResistanceEnabled), "CHECKBOX", + QGVAR(airResistanceEnabled), + "CHECKBOX", [LSTRING(airResistanceEnabled_DisplayName), LSTRING(airResistanceEnabled_Description)], _category, false, // default value - true, // isGlobal + 1, // isGlobal {[QGVAR(airResistanceEnabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart ] call CBA_fnc_addSetting; [ - QGVAR(allowComputerRangefinder), "CHECKBOX", + QGVAR(allowComputerRangefinder), + "CHECKBOX", [LSTRING(allowComputerRangefinder_DisplayName), LSTRING(allowComputerRangefinder_Description)], _category, true, // default value - true, // isGlobal - {[QGVAR(allowComputerRangefinder), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + 1 // isGlobal ] call CBA_fnc_addSetting; [ - QGVAR(allowCompass), "CHECKBOX", + QGVAR(allowCompass), + "CHECKBOX", [LSTRING(allowCompass_DisplayName), LSTRING(allowCompass_Description)], _category, true, // default value - true, // isGlobal - {[QGVAR(allowCompass), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + 1 // isGlobal ] call CBA_fnc_addSetting; [ - QGVAR(useAmmoHandling), "CHECKBOX", + QGVAR(useAmmoHandling), + "CHECKBOX", [LSTRING(useAmmoHandling_DisplayName), LSTRING(useAmmoHandling_Description)], _category, false, // default value - true, // isGlobal + 1, // isGlobal {[QGVAR(useAmmoHandling), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart ] call CBA_fnc_addSetting; diff --git a/addons/mk6mortar/stringtable.xml b/addons/mk6mortar/stringtable.xml index c6f29a037d8..186cd926849 100644 --- a/addons/mk6mortar/stringtable.xml +++ b/addons/mk6mortar/stringtable.xml @@ -120,10 +120,10 @@ Hava Direnci - For Player Shots, Model Air Resistance and Wind Effects + Simulates air resistance and wind effects for player shots. Modeluj opór powietrza oraz wpływ wiatru na tor lotu pocisku dla strzałów z moździerza Mk6 przez graczy Para disparos del jugador, modelo de resistencia al aire y efectos de viento - Für Spielerschüsse, Luftwiderstand und Windeffekte + Simuliert Luftwiderstand und Windeffekte für Spielerschüsse. 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 Pour les tirs des joueurs, simule la résistance de l'air et les effets du vent. @@ -233,19 +233,19 @@ Používat ruční manipulaci s municí - Removes mortar magazines, requiring individual rounds to be loaded by the gunner or loader. Does not affect AI mortars. - Enfernt das Magzin des Mörsers. Es ist nun erforderlich, die einzelnen Patronen manuell zu laden. Dies beeinflusst nicht die KI-Truppen. - Elimina los cargadores del mortero, requiriendo al artillero o cargador la carga manual de cada rondas. No afecta morteros controlados por IA. - Usuwa magazynki moździerza, wymagając ładowania pojedynczych pocisków przez strzelca lub ładowniczego. Nie dotyczy moździerzy AI. - Enlève les chargeurs de mortier, ce qui oblige le tireur ou le servant à charger les obus manuellement. N'affecte pas les mortiers IA. - Rimuove i caricatori di colpi dal mortaio. Un operatore dovrà caricare proiettili singoli prima di poter fare fuoco. Non viene applicato su operatori IA. - Elimina os carregadores do morteiro, requerendo que o atirador ou carregador utilize de forma individual a munição. Não afeta os morteiros controlados pela IA. - Удаляет артиллерийские магазины, требует загрузку отдельных снарядов стрелком или заряжающим. Не влияет на артиллерию ИИ. - 迫撃砲から弾倉を除去します。一発ずつ射手か装填手によって装填される必要があります。AIの迫撃砲には影響を与えません。 - 박격포 탄창을 제거합니다, 사수나 장전수가 개별적으로 탄환을 넣어줘야 합니다. 인공지능은 영향을 받지 않습니다. - 开启此功能时。迫击炮的弹药需由炮手与装填手共同合作来进行装填。此功能并不影响由 AI 射击的迫击炮 - 開啟此功能時。迫擊砲的彈藥需由砲手與裝填手共同合作來進行裝填。此功能並不影響由AI射擊的迫擊砲 - Odstraní z minometu zásobník a vynucuje nabíjení po každém výstřelu buď mířičem nebo nabíječem. Tato možnost neovlivňuje AI posádky. + Removes mortar magazines, requiring individual rounds to be loaded by the gunner or loader. + Enfernt das Magzin des Mörsers. Es ist nun erforderlich, die einzelnen Patronen manuell zu laden. + Elimina los cargadores del mortero, requiriendo al artillero o cargador la carga manual de cada rondas. + Usuwa magazynki moździerza, wymagając ładowania pojedynczych pocisków przez strzelca lub ładowniczego. + Enlève les chargeurs de mortier, ce qui oblige le tireur ou le servant à charger les obus manuellement. + Rimuove i caricatori di colpi dal mortaio. Un operatore dovrà caricare proiettili singoli prima di poter fare fuoco. + Elimina os carregadores do morteiro, requerendo que o atirador ou carregador utilize de forma individual a munição. + Удаляет артиллерийские магазины, требует загрузку отдельных снарядов стрелком или заряжающим. + 迫撃砲から弾倉を除去します。一発ずつ射手か装填手によって装填される必要があります。 + 박격포 탄창을 제거합니다, 사수나 장전수가 개별적으로 탄환을 넣어줘야 합니다. + 开启此功能时。迫击炮的弹药需由炮手与装填手共同合作来进行装填 + 開啟此功能時。迫擊砲的彈藥需由砲手與裝填手共同合作來進行裝填 + Odstraní z minometu zásobník a vynucuje nabíjení po každém výstřelu buď mířičem nebo nabíječem. Remove Round diff --git a/addons/movement/functions/fnc_handleClimb.sqf b/addons/movement/functions/fnc_handleClimb.sqf index 1325f2f021e..a54007862e3 100644 --- a/addons/movement/functions/fnc_handleClimb.sqf +++ b/addons/movement/functions/fnc_handleClimb.sqf @@ -24,5 +24,5 @@ private _pos = _unit modelToWorldVisual (_unit selectionPosition "camera"); _pos = _pos vectorDiff (_unit selectionPosition "camera"); -_unit setPosASL (AGLtoASL _pos); -TRACE_2("",AGLtoASL _pos,getPosASL _unit); +_unit setPosASL (AGLToASL _pos); +TRACE_2("",AGLToASL _pos,getPosASL _unit); diff --git a/addons/nametags/functions/fnc_drawNameTagIcon.sqf b/addons/nametags/functions/fnc_drawNameTagIcon.sqf index efe0c6bf157..26ef2584ead 100644 --- a/addons/nametags/functions/fnc_drawNameTagIcon.sqf +++ b/addons/nametags/functions/fnc_drawNameTagIcon.sqf @@ -44,11 +44,11 @@ _fnc_parameters = { private _targetFaction = _target getVariable [QGVAR(faction), faction _target]; private _customRankIcons = GVAR(factionRanks) get _targetFaction; - if (!isNil "_customRankIcons") then { - _customRankIcons param [ALL_RANKS find rank _target, ""] // return - } else { + if (isNil "_customRankIcons") then { // default rank icons format ["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa", rank _target] // return + } else { + _customRankIcons param [ALL_RANKS find rank _target, ""] // return }; }; }; diff --git a/addons/nametags/functions/fnc_onDraw3d.sqf b/addons/nametags/functions/fnc_onDraw3d.sqf index f831a3209fc..e169eb72692 100644 --- a/addons/nametags/functions/fnc_onDraw3d.sqf +++ b/addons/nametags/functions/fnc_onDraw3d.sqf @@ -37,17 +37,17 @@ if (GVAR(showPlayerNames) == 4) then { private _camPosAGL = positionCameraToWorld [0, 0, 0]; if !((_camPosAGL select 0) isEqualType 0) exitWith {}; // handle RHS / bugged vehicle slots -private _camPosASL = AGLtoASL _camPosAGL; +private _camPosASL = AGLToASL _camPosAGL; // Show nametag for the unit behind the cursor or its commander if (_enabledTagsCursor) then { private _target = cursorTarget; if !(_target isKindOf "CAManBase") then { // When cursorTarget is on a vehicle show the nametag for the commander. - if !(_target in allUnitsUAV) then { - _target = effectiveCommander _target; - } else { + if (_target in allUnitsUAV) then { _target = objNull; + } else { + _target = effectiveCommander _target; }; }; if (isNull _target) exitWith {}; @@ -115,7 +115,7 @@ if (_enabledTagsNearby) then { private _screenPos = worldToScreen (_target modelToWorld (_target selectionPosition "head")); if (_screenPos isNotEqualTo []) then { // Distance from center / half of screen width - _centerOffsetFactor = 1 - ((_screenPos distance2D [0.5, 0.5]) / (safezoneW / 3)); + _centerOffsetFactor = 1 - ((_screenPos distance2D [0.5, 0.5]) / (safeZoneW / 3)); } else { _centerOffsetFactor = 0; }; diff --git a/addons/nightvision/RscTitles.hpp b/addons/nightvision/RscTitles.hpp index 1a4d030e015..f3b1d1870f6 100644 --- a/addons/nightvision/RscTitles.hpp +++ b/addons/nightvision/RscTitles.hpp @@ -28,13 +28,13 @@ class RscTitles { idc = 1002; text = "#(argb,8,8,3)color(0,0,0,1)"; x = "safeZoneXAbs"; - Y = "safezoneY"; - W = "(safezoneX - safeZoneXAbs) * ((getResolution select 4)/(16/3))"; + Y = "safeZoneY"; + W = "(safeZoneX - safeZoneXAbs) * ((getResolution select 4)/(16/3))"; H = "safeZoneH"; }; class trippleHeadRight: trippleHeadLeft { idc = 1003; - x = "safeZoneXAbs + safeZoneWAbs - (safezoneX - safeZoneXABS) * ((getResolution select 4)/(16/3))"; + x = "safeZoneXAbs + safeZoneWAbs - (safeZoneX - safeZoneXABS) * ((getResolution select 4)/(16/3))"; }; }; }; diff --git a/addons/nightvision/functions/fnc_pfeh.sqf b/addons/nightvision/functions/fnc_pfeh.sqf index dbd101631cd..9d5f6e93bb8 100644 --- a/addons/nightvision/functions/fnc_pfeh.sqf +++ b/addons/nightvision/functions/fnc_pfeh.sqf @@ -163,7 +163,9 @@ if (CBA_missionTime < GVAR(nextEffectsUpdate)) then { }; _fogApply = linearConversion [0, 1, GVAR(priorFog) select 0, (GVAR(fogScaling) * _fogApply), 1]; // mix in old fog if present - GVAR(nvgFog) = [_fogApply, 0, 0]; + GVAR(nvgFog) = fogParams; + GVAR(nvgFog) set [0, _fogApply]; + 0 setFog GVAR(nvgFog) }; diff --git a/addons/nightvision/functions/fnc_refreshGoggleType.sqf b/addons/nightvision/functions/fnc_refreshGoggleType.sqf index ccfbd017b6f..2c7dedaa834 100644 --- a/addons/nightvision/functions/fnc_refreshGoggleType.sqf +++ b/addons/nightvision/functions/fnc_refreshGoggleType.sqf @@ -106,7 +106,7 @@ if (_borderImage == "") then { _borderImageCtrl ctrlSetFade ([.15, 0] select _eyeCups); #define BORDER_SIZE 3 - GVAR(defaultPositionBorder) = [safezoneX - (((BORDER_SIZE * 0.75) * safezoneH) - safezoneW) / 2, safezoneY - ((BORDER_SIZE - 1) / 2) * safezoneH, (BORDER_SIZE * 0.75) * safezoneH, BORDER_SIZE * safezoneH]; + GVAR(defaultPositionBorder) = [safeZoneX - (((BORDER_SIZE * 0.75) * safeZoneH) - safeZoneW) / 2, safeZoneY - ((BORDER_SIZE - 1) / 2) * safeZoneH, (BORDER_SIZE * 0.75) * safeZoneH, BORDER_SIZE * safeZoneH]; [_borderImageCtrl, GVAR(defaultPositionBorder), _scale] call FUNC(scaleCtrl); }; @@ -119,7 +119,7 @@ if (_hideHex) then { _hexCtrl ctrlSetText QPATHTOF(data\nvg_mask_hexes_thin.paa); #define HEX_SIZE 1.5 - GVAR(defaultPositionHex) = [safezoneX - (((HEX_SIZE * 0.75) * safezoneH) - safezoneW) / 2, safezoneY - ((HEX_SIZE - 1) / 2) * safezoneH, (HEX_SIZE * 0.75) * safezoneH, HEX_SIZE * safezoneH]; + GVAR(defaultPositionHex) = [safeZoneX - (((HEX_SIZE * 0.75) * safeZoneH) - safeZoneW) / 2, safeZoneY - ((HEX_SIZE - 1) / 2) * safeZoneH, (HEX_SIZE * 0.75) * safeZoneH, HEX_SIZE * safeZoneH]; [_hexCtrl, GVAR(defaultPositionHex), _scale] call FUNC(scaleCtrl); }; diff --git a/addons/nlaw/CfgAmmo.hpp b/addons/nlaw/CfgAmmo.hpp index f572678d20b..650fa148873 100644 --- a/addons/nlaw/CfgAmmo.hpp +++ b/addons/nlaw/CfgAmmo.hpp @@ -1,41 +1,11 @@ +class ace_missileguidance_type_Nlaw; class CfgAmmo { class M_NLAW_AT_F; class ACE_NLAW: M_NLAW_AT_F { hit = 400; // Default was 500 indirectHit = 20; // Default was 15 - class ace_missileguidance { + class ace_missileguidance: ace_missileguidance_type_Nlaw { enabled = 1; - - pitchRate = 5; // Minium flap deflection for guidance - yawRate = 10; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = QGVAR(seeker); - seekerTypes[] = {QGVAR(seeker)}; - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = {"LOBL"}; - - defaultNavigationType = QGVAR(PLOS); - navigationTypes[] = { QGVAR(PLOS) }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 45; // Angle in front of the missile which can be searched - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 0; - seekerMaxRange = 10; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = QGVAR(directAttack); - attackProfiles[] = {QGVAR(directAttack), QGVAR(overflyTopAttack)}; - useModeForAttackProfile = 1; - showHintOnCycle = 1; - - // Run once at fired event - onFired = QFUNC(onFired); }; }; diff --git a/addons/nlaw/XEH_postInit.sqf b/addons/nlaw/XEH_postInit.sqf index 16be48ce26c..5e3f35572c8 100644 --- a/addons/nlaw/XEH_postInit.sqf +++ b/addons/nlaw/XEH_postInit.sqf @@ -30,20 +30,20 @@ addMissionEventHandler ["Draw3d", { // GREEN - Draw an object called "testTarget"'s aim pos and 1 sec aimpos predicted by velocity if ((!isNil "testTarget") && {!isNull testTarget}) then { { - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,0,1], ASLtoAGL ((aimPos testTarget) vectorAdd ((velocity testTarget) vectorMultiply _x)), 0.75, 0.75, 0, format ["%1", _x], 1, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,0,1], ASLToAGL ((aimPos testTarget) vectorAdd ((velocity testTarget) vectorMultiply _x)), 0.75, 0.75, 0, format ["%1", _x], 1, 0.025, "TahomaB"]; } forEach [0, 1, 2, 3]; }; // RED - If lock key is down, draw weapon dir and predicted path at various times if (GVAR(yawChange) != 0) then { { - private _viewASL = AGLtoASL positionCameraToWorld [0,0,0]; + private _viewASL = AGLToASL positionCameraToWorld [0,0,0]; private _viewDir = ACE_player weaponDirection (currentWeapon ACE_player); (_viewDir call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"]; private _realYaw = _yaw + GVAR(yawChange) * _x; private _realPitch = _pitch + GVAR(pitchChange) * _x; private _returnTargetPos = _viewASL vectorAdd ([1000, _realYaw, _realPitch] call CBA_fnc_polar2vect); - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLtoAGL _returnTargetPos, 0.75, 0.75, 0, format ["%1", _x], 1, 0.025, "TahomaB"]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLToAGL _returnTargetPos, 0.75, 0.75, 0, format ["%1", _x], 1, 0.025, "TahomaB"]; } forEach [0, 1, 2, 3]; }; }]; diff --git a/addons/nlaw/functions/fnc_attackProfile.sqf b/addons/nlaw/functions/fnc_attackProfile.sqf index f5277808357..8f06e26f9c4 100644 --- a/addons/nlaw/functions/fnc_attackProfile.sqf +++ b/addons/nlaw/functions/fnc_attackProfile.sqf @@ -35,14 +35,14 @@ private _flightTime = CBA_missionTime - _startTime; private _realYaw = _yaw + _yawChange * _flightTime; private _realPitch = _pitch + _pitchChange * _flightTime; -drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], ASLtoAGL _launchPos, 0.75, 0.75, 0, "LAUNCH", 1, 0.025, "TahomaB"]; -drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,1,1], ASLtoAGL (_launchPos vectorAdd (_startLOS vectorMultiply (_distanceFromLaunch + 50))), 0.75, 0.75, 0, "Original LOS", 1, 0.025, "TahomaB"]; -drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,0,1], ASLtoAGL (_launchPos vectorAdd ([_distanceFromLaunch + 50, _realYaw, _realPitch] call CBA_fnc_polar2vect)), 0.75, 0.75, 0, format ["Predicted @%1sec",(floor(_flightTime * 10)/10)], 1, 0.025, "TahomaB"]; -drawLine3D [ASLtoAGL _launchPos, ASLtoAGL (_launchPos vectorAdd (_startLOS vectorMultiply (_distanceFromLaunch + 50))), [1,0,0,1]]; -drawLine3D [ASLtoAGL _launchPos, ASLtoAGL (_launchPos vectorAdd ([_distanceFromLaunch + 50, _realYaw, _realPitch] call CBA_fnc_polar2vect)), [1,1,0,1]]; +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], ASLToAGL _launchPos, 0.75, 0.75, 0, "LAUNCH", 1, 0.025, "TahomaB"]; +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,1,1], ASLToAGL (_launchPos vectorAdd (_startLOS vectorMultiply (_distanceFromLaunch + 50))), 0.75, 0.75, 0, "Original LOS", 1, 0.025, "TahomaB"]; +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,0,1], ASLToAGL (_launchPos vectorAdd ([_distanceFromLaunch + 50, _realYaw, _realPitch] call CBA_fnc_polar2vect)), 0.75, 0.75, 0, format ["Predicted @%1sec",(floor(_flightTime * 10)/10)], 1, 0.025, "TahomaB"]; +drawLine3D [ASLToAGL _launchPos, ASLToAGL (_launchPos vectorAdd (_startLOS vectorMultiply (_distanceFromLaunch + 50))), [1,0,0,1]]; +drawLine3D [ASLToAGL _launchPos, ASLToAGL (_launchPos vectorAdd ([_distanceFromLaunch + 50, _realYaw, _realPitch] call CBA_fnc_polar2vect)), [1,1,0,1]]; private _test = lineIntersectsSurfaces [_launchPos, _launchPos vectorAdd (_startLOS vectorMultiply 3000), player, _projectile]; if ((count _test) > 0) then { - private _posAGL = ASLtoAGL ((_test select 0) select 0); + private _posAGL = ASLToAGL ((_test select 0) select 0); drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], _posAGL, 0.75, 0.75, 0, "Original Impact", 1, 0.025, "TahomaB"]; }; #endif diff --git a/addons/nlaw/functions/fnc_navigation.sqf b/addons/nlaw/functions/fnc_navigation.sqf index 1cfd8f91d56..7572b44d6f3 100644 --- a/addons/nlaw/functions/fnc_navigation.sqf +++ b/addons/nlaw/functions/fnc_navigation.sqf @@ -67,8 +67,8 @@ _navigationParams set [6, _yawRateDifference]; private _desiredYawChange = _yawRateDifference * PROPORTIONALITY_CONSTANT + _yawRateDifference * 2; #ifdef DRAW_NLAW_INFO -drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], ASLtoAGL getPosASLVisual _projectile, 0.75, 0.75, 0, format ["dP [%1] dY: [%2]", _desiredPitchChange, _desiredYawChange], 1, 0.025, "TahomaB"]; -drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], [0, 0, 1] vectorAdd ASLtoAGL getPosASLVisual _projectile, 0.75, 0.75, 0, format ["pitch proportional [%1] yaw proportional [%2]", _pitchModifier, _yawModifier], 1, 0.025, "TahomaB"]; +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], ASLToAGL getPosASLVisual _projectile, 0.75, 0.75, 0, format ["dP [%1] dY: [%2]", _desiredPitchChange, _desiredYawChange], 1, 0.025, "TahomaB"]; +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], [0, 0, 1] vectorAdd ASLToAGL getPosASLVisual _projectile, 0.75, 0.75, 0, format ["pitch proportional [%1] yaw proportional [%2]", _pitchModifier, _yawModifier], 1, 0.025, "TahomaB"]; #endif TRACE_4("nlaw pitch/yaw info",_currentPitch,_lastPitch,_currentYaw,_lastYaw); diff --git a/addons/nlaw/functions/fnc_onFired.sqf b/addons/nlaw/functions/fnc_onFired.sqf index e8332b8caf9..cbaa2cfc0a4 100644 --- a/addons/nlaw/functions/fnc_onFired.sqf +++ b/addons/nlaw/functions/fnc_onFired.sqf @@ -50,7 +50,7 @@ if (_shooter == ACE_player) then { private _debugYaw = _debugYaw + _yawChange * _x; private _debugPitch = _debugPitch + _pitchChange * _x; private _debugPos = _debugPos vectorAdd ([_distance, _debugYaw, _debugPitch] call CBA_fnc_polar2vect); - GVAR(debug_firedPrediction) pushBack ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,0,0,1], ASLtoAGL _debugPos, 0.5, 0.5, 0, format ["%1", _x], 1, 0.025, "TahomaB"]; + GVAR(debug_firedPrediction) pushBack ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,0,0,1], ASLToAGL _debugPos, 0.5, 0.5, 0, format ["%1", _x], 1, 0.025, "TahomaB"]; }; #endif } else { diff --git a/addons/nlaw/functions/fnc_seeker.sqf b/addons/nlaw/functions/fnc_seeker.sqf index a3a60e94a1f..a77b7ecb3b6 100644 --- a/addons/nlaw/functions/fnc_seeker.sqf +++ b/addons/nlaw/functions/fnc_seeker.sqf @@ -62,7 +62,7 @@ if ((_projPos distance _launchPos) >= 20) then { // This represents a position that the missile was at between the last frame and now private _virtualPos = _lastPos vectorAdd (_vectorDir vectorMultiply _stepSize); #ifdef DRAW_NLAW_INFO - drawLine3D [ASLtoAGL _virtualPos, ASLtoAGL (_virtualPos vectorAdd [0,0,-5]), [1,0,_stepSize/(_frameDistance max 0.1),1]]; + drawLine3D [ASLToAGL _virtualPos, ASLToAGL (_virtualPos vectorAdd [0,0,-5]), [1,0,_stepSize/(_frameDistance max 0.1),1]]; #endif // Limit scan to 5 meters directly down (shaped charge jet has a very limited range) @@ -71,7 +71,7 @@ if ((_projPos distance _launchPos) >= 20) then { (_res select 0) params ["_targetPos", "", "_target"]; if ((_target isKindOf "Tank") || {_target isKindOf "Car"} || {_target isKindOf "Air"}) exitWith { TRACE_3("Firing shaped charge down",_target,_targetPos distance _virtualPos,_frameDistance); - TRACE_2("",_target worldToModel (ASLtoAGL _virtualPos),boundingBoxReal _target); + TRACE_2("",_target worldToModel (ASLToAGL _virtualPos),boundingBoxReal _target); _virtualPos = _virtualPos vectorAdd (_vectorDir vectorMultiply 1.25); deleteVehicle _projectile; diff --git a/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf b/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf index 74d18a66d90..1a6d35c2059 100644 --- a/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf +++ b/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf @@ -76,7 +76,7 @@ _text = format [" { _var = missionNamespace getVariable [_x, nil]; - if(!isnil "_var" && {_var isEqualType []} && {(count _var) > MIN_ARRAY_SIZE}) then { + if(!isNil "_var" && {_var isEqualType []} && {(count _var) > MIN_ARRAY_SIZE}) then { _text = format ["%1 - ARRAY SIZE: %2", _x, (count _var)]; [_text] call _outputText; }; @@ -86,7 +86,7 @@ _text = format [" private _unit = _x; { private _var = _unit getVariable [_x, nil]; - if(!isnil "_var" && {_var isEqualType []} && {(count _var) > MIN_ARRAY_SIZE}) then { + if(!isNil "_var" && {_var isEqualType []} && {(count _var) > MIN_ARRAY_SIZE}) then { _text = format ["%1 on [%2] - ARRAY SIZE: %3", _x, _unit, (count _var)]; [_text] call _outputText; }; diff --git a/addons/optionsmenu/gui/mainMenu.hpp b/addons/optionsmenu/gui/mainMenu.hpp index 0b26df7017a..9df21dbeb5f 100644 --- a/addons/optionsmenu/gui/mainMenu.hpp +++ b/addons/optionsmenu/gui/mainMenu.hpp @@ -22,7 +22,7 @@ class RscDisplayMain: RscStandardDisplay { class ACE_news_apex: InfoNews { idc = IDC_MAIN_INFO; - y = "safezoneY + safezoneH - (3 * 2 + 1) * (pixelH * pixelGrid * 2) - 4 * (4 * pixelH)"; + y = "safeZoneY + safeZoneH - (3 * 2 + 1) * (pixelH * pixelGrid * 2) - 4 * (4 * pixelH)"; class Controls: Controls { class Background: Background {}; diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf index a49030b1adb..4abe8d93ee5 100644 --- a/addons/overheating/XEH_postInit.sqf +++ b/addons/overheating/XEH_postInit.sqf @@ -71,7 +71,7 @@ if (hasInterface) then { ["CAManBase", "Reloaded", { params ["_unit", "_weapon", "_muzzle"]; if (_muzzle == _weapon) then { - _unit setVariable [format [QGVAR(%1_ammoTemp), _weapon], 0]; + _unit setVariable [format [QGVAR(%1_ammoTemp), _weapon], ambientTemperature select 0]; }; }] call CBA_fnc_addClassEventHandler; }; diff --git a/addons/overheating/functions/fnc_getWeaponData.sqf b/addons/overheating/functions/fnc_getWeaponData.sqf index 8edd86bb1aa..ec68cf67b9d 100644 --- a/addons/overheating/functions/fnc_getWeaponData.sqf +++ b/addons/overheating/functions/fnc_getWeaponData.sqf @@ -77,7 +77,7 @@ if (_muzzle == "this") then { _muzzle = _weapon; }; -private _reloadTime = getNumber (configfile >> "CfgWeapons" >> _weapon >> (_modes select 0) >> "reloadTime"); +private _reloadTime = getNumber (configFile >> "CfgWeapons" >> _weapon >> (_modes select 0) >> "reloadTime"); private _closedBolt = getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(closedBolt)); diff --git a/addons/overpressure/functions/fnc_firedEHBB.sqf b/addons/overpressure/functions/fnc_firedEHBB.sqf index 05a761bf068..59b51f28629 100644 --- a/addons/overpressure/functions/fnc_firedEHBB.sqf +++ b/addons/overpressure/functions/fnc_firedEHBB.sqf @@ -15,8 +15,8 @@ * Public: No */ -//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); +//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; +TRACE_8("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_gunner); // Retrieve backblast values private _bbValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues); @@ -28,11 +28,11 @@ TRACE_4("cache",_backblastAngle,_backblastRange,_backblastDamage,_offset); if (_backblastDamage <= 0) exitWith {}; -private _direction = [0, 0, 0] vectorDiff (vectorDir _projectile); -private _position = ((getPosASL _projectile) vectorAdd (_direction vectorMultiply _offset)); +private _direction = (vectorDir _projectile) vectorMultiply -1; +private _position = (getPosASL _projectile) vectorAdd (_direction vectorMultiply _offset); // Damage to others -private _affected = (ASLtoAGL _position) nearEntities ["CAManBase", _backblastRange]; +private _affected = (ASLToAGL _position) nearEntities ["CAManBase", _backblastRange]; // Let each client handle their own affected units ["ace_overpressure", [_unit, _position, _direction, _weapon, _magazine, _ammo], _affected] call CBA_fnc_targetEvent; diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index e011098b59e..eb51a055076 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -15,8 +15,8 @@ * Public: No */ -//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); +//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; +TRACE_8("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_gunner); // Retrieve overpressure values private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues); @@ -33,7 +33,7 @@ private _position = getPosASL _projectile; private _direction = vectorDir _projectile; // Damage to others -private _affected = (ASLtoAGL _position) nearEntities ["CAManBase", _dangerZoneRange]; +private _affected = (ASLToAGL _position) nearEntities ["CAManBase", _dangerZoneRange]; // Let each client handle their own affected units ["ace_overpressure", [_unit, _position, _direction, _weapon, _magazine, _ammo], _affected] call CBA_fnc_targetEvent; diff --git a/addons/overpressure/functions/fnc_overpressureDamage.sqf b/addons/overpressure/functions/fnc_overpressureDamage.sqf index 12b7a820cab..f727413d4a5 100644 --- a/addons/overpressure/functions/fnc_overpressureDamage.sqf +++ b/addons/overpressure/functions/fnc_overpressureDamage.sqf @@ -73,4 +73,4 @@ TRACE_3("cache",_overpressureAngle,_overpressureRange,_overpressureDamage); #endif }; }; -} forEach ((ASLtoAGL _posASL) nearEntities ["CAManBase", _overpressureRange]); +} forEach ((ASLToAGL _posASL) nearEntities ["CAManBase", _overpressureRange]); diff --git a/addons/parachute/RscTitles.hpp b/addons/parachute/RscTitles.hpp index 48cf11bee4d..388115a2a88 100644 --- a/addons/parachute/RscTitles.hpp +++ b/addons/parachute/RscTitles.hpp @@ -13,37 +13,37 @@ class RscTitles { class AltimeterImage: RscPicture { idc = 1200; text = QPATHTOF(UI\watch_altimeter.paa); - x = "0.118437 * safezoneW + safezoneX"; - y = "0.621 * safezoneH + safezoneY"; - w = "0.20625 * safezoneW"; - h = "0.341 * safezoneH"; + x = "0.118437 * safeZoneW + safeZoneX"; + y = "0.621 * safeZoneH + safeZoneY"; + w = "0.20625 * safeZoneW"; + h = "0.341 * safeZoneH"; }; class HeightText: RscText { idc = 1100; text = "----"; - x = "0.200937 * safezoneW + safezoneX"; - y = "0.764 * safezoneH + safezoneY"; - w = "0.04125 * safezoneW"; - h = "0.033 * safezoneH"; + x = "0.200937 * safeZoneW + safeZoneX"; + y = "0.764 * safeZoneH + safeZoneY"; + w = "0.04125 * safeZoneW"; + h = "0.033 * safeZoneH"; colorBackground[] = {0,0,0,0}; colorText[] = {0,0,0,1}; }; class DecendRate: RscText { idc = 1000; text = "--"; - x = "0.21125 * safezoneW + safezoneX"; - y = "0.742 * safezoneH + safezoneY"; - w = "0.020625 * safezoneW"; - h = "0.022 * safezoneH"; + x = "0.21125 * safeZoneW + safeZoneX"; + y = "0.742 * safeZoneH + safeZoneY"; + w = "0.020625 * safeZoneW"; + h = "0.022 * safeZoneH"; colorText[] = {0,0,0,1}; }; class TimeText: RscText { idc = 1001; text = "00:00:00"; - x = "0.202094 * safezoneW + safezoneX"; - y = "0.819 * safezoneH + safezoneY"; - w = "0.0380375 * safezoneW"; - h = "0.022 * safezoneH"; + x = "0.202094 * safeZoneW + safeZoneX"; + y = "0.819 * safeZoneH + safeZoneY"; + w = "0.0380375 * safeZoneW"; + h = "0.022 * safeZoneH"; colorText[] = {0,0,0,1}; }; }; diff --git a/addons/parachute/functions/fnc_cutParachute.sqf b/addons/parachute/functions/fnc_cutParachute.sqf index c66d9ff0504..604fb201076 100644 --- a/addons/parachute/functions/fnc_cutParachute.sqf +++ b/addons/parachute/functions/fnc_cutParachute.sqf @@ -18,6 +18,6 @@ params ["_unit", "_parachute"]; TRACE_2("cutParachute",_unit,_parachute); -playSound3d ["A3\Sounds_F\characters\parachute\parachute_landing.wss", _unit]; +playSound3D ["A3\Sounds_F\characters\parachute\parachute_landing.wss", _unit]; _unit action ["GetOut", _parachute]; deleteVehicle _parachute; diff --git a/addons/pylons/XEH_postInit.sqf b/addons/pylons/XEH_postInit.sqf index 3167c0a838a..3acbfe71571 100644 --- a/addons/pylons/XEH_postInit.sqf +++ b/addons/pylons/XEH_postInit.sqf @@ -36,7 +36,7 @@ GVAR(loadoutAction) = [ // create action [QGVAR(setPylonLoadOutEvent), { params ["_aircraft", "_pylonIndex", "_pylon", "_turret", "_weaponToRemove"]; TRACE_5("setPylonLoadOutEvent",_aircraft,_pylonIndex,_pylon,_turret,_weaponToRemove); - _aircraft setPylonLoadOut [_pylonIndex, _pylon, false, _turret]; + _aircraft setPylonLoadout [_pylonIndex, _pylon, false, _turret]; if (_weaponToRemove != "") then { { if (_aircraft turretLocal _x) then { diff --git a/addons/pylons/functions/fnc_showDialog.sqf b/addons/pylons/functions/fnc_showDialog.sqf index 9c0faab52d0..7df50c6b2aa 100644 --- a/addons/pylons/functions/fnc_showDialog.sqf +++ b/addons/pylons/functions/fnc_showDialog.sqf @@ -73,8 +73,8 @@ GVAR(comboBoxes) = []; _combo ctrlSetPosition [ (_picturePos select 0) + (_uiPos select 0), (_picturePos select 1) + (_uiPos select 1), - 0.1 * safezoneW, - 0.028 * safezoneH + 0.1 * safeZoneW, + 0.028 * safeZoneH ]; _combo ctrlCommit 0; @@ -113,10 +113,10 @@ GVAR(comboBoxes) = []; [_button, false, _turret] call FUNC(onButtonTurret); _button ctrlAddEventHandler ["ButtonClick", {[_this select 0, true, []] call FUNC(onButtonTurret)}]; _button ctrlSetPosition [ - (_picturePos select 0) + (_uiPos select 0) - (0.0165 * safezoneW), + (_picturePos select 0) + (_uiPos select 0) - (0.0165 * safeZoneW), (_picturePos select 1) + (_uiPos select 1), - 0.0165 * safezoneW, - 0.028 * safezoneH + 0.0165 * safeZoneW, + 0.028 * safeZoneH ]; _button ctrlCommit 0; }; diff --git a/addons/pylons/menu.hpp b/addons/pylons/menu.hpp index 143792e566e..3f238a9da1c 100644 --- a/addons/pylons/menu.hpp +++ b/addons/pylons/menu.hpp @@ -23,143 +23,143 @@ class GVAR(DialogLoadout) { class TextTitlebar: RscText { idc = ID_TEXT_TITLEBAR; text = CSTRING(AircraftLoadoutTitle); - x = "0.15835 * safezoneW + safezoneX"; - y = "0.262 * safezoneH + safezoneY"; - w = "0.68304 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.15835 * safeZoneW + safeZoneX"; + y = "0.262 * safeZoneH + safeZoneY"; + w = "0.68304 * safeZoneW"; + h = "0.028 * safeZoneH"; colorBackground[] = {"(profileNamespace getVariable ['GUI_BCG_RGB_R', 0.13])","(profileNamespace getVariable ['GUI_BCG_RGB_G', 0.54])","(profileNamespace getVariable ['GUI_BCG_RGB_B', 0.21])",1}; }; class BackgroundDialog: IGUIBack { idc = ID_BACKGROUND_DIALOG; - x = "0.15835 * safezoneW + safezoneX"; - y = "0.29 * safezoneH + safezoneY"; - w = "0.68304 * safezoneW"; - h = "0.448 * safezoneH"; + x = "0.15835 * safeZoneW + safeZoneX"; + y = "0.29 * safeZoneH + safeZoneY"; + w = "0.68304 * safeZoneW"; + h = "0.448 * safeZoneH"; colorBackground[] = {0,0,0,0.3}; }; class BackgroundPicture: IGUIBack { idc = ID_BACKGROUND_PICTURE; - x = "0.171616 * safezoneW + safezoneX"; - y = "0.318 * safezoneH + safezoneY"; - w = "0.440035 * safezoneW"; - h = "0.392 * safezoneH"; + x = "0.171616 * safeZoneW + safeZoneX"; + y = "0.318 * safeZoneH + safeZoneY"; + w = "0.440035 * safeZoneW"; + h = "0.392 * safeZoneH"; colorBackground[] = {0.3,0.3,0.3,1}; }; class PictureAircraft: RscPictureKeepAspect { idc = ID_PICTURE_AIRCRAFT; - x = "0.171616 * safezoneW + safezoneX"; - y = "0.318 * safezoneH + safezoneY"; - w = "0.440035 * safezoneW"; - h = "0.392 * safezoneH"; + x = "0.171616 * safeZoneW + safeZoneX"; + y = "0.318 * safeZoneH + safeZoneY"; + w = "0.440035 * safeZoneW"; + h = "0.392 * safeZoneH"; }; class CheckboxMirror: RscCheckBox { idc = ID_CHECKBOX_MIRROR; - x = "0.171616 * safezoneW + safezoneX"; - y = "0.318 * safezoneH + safezoneY"; - w = "0.0165 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.171616 * safeZoneW + safeZoneX"; + y = "0.318 * safeZoneH + safeZoneY"; + w = "0.0165 * safeZoneW"; + h = "0.028 * safeZoneH"; }; class TextMirror: RscText { idc = ID_TEXT_MIRROR; text = "$STR_3DEN_Object_Attribute_PylonsMirror_displayName"; tooltip="$STR_3DEN_Object_Attribute_PylonsMirror_tooltip"; - x = "0.188116 * safezoneW + safezoneX"; - y = "0.318 * safezoneH + safezoneY"; - w = "0.0656768 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.188116 * safeZoneW + safeZoneX"; + y = "0.318 * safeZoneH + safeZoneY"; + w = "0.0656768 * safeZoneW"; + h = "0.028 * safeZoneH"; colorBackground[] = {0,0,0,0.5}; }; class CheckboxFRIES: RscCheckBox { idc = ID_CHECKBOX_FRIES; - x = "0.171616 * safezoneW + safezoneX"; - y = "0.346 * safezoneH + safezoneY"; - w = "0.0165 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.171616 * safeZoneW + safeZoneX"; + y = "0.346 * safeZoneH + safeZoneY"; + w = "0.0165 * safeZoneW"; + h = "0.028 * safeZoneH"; }; class TextFRIES: RscText { idc = ID_TEXT_FRIES; text = "FRIES"; - x = "0.188116 * safezoneW + safezoneX"; - y = "0.346 * safezoneH + safezoneY"; - w = "0.0656768 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.188116 * safeZoneW + safeZoneX"; + y = "0.346 * safeZoneH + safeZoneY"; + w = "0.0656768 * safeZoneW"; + h = "0.028 * safeZoneH"; colorBackground[] = {0,0,0,0.5}; }; class TextListTitle: RscText { idc = ID_TEXT_LISTTITLE; - x = "0.624786 * safezoneW + safezoneX"; - y = "0.318 * safezoneH + safezoneY"; - w = "0.203437 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.624786 * safeZoneW + safeZoneX"; + y = "0.318 * safeZoneH + safeZoneY"; + w = "0.203437 * safeZoneW"; + h = "0.028 * safeZoneH"; colorBackground[] = {0,0,0,0.5}; }; class ListLoadouts: RscListBox { idc = ID_LIST_LOADOUTS; - x = "0.624786 * safezoneW + safezoneX"; - y = "0.346 * safezoneH + safezoneY"; - w = "0.203437 * safezoneW"; - h = "0.294 * safezoneH"; + x = "0.624786 * safeZoneW + safeZoneX"; + y = "0.346 * safeZoneH + safeZoneY"; + w = "0.203437 * safeZoneW"; + h = "0.294 * safeZoneH"; }; class EditLoadoutName: RscEdit { idc = ID_EDIT_LOADOUTNAME; - x = "0.624786 * safezoneW + safezoneX"; - y = "0.64 * safezoneH + safezoneY"; - w = "0.203437 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.624786 * safeZoneW + safeZoneX"; + y = "0.64 * safeZoneH + safeZoneY"; + w = "0.203437 * safeZoneW"; + h = "0.028 * safeZoneH"; colorBackground[] = {0,0,0,0.7}; }; class ButtonSave: RscButtonMenu { idc = ID_BUTTON_SAVE; action = QUOTE(call FUNC(onButtonSave)); text = "$STR_disp_int_save"; - x = "0.624786 * safezoneW + safezoneX"; - y = "0.682 * safezoneH + safezoneY"; - w = "0.0590625 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.624786 * safeZoneW + safeZoneX"; + y = "0.682 * safeZoneH + safeZoneY"; + w = "0.0590625 * safeZoneW"; + h = "0.028 * safeZoneH"; }; class ButtonLoad: RscButtonMenu { idc = ID_BUTTON_LOAD; action = QUOTE(call FUNC(onButtonLoad)); text = "$STR_disp_int_load"; - x = "0.69703 * safezoneW + safezoneX"; - y = "0.682 * safezoneH + safezoneY"; - w = "0.0590625 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.69703 * safeZoneW + safeZoneX"; + y = "0.682 * safeZoneH + safeZoneY"; + w = "0.0590625 * safeZoneW"; + h = "0.028 * safeZoneH"; }; class ButtonDelete: RscButtonMenu { idc = ID_BUTTON_DELETE; action = QUOTE(call FUNC(onButtonDelete)); text = "$STR_disp_delete"; - x = "0.769275 * safezoneW + safezoneX"; - y = "0.682 * safezoneH + safezoneY"; - w = "0.0590625 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.769275 * safeZoneW + safeZoneX"; + y = "0.682 * safeZoneH + safeZoneY"; + w = "0.0590625 * safeZoneW"; + h = "0.028 * safeZoneH"; }; class ButtonApply: RscButtonMenu { idc = ID_BUTTON_APPLY; action = QUOTE(call FUNC(onButtonApply)); text = "$STR_ui_debug_but_apply"; - x = "0.683895 * safezoneW + safezoneX"; - y = "0.738 * safezoneH + safezoneY"; - w = "0.0721875 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.683895 * safeZoneW + safeZoneX"; + y = "0.738 * safeZoneH + safeZoneY"; + w = "0.0721875 * safeZoneW"; + h = "0.028 * safeZoneH"; }; class ButtonClose: RscButtonMenu { idc = ID_BUTTON_CLOSE; text = "$STR_disp_cancel"; action = QUOTE(call FUNC(onButtonClose)); - x = "0.769275 * safezoneW + safezoneX"; - y = "0.738 * safezoneH + safezoneY"; - w = "0.0721875 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.769275 * safeZoneW + safeZoneX"; + y = "0.738 * safeZoneH + safeZoneY"; + w = "0.0721875 * safeZoneW"; + h = "0.028 * safeZoneH"; }; class TextBanner: RscText { idc = ID_TEXT_BANNER; text = CSTRING(BannerText); - x = "0.171616 * safezoneW + safezoneX"; - y = "0.738 * safezoneH + safezoneY"; - w = "0.440035 * safezoneW"; - h = "0.028 * safezoneH"; + x = "0.171616 * safeZoneW + safeZoneX"; + y = "0.738 * safeZoneH + safeZoneY"; + w = "0.440035 * safeZoneW"; + h = "0.028 * safeZoneH"; colorBackground[] = {0.5,0,0,0.5}; }; }; diff --git a/addons/quickmount/functions/fnc_addFreeSeatsActions.sqf b/addons/quickmount/functions/fnc_addFreeSeatsActions.sqf index c1318e3f747..efb40d2ac1a 100644 --- a/addons/quickmount/functions/fnc_addFreeSeatsActions.sqf +++ b/addons/quickmount/functions/fnc_addFreeSeatsActions.sqf @@ -34,14 +34,14 @@ [ARR_5( \ {!isNull objectParent (_this select 0)}, \ { \ - LOG_1("moved in after %1 frames",diag_frameno-GVAR(frame)); \ + LOG_1("moved in after %1 frames",diag_frameNo-GVAR(frame)); \ (_this select 0) enableSimulation true; \ }, \ [ARR_3(_player,_moveBackCode,_moveBackParams)], \ TAKEN_SEAT_TIMEOUT, \ { \ params [ARR_3("_player","_moveBackCode","_moveBackParams")]; \ - WARNING_1("failed move in after %1 frames",diag_frameno-GVAR(frame)); \ + WARNING_1("failed move in after %1 frames",diag_frameNo-GVAR(frame)); \ [ARR_2(_player,_moveBackParams)] call _moveBackCode; \ localize "str_mis_state_failed" call EFUNC(common,displayTextStructured); \ _player enableSimulation true; \ @@ -61,7 +61,7 @@ private _fnc_move = { (_this select 2) params ["_moveInCode", "_moveInParams", "_currentTurret", "_moveBackCode", "_moveBackParams"]; - TRACE_6("fnc_move params",_moveInCode,_moveInParams,_currentTurret,_moveBackCode,_moveBackParams,call {GVAR(frame)=diag_frameno}); + TRACE_6("fnc_move params",_moveInCode,_moveInParams,_currentTurret,_moveBackCode,_moveBackParams,call {GVAR(frame)=diag_frameNo}); // workaround getting damage when moveOut while vehicle is moving // also this helps with arma bug when unit is stuck in wrong anim when move in turret with configured enabledByAnimationSource @@ -83,7 +83,7 @@ private _fnc_move = { {params ["_target", "_player", "_currentTurret"]; IS_MOVED_OUT}, { params ["", "_player", "", "_moveInCode", "_moveInParams", "_moveBackCode", "_moveBackParams"]; - LOG_2("moved out after %1 frames",diag_frameno-GVAR(frame),call {GVAR(frame)=diag_frameno; 0}); + LOG_2("moved out after %1 frames",diag_frameNo-GVAR(frame),call {GVAR(frame)=diag_frameNo; 0}); [_player, _moveInParams] call _moveInCode; WAIT_IN_OR_MOVE_BACK; }, @@ -202,15 +202,15 @@ private _cargoNumber = -1; if (_vehicle lockedTurret _turretPath) then {breakTo "crewLoop"}; if (_role == "gunner" && {unitIsUAV _vehicle}) then {breakTo "crewLoop"}; private _turretConfig = [_vehicleConfig, _turretPath] call CBA_fnc_getTurret; - if (!_isInVehicle) then { - _params = ["GetInTurret", _vehicle, _turretPath]; - _statement = {_player action (_this select 2)}; - } else { + if (_isInVehicle) then { private _gunnerCompartments = (_turretConfig >> "gunnerCompartments") call BIS_fnc_getCfgData; TO_COMPARTMENT_STRING(_gunnerCompartments); if (_compartment != _gunnerCompartments) then {breakTo "crewLoop"}; _params = [{MOVE_IN_CODE(moveInTurret)}, [_vehicle, _turretPath], _currentTurret, _moveBackCode, _moveBackParams]; _statement = _fnc_move; + } else { + _params = ["GetInTurret", _vehicle, _turretPath]; + _statement = {_player action (_this select 2)}; }; _name = getText (_turretConfig >> "gunnerName"); _icon = switch true do { diff --git a/addons/rangecard/RscTitles.hpp b/addons/rangecard/RscTitles.hpp index 720f724be4d..6b8af599752 100644 --- a/addons/rangecard/RscTitles.hpp +++ b/addons/rangecard/RscTitles.hpp @@ -73,8 +73,8 @@ class ACE_RangeCard_Dialog { SizeEX=0.025; idc=-1; style=48; - x="safezoneX"; - y="safezoneY+0.181889"; + x="safeZoneX"; + y="safeZoneY+0.181889"; w="1.62727*3/4"; h="1.62727"; colorBackground[]={1,1,1,1}; @@ -84,67 +84,67 @@ class ACE_RangeCard_Dialog { class CAPTION_TEXT_1: RangeCard_RscText { idc=770000; style=ST_LEFT; - x="safezoneX+0.18"; - y="safezoneY+0.181889+0.0"; + x="safeZoneX+0.18"; + y="safeZoneY+0.181889+0.0"; w="0.56*1.62727*3/4"; text=".408 CheyTac - 410 gr Predator Projectiles"; }; class CAPTION_TEXT_2: CAPTION_TEXT_1 { idc=770001; SizeEx=0.022; - y="safezoneY+0.181889+0.03"; + y="safeZoneY+0.181889+0.03"; text="Drop Tables for B.P.: 1013.25mb; Corrected for MVV at Air/Ammo Temperatures -15-35 °C"; }; class CAPTION_TEXT_3: CAPTION_TEXT_2 { idc=770002; - y="safezoneY+0.181889+0.06"; + y="safeZoneY+0.181889+0.06"; text="CheyTac Intervention - 29'' 1:13'' twist (M-200)"; }; class ZERO_RANGE_TEXT: RangeCard_RscText { idc=77003; style=ST_LEFT; SizeEx=0.028; - x="safezoneX+0.885"; - y="safezoneY+0.181889+0.01"; + x="safeZoneX+0.885"; + y="safeZoneY+0.181889+0.01"; w="0.125*1.62727*3/4"; text="100m ZERO"; }; class BAROMETRIC_PRESSURE_TEXT: ZERO_RANGE_TEXT { idc=77004; colorText[]={1,0,0,0.8}; - y="safezoneY+0.181889+0.05"; + y="safeZoneY+0.181889+0.05"; text="B.P.: 1013.25mb"; }; class TARGET_RANGE_TEXT_1: RangeCard_RscText { idc=770010; colorText[]={1,1,1,1}; - x="safezoneX+0.185"; - y="safezoneY+0.181889+0.098"; + x="safeZoneX+0.185"; + y="safeZoneY+0.181889+0.098"; text="Target"; }; class TARGET_RANGE_TEXT_2: TARGET_RANGE_TEXT_1 { idc=770011; SizeEx=0.03; - y="safezoneY+0.181889+0.125"; + y="safeZoneY+0.181889+0.125"; text="Range"; }; class TARGET_RANGE_TEXT_3: TARGET_RANGE_TEXT_1 { idc=770012; - y="safezoneY+0.181889+0.152"; + y="safeZoneY+0.181889+0.152"; text="(m)"; }; class BULLET_DROP_TEXT_1: RangeCard_RscText { idc=770013; - x="safezoneX+0.25"; - y="safezoneY+0.181889+0.095"; + x="safeZoneX+0.25"; + y="safeZoneY+0.181889+0.095"; w="0.405*1.62727*3/4"; text="Bullet Drop (MRADs)"; }; class WIND_LEAD_CAPTION_LIST: RangeCard_RscListNBox { idc=770100; sizeEx=0.021; - x="safezoneX+0.728"; - y="safezoneY+0.181889+0.091"; + x="safeZoneX+0.728"; + y="safeZoneY+0.181889+0.091"; w="0.25*1.62727*3/4"; h="0.0909445"; columns[]={"0.03/2", "0.985/2"}; @@ -153,8 +153,8 @@ class ACE_RangeCard_Dialog { }; class TEMPERATURE_CAPTION_LIST_1: RangeCard_RscListNBox { idc=770200; - x="safezoneX+0.24"; - y="safezoneY+0.181889+0.125"; + x="safeZoneX+0.24"; + y="safeZoneY+0.181889+0.125"; w="0.405*1.62727*3/4"; h="0.0909445"; columns[]={"0/9", "1/9", "2/9", "3/9", "4/9", "5/9", "5.9/9", "6.9/9", "7.8/9"}; @@ -163,8 +163,8 @@ class ACE_RangeCard_Dialog { }; class TEMPERATURE_CAPTION_LIST_2: RangeCard_RscListNBox { idc=770300; - x="safezoneX+0.728"; - y="safezoneY+0.181889+0.15"; + x="safeZoneX+0.728"; + y="safeZoneY+0.181889+0.15"; w="0.25*1.62727*3/4"; h="0.0909445"; columns[]={"0/6", "0.9/6", "1.8/6", "2.9/6", "3.8/6", "4.8/6"}; @@ -173,8 +173,8 @@ class ACE_RangeCard_Dialog { }; class RANGE_CARD_DATA: RangeCard_RscListNBox { idc=770400; - x="safezoneX+0.182"; - y="safezoneY+0.181889+0.194"; + x="safeZoneX+0.182"; + y="safeZoneY+0.181889+0.194"; w="0.72*1.62727*3/4"; h="1.62727"; columns[]={"0/16", "1.2/16", "2.2/16", "3.2/16", "4.2/16", "5.1/16", "6.1/16", "7.1/16", "8.1/16", @@ -185,13 +185,13 @@ class ACE_RangeCard_Dialog { class FOOTNOTE_TEXT_1: CAPTION_TEXT_1 { idc=770020; SizeEx=0.022; - y="safezoneY+1.72431"; + y="safeZoneY+1.72431"; w="0.705*1.62727*3/4"; text="For best results keep ammunition at ambient air temperature. Tables calculated for the above listed barrel"; }; class FOOTNOTE_TEXT_2: FOOTNOTE_TEXT_1 { idc=770021; - y="safezoneY+1.72431+0.024"; + y="safeZoneY+1.72431+0.024"; text="and load with optic mounted 1.5'' above line of bore."; }; }; diff --git a/addons/rangecard/functions/fnc_calculateRangeCard.sqf b/addons/rangecard/functions/fnc_calculateRangeCard.sqf index 0663fcfd531..c16b202539e 100644 --- a/addons/rangecard/functions/fnc_calculateRangeCard.sqf +++ b/addons/rangecard/functions/fnc_calculateRangeCard.sqf @@ -83,8 +83,8 @@ _bulletPos set [1, 0]; _bulletPos set [2, -(_boreHeight / 100)]; _bulletVelocity set [0, 0]; -_bulletVelocity set [1, Cos(_scopeBaseAngle) * _muzzleVelocity]; -_bulletVelocity set [2, Sin(_scopeBaseAngle) * _muzzleVelocity]; +_bulletVelocity set [1, cos(_scopeBaseAngle) * _muzzleVelocity]; +_bulletVelocity set [2, sin(_scopeBaseAngle) * _muzzleVelocity]; while {_TOF < 6 && (_bulletPos select 1) < _targetRange} do { _bulletSpeed = vectorMagnitude _bulletVelocity; @@ -123,21 +123,21 @@ while {_TOF < 6 && (_bulletPos select 1) < _targetRange} do { _tz = (_lastBulletPos select 2) + (_range - (_lastBulletPos select 1)) * ((_bulletPos select 2) - (_lastBulletPos select 2)) / ((_bulletPos select 1) - (_lastBulletPos select 1)); _elevation = - atan(_tz / _range); _windage = - atan(_tx / _range); - _lead = (_targetSpeed * _TOF) / (Tan(MRAD_TO_DEG(1)) * _range); + _lead = (_targetSpeed * _TOF) / (tan(MRAD_TO_DEG(1)) * _range); }; - private _elevationString = Str(round(-DEG_TO_MRAD(_elevation) * 10) / 10); + private _elevationString = str(round(-DEG_TO_MRAD(_elevation) * 10) / 10); if (_elevationString == "0") then { _elevationString = "-0.0"; }; if (_elevationString find "." == -1) then { _elevationString = _elevationString + ".0"; }; - private _windageString = Str(round(DEG_TO_MRAD(_windage) * 10) / 10); + private _windageString = str(round(DEG_TO_MRAD(_windage) * 10) / 10); if (_windageString find "." == -1) then { _windageString = _windageString + ".0"; }; - private _leadString = Str(round(_lead * 10) / 10); + private _leadString = str(round(_lead * 10) / 10); if (_leadString find "." == -1) then { _leadString = _leadString + ".0"; }; diff --git a/addons/rangecard/functions/fnc_updateRangeCard.sqf b/addons/rangecard/functions/fnc_updateRangeCard.sqf index ba44d7e41cc..76b679accf5 100644 --- a/addons/rangecard/functions/fnc_updateRangeCard.sqf +++ b/addons/rangecard/functions/fnc_updateRangeCard.sqf @@ -42,7 +42,7 @@ for "_row" from 0 to 49 do { _control ctrlSetTextColor [0, 0, 0, 1]; }; _control ctrlCommit 0; - _control ctrlSetText Str(100 + _row * 50); + _control ctrlSetText str(100 + _row * 50); GVAR(controls) pushBack _control; }; for "_column" from 0 to 8 do { diff --git a/addons/rearm/functions/fnc_canRearm.sqf b/addons/rearm/functions/fnc_canRearm.sqf index 8d2b0b58e50..34bb3727536 100644 --- a/addons/rearm/functions/fnc_canRearm.sqf +++ b/addons/rearm/functions/fnc_canRearm.sqf @@ -22,7 +22,7 @@ if (!alive _vehicle) exitWith {false}; if (GVAR(level) == 0 || {isNull _unit} || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {_vehicle distance _unit > REARM_ACTION_DISTANCE} || {_vehicle getVariable [QGVAR(disabled), false]}) exitWith {false}; private _dummy = _unit getVariable [QGVAR(dummy), objNull]; -if (isNull _dummy) exitwith {false}; +if (isNull _dummy) exitWith {false}; private _magazineClass = _dummy getVariable QGVAR(magazineClass); if (isNil "_magazineClass") exitWith {false}; diff --git a/addons/rearm/functions/fnc_grabAmmo.sqf b/addons/rearm/functions/fnc_grabAmmo.sqf index b8c53371d8d..b7f87a69ba4 100644 --- a/addons/rearm/functions/fnc_grabAmmo.sqf +++ b/addons/rearm/functions/fnc_grabAmmo.sqf @@ -35,7 +35,7 @@ REARM_HOLSTER_WEAPON; _unit removeAction _actionID; }; _actionID = _unit addAction [ - format ["%1", localize ELSTRING(dragging,Drop)], + format ["%1", LELSTRING(common,Drop)], '(_this select 0) call FUNC(dropAmmo)', nil, 20, diff --git a/addons/rearm/functions/fnc_rearm.sqf b/addons/rearm/functions/fnc_rearm.sqf index 8ef09c8f76b..821691a3259 100644 --- a/addons/rearm/functions/fnc_rearm.sqf +++ b/addons/rearm/functions/fnc_rearm.sqf @@ -20,7 +20,7 @@ params ["_target", "_unit"]; TRACE_2("rearm",_target,_unit); private _attachedDummy = _unit getVariable [QGVAR(dummy), objNull]; -if (isNull _attachedDummy) exitwith {ERROR_1("attachedDummy null %1",_attachedDummy);}; +if (isNull _attachedDummy) exitWith {ERROR_1("attachedDummy null %1",_attachedDummy);}; private _magazineClass = _attachedDummy getVariable QGVAR(magazineClass); if (isNil "_magazineClass") exitWith {ERROR_1("magazineClass nil %1",_attachedDummy);}; diff --git a/addons/rearm/functions/fnc_rearmSuccessLocal.sqf b/addons/rearm/functions/fnc_rearmSuccessLocal.sqf index f41dff6ea9c..ace43baf8f9 100644 --- a/addons/rearm/functions/fnc_rearmSuccessLocal.sqf +++ b/addons/rearm/functions/fnc_rearmSuccessLocal.sqf @@ -31,7 +31,7 @@ if (_pylon > 0) exitWith { // Fill magazine completely if (_turretPath isEqualTo [-1]) then {_turretPath = [];}; // Convert back to pylon turret format TRACE_3("",_pylon,_magazineClass,_rounds); - _vehicle setPylonLoadOut [_pylon, _magazineClass, true, _turretPath]; + _vehicle setPylonLoadout [_pylon, _magazineClass, true, _turretPath]; [QEGVAR(common,displayTextStructured), [[LSTRING(Hint_RearmedTriple), _rounds, getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), getText(configOf _vehicle >> "displayName")], 3, _unit], [_unit]] call CBA_fnc_targetEvent; @@ -41,7 +41,7 @@ if (_pylon > 0) exitWith { private _currentCount = _vehicle ammoOnPylon _pylon; private _newCount = ((_currentCount max 0) + _numRounds) min _rounds; TRACE_3("",_pylon,_magazineClass,_newCount); - _vehicle setPylonLoadOut [_pylon, _magazineClass, true, _turretPath]; + _vehicle setPylonLoadout [_pylon, _magazineClass, true, _turretPath]; _vehicle setAmmoOnPylon [_pylon, _newCount]; [QEGVAR(common,displayTextStructured), [[LSTRING(Hint_RearmedTriple), _numRounds, getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), diff --git a/addons/rearm/functions/fnc_storeAmmo.sqf b/addons/rearm/functions/fnc_storeAmmo.sqf index e9f57369f3d..1d08d289be4 100644 --- a/addons/rearm/functions/fnc_storeAmmo.sqf +++ b/addons/rearm/functions/fnc_storeAmmo.sqf @@ -19,7 +19,7 @@ params ["_truck", "_unit"]; private _attachedDummy = _unit getVariable [QGVAR(dummy), objNull]; -if (isNull _attachedDummy) exitwith {}; +if (isNull _attachedDummy) exitWith {}; private _magazineClass = _attachedDummy getVariable [QGVAR(magazineClass), "#noVar"]; diff --git a/addons/rearm/functions/fnc_takeSuccess.sqf b/addons/rearm/functions/fnc_takeSuccess.sqf index 1d112f26459..214713c80d6 100644 --- a/addons/rearm/functions/fnc_takeSuccess.sqf +++ b/addons/rearm/functions/fnc_takeSuccess.sqf @@ -42,7 +42,7 @@ private _dummy = [_unit, _magazineClass] call FUNC(createDummy); [_dummy, _unit] call FUNC(pickUpAmmo); private _actionID = _unit addAction [ - format ["%1", localize ELSTRING(dragging,Drop)], + format ["%1", LELSTRING(common,Drop)], '(_this select 0) call FUNC(dropAmmo)', nil, 20, diff --git a/addons/refuel/dev/exportTerrainRefuelPositions.sqf b/addons/refuel/dev/exportTerrainRefuelPositions.sqf index c7f9abfb2fd..8064736ad9c 100644 --- a/addons/refuel/dev/exportTerrainRefuelPositions.sqf +++ b/addons/refuel/dev/exportTerrainRefuelPositions.sqf @@ -69,7 +69,7 @@ if (_checkCount != _totalCount) then { // export text private _nl = toString [10]; private _multipleBasePumps = 1 < count _basePumps; -private _output = [format [" %1[] = { /* %2 */", worldName, getText (configfile >> "CfgWorlds" >> worldName >> "description")]]; +private _output = [format [" %1[] = { /* %2 */", worldName, getText (configFile >> "CfgWorlds" >> worldName >> "description")]]; { if (_forEachIndex > 0) then {_output pushBack ","}; _x params ["_class", "_positions"]; diff --git a/addons/refuel/functions/fnc_connectNozzleAction.sqf b/addons/refuel/functions/fnc_connectNozzleAction.sqf index 502e1dc3a41..1a022b6e768 100644 --- a/addons/refuel/functions/fnc_connectNozzleAction.sqf +++ b/addons/refuel/functions/fnc_connectNozzleAction.sqf @@ -62,7 +62,7 @@ if (_bestPosASL isEqualTo []) exitWith { //Move it out slightly, for visibility sake (better to look a little funny than be embedded//sunk in the hull and be useless) _bestPosASL = _bestPosASL vectorAdd ((_bestPosASL vectorFromTo _startingPosASL) vectorMultiply 0.05); -private _attachPosModel = _sink worldToModel (ASLtoAGL _bestPosASL); +private _attachPosModel = _sink worldToModel (ASLToAGL _bestPosASL); [ GVAR(progressDuration), diff --git a/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf b/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf index 3e4dc23afbb..da47bc3c725 100644 --- a/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf +++ b/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf @@ -89,7 +89,7 @@ TRACE_2("start",_unit,_nozzle); }; private _hintLMB = ""; - private _hintRMB = localize ELSTRING(dragging,Drop); + private _hintRMB = LELSTRING(common,Drop); getCursorObjectParams params ["_cursorObject", "", "_distance"]; if (!isNull _cursorObject && {_distance < REFUEL_NOZZLE_ACTION_DISTANCE}) then { diff --git a/addons/reload/functions/fnc_checkAmmo.sqf b/addons/reload/functions/fnc_checkAmmo.sqf index f558d917699..8039c9527ca 100644 --- a/addons/reload/functions/fnc_checkAmmo.sqf +++ b/addons/reload/functions/fnc_checkAmmo.sqf @@ -23,7 +23,7 @@ if (_unit == _target) then { _target = vehicle _target; }; - [_unit, "Gear", 1] call EFUNC(common,doGesture); + [_unit, "reloadMagazine", 0] call EFUNC(common,doGesture); }; [FUNC(displayAmmo), _target, 1] call CBA_fnc_waitAndExecute; diff --git a/addons/reload/functions/fnc_displayAmmo.sqf b/addons/reload/functions/fnc_displayAmmo.sqf index 68e176587ad..7e38ee65f87 100644 --- a/addons/reload/functions/fnc_displayAmmo.sqf +++ b/addons/reload/functions/fnc_displayAmmo.sqf @@ -122,7 +122,7 @@ if (_isStaticWeapon) then { _loadedName = parseText format ["%1", _loadedName]; - private _text = composeText [_loadedName, linebreak, _ammoBarsStructuredText]; + private _text = composeText [_loadedName, lineBreak, _ammoBarsStructuredText]; [_text] call EFUNC(common,displayTextStructured); } else { if (_magazine != "") then { diff --git a/addons/repair/functions/fnc_canRepair.sqf b/addons/repair/functions/fnc_canRepair.sqf index ff61450b12b..4a77383c288 100644 --- a/addons/repair/functions/fnc_canRepair.sqf +++ b/addons/repair/functions/fnc_canRepair.sqf @@ -21,7 +21,7 @@ params ["_caller", "_target", "_hitPoint", "_className"]; TRACE_4("params",_caller,_target,_hitPoint,_className); -private _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); +private _config = (configFile >> "ACE_Repair" >> "Actions" >> _className); if !(isClass _config) exitWith {false}; // or go for a default? // if(isEngineOn _target) exitWith {false}; // Ignore here so action shows, then exit and show warning when selected #3348 diff --git a/addons/repair/functions/fnc_repair.sqf b/addons/repair/functions/fnc_repair.sqf index ccb2e42dfd0..ae4038daf0a 100644 --- a/addons/repair/functions/fnc_repair.sqf +++ b/addons/repair/functions/fnc_repair.sqf @@ -21,7 +21,7 @@ params ["_caller", "_target", "_hitPoint", "_className"]; TRACE_4("params",_caller,_target,_hitPoint,_className); -private _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); +private _config = (configFile >> "ACE_Repair" >> "Actions" >> _className); if !(isClass _config) exitWith {false}; // or go for a default? private _engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { diff --git a/addons/repair/functions/fnc_repair_failure.sqf b/addons/repair/functions/fnc_repair_failure.sqf index 37b2c50447c..0c7fcbf9af3 100644 --- a/addons/repair/functions/fnc_repair_failure.sqf +++ b/addons/repair/functions/fnc_repair_failure.sqf @@ -59,7 +59,7 @@ if (!isNil "_weaponSelect") then { // Record specific callback -private _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); +private _config = (configFile >> "ACE_Repair" >> "Actions" >> _className); private _callback = getText (_config >> "callbackFailure"); if (isNil _callback) then { diff --git a/addons/repair/functions/fnc_repair_success.sqf b/addons/repair/functions/fnc_repair_success.sqf index 9da2b0c4039..94ffd819e31 100644 --- a/addons/repair/functions/fnc_repair_success.sqf +++ b/addons/repair/functions/fnc_repair_success.sqf @@ -54,7 +54,7 @@ if (!isNil "_weaponSelect") then { } forEach _claimedObjects; // Record specific callback -private _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); +private _config = (configFile >> "ACE_Repair" >> "Actions" >> _className); private _callback = getText (_config >> "callbackSuccess"); if (isNil _callback) then { diff --git a/addons/repair/functions/fnc_useItems.sqf b/addons/repair/functions/fnc_useItems.sqf index edc18bcb16f..784c4a5da2a 100644 --- a/addons/repair/functions/fnc_useItems.sqf +++ b/addons/repair/functions/fnc_useItems.sqf @@ -25,14 +25,14 @@ private _itemsUsedBy = []; if (_x isEqualType []) then { { private _itemUsedInfo = [_unit, _x] call FUNC(useItem); - if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; + if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushBack [(_itemUsedInfo select 1), _x]}; } forEach _x; }; // handle required item if (_x isEqualType "") then { private _itemUsedInfo = [_unit, _x] call FUNC(useItem); - if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; + if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushBack [(_itemUsedInfo select 1), _x]}; }; } forEach _items; diff --git a/addons/respawn/functions/fnc_updateRallypoint.sqf b/addons/respawn/functions/fnc_updateRallypoint.sqf index a0e14a4ed29..bedc887b3c2 100644 --- a/addons/respawn/functions/fnc_updateRallypoint.sqf +++ b/addons/respawn/functions/fnc_updateRallypoint.sqf @@ -18,7 +18,7 @@ */ params ["_rallypoint", "_side"]; -private _position = param [2, getpos _rallypoint]; +private _position = param [2, getPos _rallypoint]; if (!hasInterface) exitWith {}; diff --git a/addons/sandbag/functions/fnc_pickup.sqf b/addons/sandbag/functions/fnc_pickup.sqf index 2bcc418f4ca..07a6285e685 100644 --- a/addons/sandbag/functions/fnc_pickup.sqf +++ b/addons/sandbag/functions/fnc_pickup.sqf @@ -29,7 +29,7 @@ _unit setVariable [QGVAR(isUsingSandbag), true]; if (isNull _sandbag) exitWith {}; - deletevehicle _sandbag; + deleteVehicle _sandbag; // Force physx update { diff --git a/addons/scopes/RscTitles.hpp b/addons/scopes/RscTitles.hpp index c108caaf4d8..5b3002599ea 100644 --- a/addons/scopes/RscTitles.hpp +++ b/addons/scopes/RscTitles.hpp @@ -26,10 +26,10 @@ class RscTitles { colorBackground[] = { 1, 1, 1, 1 }; shadow = 1; - x = "(0.5 - 0.4 / 2) * safezoneW + safezoneX"; - y = "0 * safezoneH + safezoneY"; - w = "0.4 * safezoneW"; - h = "0.3 * safezoneH"; + x = "(0.5 - 0.4 / 2) * safeZoneW + safeZoneX"; + y = "0 * safeZoneH + safeZoneY"; + w = "0.4 * safeZoneW"; + h = "0.3 * safeZoneH"; }; class ACE_Scopes_Zeroing_Vertical: RscText { idc = 12; @@ -43,10 +43,10 @@ class RscTitles { colorBackground[] = { 1, 0, 0, 0 }; shadow = 0; - x = "(0.5 - 0.4 / 2 + 0.45*0.4) * safezoneW + safezoneX"; - y = "(0 + 0.19*0.3) * safezoneH + safezoneY"; - w = "0.04 * safezoneW"; - h = "0.025 * safezoneH"; + x = "(0.5 - 0.4 / 2 + 0.45*0.4) * safeZoneW + safeZoneX"; + y = "(0 + 0.19*0.3) * safeZoneH + safeZoneY"; + w = "0.04 * safeZoneW"; + h = "0.025 * safeZoneH"; }; class ACE_Scopes_Zeroing_Horizontal: RscText { idc = 13; @@ -60,10 +60,10 @@ class RscTitles { colorBackground[] = { 1, 0, 0, 0 }; shadow = 0; - x = "(0.5 - 0.4 / 2 + 0.6*0.4) * safezoneW + safezoneX"; - y = "(0 + 0.47*0.3) * safezoneH + safezoneY"; - w = "0.019 * safezoneW"; - h = "0.025 * safezoneH"; + x = "(0.5 - 0.4 / 2 + 0.6*0.4) * safeZoneW + safeZoneX"; + y = "(0 + 0.47*0.3) * safeZoneH + safeZoneY"; + w = "0.019 * safeZoneW"; + h = "0.025 * safeZoneH"; }; }; }; diff --git a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf index b813dde9ef8..d356343099d 100644 --- a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf +++ b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf @@ -43,6 +43,10 @@ if (cameraView == "GUNNER") then { _yaw = _yaw + _windageDifference; [_unit, _pitch, _bank, _yaw] call EFUNC(common,setPitchBankYaw); }; + + if (GVAR(inScopeAdjustment)) then { + [] call FUNC(showZeroing); + }; } else { [] call FUNC(showZeroing); }; diff --git a/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf b/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf index ed1222e3bbc..670a119f839 100644 --- a/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf +++ b/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf @@ -42,9 +42,7 @@ private _vanillaZero = parseNumber (("ace" callExtension ["ballistics:replicate_ _vanillaZero = 0; #endif -private _trueZero = if (!_advancedBallistics) then { - parseNumber (("ace" callExtension ["ballistics:zero_vanilla", [_newZeroRange, _initSpeed, _airFriction, _boreHeight]]) select 0) -} else { +private _trueZero = if (_advancedBallistics) then { // Get Weapon and Ammo Configurations private _AmmoCacheEntry = uiNamespace getVariable format[QEGVAR(advanced_ballistics,%1), _ammo]; if (isNil "_AmmoCacheEntry") then { @@ -81,6 +79,8 @@ private _trueZero = if (!_advancedBallistics) then { _atmosphereModel ]]) select 0 ) +} else { + parseNumber (("ace" callExtension ["ballistics:zero_vanilla", [_newZeroRange, _initSpeed, _airFriction, _boreHeight]]) select 0) }; private _zeroAngleCorrection = _trueZero - _vanillaZero; diff --git a/addons/scopes/initSettings.inc.sqf b/addons/scopes/initSettings.inc.sqf index 40ed62cbcc2..e74bcb4c073 100644 --- a/addons/scopes/initSettings.inc.sqf +++ b/addons/scopes/initSettings.inc.sqf @@ -76,18 +76,26 @@ private _category = format ["ACE %1", localize LSTRING(DisplayName)]; true // Needs mission restart ] call CBA_fnc_addSetting; +[ + QGVAR(simplifiedZeroing), "CHECKBOX", + [LSTRING(simplifiedZeroing_displayName), LSTRING(simplifiedZeroing_description)], + _category, + false, + 1 +] call CBA_fnc_addSetting; + [ QGVAR(useLegacyUI), "CHECKBOX", [LSTRING(useLegacyUI_displayName), LSTRING(useLegacyUI_description)], _category, false, - 0 + 2 ] call CBA_fnc_addSetting; [ - QGVAR(simplifiedZeroing), "CHECKBOX", - [LSTRING(simplifiedZeroing_displayName), LSTRING(simplifiedZeroing_description)], + QGVAR(inScopeAdjustment), "CHECKBOX", + LSTRING(inScopeAdjustment_displayName), _category, false, - 1 + 0 ] call CBA_fnc_addSetting; diff --git a/addons/scopes/stringtable.xml b/addons/scopes/stringtable.xml index 9a47f657cc0..4174a91d02e 100644 --- a/addons/scopes/stringtable.xml +++ b/addons/scopes/stringtable.xml @@ -347,6 +347,11 @@ Replikuje systém naměřování puškohledů ze základní hry. Replica en los visores el sistema de homogeneizado de vanilla + + Show adjustment UI in scope + Zeige Absehenverstellungs-UI im Zielfernrohr + Mostra UI delle manopole nel mirino + Minor adjustment up Kleine Korrektur hoch diff --git a/addons/sitting/functions/fnc_canSit.sqf b/addons/sitting/functions/fnc_canSit.sqf index 4328234bd90..609bcea6828 100644 --- a/addons/sitting/functions/fnc_canSit.sqf +++ b/addons/sitting/functions/fnc_canSit.sqf @@ -21,6 +21,7 @@ params ["_seat", "_player", ["_seatPos", 0]]; // Sitting enabled, not occupied and standing up (or not on a big slope) XGVAR(enable) && +{[_player, _seat] call EFUNC(common,canInteractWith)} && {isNil {_player getVariable QGVAR(sittingStatus)}} && { private _seatsClaimed = _seat getVariable [QGVAR(seatsClaimed), []]; diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index 033a1f4d2ca..d359083c44a 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -56,7 +56,7 @@ TRACE_2("Sit pos and dir",_sitPosition,_sitDirection); // Set direction and position _player setDir _sitDirection; //modelToWorld returns AGL -_player setPosASL (AGLtoASL (_seat modelToWorld _sitPosition)); +_player setPosASL (AGLToASL (_seat modelToWorld _sitPosition)); // Set variables, save seat object on player _player setVariable [QGVAR(sittingStatus), [_seat, _actionID, _seatPos]]; diff --git a/addons/spectator/functions/fnc_cam_setVisionMode.sqf b/addons/spectator/functions/fnc_cam_setVisionMode.sqf index 5bcf8710b6b..eaec12a86d3 100644 --- a/addons/spectator/functions/fnc_cam_setVisionMode.sqf +++ b/addons/spectator/functions/fnc_cam_setVisionMode.sqf @@ -29,10 +29,10 @@ if !(_newVision in _visions) then { if (GVAR(camMode) != MODE_FPS) then { // 0+ are all thermal vision types if (_newVision < 0) then { - false setCamUseTi 0; + false setCamUseTI 0; camUseNVG (_newVision >= VISION_NVG); } else { - true setCamUseTi _newVision; + true setCamUseTI _newVision; }; // Give user feedback that vision mode changed diff --git a/addons/spectator/functions/fnc_cam_tick.sqf b/addons/spectator/functions/fnc_cam_tick.sqf index 1e7e1b99137..11f257b7d5a 100644 --- a/addons/spectator/functions/fnc_cam_tick.sqf +++ b/addons/spectator/functions/fnc_cam_tick.sqf @@ -58,7 +58,9 @@ if (_cameraMode != MODE_FREE) then { _camTarget = GVAR(camFocus); // Focus get in / out of vehicle state -if !(isNull _camTarget) then { +if (isNull _camTarget) then { + GVAR(camTargetInVehicle) = false; +} else { private _targetInVeh = GVAR(camTargetInVehicle); if (GVAR(camHasTarget)) then { @@ -72,8 +74,6 @@ if !(isNull _camTarget) then { GVAR(camTargetInVehicle) = false; }; }; -} else { - GVAR(camTargetInVehicle) = false; }; // Camera lights diff --git a/addons/spectator/functions/fnc_setCameraAttributes.sqf b/addons/spectator/functions/fnc_setCameraAttributes.sqf index f33f23c09a4..48cc4fb0c58 100644 --- a/addons/spectator/functions/fnc_setCameraAttributes.sqf +++ b/addons/spectator/functions/fnc_setCameraAttributes.sqf @@ -88,7 +88,7 @@ if (!isNil QGVAR(camera)) then { // GVARs exits purely for pre-setting of these attributes if (!isNil "_position") then { - GVAR(camPos) = ATLtoASL _position; + GVAR(camPos) = ATLToASL _position; }; if (!isNil "_direction") then { diff --git a/addons/spectator/functions/fnc_ui_handleKeyDown.sqf b/addons/spectator/functions/fnc_ui_handleKeyDown.sqf index c26a06786d7..59dd418782a 100644 --- a/addons/spectator/functions/fnc_ui_handleKeyDown.sqf +++ b/addons/spectator/functions/fnc_ui_handleKeyDown.sqf @@ -108,13 +108,13 @@ if (_key == DIK_L) exitWith { { deleteVehicle _x; } forEach GVAR(camLights); GVAR(camLights) = []; } else { - private _cameraLight = "#lightpoint" createvehicleLocal getPosASL GVAR(camera); + private _cameraLight = "#lightpoint" createVehicleLocal getPosASL GVAR(camera); _cameraLight setLightBrightness 2; _cameraLight setLightAmbient [1,1,1]; _cameraLight setLightColor [0,0,0]; _cameraLight lightAttachObject [GVAR(camera), [0,0,0]]; - private _pointerLight = "#lightpoint" createvehicleLocal getPosASL GVAR(camera); + private _pointerLight = "#lightpoint" createVehicleLocal getPosASL GVAR(camera); _pointerLight setLightBrightness 1; _pointerLight setLightAmbient [1,1,1]; _pointerLight setLightColor [0,0,0]; diff --git a/addons/spectator/functions/fnc_ui_handleListClick.sqf b/addons/spectator/functions/fnc_ui_handleListClick.sqf index 600b7e711ce..f81a73f4fd1 100644 --- a/addons/spectator/functions/fnc_ui_handleListClick.sqf +++ b/addons/spectator/functions/fnc_ui_handleListClick.sqf @@ -33,7 +33,7 @@ if !(isNull _object) then { if (_dblClick) then { // Place camera within ~10m of the object and above ground level private _pos = getPosASLVisual _object; - GVAR(camera) setPosASL (AGLtoASL (_pos getPos [1 + random 10, random 360]) vectorAdd [0,0,2 + random 10]); + GVAR(camera) setPosASL (AGLToASL (_pos getPos [1 + random 10, random 360]) vectorAdd [0,0,2 + random 10]); // Reset the focus [objNull] call FUNC(setFocus); diff --git a/addons/spectator/functions/fnc_ui_updateHelp.sqf b/addons/spectator/functions/fnc_ui_updateHelp.sqf index 1ddbbacad91..4a226bf3613 100644 --- a/addons/spectator/functions/fnc_ui_updateHelp.sqf +++ b/addons/spectator/functions/fnc_ui_updateHelp.sqf @@ -31,7 +31,7 @@ private _controls = []; // When not in first person, camera rotation applies if (_cameraMode != MODE_FPS) then { - _controls pushback ["[RMB]", localize "STR_A3_Spectator_Helper_CameraRotation"]; + _controls pushBack ["[RMB]", localize "STR_A3_Spectator_Helper_CameraRotation"]; }; // When in free camera, focus/un-focus with LMB @@ -52,31 +52,31 @@ if (_hasTarget && {count _availableModes > 1}) then { }; if (_cameraMode == MODE_FREE) then { - _controls pushback [ + _controls pushBack [ format ["[%1/%2]", [DIK_W] call CBA_fnc_localizeKey, [DIK_S] call CBA_fnc_localizeKey], localize "STR_A3_Spectator_Helper_Movement" ]; - _controls pushback [ + _controls pushBack [ format ["[%1/%2]", [DIK_A] call CBA_fnc_localizeKey, [DIK_D] call CBA_fnc_localizeKey], localize "STR_A3_Spectator_Helper_Strafing" ]; - _controls pushback [ + _controls pushBack [ format ["[%1/%2]", [DIK_Q] call CBA_fnc_localizeKey, [DIK_Z] call CBA_fnc_localizeKey], localize "STR_A3_Spectator_Helper_Height" ]; } else { - _controls pushback [ + _controls pushBack [ format ["[%1]", toUpper ([DIK_RIGHT] call CBA_fnc_localizeKey)], localize LSTRING(nextUnit) ]; - _controls pushback [ + _controls pushBack [ format ["[%1]", toUpper ([DIK_LEFT] call CBA_fnc_localizeKey)], localize LSTRING(prevUnit) ]; }; if (_cameraMode != MODE_FPS) then { - _controls pushback [ + _controls pushBack [ format ["[%1]", ([DIK_N] call CBA_fnc_localizeKey)], localize LSTRING(nextVis) ]; @@ -128,7 +128,7 @@ lnbClear _help; // Set height based on number of rows private _newH = (GVAR(uiHelpH) / MAX_CONTROLS_HELP_ENTRIES) * count _controls; -private _newY = safezoneY + safezoneH - _newH; +private _newY = safeZoneY + safeZoneH - _newH; (ctrlPosition _help) params ["_newX","","_newW"]; diff --git a/addons/spectator/functions/fnc_ui_updateIconsToDraw.sqf b/addons/spectator/functions/fnc_ui_updateIconsToDraw.sqf index 6093467d639..e5a736a7754 100644 --- a/addons/spectator/functions/fnc_ui_updateIconsToDraw.sqf +++ b/addons/spectator/functions/fnc_ui_updateIconsToDraw.sqf @@ -89,7 +89,7 @@ private _camPos = AGLToASL positionCameraToWorld [0,0,0]; 0, _heightByDistance, 0, - groupID _group, + groupId _group, 2, _fontSizeByDistance, "PuristaMedium", diff --git a/addons/spectator/functions/fnc_ui_updateListEntities.sqf b/addons/spectator/functions/fnc_ui_updateListEntities.sqf index 000f9a4b226..969460329c9 100644 --- a/addons/spectator/functions/fnc_ui_updateListEntities.sqf +++ b/addons/spectator/functions/fnc_ui_updateListEntities.sqf @@ -54,7 +54,7 @@ private _entities = [true] call FUNC(getTargetEntities); // Cache the info of the group itself private _groupTexture = [_group] call FUNC(getGroupIcon); - private _groupInfo = [_group, str _group, _groupTexture, groupID _group]; + private _groupInfo = [_group, str _group, _groupTexture, groupId _group]; // Add the group to the correct side private _side = side _group; diff --git a/addons/spectator/script_component.hpp b/addons/spectator/script_component.hpp index b4e7c82ac88..c29c60bdefc 100644 --- a/addons/spectator/script_component.hpp +++ b/addons/spectator/script_component.hpp @@ -17,12 +17,12 @@ #include "\z\ace\addons\main\script_macros.hpp" // UI grid -#define SIZEX ((safezoneW / safezoneH) min 1.2) +#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)) +#define X_PART(num) (W_PART(num) + (safeZoneX + (safeZoneW - SIZEX)/2)) +#define Y_PART(num) (H_PART(num) + (safeZoneY + (safeZoneH - SIZEY)/2)) // UI/Camera related values #define SPEED_SLOW 0.1 diff --git a/addons/spectator/ui.hpp b/addons/spectator/ui.hpp index f61e7749eea..d81887db760 100644 --- a/addons/spectator/ui.hpp +++ b/addons/spectator/ui.hpp @@ -82,7 +82,7 @@ class GVAR(display) { onMouseExit = QUOTE([true] call FUNC(ui_fadeList)); x = "safeZoneX"; - y = "safezoneY"; + y = "safeZoneY"; w = QUOTE(W_PART(13.5)); h = QUOTE(H_PART(1.5)); @@ -98,7 +98,7 @@ class GVAR(display) { class CameraTypesGroup: RscControlsGroupNoScrollbars { idc = IDC_CAM_TYPES; x = QUOTE(X_PART(15.5)); - y = QUOTE(safezoneY + safezoneH - H_PART(2.38)); + y = QUOTE(safeZoneY + safeZoneH - H_PART(2.38)); w = QUOTE(W_PART(8.6)); h = 2.6; class controls { @@ -245,8 +245,8 @@ class GVAR(display) { }; class HelpBackground: RscText { idc = IDC_HELP_BACK; - x = QUOTE(safezoneX + safezoneW - W_PART(12)); - y = QUOTE(safezoneY + safezoneH - H_PART(8)); + x = QUOTE(safeZoneX + safeZoneW - W_PART(12)); + y = QUOTE(safeZoneY + safeZoneH - H_PART(8)); w = QUOTE(W_PART(12)); h = QUOTE(H_PART(8)); colorBackground[] = {0,0,0,0.75}; @@ -256,8 +256,8 @@ class GVAR(display) { disableOverflow = 0; rowHeight = QUOTE(H_PART(1)); idc = IDC_HELP; - x = QUOTE(safezoneX + safezoneW - W_PART(12)); - y = QUOTE(safezoneY + safezoneH - H_PART(12)); + x = QUOTE(safeZoneX + safeZoneW - W_PART(12)); + y = QUOTE(safeZoneY + safeZoneH - H_PART(12)); w = QUOTE(W_PART(12)); h = QUOTE(H_PART(12)); }; diff --git a/addons/spottingscope/script_component.hpp b/addons/spottingscope/script_component.hpp index 6b2d95abbd5..cf7b8a835f7 100644 --- a/addons/spottingscope/script_component.hpp +++ b/addons/spottingscope/script_component.hpp @@ -16,8 +16,8 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define POS_X_BASE(size) safezoneX + 0.5 * safezoneW - 0.5 * (size) / (getResolution select 5) -#define POS_Y_BASE(size) safezoneY + 0.5 * safezoneH - 0.5 * (size) / (getResolution select 5) * 4/3 +#define POS_X_BASE(size) safeZoneX + 0.5 * safeZoneW - 0.5 * (size) / (getResolution select 5) +#define POS_Y_BASE(size) safeZoneY + 0.5 * safeZoneH - 0.5 * (size) / (getResolution select 5) * 4/3 #define POS_W_BASE(size) (size) / (getResolution select 5) #define POS_H_BASE(size) (size) / (getResolution select 5) * 4/3 diff --git a/addons/tagging/functions/fnc_createTag.sqf b/addons/tagging/functions/fnc_createTag.sqf index 90923cc8034..134e37bcc0a 100644 --- a/addons/tagging/functions/fnc_createTag.sqf +++ b/addons/tagging/functions/fnc_createTag.sqf @@ -68,7 +68,7 @@ if (_object getVariable [QGVAR(testVar), false]) then { if (_selection == "" && _damage >= 1) then { { deleteVehicle _x; - } foreach (_object getVariable [QGVAR(attachedTags), []]); + } forEach (_object getVariable [QGVAR(attachedTags), []]); _object setVariable [QGVAR(attachedTags), []]; }; }]; diff --git a/addons/towing/config.cpp b/addons/towing/config.cpp index d4d1b5e8540..7c98be1756c 100644 --- a/addons/towing/config.cpp +++ b/addons/towing/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common", "ace_logistics_rope"}; + requiredAddons[] = {"ace_interaction", "ace_logistics_rope"}; author = ECSTRING(common,ACETeam); authors[] = {"tcvm"}; url = ECSTRING(main,URL); @@ -16,4 +16,3 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" - diff --git a/addons/towing/functions/fnc_attachRopePFH.sqf b/addons/towing/functions/fnc_attachRopePFH.sqf index 37f626e0a92..31def8dcb83 100644 --- a/addons/towing/functions/fnc_attachRopePFH.sqf +++ b/addons/towing/functions/fnc_attachRopePFH.sqf @@ -21,7 +21,7 @@ private _viewDirection = getCameraViewDirection _unit; GVAR(attachHelper) setPosASL (_unit modelToWorldVisualWorld [0, 1, 1.5]); private _hintLMB = ""; -private _hintRMB = localize ELSTRING(dragging,Drop); +private _hintRMB = LELSTRING(common,Drop); private _startPos = eyePos _unit; private _endPos = _startPos vectorAdd (_viewDirection vectorMultiply TOW_ACTION_DISTANCE); diff --git a/addons/towing/functions/fnc_towStateMachinePFH.sqf b/addons/towing/functions/fnc_towStateMachinePFH.sqf index 7b295754fad..ad516f211b6 100644 --- a/addons/towing/functions/fnc_towStateMachinePFH.sqf +++ b/addons/towing/functions/fnc_towStateMachinePFH.sqf @@ -70,7 +70,7 @@ switch (_state) do { // can't use createVehicleLocal because rope can be non-local (like parent) and it must be attached to global vehicle GVAR(helper) = createVehicle [QGVAR(helper), [0, 0, 0], [], 0, "CAN_COLLIDE"]; GVAR(helper) attachTo [_unit, [0, 0, 0], "LeftHand", true]; - _rope = ropeCreate [_parent, _parent worldToModelVisual ASLtoAGL getPosASLVisual GVAR(attachHelper), GVAR(helper), [0, 0, 0], _length]; + _rope = ropeCreate [_parent, _parent worldToModelVisual ASLToAGL getPosASLVisual GVAR(attachHelper), GVAR(helper), [0, 0, 0], _length]; _args set [3, _rope]; }; @@ -95,7 +95,7 @@ switch (_state) do { case TOW_STATE_ATTACH: { TRACE_3("state attach",GVAR(attachHelper),_parent,_rope); private _child = GVAR(attachHelper) getVariable [QGVAR(object), objNull]; - private _relativeAttachPos = _child worldToModelVisual ASLtoAGL getPosASLVisual GVAR(attachHelper); + private _relativeAttachPos = _child worldToModelVisual ASLToAGL getPosASLVisual GVAR(attachHelper); TRACE_3("child&pos",_parent,_child,_relativeAttachPos); @@ -118,7 +118,7 @@ switch (_state) do { }; private _hookParent = createVehicle [QGVAR(hook), [0, 0, 0], [], 0, "CAN_COLLIDE"]; - _hookParent attachTo [_parent, _parent worldToModelVisual ASLtoAGL getPosASLVisual _rope]; + _hookParent attachTo [_parent, _parent worldToModelVisual ASLToAGL getPosASLVisual _rope]; private _hook = createVehicle [QGVAR(hook), [0, 0, 0], [], 0, "CAN_COLLIDE"]; _hook attachTo [_child, _relativeAttachPos]; diff --git a/addons/trenches/XEH_preInit.sqf b/addons/trenches/XEH_preInit.sqf index 94decd550af..c8c9a3451f9 100644 --- a/addons/trenches/XEH_preInit.sqf +++ b/addons/trenches/XEH_preInit.sqf @@ -8,6 +8,6 @@ PREP_RECOMPILE_END; #include "initSettings.inc.sqf" -GVAR(entrenchingTools) = call (uiNamespace getVariable QGVAR(entrenchingTools)); +GVAR(entrenchingTools) = keys (uiNamespace getVariable QGVAR(entrenchingTools)); ADDON = true; diff --git a/addons/trenches/XEH_preStart.sqf b/addons/trenches/XEH_preStart.sqf index c966b2c9b6d..05065910397 100644 --- a/addons/trenches/XEH_preStart.sqf +++ b/addons/trenches/XEH_preStart.sqf @@ -6,4 +6,4 @@ private _entrenchingTools = (QUOTE(getNumber (_x >> QQGVAR(entrenchingTool)) > 0 _entrenchingTools append (QUOTE(getNumber (_x >> QQGVAR(entrenchingTool)) > 0) configClasses (configFile >> "CfgVehicles") apply {configName _x}); TRACE_1("",_entrenchingTools); -uiNamespace setVariable [QGVAR(entrenchingTools), compileFinal str _entrenchingTools]; +uiNamespace setVariable [QGVAR(entrenchingTools), compileFinal (_entrenchingTools createHashMapFromArray [])]; diff --git a/addons/trenches/functions/fnc_continueDiggingTrench.sqf b/addons/trenches/functions/fnc_continueDiggingTrench.sqf index 78047c189e4..e3aadcfd51c 100644 --- a/addons/trenches/functions/fnc_continueDiggingTrench.sqf +++ b/addons/trenches/functions/fnc_continueDiggingTrench.sqf @@ -81,7 +81,7 @@ if(_actualProgress == 0) then { _cutterPos set [2, getTerrainHeightASL _cutterPos]; _trenchGrassCutter setPosASL _cutterPos; deleteVehicle _trenchGrassCutter; - } foreach getArray (configOf _trench >> QGVAR(grassCuttingPoints)); + } forEach getArray (configOf _trench >> QGVAR(grassCuttingPoints)); }; private _progressLeft = (_actualProgress * 10) + 1; diff --git a/addons/trenches/functions/fnc_hasEntrenchingTool.sqf b/addons/trenches/functions/fnc_hasEntrenchingTool.sqf index 5a1127d0072..1568801fdb8 100644 --- a/addons/trenches/functions/fnc_hasEntrenchingTool.sqf +++ b/addons/trenches/functions/fnc_hasEntrenchingTool.sqf @@ -23,4 +23,4 @@ private _uniqueItems = _unit call EFUNC(common,uniqueItems); _uniqueItems append weapons _unit; _uniqueItems pushBack backpack _unit; -GVAR(entrenchingTools) findIf {_x in _uniqueItems} != -1 // return +GVAR(entrenchingTools) findAny _uniqueItems != -1 // return diff --git a/addons/trenches/functions/fnc_placeConfirm.sqf b/addons/trenches/functions/fnc_placeConfirm.sqf index 9a49df86e79..2cfdaf8891e 100644 --- a/addons/trenches/functions/fnc_placeConfirm.sqf +++ b/addons/trenches/functions/fnc_placeConfirm.sqf @@ -64,7 +64,7 @@ for [{private _ix = -_dx/2},{_ix <= _dx/2},{_ix = _ix + _dx/3}] do { _pos set [2, getTerrainHeightASL _pos]; _pos2 = +_pos; _pos2 set [2, getTerrainHeightASL _pos + 1]; - drawLine3D [ASLtoAGL _pos, ASLtoAGL _pos2, [1,1,0,1]]; + drawLine3D [ASLToAGL _pos, ASLToAGL _pos2, [1,1,0,1]]; #endif }; }; diff --git a/addons/trenches/functions/fnc_placeTrench.sqf b/addons/trenches/functions/fnc_placeTrench.sqf index e6e03e0b579..285fe278e94 100644 --- a/addons/trenches/functions/fnc_placeTrench.sqf +++ b/addons/trenches/functions/fnc_placeTrench.sqf @@ -77,7 +77,7 @@ GVAR(digPFH) = [{ _pos set [2, getTerrainHeightASL _pos]; _pos2 = +_pos; _pos2 set [2, getTerrainHeightASL _pos + 1]; - drawLine3D [ASLtoAGL _pos, ASLtoAGL _pos2, [1,1,0,1]]; + drawLine3D [ASLToAGL _pos, ASLToAGL _pos2, [1,1,0,1]]; #endif }; }; diff --git a/addons/ui/CfgInGameUI.hpp b/addons/ui/CfgInGameUI.hpp index 8f39984b03c..3e1f28ba204 100644 --- a/addons/ui/CfgInGameUI.hpp +++ b/addons/ui/CfgInGameUI.hpp @@ -1,5 +1,5 @@ class CfgInGameUI { class DefaultAction { - size = QUOTE(profileNamespace getVariable [ARR_2('GVAR(hideDefaultActionIcon)',(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8))]); + size = QUOTE(profileNamespace getVariable [ARR_2('GVAR(hideDefaultActionIcon)',(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.8))]); }; }; diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index b50bdd5340d..f0a0768b367 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -725,6 +725,8 @@ Hide all UI 全てのUIを隠す + Cacher toute l'interface utilisateur. + Скрыть весь интерфейс diff --git a/addons/vector/RscInGameUI.hpp b/addons/vector/RscInGameUI.hpp index 7e2f7057650..b7a6f25022b 100644 --- a/addons/vector/RscInGameUI.hpp +++ b/addons/vector/RscInGameUI.hpp @@ -51,88 +51,88 @@ class RscInGameUI { class ACE_ScriptedDisplayControlsGroup: RscControlsGroupNoScrollbars { onLoad = "uiNamespace setVariable ['ACE_dlgVector', ctrlParent (_this select 0)];"; idc = 170; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; + x = "safeZoneX"; + y = "safeZoneY"; + w = "safeZoneW"; + h = "safeZoneH"; class controls { class Center: RscPicture { idc = IDC_CENTER; colorText[] = {1,0,0,0.5}; - x = "0.5 - (0.8 / 16 * safezoneW)/2 - safezoneX"; - y = "0.5 - (0.8 / 9 * safezoneH)/2 - safezoneY"; - w = "0.8 / 16 * safezoneW"; - h = "0.8 / 9 * safezoneH"; + x = "0.5 - (0.8 / 16 * safeZoneW)/2 - safeZoneX"; + y = "0.5 - (0.8 / 9 * safeZoneH)/2 - safeZoneY"; + w = "0.8 / 16 * safeZoneW"; + h = "0.8 / 9 * safeZoneH"; }; class Crosshair: Center { idc = IDC_CROSSHAIR; - x = "0.5 - (0.7 / 16 * safezoneW)/2 - safezoneX"; - y = "0.5 - (0.7 / 9 * safezoneH)/2 - safezoneY"; - w = "0.7 / 16 * safezoneW"; - h = "0.7 / 9 * safezoneH"; + x = "0.5 - (0.7 / 16 * safeZoneW)/2 - safeZoneX"; + y = "0.5 - (0.7 / 9 * safeZoneH)/2 - safeZoneY"; + w = "0.7 / 16 * safeZoneW"; + h = "0.7 / 9 * safeZoneH"; }; class Digit0: Center { idc = IDC_DIGIT_0; - x = "(0.54 + 0 * 0.02) * safezoneW"; - y = "0.54 * safezoneH"; - w = "0.5 / 16 * safezoneW"; - h = "0.5 / 9 * safezoneH"; + x = "(0.54 + 0 * 0.02) * safeZoneW"; + y = "0.54 * safeZoneH"; + w = "0.5 / 16 * safeZoneW"; + h = "0.5 / 9 * safeZoneH"; }; class Digit1: Digit0 { idc = IDC_DIGIT_1; - x = "(0.54 + 1 * 0.02) * safezoneW"; + x = "(0.54 + 1 * 0.02) * safeZoneW"; }; class Digit2: Digit0 { idc = IDC_DIGIT_2; - x = "(0.54 + 2 * 0.02) * safezoneW"; + x = "(0.54 + 2 * 0.02) * safeZoneW"; }; class Digit3: Digit0 { idc = IDC_DIGIT_3; - x = "(0.54 + 3 * 0.02) * safezoneW"; + x = "(0.54 + 3 * 0.02) * safeZoneW"; }; class Digit4: Digit0 { idc = IDC_DIGIT_4; - x = "(0.54 + 4 * 0.02) * safezoneW"; + x = "(0.54 + 4 * 0.02) * safeZoneW"; }; class Digit5: Digit0 { idc = IDC_DIGIT_5; - x = "(0.35 + 0 * 0.02) * safezoneW"; + x = "(0.35 + 0 * 0.02) * safeZoneW"; }; class Digit6: Digit0 { idc = IDC_DIGIT_6; - x = "(0.35 + 1 * 0.02) * safezoneW"; + x = "(0.35 + 1 * 0.02) * safeZoneW"; }; class Digit7: Digit0 { idc = IDC_DIGIT_7; - x = "(0.35 + 2 * 0.02) * safezoneW"; + x = "(0.35 + 2 * 0.02) * safeZoneW"; }; class Digit8: Digit0 { idc = IDC_DIGIT_8; - x = "(0.35 + 3 * 0.02) * safezoneW"; + x = "(0.35 + 3 * 0.02) * safeZoneW"; }; class Digit9: Digit0 { idc = IDC_DIGIT_9; - x = "(0.35 + 4 * 0.02) * safezoneW"; + x = "(0.35 + 4 * 0.02) * safeZoneW"; }; class DigitE1: Digit0 { idc = IDC_DIGIT_E1; - x = "(0.39 + 0 * 0.02) * safezoneW"; - y = "0.42 * safezoneH"; + x = "(0.39 + 0 * 0.02) * safeZoneW"; + y = "0.42 * safeZoneH"; }; class DigitE2: DigitE1 { idc = IDC_DIGIT_E2; - x = "(0.39 + 1 * 0.02) * safezoneW"; + x = "(0.39 + 1 * 0.02) * safeZoneW"; }; class DigitE3: DigitE1 { idc = IDC_DIGIT_E3; - x = "(0.39 + 2 * 0.02) * safezoneW"; + x = "(0.39 + 2 * 0.02) * safeZoneW"; }; class DigitE4: DigitE1 { idc = IDC_DIGIT_E4; - x = "(0.39 + 3 * 0.02) * safezoneW"; + x = "(0.39 + 3 * 0.02) * safeZoneW"; }; }; }; diff --git a/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf b/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf index 4654b616d06..b0540de484f 100644 --- a/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf +++ b/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf @@ -75,14 +75,14 @@ if (isNil "_multHit") then { _ignoreHit = true; } else { // If the hitpoint isnt in the old array then that means that the time expired and a new array should be generated - if (!_hitPointInOldArray) then { + if (_hitPointInOldArray) then { + _vehicle setVariable [QGVAR(hitTime), [CBA_missionTime, _source, [_hitPoint]]]; + } else { private _oldHitPoints = _multHit select 2; _oldHitPoints pushBack _hitPoint; _vehicle setVariable [QGVAR(hitTime), [CBA_missionTime, _source, _oldHitPoints]]; _ignoreBailCheck = true; - } else { - _vehicle setVariable [QGVAR(hitTime), [CBA_missionTime, _source, [_hitPoint]]]; }; }; }; diff --git a/addons/vehicle_damage/stringtable.xml b/addons/vehicle_damage/stringtable.xml index 7053cc6d3c2..3bb2872e0e7 100644 --- a/addons/vehicle_damage/stringtable.xml +++ b/addons/vehicle_damage/stringtable.xml @@ -34,6 +34,7 @@ Habilitar daño avanzado de coche Habilitar dano avançado para carros 高度な車ダメージを有効化 + Включить продвинутое повреждение автомобиля Enable advanced car damage (Experimental) diff --git a/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf b/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf index c5f7e0e35a0..ec58a6fa2c5 100644 --- a/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf +++ b/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf @@ -34,4 +34,4 @@ if (_sideKeyName in _items) exitWith {true}; private _customKeys = _veh getVariable [QGVAR(customKeys), []]; private _magazines = magazinesDetail _unit; -(_customKeys findIf {_x in _magazines}) != -1 +_customKeys findAny _magazines != -1 diff --git a/addons/viewports/dev/debugPoints.sqf b/addons/viewports/dev/debugPoints.sqf index 53fe016b628..2ffc81f512a 100644 --- a/addons/viewports/dev/debugPoints.sqf +++ b/addons/viewports/dev/debugPoints.sqf @@ -22,8 +22,8 @@ #define IDD_3DEN 313 [] spawn { - INFO_2("Pre-Init [is3den %1][3den display: %2]",is3den,!isNull findDisplay IDD_3DEN); - if (!is3den) exitWith {}; + INFO_2("Pre-Init [is3den %1][3den display: %2]",is3DEN,!isNull findDisplay IDD_3DEN); + if (!is3DEN) exitWith {}; GVAR(3denIndex) = 0; GVAR(3denViewports) = []; @@ -99,7 +99,7 @@ private _pointASL = _intersections # 0 # 0; if (isNil "_pointASL") exitWith {}; _pointASL = _pointASL vectorAdd [0,0,0.09]; // Add a little bit up because it always sinks into the model - private _pointMS = _vehicle worldToModel ASLtoAGL _pointASL; + private _pointMS = _vehicle worldToModel ASLToAGL _pointASL; private _name = format ["view_%1",GVAR(3denIndex)]; // [_name, _type, _camLocation, _camAttach, _screenLocation, _maxDistance, _compartments, _roles] @@ -114,7 +114,7 @@ addMissionEventHandler ["Draw3D", { private _vehicle = vehicle player; private _viewports = _vehicle getVariable [QGVAR(viewports), []]; - if (is3den) then { + if (is3DEN) then { _vehicle = (get3DENSelected "object") param [0, objNull]; if (isNull _vehicle) exitWith {}; _viewports = [_vehicle] call FUNC(getViewports); @@ -127,7 +127,7 @@ addMissionEventHandler ["Draw3D", { drawIcon3D ["#(argb,8,8,3)color(1,1,1,1)", [1,1,0,1], _vehicle modelToWorldVisual [0,0,0], 0.1, 0.1, 0, "", 1, 0.02, "TahomaB"]; if (alive player) then { // not using ace_player so this works in 3den - drawIcon3D ["#(argb,8,8,3)color(1,1,1,1)", [0,1,0,1], aslToAGL eyepos player, 0.1, 0.1, 0, "eye", 1, 0.02, "TahomaB"]; + drawIcon3D ["#(argb,8,8,3)color(1,1,1,1)", [0,1,0,1], ASLToAGL eyePos player, 0.1, 0.1, 0, "eye", 1, 0.02, "TahomaB"]; drawIcon3D ["#(argb,8,8,3)color(1,1,1,1)", [0,1,0,1], player modelToWorldVisual (player selectionPosition "pilot"), 0.1, 0.1, 0, "pilot", 1, 0.02, "TahomaB"]; }; // { diff --git a/addons/viewports/functions/fnc_eachFrame.sqf b/addons/viewports/functions/fnc_eachFrame.sqf index 21f2f09dc8d..55971172945 100644 --- a/addons/viewports/functions/fnc_eachFrame.sqf +++ b/addons/viewports/functions/fnc_eachFrame.sqf @@ -39,12 +39,12 @@ if (cba_events_control) then { ([_player] call FUNC(getSeatInfo)) params ["_role", "", "", "_compartment"]; private _newIndexAngle = 45; // Controls the max angle - private _eyesPosASL = AGLtoASL (positionCameraToWorld [0, 0, 0]); - private _eyesDir = (AGLtoASL (positionCameraToWorld [0, 0, 1])) vectorDiff _eyesPosASL; + private _eyesPosASL = AGLToASL (positionCameraToWorld [0, 0, 0]); + private _eyesDir = (AGLToASL (positionCameraToWorld [0, 0, 1])) vectorDiff _eyesPosASL; { _x params ["", "", "_camLocation", "", "_screenLocation", "_maxDistance", "_compartments", "_roles"]; - private _viewASL = AGLtoASL (_vehicle modelToWorldVisual _screenLocation); + private _viewASL = AGLToASL (_vehicle modelToWorldVisual _screenLocation); private _viewDiff = _viewASL vectorDiff _eyesPosASL; private _viewAngle = acos (_viewDiff vectorCos _eyesDir); #ifdef DEBUG_MODE_FULL diff --git a/addons/viewports/functions/fnc_viewCreate.sqf b/addons/viewports/functions/fnc_viewCreate.sqf index 8b08da95756..7d9e45864b0 100644 --- a/addons/viewports/functions/fnc_viewCreate.sqf +++ b/addons/viewports/functions/fnc_viewCreate.sqf @@ -68,12 +68,12 @@ switch (true) do { private _ctrlRender = _display ctrlCreate ["RscPicture", -1]; _ctrlRender ctrlSetText _renderTexture; - _ctrlRender ctrlSetPosition [safezoneX + 0.5 * safezoneW - 0.5 * _viewWidth, safezoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; + _ctrlRender ctrlSetPosition [safeZoneX + 0.5 * safeZoneW - 0.5 * _viewWidth, safeZoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; _ctrlRender ctrlCommit 0; private _ctrlOverlay = _display ctrlCreate ["RscPicture", -1]; _ctrlOverlay ctrlSetText "\a3\weapons_f\reticle\data\optika_tv_ca.paa"; - _ctrlOverlay ctrlSetPosition [safezoneX + 0.5 * safezoneW - 0.5 * _viewWidth, safezoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; + _ctrlOverlay ctrlSetPosition [safeZoneX + 0.5 * safeZoneW - 0.5 * _viewWidth, safeZoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; _ctrlOverlay ctrlCommit 0; if (_usingGoggles) then { @@ -82,7 +82,7 @@ switch (true) do { private _ctrlNVG = _display ctrlCreate ["RscPicture", -1]; _ctrlNVG ctrlSetText "#(argb,8,8,3)color(1,1,0.6,0.9)"; - _ctrlNVG ctrlSetPosition [safezoneX + 0.5 * safezoneW - 0.5 * _viewWidth, safezoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; + _ctrlNVG ctrlSetPosition [safeZoneX + 0.5 * safeZoneW - 0.5 * _viewWidth, safeZoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; _ctrlNVG ctrlCommit 0; } else { _camEffect = [0]; // 2.08's currentVisionMode change could allow matching real turret's vision mode @@ -106,20 +106,20 @@ switch (true) do { private _ctrlRender = _display ctrlCreate ["RscPicture", -1]; _ctrlRender ctrlSetText _renderTexture; - _ctrlRender ctrlSetPosition [safezoneX + 0.5 * safezoneW - 0.5 * _viewWidth, safezoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; + _ctrlRender ctrlSetPosition [safeZoneX + 0.5 * safeZoneW - 0.5 * _viewWidth, safeZoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; _ctrlRender ctrlCommit 0; if (_usingGoggles) then { // Roughly try to color match ace_nvg, and make it semi-opaque private _ctrlNVG = _display ctrlCreate ["RscPicture", -1]; _ctrlNVG ctrlSetText "#(argb,8,8,3)color(0.25,0.2,0.05,0.75)"; - _ctrlNVG ctrlSetPosition [safezoneX + 0.5 * safezoneW - 0.5 * _viewWidth, safezoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; + _ctrlNVG ctrlSetPosition [safeZoneX + 0.5 * safeZoneW - 0.5 * _viewWidth, safeZoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; _ctrlNVG ctrlCommit 0; }; private _ctrlOverlay = _display ctrlCreate ["RscPicture", -1]; _ctrlOverlay ctrlSetText QPATHTOF(data\optic_window_ca.paa); - _ctrlOverlay ctrlSetPosition [safezoneX + 0.5 * safezoneW - 0.5 * _viewWidth, safezoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; + _ctrlOverlay ctrlSetPosition [safeZoneX + 0.5 * safeZoneW - 0.5 * _viewWidth, safeZoneY + 0.5 * safeZoneH - 0.5 * _viewHeight, _viewWidth, _viewHeight]; _ctrlOverlay ctrlCommit 0; }; }; diff --git a/addons/volume/XEH_postInitClient.sqf b/addons/volume/XEH_postInitClient.sqf index 896bb718f8d..ae774f2f51d 100644 --- a/addons/volume/XEH_postInitClient.sqf +++ b/addons/volume/XEH_postInitClient.sqf @@ -23,10 +23,10 @@ if (!hasInterface) exitWith {}; if (!XGVAR(lowerInVehicles)) exitWith {}; - if (!isNull objectParent _unit) then { - call FUNC(lowerVolume); - } else { + if (isNull objectParent _unit) then { call FUNC(restoreVolume); + } else { + call FUNC(lowerVolume); }; }] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/weather/functions/fnc_updateTemperature.sqf b/addons/weather/functions/fnc_updateTemperature.sqf index 3036171145d..34338f9d79e 100644 --- a/addons/weather/functions/fnc_updateTemperature.sqf +++ b/addons/weather/functions/fnc_updateTemperature.sqf @@ -16,7 +16,7 @@ */ private _month = date select 1; -private _timeRatio = abs(daytime - 12) / 12; +private _timeRatio = abs(dayTime - 12) / 12; GVAR(currentTemperature) = (GVAR(TempDay) select (_month - 1)) * (1 - _timeRatio) + (GVAR(TempNight) select (_month - 1)) * _timeRatio; GVAR(currentTemperature) = GVAR(currentTemperature) + GVAR(temperatureShift) - GVAR(badWeatherShift) * GVAR(currentOvercast); diff --git a/addons/xm157/functions/fnc_ballistics_calculator.sqf b/addons/xm157/functions/fnc_ballistics_calculator.sqf index 1bf6fb86ad7..46b09170e3b 100644 --- a/addons/xm157/functions/fnc_ballistics_calculator.sqf +++ b/addons/xm157/functions/fnc_ballistics_calculator.sqf @@ -41,7 +41,7 @@ private _barometricPressure = _altitude call EFUNC(weather,calculateBarometricPr private _bulletPos = [0,0,-(_boreHeight / 100)]; private _lastBulletPos = +_bulletPos; -private _bulletVelocity = [0,Cos(_scopeBaseAngle) * _muzzleVelocity,Sin(_scopeBaseAngle) * _muzzleVelocity]; +private _bulletVelocity = [0,cos(_scopeBaseAngle) * _muzzleVelocity,sin(_scopeBaseAngle) * _muzzleVelocity]; private _gravity = [-sin (_bank) * cos(_scopeBaseAngle + _inclinationAngle) * -GRAVITY, sin(_scopeBaseAngle + _inclinationAngle) * -GRAVITY, cos (_bank) * cos(_scopeBaseAngle + _inclinationAngle) * -GRAVITY]; diff --git a/addons/xm157/functions/fnc_keyPress.sqf b/addons/xm157/functions/fnc_keyPress.sqf index 3a9dd53a269..684fdedefd2 100644 --- a/addons/xm157/functions/fnc_keyPress.sqf +++ b/addons/xm157/functions/fnc_keyPress.sqf @@ -23,7 +23,7 @@ if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) if !(ACE_player call CBA_fnc_canUseWeapon) exitWith { false }; if (currentMuzzle ACE_player != currentWeapon ACE_player) exitWith { false }; -private _display = uinamespace getVariable [QGVAR(display), displayNull]; +private _display = uiNamespace getVariable [QGVAR(display), displayNull]; if (isNull _display) exitWith { ERROR("keyPress-no display"); false }; if (_keyDown) then { playSound QGVAR(click); }; diff --git a/addons/xm157/functions/fnc_weaponInfo_onLoad.sqf b/addons/xm157/functions/fnc_weaponInfo_onLoad.sqf index dfefca30d43..e490c6e14d0 100644 --- a/addons/xm157/functions/fnc_weaponInfo_onLoad.sqf +++ b/addons/xm157/functions/fnc_weaponInfo_onLoad.sqf @@ -18,7 +18,7 @@ params ["_display"]; TRACE_1("weaponInfo_onLoad",_display); -uinamespace setVariable [QGVAR(display), _display]; +uiNamespace setVariable [QGVAR(display), _display]; [_display, true] call cba_optics_fnc_loadScriptedOptic; // pass thru to cba diff --git a/addons/yardage450/functions/fnc_acquireTarget.sqf b/addons/yardage450/functions/fnc_acquireTarget.sqf index d5aea3a800f..88f85f29cc3 100644 --- a/addons/yardage450/functions/fnc_acquireTarget.sqf +++ b/addons/yardage450/functions/fnc_acquireTarget.sqf @@ -45,7 +45,7 @@ GVAR(distanceIndex) = -1; private _range = (_min + _max) / 2; if (_range >= MIN_DISTANCE && _range <= MAX_DISTANCE) then { GVAR(targetAcquired) = true; - GVAR(targetRangeText) = Str(round(_range)); + GVAR(targetRangeText) = str(round(_range)); }; }; }; diff --git a/addons/zeus/functions/fnc_bi_moduleArsenal.sqf b/addons/zeus/functions/fnc_bi_moduleArsenal.sqf index 8dd5f269296..76f723b2dd3 100644 --- a/addons/zeus/functions/fnc_bi_moduleArsenal.sqf +++ b/addons/zeus/functions/fnc_bi_moduleArsenal.sqf @@ -21,15 +21,15 @@ params ["_logic", "", "_activated"]; if (_activated && local _logic) then { - _unit = _logic getvariable ["bis_fnc_curatorAttachObject_object",objnull]; + _unit = _logic getVariable ["bis_fnc_curatorAttachObject_object",objNull]; //--- Check if the unit is suitable _error = ""; switch true do { - case (isnull _unit): {_error = localize "str_a3_BIS_fnc_showCuratorFeedbackMessage_506";}; + case (isNull _unit): {_error = localize "str_a3_BIS_fnc_showCuratorFeedbackMessage_506";}; case !(alive _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorDead";}; - case (isnull group _unit || !(side group _unit in [east,west,resistance,civilian])): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorBrain";}; - case (!isNull objectParent _unit || effectivecommander _unit != _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorVehicle";}; + case (isNull group _unit || !(side group _unit in [east,west,resistance,civilian])): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorBrain";}; + case (!isNull objectParent _unit || effectiveCommander _unit != _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorVehicle";}; }; if (_error == "") then { @@ -51,10 +51,10 @@ if (_activated && local _logic) then { } else { if !(isPlayer _unit) then { - ([] call bis_fnc_rscLayer) cuttext ["","black out",0.5]; + ([] call bis_fnc_rscLayer) cutText ["","black out",0.5]; ["#(argb,8,8,3)color(0,0,0,1)",false,nil,0,[0.5,0]] call bis_fnc_textTiles; ["Open",[true,nil,_unit]] call bis_fnc_arsenal; - ([] call bis_fnc_rscLayer) cuttext ["","plain"]; + ([] call bis_fnc_rscLayer) cutText ["","plain"]; } else { [objNull, localize "str_a3_BIS_fnc_moduleArsenal_errorDead"] call bis_fnc_showCuratorFeedbackMessage; diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index cdc4d35b648..a10807dbe70 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -24,33 +24,33 @@ params ["_logic", "_units", "_activated"]; if (_activated) then { // Terminate when not created on the server - if (!isServer && local _logic && isnull (getassignedcuratorunit _logic)) exitwith { - [format ["%1 is trying to create curator logic ModuleCurator_F",profilename],"bis_fnc_error",false] call bis_fnc_mp; - deletevehicle _logic; + if (!isServer && local _logic && isNull (getAssignedCuratorUnit _logic)) exitWith { + [format ["%1 is trying to create curator logic ModuleCurator_F",profileName],"bis_fnc_error",false] call bis_fnc_mp; + deleteVehicle _logic; }; // Get curator owner - _ownerVar = _logic getvariable ["owner",""]; - _ownerUID = parsenumber _ownerVar; - if (cheatsenabled) then { - _ownerVarArray = toarray _ownerVar; + _ownerVar = _logic getVariable ["owner",""]; + _ownerUID = parseNumber _ownerVar; + if (cheatsEnabled) then { + _ownerVarArray = toArray _ownerVar; _ownerVarArray resize 3; - if (tostring _ownerVarArray == "DEV") then {_ownerUID = 1;}; + if (toString _ownerVarArray == "DEV") then {_ownerUID = 1;}; }; - if (_ownerVar == "" && !ismultiplayer) then { + if (_ownerVar == "" && !isMultiplayer) then { ["Curator owner not defined, player used instead in singleplayer."] call bis_fnc_error; _ownerVar = player call bis_fnc_objectvar; }; - if (_ownerUID > 0 && !ismultiplayer) then { + if (_ownerUID > 0 && !isMultiplayer) then { _ownerVar = player call bis_fnc_objectvar; }; _isAdmin = _ownerVar == "#adminLogged" || _ownerVar == "#adminVoted"; // Wipe out the variable so clients can't access it - _logic setvariable ["owner",nil]; + _logic setVariable ["owner",nil]; // Server - if (isserver) then { + if (isServer) then { // Prepare admin variable _adminVar = ""; @@ -58,25 +58,25 @@ if (_activated) then { _letters = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]; _adminVar = "admin_"; for "_i" from 0 to 9 do {_adminVar = _adminVar + selectRandom _letters}; - _logic setvariable ["adminVar",_adminVar,true]; + _logic setVariable ["adminVar",_adminVar,true]; }; // Get allowed addons - _addonsType = _logic getvariable ["Addons",2]; + _addonsType = _logic getVariable ["Addons",2]; _addons = []; switch _addonsType do { // All (including unofficial ones) case 3: { - _cfgPatches = configfile >> "cfgpatches"; + _cfgPatches = configFile >> "cfgpatches"; for "_i" from 0 to (count _cfgPatches - 1) do { _class = _cfgPatches select _i; - if (isclass _class) then {_addons set [count _addons,configname _class];}; + if (isClass _class) then {_addons set [count _addons,configName _class];}; }; // Modified by ace_zeus - bis_fnc_activateaddons will error if time > 0 so only call if at start if (time <= 0) then { _addons call bis_fnc_activateaddons; }; - removeallcuratoraddons _logic; - _logic addcuratoraddons _addons; + removeAllCuratorAddons _logic; + _logic addCuratorAddons _addons; }; // All active @@ -86,74 +86,74 @@ if (_activated) then { case 1: { _addonsList = []; { - _addonsList = _addonsList + (unitaddons typeof _x); - } foreach (entities "all"); - removeallcuratoraddons _logic; - _logic addcuratoraddons _addonsList; + _addonsList = _addonsList + (unitAddons typeOf _x); + } forEach (entities "all"); + removeAllCuratorAddons _logic; + _logic addCuratorAddons _addonsList; }; // None case 0: { - removeallcuratoraddons _logic; + removeAllCuratorAddons _logic; }; }; // Handle ownership [_logic,_ownerVar,_ownerUID,_adminVar] spawn { - scriptname "BIS_fnc_moduleCurator: Owner"; + scriptName "BIS_fnc_moduleCurator: Owner"; params ["_logic", "_ownerVar", "_ownerUID", "_adminVar"]; if (_adminVar != "") then {_ownerVar = _adminVar;}; - _forced = _logic getvariable ["forced",0] > 0; - _name = _logic getvariable ["name",""]; + _forced = _logic getVariable ["forced",0] > 0; + _name = _logic getVariable ["name",""]; if (_name == "") then {_name = localize "STR_A3_curator";}; // Wait until mission starts waitUntil {time > 0}; // NOTE: DO NOT CHANGE TO CBA_missionTime, IT BREAKS THE MODULE // Refresh addon list, so it's broadcasted to clients - _addons = curatoraddons _logic; + _addons = curatorAddons _logic; removeAllCuratorAddons _logic; - _logic addcuratoraddons _addons; + _logic addCuratorAddons _addons; while {true} do { // Wait for player to become Zeus switch true do { case (_ownerUID > 0): { - waituntil { + waitUntil { sleep 0.01; - {getplayeruid _x == _ownerVar} count playableunits > 0 || isnull _logic + {getPlayerUID _x == _ownerVar} count playableUnits > 0 || isNull _logic }; }; default { - waituntil {isplayer (missionnamespace getvariable [_ownerVar,objnull]) || isnull _logic}; + waitUntil {isPlayer (missionNamespace getVariable [_ownerVar,objNull]) || isNull _logic}; }; }; - if (isnull _logic) exitwith {}; + if (isNull _logic) exitWith {}; // Assign - _player = objnull; + _player = objNull; switch true do { case (_ownerUID > 0): { { - if (getplayeruid _x == _ownerVar) exitwith {_player = _x;}; - } foreach playableunits; + if (getPlayerUID _x == _ownerVar) exitWith {_player = _x;}; + } forEach playableUnits; }; default { - _player = missionnamespace getvariable [_ownerVar,objnull]; + _player = missionNamespace getVariable [_ownerVar,objNull]; }; }; - waituntil {unassigncurator _logic; isnull (getassignedcuratorunit _logic) || isnull _logic}; - waituntil {_player assignCurator _logic; getassignedcuratorunit _logic == _player || isnull _logic}; - if (isnull _logic) exitwith {}; + waitUntil {unassignCurator _logic; isNull (getAssignedCuratorUnit _logic) || isNull _logic}; + waitUntil {_player assignCurator _logic; getAssignedCuratorUnit _logic == _player || isNull _logic}; + if (isNull _logic) exitWith {}; // Add radio channels { - _x radiochanneladd [_player]; - } foreach (_logic getvariable ["channels",[]]); + _x radioChannelAdd [_player]; + } forEach (_logic getVariable ["channels",[]]); // Added by ace_zeus to delay ascension message code private _msgCode = { @@ -162,10 +162,10 @@ if (_activated) then { // Sent notification to all assigned players if ((_logic getVariable ["showNotification",true]) && GVAR(zeusAscension)) then { { - if (isplayer _x) then { + if (isPlayer _x) then { [["CuratorAssign",[_name,name _player]],"bis_fnc_showNotification",_x] call bis_fnc_mp; }; - } forEach (curatoreditableobjects _logic); + } forEach (curatorEditableObjects _logic); }; }; @@ -184,25 +184,25 @@ if (_activated) then { // Wait for player to stop being Zeus switch true do { case (_ownerUID > 0): { - waituntil { + waitUntil { sleep 0.01; - {getplayeruid _x == _ownerVar} count playableunits == 0 || isnull _logic + {getPlayerUID _x == _ownerVar} count playableUnits == 0 || isNull _logic }; }; default { - waituntil {_player != missionnamespace getvariable [_ownerVar,objnull] || isnull _logic}; + waitUntil {_player != missionNamespace getVariable [_ownerVar,objNull] || isNull _logic}; }; }; - if (isnull _logic) exitwith {}; + if (isNull _logic) exitWith {}; // Add radio channels { - _x radiochannelremove [_player]; - } foreach (_logic getvariable ["channels",[]]); + _x radioChannelRemove [_player]; + } forEach (_logic getVariable ["channels",[]]); // Unassign - waituntil {unassigncurator _logic; isnull (getassignedcuratorunit _logic) || isnull _logic}; - if (isnull _logic) exitwith {}; + waitUntil {unassignCurator _logic; isNull (getAssignedCuratorUnit _logic) || isNull _logic}; + if (isNull _logic) exitWith {}; }; }; @@ -214,17 +214,17 @@ if (_activated) then { // Create bird _birdType = _logic getVariable ["birdType","eagle_f"]; if (_birdType != "") then { - _bird = createvehicle [_birdType,[100,100,100],[],0,"none"]; + _bird = createVehicle [_birdType,[100,100,100],[],0,"none"]; _logic setVariable ["bird",_bird,true]; }; // Locality changed - _logic addeventhandler [ - "local", + _logic addEventHandler [ + "Local", { _logic = _this select 0; - _bird = _logic getVariable ["bird",objnull]; - _bird setowner owner _logic; + _bird = _logic getVariable ["bird",objNull]; + _bird setOwner owner _logic; } ]; }; @@ -240,70 +240,70 @@ if (_activated) then { // Activated all future addons _addons = []; { - if (typeof _x == "ModuleCuratorAddAddons_F") then { - _paramAddons = call compile ("[" + (_x getvariable ["addons",""]) + "]"); + if (typeOf _x == "ModuleCuratorAddAddons_F") then { + _paramAddons = call compile ("[" + (_x getVariable ["addons",""]) + "]"); { if !(_x in _addons) then {_addons set [count _addons,_x];}; { if !(_x in _addons) then {_addons set [count _addons,_x];}; - } foreach (unitaddons _x); - } foreach _paramAddons; + } forEach (unitAddons _x); + } forEach _paramAddons; }; - } foreach (synchronizedobjects _logic); + } forEach (synchronizedObjects _logic); // Modified by ace_zeus - bis_fnc_activateaddons will error if time > 0 so only call if at start if (time <= 0) then { _addons call bis_fnc_activateaddons; }; }; // Player - if (hasinterface) then { - waituntil {local player}; + if (hasInterface) then { + waitUntil {local player}; _serverCommand = ["#kick", "#shutdown"] select (_ownerVar == "#adminLogged"); // Black effect until the interface is open - _forced = _logic getvariable ["forced",0] > 0; + _forced = _logic getVariable ["forced",0] > 0; if (_forced) then { _isCurator = switch true do { case (_ownerUID > 0): { - getplayeruid player == _ownerVar + getPlayerUID player == _ownerVar }; case (_isAdmin): { - isserver || servercommandavailable _serverCommand + isServer || serverCommandAvailable _serverCommand }; default { - player == missionnamespace getvariable [_ownerVar,objnull] + player == missionNamespace getVariable [_ownerVar,objNull] }; }; if (_isCurator) then { [true,true] spawn bis_fnc_forceCuratorInterface; - ("RscDisplayCurator" call bis_fnc_rscLayer) cuttext ["","black in",1e10]; + ("RscDisplayCurator" call bis_fnc_rscLayer) cutText ["","black in",1e10]; }; }; // Check if player is server admin if (_isAdmin) then { - _adminVar = _logic getvariable ["adminVar",""]; - _logic setvariable ["adminVar",nil]; - if (isserver) then { + _adminVar = _logic getVariable ["adminVar",""]; + _logic setVariable ["adminVar",nil]; + if (isServer) then { // Host - missionnamespace setvariable [_adminVar,player]; + missionNamespace setVariable [_adminVar,player]; } else { // Client [_logic,_adminVar,_serverCommand] spawn { - scriptname "BIS_fnc_moduleCurator: Admin check"; + scriptName "BIS_fnc_moduleCurator: Admin check"; _logic = _this select 0; _adminVar = _this select 1; _serverCommand = _this select 2; while {true} do { - waituntil {sleep 0.1; servercommandavailable _serverCommand}; - missionnamespace setvariable [_adminVar,player]; - publicvariable _adminVar; - _respawn = player addeventhandler ["respawn",format ["%1 = _this select 0; publicvariable '%1';",_adminVar]]; - - waituntil {sleep 0.1; !servercommandavailable _serverCommand}; - missionnamespace setvariable [_adminVar,objnull]; - publicvariable _adminVar; - player removeeventhandler ["respawn",_respawn]; + waitUntil {sleep 0.1; serverCommandAvailable _serverCommand}; + missionNamespace setVariable [_adminVar,player]; + publicVariable _adminVar; + _respawn = player addEventHandler ["Respawn",format ["%1 = _this select 0; publicvariable '%1';",_adminVar]]; + + waitUntil {sleep 0.1; !serverCommandAvailable _serverCommand}; + missionNamespace setVariable [_adminVar,objNull]; + publicVariable _adminVar; + player removeEventHandler ["Respawn",_respawn]; }; }; }; @@ -312,10 +312,10 @@ if (_activated) then { [_logic] spawn { _logic = _this select 0; sleep 1; - waituntil {alive player}; + waitUntil {alive player}; // Show warning when Zeus key is not assigned - if (count (actionkeys "curatorInterface") == 0) then { + if (count (actionKeys "curatorInterface") == 0) then { [ format [ localize "str_a3_cfgvehicles_modulecurator_f_keyNotAssigned", @@ -326,13 +326,13 @@ if (_activated) then { // Show hint about pinging for players if ( - isnil {profilenamespace getvariable "bis_fnc_curatorPinged_done"} + isNil {profileNamespace getVariable "bis_fnc_curatorPinged_done"} && {isTutHintsEnabled} && - {isnull getassignedcuratorlogic player} + {isNull getAssignedCuratorLogic player} && - {player in curatoreditableobjects _logic} + {player in curatorEditableObjects _logic} ) then { sleep 0.5; [["Curator","Ping"]] call bis_fnc_advHint; @@ -340,16 +340,16 @@ if (_activated) then { }; // Add local event handlers - _logic addeventhandler ["curatorFeedbackMessage",{_this call bis_fnc_showCuratorFeedbackMessage;}]; - _logic addeventhandler ["curatorPinged",{_this call bis_fnc_curatorPinged;}]; - _logic addeventhandler ["curatorObjectPlaced",{_this call bis_fnc_curatorObjectPlaced;}]; - _logic addeventhandler ["curatorObjectEdited",{_this call bis_fnc_curatorObjectEdited;}]; - _logic addeventhandler ["curatorWaypointPlaced",{_this call bis_fnc_curatorWaypointPlaced;}]; - - _logic addeventhandler ["curatorObjectDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; - _logic addeventhandler ["curatorGroupDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; - _logic addeventhandler ["curatorWaypointDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; - _logic addeventhandler ["curatorMarkerDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; + _logic addEventHandler ["CuratorFeedbackMessage",{_this call bis_fnc_showCuratorFeedbackMessage;}]; + _logic addEventHandler ["CuratorPinged",{_this call bis_fnc_curatorPinged;}]; + _logic addEventHandler ["CuratorObjectPlaced",{_this call bis_fnc_curatorObjectPlaced;}]; + _logic addEventHandler ["CuratorObjectEdited",{_this call bis_fnc_curatorObjectEdited;}]; + _logic addEventHandler ["CuratorWaypointPlaced",{_this call bis_fnc_curatorWaypointPlaced;}]; + + _logic addEventHandler ["CuratorObjectDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; + _logic addEventHandler ["CuratorGroupDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; + _logic addEventHandler ["CuratorWaypointDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; + _logic addEventHandler ["CuratorMarkerDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; player call bis_fnc_curatorRespawn; }; diff --git a/addons/zeus/functions/fnc_bi_moduleMine.sqf b/addons/zeus/functions/fnc_bi_moduleMine.sqf index 0bd8ba574ff..509efa0a1c5 100644 --- a/addons/zeus/functions/fnc_bi_moduleMine.sqf +++ b/addons/zeus/functions/fnc_bi_moduleMine.sqf @@ -21,18 +21,18 @@ params ["_logic", "_units", "_activated"]; if (_activated) then { - _explosive = gettext (configOf _logic >> "explosive"); + _explosive = getText (configOf _logic >> "explosive"); if (_explosive != "") then { - _explosive = createvehicle [_explosive,position _logic,[],0,"none"]; - _explosive attachto [_logic]; + _explosive = createVehicle [_explosive,position _logic,[],0,"none"]; + _explosive attachTo [_logic]; // Added by ace_zeus to control if mines are revealed if (GVAR(revealMines) > MINE_REVEAL_NONE) then { //--- Reveal the mine to curator's side { - _side = (getassignedcuratorunit _x) call bis_fnc_objectSide; - _side revealmine _explosive; - } forEach (objectcurators _logic); + _side = (getAssignedCuratorUnit _x) call bis_fnc_objectSide; + _side revealMine _explosive; + } forEach (objectCurators _logic); if (GVAR(revealMines) == MINE_REVEAL_FULL) then { //--- Mark minefields in the map @@ -43,8 +43,8 @@ if (_activated) then { //--- Show hint to curator who placed the object [[["Curator","PlaceMines"],nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",_logic] call bis_fnc_mp; - waituntil {sleep 0.1; isnull _explosive || isnull _logic || !alive _logic}; - if (isnull _logic) then {deletevehicle _explosive;} else {_explosive setdamage 1;}; - deletevehicle _logic; + waitUntil {sleep 0.1; isNull _explosive || isNull _logic || !alive _logic}; + if (isNull _logic) then {deleteVehicle _explosive;} else {_explosive setDamage 1;}; + deleteVehicle _logic; }; }; diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf index ba30a2eaf44..94771354ba4 100644 --- a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -23,26 +23,26 @@ _logic = _this select 0; _units = _this select 1; _activated = _this select 2; -if ({local _x} count (objectcurators _logic) > 0) then { +if ({local _x} count (objectCurators _logic) > 0) then { //--- Reveal the circle to curators - _logic hideobject false; - _logic setpos position _logic; + _logic hideObject false; + _logic setPos position _logic; }; -if !(isserver) exitwith {}; +if !(isServer) exitWith {}; if (_activated) then { - _ammo = _logic getvariable ["type",gettext (configOf _logic >> "ammo")]; + _ammo = _logic getVariable ["type",getText (configOf _logic >> "ammo")]; if (_ammo != "") then { - _cfgAmmo = configfile >> "cfgammo" >> _ammo; + _cfgAmmo = configFile >> "cfgammo" >> _ammo; //if !(isclass _cfgAmmo) exitwith {["CfgAmmo class '%1' not found.",_ammo] call bis_fnc_error;}; // It seems BI broke this part... // _dirVar = _fnc_scriptname + typeof _logic; // _logic setdir (missionnamespace getvariable [_dirVar,direction _logic]); //--- Restore custom direction - _pos = getposatl _logic; + _pos = getPosATL _logic; _posAmmo = +_pos; _posAmmo set [2,0]; _dir = direction _logic; - _simulation = toLowerANSI gettext (configfile >> "cfgammo" >> _ammo >> "simulation"); + _simulation = toLowerANSI getText (configFile >> "cfgammo" >> _ammo >> "simulation"); _altitude = 0; _velocity = []; _attach = false; @@ -58,7 +58,7 @@ if (_activated) then { _altitude = 1000; _velocity = [0,0,-100]; _radio = "SentGenIncoming"; - _sounds = if (getnumber (_cfgAmmo >> "hit") < 200) then {["mortar1","mortar2"]} else {["shell1","shell2","shell3","shell4"]}; + _sounds = if (getNumber (_cfgAmmo >> "hit") < 200) then {["mortar1","mortar2"]} else {["shell1","shell2","shell3","shell4"]}; _sound = selectRandom _sounds; _hint = ["Curator","PlaceOrdnance"]; _shakeStrength = 0.01; @@ -66,7 +66,7 @@ if (_activated) then { }; case "shotsubmunitions": { _posAmmo = [_posAmmo,500,_dir + 180] call bis_fnc_relpos; - _altitude = 1000 - ((getterrainheightasl _posAmmo) - (getterrainheightasl _pos)); + _altitude = 1000 - ((getTerrainHeightASL _posAmmo) - (getTerrainHeightASL _pos)); _posAmmo set [2,_altitude]; _velocity = [sin _dir * 68,cos _dir * 68,-100]; _radio = "SentGenIncoming"; @@ -102,22 +102,22 @@ if (_activated) then { }; }; }; - } foreach allPlayers; + } forEach allPlayers; }; }; - if (count _hint > 0 && {count objectcurators _logic > 0}) then { - [[_hint,nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",objectcurators _logic] call bis_fnc_mp; + if (count _hint > 0 && {count objectCurators _logic > 0}) then { + [[_hint,nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",objectCurators _logic] call bis_fnc_mp; }; if (count _velocity == 3) then { - _altitude = (_logic getvariable ["altitude",_altitude]) call BIS_fnc_parseNumberSafe; - _radio = _logic getvariable ["radio",_radio]; + _altitude = (_logic getVariable ["altitude",_altitude]) call BIS_fnc_parseNumberSafe; + _radio = _logic getVariable ["radio",_radio]; //--- Create projectile _posAmmo set [2,_altitude]; - _projectile = createvehicle [_ammo,_posAmmo,[],0,"none"]; - _projectile setpos _posAmmo; - _projectile setvelocity _velocity; - if (_attach) then {_projectile attachto [_logic,[0,0,_altitude]];}; + _projectile = createVehicle [_ammo,_posAmmo,[],0,"none"]; + _projectile setPos _posAmmo; + _projectile setVelocity _velocity; + if (_attach) then {_projectile attachTo [_logic,[0,0,_altitude]];}; // Added by ace_zeus for ace_frag compatibility if (!isNil QEFUNC(frag,addPfhRound)) then { @@ -128,7 +128,7 @@ if (_activated) then { if (_sound != "") then {[[_logic,_sound,"say3D"],"bis_fnc_sayMessage"] call bis_fnc_mp;}; //--- Create sound source - _soundSource = if (_soundSourceClass != "") then {createSoundSource [_soundSourceClass,_pos,[],0]} else {objnull}; + _soundSource = if (_soundSourceClass != "") then {createSoundSource [_soundSourceClass,_pos,[],0]} else {objNull}; // Added by ace_zeus to toggle ordnance radio message if (GVAR(radioOrdnance)) then { @@ -138,54 +138,54 @@ if (_activated) then { //--- Update if (_attach) then { - waituntil { - _soundSource setposatl getposatl _projectile; + waitUntil { + _soundSource setPosATL getPosATL _projectile; sleep 1; - isnull _projectile || isnull _logic + isNull _projectile || isNull _logic }; } else { - waituntil { - _soundSource setposatl getposatl _projectile; + waitUntil { + _soundSource setPosATL getPosATL _projectile; - if (getposatl _logic distance _pos > 0 || direction _logic != _dir) then { - _posNew = getposasl _logic; + if (getPosATL _logic distance _pos > 0 || direction _logic != _dir) then { + _posNew = getPosASL _logic; _dirDiff = direction _logic - _dir; - _posNew = [_posNew,[getposasl _projectile,_pos] call bis_fnc_distance2d,direction _logic + 180] call bis_fnc_relpos; - _posNew set [2,getposasl _projectile select 2]; - _projectile setvelocity ([velocity _projectile,-_dirDiff] call bis_fnc_rotatevector2d); - _projectile setposasl _posNew; - _pos = getposatl _logic; + _posNew = [_posNew,[getPosASL _projectile,_pos] call bis_fnc_distance2d,direction _logic + 180] call bis_fnc_relpos; + _posNew set [2,getPosASL _projectile select 2]; + _projectile setVelocity ([velocity _projectile,-_dirDiff] call bis_fnc_rotatevector2d); + _projectile setPosASL _posNew; + _pos = getPosATL _logic; _dir = direction _logic; //missionnamespace setvariable [_dirVar,_dir]; See L37 }; sleep 0.1; - isnull _projectile || isnull _logic + isNull _projectile || isNull _logic }; }; - deletevehicle _projectile; - deletevehicle _soundSource; - if (count objectcurators _logic > 0) then { + deleteVehicle _projectile; + deleteVehicle _soundSource; + if (count objectCurators _logic > 0) then { //--- Delete curator spawned logic if (_shakeStrength > 0) then { if (_simulation == "shotsubmunitions") then {sleep 0.5;}; [[_shakeStrength,0.7,[position _logic,_shakeRadius]],"bis_fnc_shakeCuratorCamera"] call bis_fnc_mp; }; - deletevehicle _logic; + deleteVehicle _logic; } else { //--- Repeat to achieve permanent effect - _repeat = _logic getvariable ["repeat",0] > 0; + _repeat = _logic getVariable ["repeat",0] > 0; if (_repeat) then { [_logic,_units,_activated] call bis_fnc_moduleprojectile; } else { - deletevehicle _logic; + deleteVehicle _logic; }; }; } else { - deletevehicle _logic; + deleteVehicle _logic; }; } else { - ["Cannot create projectile, 'ammo' config attribute is missing in %1",typeof _logic] call bis_fnc_error; + ["Cannot create projectile, 'ammo' config attribute is missing in %1",typeOf _logic] call bis_fnc_error; }; }; diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf index 2aa438be532..dcc546ce3be 100644 --- a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -22,38 +22,38 @@ _logic = _this select 0; _units = _this select 1; _activated = _this select 2; -if (_activated && local _logic && !isnull curatorcamera) then { +if (_activated && local _logic && !isNull curatorCamera) then { //--- Terminate when remote control is already in progress - if !(isnull (missionnamespace getvariable ["bis_fnc_moduleRemoteControl_unit",objnull])) exitwith {}; + if !(isNull (missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit",objNull])) exitWith {}; //--- Get unit under cursor - _unit = objnull; - _mouseOver = missionnamespace getvariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]]; + _unit = objNull; + _mouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]]; if ((_mouseOver select 0) == "OBJECT") then {_unit = _mouseOver select 1;}; - _unit = effectivecommander _unit; + _unit = effectiveCommander _unit; //--- Temp owner - private _tempOwner = _unit getvariable ["bis_fnc_moduleRemoteControl_owner", objnull]; + private _tempOwner = _unit getVariable ["bis_fnc_moduleRemoteControl_owner", objNull]; //--- Check if the unit is suitable _error = ""; if !(side group _unit in [east,west,resistance,civilian]) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorEmpty";}; - if (isplayer _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer";}; + if (isPlayer _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer";}; if !(alive _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorDestroyed";}; - if (isnull _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorNull";}; - if (!isnull _tempOwner && {_tempOwner in allPlayers}) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; - if (isuavconnected vehicle _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; + if (isNull _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorNull";}; + if (!isNull _tempOwner && {_tempOwner in allPlayers}) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; + if (isUAVConnected vehicle _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; if (_error == "") then { _unit spawn { - scriptname "bis_fnc_moduleRemoteControl: Loop"; + scriptName "bis_fnc_moduleRemoteControl: Loop"; _unit = _this; _vehicle = vehicle _unit; - _vehicleRole = str assignedvehiclerole _unit; + _vehicleRole = str assignedVehicleRole _unit; bis_fnc_moduleRemoteControl_unit = _unit; - _unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true]; + _unit setVariable ["bis_fnc_moduleRemoteControl_owner",player,true]; // Added by ace_zeus to toggle remote control wind sound if (GVAR(remoteWind)) then { @@ -61,125 +61,125 @@ if (_activated && local _logic && !isnull curatorcamera) then { [format ["wind%1",ceil random 5],"bis_fnc_playsound"] call bis_fnc_mp; }; - _blur = ppeffectcreate ["RadialBlur",144]; - _blur ppeffectenable true; - _blur ppeffectadjust [0,0,0.3,0.3]; - _blur ppeffectcommit 0; - _blur ppeffectadjust [0.03,0.03,0.1,0.1]; - _blur ppeffectcommit 1; - - _cam = "camera" camcreate getposatl curatorcamera; - _cam cameraeffect ["internal","back"]; - _cam campreparetarget (screentoworld [0.5,0.5]); - _cam camcommitprepared 0; - _cam campreparetarget _unit; - _cam campreparefov 0.1; - _cam camcommitprepared 1; + _blur = ppEffectCreate ["RadialBlur",144]; + _blur ppEffectEnable true; + _blur ppEffectAdjust [0,0,0.3,0.3]; + _blur ppEffectCommit 0; + _blur ppEffectAdjust [0.03,0.03,0.1,0.1]; + _blur ppEffectCommit 1; + + _cam = "camera" camCreate getPosATL curatorCamera; + _cam cameraEffect ["internal","back"]; + _cam camPrepareTarget (screenToWorld [0.5,0.5]); + _cam camCommitPrepared 0; + _cam camPrepareTarget _unit; + _cam camPrepareFov 0.1; + _cam camCommitPrepared 1; sleep 0.75; - ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",0.25]; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cutText ["","black out",0.25]; sleep 0.25; //--- Wait for interface to close - (finddisplay 312) closedisplay 2; - waituntil {isnull curatorcamera}; + (findDisplay 312) closeDisplay 2; + waitUntil {isNull curatorCamera}; //--- Switch - player remotecontrol _unit; - if (cameraon != _vehicle) then { - _vehicle switchcamera cameraview; + player remoteControl _unit; + if (cameraOn != _vehicle) then { + _vehicle switchCamera cameraView; }; - ppeffectdestroy _blur; - _cam cameraeffect ["terminate","back"]; - camdestroy _cam; + ppEffectDestroy _blur; + _cam cameraEffect ["terminate","back"]; + camDestroy _cam; - _color = ppeffectcreate ["colorCorrections",1896]; - _color ppeffectenable true; - _color ppeffectadjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.0,0,0,0,0.5,1]]; - _color ppeffectcommit 0; + _color = ppEffectCreate ["colorCorrections",1896]; + _color ppEffectEnable true; + _color ppEffectAdjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.0,0,0,0,0.5,1]]; + _color ppEffectCommit 0; - _curator = getassignedcuratorlogic player; + _curator = getAssignedCuratorLogic player; [_curator,"curatorObjectRemoteControlled",[_curator,player,_unit,true]] call bis_fnc_callScriptedEventHandler; [["Curator","RemoteControl"],nil,nil,nil,nil,nil,nil,true] call bis_fnc_advHint; sleep 0.3; - _color ppeffectadjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.85,0,0,0,0.5,1]]; - _color ppeffectcommit 0.3; - ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",0.5]; + _color ppEffectAdjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.85,0,0,0,0.5,1]]; + _color ppEffectCommit 0.3; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cutText ["","black in",0.5]; //--- Back to player _vehicle = vehicle _unit; - _vehicleRole = str assignedvehiclerole _unit; + _vehicleRole = str assignedVehicleRole _unit; _rating = rating player; - waituntil { + waitUntil { //--- Refresh when vehicle or vehicle role changes - if ((vehicle _unit != _vehicle || str assignedvehiclerole _unit != _vehicleRole) && {alive _unit}) then { - player remotecontrol _unit; + if ((vehicle _unit != _vehicle || str assignedVehicleRole _unit != _vehicleRole) && {alive _unit}) then { + player remoteControl _unit; _vehicle = vehicle _unit; - _vehicleRole = str assignedvehiclerole _unit; + _vehicleRole = str assignedVehicleRole _unit; }; if (rating player < _rating) then { - player addrating (-rating player + _rating); + player addRating (-rating player + _rating); }; sleep 0.01; - !isnull curatorcamera + !isNull curatorCamera || - {cameraon == vehicle player} + {cameraOn == vehicle player} || {!alive _unit} //--- Also isnull check, objNull is not alive || {!alive player} || - {isnull getassignedcuratorlogic player} + {isNull getAssignedCuratorLogic player} }; - player addrating (-rating player + _rating); - objnull remotecontrol _unit; - _unit setvariable ["bis_fnc_moduleRemoteControl_owner",nil,true]; + player addRating (-rating player + _rating); + objNull remoteControl _unit; + _unit setVariable ["bis_fnc_moduleRemoteControl_owner",nil,true]; if (alive player) then { //--- Death screen if ( - isnull curatorcamera + isNull curatorCamera && - {cameraon != vehicle player} + {cameraOn != vehicle player} && - {!isnull _unit} + {!isNull _unit} && - {!isnull getassignedcuratorlogic player} + {!isNull getAssignedCuratorLogic player} //&& //{(_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull] == player)} ) then { sleep 2; - ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",1]; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cutText ["","black out",1]; sleep 1; }; - if !(isnull _unit) then { - _unitPos = getposatl _unit; + if !(isNull _unit) then { + _unitPos = getPosATL _unit; _camPos = [_unitPos,10,direction _unit + 180] call bis_fnc_relpos; - _camPos set [2,(_unitPos select 2) + (getterrainheightasl _unitPos) - (getterrainheightasl _camPos) + 10]; + _camPos set [2,(_unitPos select 2) + (getTerrainHeightASL _unitPos) - (getTerrainHeightASL _camPos) + 10]; //[_camPos,_unit] call bis_fnc_setcuratorcamera; - (getassignedcuratorlogic player) setvariable ["bis_fnc_modulecuratorsetcamera_params",[_camPos,_unit]]; + (getAssignedCuratorLogic player) setVariable ["bis_fnc_modulecuratorsetcamera_params",[_camPos,_unit]]; }; sleep 0.1; //--- Engine needs a delay in case controlled unit was deleted - ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",1e10]; - opencuratorinterface; - ppeffectdestroy _color; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cutText ["","black in",1e10]; + openCuratorInterface; + ppEffectDestroy _color; - waituntil {!isnull curatorcamera}; + waitUntil {!isNull curatorCamera}; } else { - ppeffectdestroy _color; + ppEffectDestroy _color; }; - player switchcamera cameraview; + player switchCamera cameraView; bis_fnc_moduleRemoteControl_unit = nil; - ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",1]; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cutText ["","black in",1]; [_curator,"curatorObjectRemoteControlled",[_curator,player,_unit,false]] call bis_fnc_callScriptedEventHandler; sleep 0.01; }; } else { - [objnull,_error] call bis_fnc_showCuratorFeedbackMessage; + [objNull,_error] call bis_fnc_showCuratorFeedbackMessage; }; - deletevehicle _logic; + deleteVehicle _logic; }; diff --git a/addons/zeus/functions/fnc_getModuleDestination.sqf b/addons/zeus/functions/fnc_getModuleDestination.sqf index 10d7acae9e0..763f9b48cac 100644 --- a/addons/zeus/functions/fnc_getModuleDestination.sqf +++ b/addons/zeus/functions/fnc_getModuleDestination.sqf @@ -109,7 +109,7 @@ GVAR(moduleDestination_mapDrawEH) = [((findDisplay 312) displayCtrl 50), "draw", private _mousePosAGL = screenToWorld getMousePosition; [_object, AGLToASL _mousePosAGL] call _drawCode; drawIcon3D [_icon, _color, _mousePosAGL, 1.5, 1.5, _angle, _text]; - drawLine3D [_mousePosAGL, ASLtoAGL (getPosASL _object), _color];; + drawLine3D [_mousePosAGL, ASLToAGL (getPosASL _object), _color];; } else { TRACE_4("cleaning up",_this select 1,GVAR(moduleDestination_displayEHMouse),GVAR(moduleDestination_displayEHKeyboard),GVAR(moduleDestination_mapDrawEH)); (_this select 1) call CBA_fnc_removePerFrameHandler; diff --git a/addons/zeus/functions/fnc_moduleCaptive.sqf b/addons/zeus/functions/fnc_moduleCaptive.sqf index ad359575e96..e16a701f055 100644 --- a/addons/zeus/functions/fnc_moduleCaptive.sqf +++ b/addons/zeus/functions/fnc_moduleCaptive.sqf @@ -29,7 +29,7 @@ if (isNil QEFUNC(captives,setHandcuffed)) then { if ((_mouseOver select 0) != "OBJECT") then { [LSTRING(NothingSelected)] call FUNC(showMessage); } else { - private _unit = effectivecommander (_mouseOver select 1); + private _unit = effectiveCommander (_mouseOver select 1); if !(_unit isKindOf "CAManBase") then { [LSTRING(OnlyInfantry)] call FUNC(showMessage); diff --git a/addons/zeus/functions/fnc_moduleCargoParadrop.sqf b/addons/zeus/functions/fnc_moduleCargoParadrop.sqf index 2aaffb37964..ed009832756 100644 --- a/addons/zeus/functions/fnc_moduleCargoParadrop.sqf +++ b/addons/zeus/functions/fnc_moduleCargoParadrop.sqf @@ -62,7 +62,7 @@ if ((_vehicle getVariable [QEGVAR(cargo,loaded), []]) isEqualTo []) exitWith { [_group] call CBA_fnc_clearWaypoints; - private _wp = _group addWaypoint [ASLtoAGL _mousePosASL, 0]; + private _wp = _group addWaypoint [ASLToAGL _mousePosASL, 0]; _wp setWaypointType "SCRIPTED"; _wp setWaypointScript QPATHTOF(functions\DOUBLES(fnc,moduleCargoParadropWaypoint).sqf); diff --git a/addons/zeus/functions/fnc_moduleSetMedic.sqf b/addons/zeus/functions/fnc_moduleSetMedic.sqf index d44dd56e593..2393de0ebfa 100644 --- a/addons/zeus/functions/fnc_moduleSetMedic.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedic.sqf @@ -29,7 +29,7 @@ if !(GETEGVAR(medical,enabled,false)) then { if ((_mouseOver select 0) != "OBJECT") then { [LSTRING(NothingSelected)] call FUNC(showMessage); } else { - private _unit = effectivecommander (_mouseOver select 1); + private _unit = effectiveCommander (_mouseOver select 1); if !(_unit isKindOf "CAManBase") then { [LSTRING(OnlyInfantry)] call FUNC(showMessage); diff --git a/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf b/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf index a624b7dded6..2860f624f22 100644 --- a/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf +++ b/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf @@ -59,7 +59,7 @@ if ([_unit] call EFUNC(common,isPlayer)) exitWith { } forEach getArtilleryAmmo [_vehicle]; TRACE_1("getArtilleryAmmo",_artilleryMag); if (_artilleryMag == "") exitWith {_targetASL = [];}; - private _eta = _vehicle getArtilleryETA [ASLtoAGL _targetASL, _artilleryMag]; + private _eta = _vehicle getArtilleryETA [ASLToAGL _targetASL, _artilleryMag]; TRACE_1("getArtilleryETA",_eta); if (_eta < 0) exitWith { [ELSTRING(Interaction,NotInRange)] call FUNC(showMessage); diff --git a/addons/zeus/functions/fnc_moduleSuppressiveFireLocal.sqf b/addons/zeus/functions/fnc_moduleSuppressiveFireLocal.sqf index f09211b034b..39efec6d921 100644 --- a/addons/zeus/functions/fnc_moduleSuppressiveFireLocal.sqf +++ b/addons/zeus/functions/fnc_moduleSuppressiveFireLocal.sqf @@ -21,7 +21,7 @@ params ["_unit", "_targetASL", "_artilleryMag"]; TRACE_4("moduleSuppressiveFireLocal",_unit,local _unit,_targetASL,_artilleryMag); if (_artilleryMag != "") exitWith { - (vehicle _unit) doArtilleryFire [ASLtoAGL _targetASL, _artilleryMag, 4]; + (vehicle _unit) doArtilleryFire [ASLToAGL _targetASL, _artilleryMag, 4]; TRACE_3("doArtilleryFire",_unit,_targetASL,_artilleryMag); }; diff --git a/addons/zeus/functions/fnc_moduleSurrender.sqf b/addons/zeus/functions/fnc_moduleSurrender.sqf index 07517d7e710..b8071a8cd52 100644 --- a/addons/zeus/functions/fnc_moduleSurrender.sqf +++ b/addons/zeus/functions/fnc_moduleSurrender.sqf @@ -29,7 +29,7 @@ if (isNil QEFUNC(captives,setSurrendered)) then { if ((_mouseOver select 0) != "OBJECT") then { [LSTRING(NothingSelected)] call FUNC(showMessage); } else { - private _unit = effectivecommander (_mouseOver select 1); + private _unit = effectiveCommander (_mouseOver select 1); if !(_unit isKindOf "CAManBase") then { [LSTRING(OnlyInfantry)] call FUNC(showMessage); diff --git a/addons/zeus/functions/fnc_moduleUnconscious.sqf b/addons/zeus/functions/fnc_moduleUnconscious.sqf index 7eede3cdece..7ca0a824c2d 100644 --- a/addons/zeus/functions/fnc_moduleUnconscious.sqf +++ b/addons/zeus/functions/fnc_moduleUnconscious.sqf @@ -29,7 +29,7 @@ if (isNil QEFUNC(medical,setUnconscious)) then { if ((_mouseOver select 0) != "OBJECT") then { [LSTRING(NothingSelected)] call FUNC(showMessage); } else { - private _unit = effectivecommander (_mouseOver select 1); + private _unit = effectiveCommander (_mouseOver select 1); if !(_unit isKindOf "CAManBase") then { [LSTRING(OnlyInfantry)] call FUNC(showMessage); diff --git a/addons/zeus/functions/fnc_ui_globalSetSkill.sqf b/addons/zeus/functions/fnc_ui_globalSetSkill.sqf index 5a7c5fc5e03..1586ce2f460 100644 --- a/addons/zeus/functions/fnc_ui_globalSetSkill.sqf +++ b/addons/zeus/functions/fnc_ui_globalSetSkill.sqf @@ -47,7 +47,7 @@ private _fnc_sliderMove = { (_display displayCtrl 16189) cbSetChecked (GVAR(GlobalSkillAI) select 5); private _fnc_onUnload = { - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; deleteVehicle _logic; @@ -57,7 +57,7 @@ private _fnc_onConfirm = { params [["_ctrlButtonOK", controlNull, [controlNull]]]; TRACE_1("_fnc_onConfirm params",_this); - private _display = ctrlparent _ctrlButtonOK; + private _display = ctrlParent _ctrlButtonOK; if (isNull _display) exitWith {}; GVAR(GlobalSkillAI) = [ diff --git a/addons/zeus/functions/fnc_ui_groupSide.sqf b/addons/zeus/functions/fnc_ui_groupSide.sqf index 110e2e302da..9c243d5642a 100644 --- a/addons/zeus/functions/fnc_ui_groupSide.sqf +++ b/addons/zeus/functions/fnc_ui_groupSide.sqf @@ -105,7 +105,7 @@ private _fnc_onSelection = { } forEach IDCs; private _fnc_onUnload = { - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; if (_this select 1 == 2) then { @@ -116,10 +116,10 @@ private _fnc_onUnload = { private _fnc_onConfirm = { params ["_ctrlButtonOK"]; - private _display = ctrlparent _ctrlButtonOK; + private _display = ctrlParent _ctrlButtonOK; if (isNull _display) exitWith {}; - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; private _unit = effectiveCommander (attachedTo _logic); diff --git a/addons/zeus/functions/fnc_ui_setEngineer.sqf b/addons/zeus/functions/fnc_ui_setEngineer.sqf index 3f008403cc7..e19b04c04c0 100644 --- a/addons/zeus/functions/fnc_ui_setEngineer.sqf +++ b/addons/zeus/functions/fnc_ui_setEngineer.sqf @@ -64,7 +64,7 @@ private _fnc_onConfirm = { private _display = ctrlParent _ctrlButtonOK; if (isNull _display) exitWith {}; - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; private _value = lbCurSel (_display displayCtrl 86947); diff --git a/addons/zeus/functions/fnc_ui_spectator.sqf b/addons/zeus/functions/fnc_ui_spectator.sqf index fe9b4a36687..04d2a067630 100644 --- a/addons/zeus/functions/fnc_ui_spectator.sqf +++ b/addons/zeus/functions/fnc_ui_spectator.sqf @@ -164,7 +164,7 @@ private _fnc_onVisionSelection = { params ["_ctrl", "_state"]; private _display = ctrlParent _ctrl; - if (isNull _display) exitwith {}; + if (isNull _display) exitWith {}; // Convert to boolean since EH returns state as 0 or 1 private _state = [false, true] select _state; diff --git a/addons/zeus/functions/fnc_ui_suicideBomber.sqf b/addons/zeus/functions/fnc_ui_suicideBomber.sqf index 26184518710..ab74b398745 100644 --- a/addons/zeus/functions/fnc_ui_suicideBomber.sqf +++ b/addons/zeus/functions/fnc_ui_suicideBomber.sqf @@ -65,7 +65,7 @@ private _fnc_onSelection = { params [["_activeCtrl", controlNull, [controlNull]]]; private _display = ctrlParent _activeCtrl; - if (isNUll _display) exitWith {}; + if (isNull _display) exitWith {}; // Update button colours and scales { diff --git a/addons/zeus/functions/fnc_ui_teleportPlayers.sqf b/addons/zeus/functions/fnc_ui_teleportPlayers.sqf index b7aab411268..9d32d8cfc02 100644 --- a/addons/zeus/functions/fnc_ui_teleportPlayers.sqf +++ b/addons/zeus/functions/fnc_ui_teleportPlayers.sqf @@ -66,7 +66,7 @@ private _fnc_onKeyUp = { private _fnc_onUnload = { params ["_display"]; - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; // Store checkbox value for reopening @@ -76,10 +76,10 @@ private _fnc_onUnload = { private _fnc_onConfirm = { params [["_ctrlButtonOK", controlNull, [controlNull]]]; - private _display = ctrlparent _ctrlButtonOK; + private _display = ctrlParent _ctrlButtonOK; if (isNull _display) exitWith {}; - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; private _lb = _display displayCtrl 16189; diff --git a/docs/wiki/feature/dragging.md b/docs/wiki/feature/dragging.md index 0d42240a238..aa462d2e64d 100644 --- a/docs/wiki/feature/dragging.md +++ b/docs/wiki/feature/dragging.md @@ -20,7 +20,9 @@ This adds the option to drag or carry units or objects. ## 2. Usage ### 2.1 Dragging / Carrying units and objects -- You can only drag or carry an unconscious unit. +- You can drag or carry dead or unconscious units. These units can't be in a ragdoll state. +- You can drag or carry units whose legs are broken. +- You can't carry if you have broken legs. - Interact with the unit or object ⊞ Win (ACE3 default key bind `Interact Key`). - Select `Drag` or `Carry`. - To release, use the mouse wheel and select `Release` or use Self Interaction Ctrl+⊞ Win and select `Release`. diff --git a/docs/wiki/framework/arsenal-framework.md b/docs/wiki/framework/arsenal-framework.md index a02dcdf646a..330e7fa99b1 100644 --- a/docs/wiki/framework/arsenal-framework.md +++ b/docs/wiki/framework/arsenal-framework.md @@ -214,7 +214,7 @@ class ace_arsenal_stats { showBar = 1; // 0 disabled; 1 enabled; showText = 1; // 0 disabled; 1 enabled; barStatement = "1"; // Statement evaluated to set the bar progress, needs to return a NUMBER. - textStatement = "test entry"; // statement evaluated to set the text entry, can return anything. + textStatement = "test entry"; // statement evaluated to set the text entry, can return anything. Arrays will have a linebreak added after each element. condition = "true"; // Condition for the stats to be displayed, default is true if not defined, needs to return a BOOL. tabs[] = { {0,1,2}, { } }; // Arrays of tabs, left array is left tabs, right array is right tabs. }; diff --git a/docs/wiki/framework/cargo-framework.md b/docs/wiki/framework/cargo-framework.md index a1d810ce9c4..2e3e695e688 100644 --- a/docs/wiki/framework/cargo-framework.md +++ b/docs/wiki/framework/cargo-framework.md @@ -114,7 +114,17 @@ Note that this function can be used to make objects loadable/unloadable (set to * [object, 3] call ace_cargo_fnc_setSize ``` -### 4.3 Adjusting cargo space of a vehicle +### 4.3 Setting Custom Load/Unload Time + +```sqf +object setVariable ["ace_cargo_delay",