diff --git a/ace_fcs.dll b/ace_fcs.dll index 7c222dc1d7..189c3c0826 100644 Binary files a/ace_fcs.dll and b/ace_fcs.dll differ diff --git a/addons/aircraft/CfgAmmo.hpp b/addons/aircraft/CfgAmmo.hpp index 177753223f..393b9666e6 100644 --- a/addons/aircraft/CfgAmmo.hpp +++ b/addons/aircraft/CfgAmmo.hpp @@ -1,5 +1,19 @@ class CfgAmmo { + class BulletBase; + class B_20mm; + + class ACE_20mm_HEDP : B_20mm { + hit = 80; + indirectHit = 12; + indirectHitRange = 2; //2; + caliber = 1.4; + tracerStartTime = 0.02; + timeToLive = 40; + explosive = 1.8; + }; + + // adjust minigun caliber and deflection to other ammo class SubmunitionBullet; class B_65x39_Minigun_Caseless: SubmunitionBullet { @@ -13,7 +27,6 @@ class CfgAmmo { }; // also adjust tracer, "muh lightshow"; also adjust splash damage radius - class BulletBase; class Gatling_30mm_HE_Plane_CAS_01_F: BulletBase { hit = 80; indirectHit = 12; @@ -22,6 +35,7 @@ class CfgAmmo { deflecting = 3; fuseDistance = 3; tracerStartTime = 0.02; + timeToLive = 40; }; // helper projectiles to simulate a rof > fps diff --git a/addons/aircraft/CfgMagazines.hpp b/addons/aircraft/CfgMagazines.hpp index 0c306f8f04..2445182163 100644 --- a/addons/aircraft/CfgMagazines.hpp +++ b/addons/aircraft/CfgMagazines.hpp @@ -10,6 +10,7 @@ class CfgMagazines { // an extended magazine for the comanche class 300Rnd_20mm_shells; class ACE_500Rnd_20mm_shells_Comanche: 300Rnd_20mm_shells { + ammo = "ACE_20mm_HEDP"; count = 500; }; }; diff --git a/addons/aircraft/CfgWeapons.hpp b/addons/aircraft/CfgWeapons.hpp index 917ba1c174..dc84c9f04a 100644 --- a/addons/aircraft/CfgWeapons.hpp +++ b/addons/aircraft/CfgWeapons.hpp @@ -54,24 +54,24 @@ class CfgWeapons { class manual: manual { reloadTime = 0.04; - dispersion = 0.0022; + dispersion = 0.006; displayName = "$STR_ACE_Aircraft_gatling_20mm_Name"; }; class close: close { reloadTime = 0.04; - dispersion = 0.0022; + dispersion = 0.006; }; class short: short { reloadTime = 0.04; - dispersion = 0.0022; + dispersion = 0.006; }; class medium: medium { reloadTime = 0.04; - dispersion = 0.0022; + dispersion = 0.006; }; class far: far { reloadTime = 0.04; - dispersion = 0.0022; + dispersion = 0.006; }; }; diff --git a/addons/aircraft/Heli_Attack_01_base_F.hpp b/addons/aircraft/Heli_Attack_01_base_F.hpp index ee271f826a..817b1dacaa 100644 --- a/addons/aircraft/Heli_Attack_01_base_F.hpp +++ b/addons/aircraft/Heli_Attack_01_base_F.hpp @@ -863,12 +863,21 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { class Turrets: Turrets { class MainTurret: MainTurret { - directionStabilized = 1; - horizontallyStabilized = 1; - weapons[] = {"ACE_gatling_20mm_Comanche","missiles_DAGR","missiles_ASRAAM", "ACE_AIR_SAFETY"}; magazines[] = {"ACE_500Rnd_20mm_shells_Comanche","4Rnd_AAA_missiles","24Rnd_PG_missiles"}; + outGunnerMayFire = 1; + commanding = -1; + primaryGunner = 1; + gunnerOpticsModel = ""; + gunnerOpticsEffect[] = {"TankCommanderOptics1"}; + gunnerForceOptics = 0; + turretInfoType = "Rsc_ACE_Helo_UI_Turret"; + showAllTargets = 2; + discretedistance[] = {100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000}; + discretedistanceinitindex = 3; + copilotHasFlares = 1; + directionStabilized = 1; isCopilot = 1; showHMD = 1; CanEject = 1; @@ -882,25 +891,6 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { class OpticsIn { - class WideNGS - { - opticsDisplayName = "W"; - initAngleX = 0; - minAngleX = -35; - maxAngleX = 10; - initAngleY = 0; - minAngleY = -100; - maxAngleY = 100; - initFov = 0.466; - minFov = 0.466; - maxFov = 0.466; - visionMode[] = {"Normal","Ti"}; - thermalMode[] = {0,1}; - gunnerOpticsColor[] = {0.15,1,0.15,1}; - gunnerOpticsModel = "A3\Weapons_F\Reticle\Optics_Gunner_MBT_03_w_F.p3d"; - directionStabilized = 0; - opticsPPEffects[] = {"OpticsCHAbera2","OpticsBlur2"}; - }; class Wide { opticsDisplayName = "W"; @@ -913,54 +903,47 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { initFov = 0.466; minFov = 0.466; maxFov = 0.466; - visionMode[] = {"Normal","Ti"}; + visionMode[] = {"Normal","NVG","Ti"}; thermalMode[] = {0,1}; - gunnerOpticsColor[] = {0.15,1,0.15,1}; - gunnerOpticsModel = "A3\Weapons_F\Reticle\Optics_Gunner_MBT_02_w_F.p3d"; - directionStabilized = 1; - opticsPPEffects[] = {"OpticsCHAbera2","OpticsBlur2"}; - gunnerOpticsEffect[] = {"TankCommanderOptics1"}; - }; - class WideL: Wide - { - opticsDisplayName = "WL"; - initFov = 0.2; - minFov = 0.2; - maxFov = 0.2; - gunnerOpticsModel = "A3\Weapons_F\Reticle\Optics_Gunner_MBT_02_m_F.p3d"; gunnerOpticsColor[] = {0,0,0,1}; directionStabilized = 1; - opticsPPEffects[] = {"OpticsCHAbera2","OpticsBlur2"}; + horizontallyStabilized = 1; + gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_wide_F"; }; class Medium: Wide { opticsDisplayName = "M"; - initFov = 0.1; - minFov = 0.1; - maxFov = 0.1; - directionStabilized = 1; + initFov = 0.093; + minFov = 0.093; + maxFov = 0.093; gunnerOpticsColor[] = {0,0,0,1}; - gunnerOpticsModel = "A3\Weapons_F\Reticle\Optics_Gunner_MBT_02_m_F.p3d"; + directionStabilized = 1; + horizontallyStabilized = 1; + gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_medium_F"; }; class Narrow: Wide { opticsDisplayName = "N"; + initFov = 0.029; + minFov = 0.029; + maxFov = 0.029; gunnerOpticsColor[] = {0,0,0,1}; - gunnerOpticsModel = "A3\Weapons_F\Reticle\Optics_Gunner_MBT_02_n_F.p3d"; directionStabilized = 1; - initFov = 0.02; - minFov = 0.02; - maxFov = 0.02; + horizontallyStabilized = 1; + gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_narrow_F"; + }; class Narrower: Wide { - opticsDisplayName = "N"; - gunnerOpticsColor[] = {0,0,0,1}; - gunnerOpticsModel = "A3\Weapons_F\Reticle\Optics_Gunner_MBT_02_n_F.p3d"; - directionStabilized = 1; + opticsDisplayName = "Z"; initFov = 0.01; minFov = 0.01; maxFov = 0.01; + gunnerOpticsColor[] = {0,0,0,1}; + directionStabilized = 1; + horizontallyStabilized = 1; + gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_narrow_F"; + }; }; class OpticsOut @@ -976,8 +959,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { initFov = 1.1; minFov = 0.133; maxFov = 1.1; - visionMode[] = {"Normal","NVG","Ti"}; - thermalMode[] = {2,3}; + visionMode[] = {"Normal","NVG"}; gunnerOpticsModel = ""; gunnerOpticsEffect[] = {}; hideUnitInfo = 1; diff --git a/addons/aircraft/README.md b/addons/aircraft/README.md index 76c721bd0c..1049493f45 100644 --- a/addons/aircraft/README.md +++ b/addons/aircraft/README.md @@ -3,7 +3,7 @@ ace_aircraft Changes to air weaponry, flightmodels and HUDs. -* Contributations by Kimi for HUD updates +* Contributations by Kimi (geraldbolso1899) for HUD updates ## Maintainers diff --git a/addons/aircraft/RscInGameUI.hpp b/addons/aircraft/RscInGameUI.hpp index 8255de35a6..620d895d9e 100644 --- a/addons/aircraft/RscInGameUI.hpp +++ b/addons/aircraft/RscInGameUI.hpp @@ -8,13 +8,16 @@ class RscOpticsValue; class VScrollbar; class HScrollbar; class RscLadderPicture; +class RscControlsGroupNoScrollbars; + + class RscInGameUI { class RscUnitInfo; class Rsc_ACE_Helo_UI_Turret: RscUnitInfo { idd = 300; - controls[] = {"CA_Zeroing","CA_IGUI_elements_group","CA_VehicleToggles"}; + controls[] = {"CA_IGUI_elements_group","CA_VehicleToggles"}; class VScrollbar; class HScrollbar; class CA_IGUI_elements_group: RscControlsGroup diff --git a/addons/attach/script_component.hpp b/addons/attach/script_component.hpp index c09a5b97e1..6d468d89c1 100644 --- a/addons/attach/script_component.hpp +++ b/addons/attach/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_ATTACH - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_ATTACH - #define DEBUG_SETTINGS DEBUG_SETTINGS_ATTACH + #define DEBUG_SETTINGS DEBUG_SETTINGS_ATTACH #endif #include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/ballistics/scripts/initTargetWall.sqf b/addons/ballistics/scripts/initTargetWall.sqf index dd1f42bb7d..b09d5897bc 100644 --- a/addons/ballistics/scripts/initTargetWall.sqf +++ b/addons/ballistics/scripts/initTargetWall.sqf @@ -4,10 +4,10 @@ _wall = _this select 0; if (local _wall) then { - _paper = "UserTexture_1x2_F" createVehicle position _wall; + _paper = "UserTexture_1x2_F" createVehicle position _wall; - _paper attachTo [_wall, [0,-0.02,0.6]]; - _paper setDir getDir _wall; + _paper attachTo [_wall, [0,-0.02,0.6]]; + _paper setDir getDir _wall; - _paper setObjectTextureGlobal [0, QUOTE(PATHTOF(textures\target_ca.paa))]; + _paper setObjectTextureGlobal [0, QUOTE(PATHTOF(textures\target_ca.paa))]; }; diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index fe9c8a4c77..b7da27ea75 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -73,6 +73,7 @@ PREP(getStringFromMissionSQM); PREP(getTargetAzimuthAndInclination); PREP(getTargetDistance); PREP(getTargetObject); +PREP(getTurnedOnLights); PREP(getTurretCommander); PREP(getTurretConfigPath); PREP(getTurretCopilot); @@ -111,6 +112,7 @@ PREP(isModLoaded); PREP(isPlayer); PREP(isTurnedOut); PREP(letterToCode); +PREP(lightIntensityFromObject); PREP(loadPerson); PREP(loadPersonLocal); PREP(loadSettingsFromProfile); @@ -122,6 +124,7 @@ PREP(moveToTempGroup); PREP(muteUnit); PREP(numberToDigits); PREP(numberToDigitsString); +PREP(numberToString); PREP(onAnswerRequest); PREP(onLoadRscDisplayChannel); PREP(owned); @@ -188,6 +191,9 @@ PREP(getConfigGunner); PREP(getConfigCommander); PREP(getHitPoints); PREP(getHitPointsWithSelections); +PREP(getReflectorsWithSelections); +PREP(getLightProperties); +PREP(getLightPropertiesWeapon); PREP(getVehicleCrew); // turrets diff --git a/addons/common/functions/fnc_addCanInteractWithCondition.sqf b/addons/common/functions/fnc_addCanInteractWithCondition.sqf index 99815a08a7..ef46b23706 100644 --- a/addons/common/functions/fnc_addCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_addCanInteractWithCondition.sqf @@ -29,7 +29,7 @@ private "_index"; _index = _conditionNames find _conditionName; if (_index == -1) then { - _index = count _conditionNames; + _index = count _conditionNames; }; _conditionNames set [_index, _conditionName]; diff --git a/addons/common/functions/fnc_ambientBrightness.sqf b/addons/common/functions/fnc_ambientBrightness.sqf index f29ff9e8e5..172739247f 100644 --- a/addons/common/functions/fnc_ambientBrightness.sqf +++ b/addons/common/functions/fnc_ambientBrightness.sqf @@ -11,4 +11,4 @@ */ #include "script_component.hpp" -sunOrMoon * sunOrMoon * (1 - overcast * 0.25) + (moonIntensity/5 min 1) * (1 - overcast) +(sunOrMoon * sunOrMoon * (1 - overcast * 0.25) + (moonIntensity/5) * (1 - overcast)) min 1 diff --git a/addons/common/functions/fnc_blurScreen.sqf b/addons/common/functions/fnc_blurScreen.sqf index c3d101a37e..8f5e50289f 100644 --- a/addons/common/functions/fnc_blurScreen.sqf +++ b/addons/common/functions/fnc_blurScreen.sqf @@ -15,28 +15,28 @@ _id = _this select 0; _show = if (count _this > 1) then {_this select 1} else {false}; if (isnil QGVAR(SHOW_BLUR_SCREEN_COLLECTION)) then { - GVAR(SHOW_BLUR_SCREEN_COLLECTION) = []; + GVAR(SHOW_BLUR_SCREEN_COLLECTION) = []; }; if (typeName _show == typeName 0) then { - _show = (_show == 1); + _show = (_show == 1); }; if (_show) then { - GVAR(SHOW_BLUR_SCREEN_COLLECTION) pushback _id; - // show blur - if (isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then { - GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = ppEffectCreate ["DynamicBlur", 102]; - GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectAdjust [0.9]; - GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectEnable true; - GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectCommit 0; - }; + GVAR(SHOW_BLUR_SCREEN_COLLECTION) pushback _id; + // show blur + if (isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then { + GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = ppEffectCreate ["DynamicBlur", 102]; + GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectAdjust [0.9]; + GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectEnable true; + GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectCommit 0; + }; } else { - GVAR(SHOW_BLUR_SCREEN_COLLECTION) = GVAR(SHOW_BLUR_SCREEN_COLLECTION) - [_id]; - if (GVAR(SHOW_BLUR_SCREEN_COLLECTION) isEqualTo []) then { - // hide blur - if (!isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then { - ppEffectDestroy GVAR(MENU_ppHandle_GUI_BLUR_SCREEN); - GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = nil; - }; - }; + GVAR(SHOW_BLUR_SCREEN_COLLECTION) = GVAR(SHOW_BLUR_SCREEN_COLLECTION) - [_id]; + if (GVAR(SHOW_BLUR_SCREEN_COLLECTION) isEqualTo []) then { + // hide blur + if (!isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then { + ppEffectDestroy GVAR(MENU_ppHandle_GUI_BLUR_SCREEN); + GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = nil; + }; + }; }; diff --git a/addons/common/functions/fnc_changeProjectileDirection.sqf b/addons/common/functions/fnc_changeProjectileDirection.sqf index 04154da9c1..2cb37650b8 100644 --- a/addons/common/functions/fnc_changeProjectileDirection.sqf +++ b/addons/common/functions/fnc_changeProjectileDirection.sqf @@ -19,40 +19,35 @@ private ["_projectile", "_adjustDir", "_adjustUp", "_adjustSpeed", "_vdir", "_di _projectile = _this select 0; _adjustDir = _this select 1; _adjustUp = _this select 2; -_adjustSpeed = _this select 3; -if (isNil "_adjustSpeed") then { - _adjustSpeed = 0; +_adjustSpeed = if (count _this > 3) then { + _this select 3 +} else { + 0 }; ["CPD", [_fnc_scriptNameParent, _adjustDir, _adjustUp, _adjustSpeed], nil, false] call FUNC(log); // get old direction vector -_vdir = vectorDir _projectile; +_vdir = vectorNormalized velocity _projectile; // get azimuth and inclination and apply corrections _dir = (_vdir select 0) atan2 (_vdir select 1) + _adjustDir; -_up = sqrt ((_vdir select 1) ^ 2 + (_vdir select 0) ^ 2) atan2 - (_vdir select 2) + _adjustUp; +_up = asin (_vdir select 2) + _adjustUp; // get new direction vector (this is a unit vector) _vdir = [ - sin _dir * sin _up, - cos _dir * sin _up, - - cos _up + sin _dir * cos _up, + cos _dir * cos _up, + sin _up ]; // get best up vector -_l = sqrt ((_vdir select 0) ^ 2 + (_vdir select 1) ^ 2); if (_l == 0) then {diag_log text format ["[ACE] ERROR: %1, %2, %3, %4, %5, %6, %7", _projectile, _adjustDir, _adjustUp, vectorDir _projectile, _vdir, _dir, _up]}; -_r = -(_vdir select 2) / _l; - -_vup = [ - (_vdir select 0) * _r, - (_vdir select 1) * _r, - _l -]; +_vlat = vectorNormalized (_vdir vectorCrossProduct [0,0,1]); +_vup = _vlat vectorCrossProduct _vdir; // get new speed vector. Keep total speed, but change to new direction. Yay for vector commands. -_vel = _vdir vectorMultiply _adjustSpeed + vectorMagnitude velocity _projectile; +_vel = _vdir vectorMultiply (_adjustSpeed + vectorMagnitude velocity _projectile); // set projectile direction dir and up. Projectiles are long objects, especially with tracers, so it would look dumb otherwise. _projectile setVectorDirAndUp [_vdir, _vup]; diff --git a/addons/common/functions/fnc_displayIcon.sqf b/addons/common/functions/fnc_displayIcon.sqf index 1fbc4e89aa..15cda902d7 100644 --- a/addons/common/functions/fnc_displayIcon.sqf +++ b/addons/common/functions/fnc_displayIcon.sqf @@ -34,13 +34,13 @@ #define Y_POS_ICONS_SECOND (TOP_SIDE + (1.1 * ICON_WIDTH)) // setting values -#define TOP_RIGHT_DOWN 1 -#define TOP_RIGHT_LEFT 2 -#define TOP_LEFT_DOWN 3 -#define TOP_LEFT_RIGHT 4 +#define TOP_RIGHT_DOWN 1 +#define TOP_RIGHT_LEFT 2 +#define TOP_LEFT_DOWN 3 +#define TOP_LEFT_RIGHT 4 // other constants -#define DEFAULT_TIME 6 +#define DEFAULT_TIME 6 private ["_iconId", "_show", "_icon", "_allControls", "_refresh", "_timeAlive", "_list", "_color"]; _iconId = _this select 0; @@ -53,68 +53,68 @@ disableSerialization; _list = missionNamespace getvariable [QGVAR(displayIconList),[]]; _refresh = { - private ["_allControls"]; - // Refreshing of all icons.. - _allControls = missionNamespace getvariable [QGVAR(displayIconListControls), []]; - { - ctrlDelete _x; - }foreach _allControls; + private ["_allControls"]; + // Refreshing of all icons.. + _allControls = missionNamespace getvariable [QGVAR(displayIconListControls), []]; + { + ctrlDelete _x; + }foreach _allControls; - _allControls = []; + _allControls = []; - private ["_ctrl", "_setting"]; - _setting = missionNamespace getvariable[QGVAR(settingFeedbackIcons), 0]; - if (_setting > 0) then { - { - // +19000 because we want to make certain we are using free IDCs.. - _ctrl = ((findDisplay 46) ctrlCreate ["RscPicture", _foreachIndex + 19000]); - _position = switch (_setting) do { - case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; - case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]}; - case TOP_LEFT_DOWN: {[LEFT_SIDE + (0.5 * ICON_WIDTH), Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; - case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]}; - default {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; - }; - _ctrl ctrlSetPosition _position; - _ctrl ctrlsetText (_x select 1); - _ctrl ctrlSetTextColor (_x select 2); - _ctrl ctrlCommit 0; - _allControls pushback _ctrl; - }foreach (missionNamespace getvariable [QGVAR(displayIconList),[]]); - }; - missionNamespace setvariable [QGVAR(displayIconListControls), _allControls]; + private ["_ctrl", "_setting"]; + _setting = missionNamespace getvariable[QGVAR(settingFeedbackIcons), 0]; + if (_setting > 0) then { + { + // +19000 because we want to make certain we are using free IDCs.. + _ctrl = ((findDisplay 46) ctrlCreate ["RscPicture", _foreachIndex + 19000]); + _position = switch (_setting) do { + case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; + case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]}; + case TOP_LEFT_DOWN: {[LEFT_SIDE + (0.5 * ICON_WIDTH), Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; + case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]}; + default {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; + }; + _ctrl ctrlSetPosition _position; + _ctrl ctrlsetText (_x select 1); + _ctrl ctrlSetTextColor (_x select 2); + _ctrl ctrlCommit 0; + _allControls pushback _ctrl; + }foreach (missionNamespace getvariable [QGVAR(displayIconList),[]]); + }; + missionNamespace setvariable [QGVAR(displayIconListControls), _allControls]; }; if (_show) then { - if ({(_x select 0 == _iconId)} count _list == 0) then { - _list pushback [_iconId, _icon, _color, time]; - } else { - { - if (_x select 0 == _iconId) exitwith { - _list set [_foreachIndex, [_iconId, _icon, _color, time]]; - }; - }foreach _list; - }; - missionNamespace setvariable [QGVAR(displayIconList), _list]; - call _refresh; + if ({(_x select 0 == _iconId)} count _list == 0) then { + _list pushback [_iconId, _icon, _color, time]; + } else { + { + if (_x select 0 == _iconId) exitwith { + _list set [_foreachIndex, [_iconId, _icon, _color, time]]; + }; + }foreach _list; + }; + missionNamespace setvariable [QGVAR(displayIconList), _list]; + call _refresh; - if (_timeAlive >= 0) then { - [{ + if (_timeAlive >= 0) then { + [{ [_this select 0, false, "", [0,0,0], 0] call FUNC(displayIcon); }, [_iconId], _timeAlive, _timeAlive] call EFUNC(common,waitAndExecute); - }; + }; } else { - if ({(_x select 0 == _iconId)} count _list == 1) then { - private "_newList"; - _newList = []; - { - if (_x select 0 != _iconId) then { - _newList pushback _x; - }; - }foreach _list; + if ({(_x select 0 == _iconId)} count _list == 1) then { + private "_newList"; + _newList = []; + { + if (_x select 0 != _iconId) then { + _newList pushback _x; + }; + }foreach _list; - missionNamespace setvariable [QGVAR(displayIconList), _newList]; - call _refresh; - }; + missionNamespace setvariable [QGVAR(displayIconList), _newList]; + call _refresh; + }; }; diff --git a/addons/common/functions/fnc_dumpArray.sqf b/addons/common/functions/fnc_dumpArray.sqf index a6f08cdd39..8a95172ea7 100644 --- a/addons/common/functions/fnc_dumpArray.sqf +++ b/addons/common/functions/fnc_dumpArray.sqf @@ -7,19 +7,19 @@ _var = _this select 0; _depth = _this select 1; _pad = ""; for "_i" from 0 to _depth do { - _pad = _pad + toString [9]; + _pad = _pad + toString [9]; }; _depth = _depth + 1; if(IS_ARRAY(_var)) then { - if((count _var) > 0) then { - diag_log text format["%1[", _pad]; - { - [_x, _depth] call FUNC(dumpArray); - } forEach _var; - diag_log text format["%1],", _pad]; - } else { - diag_log text format["%1[],", _pad]; - }; + if((count _var) > 0) then { + diag_log text format["%1[", _pad]; + { + [_x, _depth] call FUNC(dumpArray); + } forEach _var; + diag_log text format["%1],", _pad]; + } else { + diag_log text format["%1[],", _pad]; + }; } else { - diag_log text format["%1%2", _pad, [_var] call FUNC(formatVar)]; + diag_log text format["%1%2", _pad, [_var] call FUNC(formatVar)]; }; diff --git a/addons/common/functions/fnc_dumpPerformanceCounters.sqf b/addons/common/functions/fnc_dumpPerformanceCounters.sqf index b9afb8f7eb..acf81ff20a 100644 --- a/addons/common/functions/fnc_dumpPerformanceCounters.sqf +++ b/addons/common/functions/fnc_dumpPerformanceCounters.sqf @@ -6,42 +6,42 @@ diag_log text format["REGISTERED ACE PFH HANDLERS"]; diag_log text format["-------------------------------------------"]; if(!isNil "ACE_PFH_COUNTER") then { - { - private["_pfh"]; - _pfh = _x select 0; - diag_log text format["Registered PFH: id=%1, %1:%2", (_pfh select 0), (_pfh select 1), (_pfh select 2) ]; - } forEach ACE_PFH_COUNTER; + { + private["_pfh"]; + _pfh = _x select 0; + diag_log text format["Registered PFH: id=%1, %1:%2", (_pfh select 0), (_pfh select 1), (_pfh select 2) ]; + } forEach ACE_PFH_COUNTER; }; diag_log text format["ACE COUNTER RESULTS"]; diag_log text format["-------------------------------------------"]; { - private["_counterEntry", "_iter", "_total", "_count", "_delta", "_averageResult"]; - _counterEntry = _x; - _iter = 0; - _total = 0; - _count = 0; - _averageResult = 0; - if( (count _counterEntry) > 3) then { - // calc - { - if(_iter > 2) then { - _count = _count + 1; - _delta = (_x select 1) - (_x select 0); - - _total = _total + _delta; - }; - _iter = _iter + 1; - } forEach _counterEntry; - - // results - _averageResult = (_total / _count) * 1000; - - // dump results - diag_log text format["%1: Average: %2s / %3 = %4ms", (_counterEntry select 0), _total, _count, _averageResult]; - } else { - diag_log text format["%1: No results", (_counterEntry select 0) ]; - }; + private["_counterEntry", "_iter", "_total", "_count", "_delta", "_averageResult"]; + _counterEntry = _x; + _iter = 0; + _total = 0; + _count = 0; + _averageResult = 0; + if( (count _counterEntry) > 3) then { + // calc + { + if(_iter > 2) then { + _count = _count + 1; + _delta = (_x select 1) - (_x select 0); + + _total = _total + _delta; + }; + _iter = _iter + 1; + } forEach _counterEntry; + + // results + _averageResult = (_total / _count) * 1000; + + // dump results + diag_log text format["%1: Average: %2s / %3 = %4ms", (_counterEntry select 0), _total, _count, _averageResult]; + } else { + diag_log text format["%1: No results", (_counterEntry select 0) ]; + }; } forEach ACE_COUNTERS; /* @@ -49,21 +49,21 @@ diag_log text format["-------------------------------------------"]; diag_log text format["ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER"]; diag_log text format["-------------------------------------------"]; { - private["_delay"]; - _delay = _x select 2; - //if(_delay > 0) then { _delay = _delay / 1000; }; - - diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)]; + private["_delay"]; + _delay = _x select 2; + //if(_delay > 0) then { _delay = _delay / 1000; }; + + diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)]; } forEach ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER; // Dump PFH Trackers diag_log text format["ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER"]; diag_log text format["-------------------------------------------"]; { - private["_delta"]; - _delta = _x select 1; - //if(_delta > 0) then { _delta = _delta / 1000; }; - diag_log text format[" DELTA: %1s", _delta]; + private["_delta"]; + _delta = _x select 1; + //if(_delta > 0) then { _delta = _delta / 1000; }; + diag_log text format[" DELTA: %1s", _delta]; } forEach ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER; //{ diff --git a/addons/common/functions/fnc_getLightProperties.sqf b/addons/common/functions/fnc_getLightProperties.sqf new file mode 100644 index 0000000000..ee1884ac1b --- /dev/null +++ b/addons/common/functions/fnc_getLightProperties.sqf @@ -0,0 +1,63 @@ +/* + * Author: commy2 + * Read properties of given vehicles light. + * + * Arguments: + * 0: Object with lights (Object) + * 1: Light classname (String) + * + * Return Value: + * Stuff from config (Array) + * + */ +#include "script_component.hpp" + +private ["_vehicle", "_light"]; + +_vehicle = _this select 0; +_light = _this select 1; + +private "_config"; +_config = configFile >> "CfgVehicles" >> typeOf _vehicle >> "Reflectors" >> _light; + +private ["_intensity", "_position", "_direction", "_innerAngle", "_outerAngle"]; + +_intensity = getNumber (_config >> "intensity"); +_position = getText (_config >> "position"); +_direction = getText (_config >> "direction"); +_innerAngle = getNumber (_config >> "innerAngle"); +_outerAngle = getNumber (_config >> "outerAngle"); + +[_intensity, _position, _direction, _innerAngle, _outerAngle] + +/* +class Reflectors +{ + class Light_1 + { + color[] = {1000,1000,1100}; + ambient[] = {10,10,11}; + intensity = 5; + size = 1; + innerAngle = 90; + outerAngle = 130; + coneFadeCoef = 2; + position = "Light_1_pos"; + direction = "Light_1_dir"; + hitpoint = "Light_1_hitpoint"; + selection = "Light_1_hide"; + useFlare = 1; + flareSize = 0.9; + flareMaxDistance = 85; + class Attenuation + { + start = 0; + constant = 0; + linear = 0; + quadratic = 0.9; + hardLimitStart = 40; + hardLimitEnd = 60; + }; + }; +}; +*/ diff --git a/addons/common/functions/fnc_getLightPropertiesWeapon.sqf b/addons/common/functions/fnc_getLightPropertiesWeapon.sqf new file mode 100644 index 0000000000..d444654b5f --- /dev/null +++ b/addons/common/functions/fnc_getLightPropertiesWeapon.sqf @@ -0,0 +1,58 @@ +/* + * Author: commy2 + * Read properties of given flashlight. @todo, Can weapons themselves still have flashlights (no attachment)? + * + * Arguments: + * 0: A flashlight (String) + * + * Return Value: + * Stuff from config (Array) + * + */ +#include "script_component.hpp" + +private "_weapon"; + +_weapon = _this select 0; + +private "_config"; +_config = configFile >> "CfgWeapons" >> _weapon >> "ItemInfo" >> "FlashLight"; + +private ["_intensity", "_position", "_direction", "_innerAngle", "_outerAngle"]; + +_intensity = getNumber (_config >> "intensity"); +_position = getText (_config >> "position"); +_direction = getText (_config >> "direction"); +_innerAngle = getNumber (_config >> "innerAngle"); +_outerAngle = getNumber (_config >> "outerAngle"); + +[_intensity, _position, _direction, _innerAngle, _outerAngle] + +/* +class FlashLight +{ + color[] = {180,156,120}; + ambient[] = {0.9,0.78,0.6}; + intensity = 20; + size = 1; + innerAngle = 20; + outerAngle = 80; + coneFadeCoef = 5; + position = "flash dir"; + direction = "flash"; + useFlare = 1; + flareSize = 1.4; + flareMaxDistance = "100.0f"; + dayLight = 0; + class Attenuation + { + start = 0.5; + constant = 0; + linear = 0; + quadratic = 1.1; + hardLimitStart = 20; + hardLimitEnd = 30; + }; + scale[] = {0}; +}; +*/ diff --git a/addons/common/functions/fnc_getReflectorsWithSelections.sqf b/addons/common/functions/fnc_getReflectorsWithSelections.sqf new file mode 100644 index 0000000000..6d47943155 --- /dev/null +++ b/addons/common/functions/fnc_getReflectorsWithSelections.sqf @@ -0,0 +1,45 @@ +/* + * Author: commy2 + * + * Returns all lighting hitpoints of any vehicle. + * Note: These are actual selections that are affected by setHit and getHit, not getHitPointDamage or setHitpointDamage. + * They behave like having an armor value of 0. + * + * Arguments: + * 0: A vehicle, not the classname (Object) + * + * Return Value: + * The light names and selections (Array) + */ +#include "script_component.hpp" + +private ["_vehicle", "_config", "_hitpoints", "_selections"]; + +_vehicle = _this select 0; + +_config = configFile >> "CfgVehicles" >> typeOf _vehicle; + +_hitpoints = []; +_selections = []; + +// iterate through all parents +while {isClass _config} do { + private "_class"; + _class = _config >> "Reflectors"; + + for "_i" from 0 to (count _class - 1) do { + private ["_entry", "_selection"]; + + _entry = _class select _i; + _selection = getText (_entry >> "hitpoint"); + + if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then { + _hitpoints pushBack configName _entry; + _selections pushBack _selection; + }; + }; + + _config = inheritsFrom _config; +}; + +[_hitPoints, _selections] diff --git a/addons/common/functions/fnc_getTurnedOnLights.sqf b/addons/common/functions/fnc_getTurnedOnLights.sqf new file mode 100644 index 0000000000..6f0dc5a9bb --- /dev/null +++ b/addons/common/functions/fnc_getTurnedOnLights.sqf @@ -0,0 +1,36 @@ +/* + * Author: commy2 + * + * Returns all turned on lights of any vehicle or streetlamp. + * + * Arguments: + * 0: A vehicle, not the classname (Object) + * + * Return Value: + * All burning lights (Array) + */ +#include "script_component.hpp" + +private "_vehicle"; + +_vehicle = _this select 0; + +if (!isLightOn _vehicle) exitWith {[]}; + +private ["_reflectorsWithSelections", "_lights", "_hitpoints"]; + +_reflectorsWithSelections = [_vehicle] call FUNC(getReflectorsWithSelections); + +_lights = _reflectorsWithSelections select 0; +_hitpoints = _reflectorsWithSelections select 1; + +private "_turnedOnLights"; +_turnedOnLights = []; +{ + if (_vehicle getHit _x <= 0.9) then { + _turnedOnLights pushBack (_lights select _forEachIndex); + }; + +} forEach _hitpoints; + +_turnedOnLights diff --git a/addons/common/functions/fnc_lightIntensityFromObject.sqf b/addons/common/functions/fnc_lightIntensityFromObject.sqf new file mode 100644 index 0000000000..1a79ceb211 --- /dev/null +++ b/addons/common/functions/fnc_lightIntensityFromObject.sqf @@ -0,0 +1,99 @@ +/* + * Author: commy2 + * Calculate light intensity object 1 recieves from object 2 + * + * Arguments: + * 0: Object that recieves light (Object) + * 1: Object that emits light (Object) + * + * Return Value: + * Brightest light level + * + */ +#include "script_component.hpp" + +private ["_unit", "_lightSource"]; + +_unit = _this select 0; +_lightSource = _this select 1; + +private "_unitPos"; +_unitPos = _unit modelToWorld (_unit selectionPosition "spine3"); + +private "_lightLevel"; +_lightLevel = 0; + +if (_lightSource isKindOf "CAManBase") then { + // handle persons with flashlights + + private "_weapon"; + _weapon = currentWeapon _lightSource; + + if !(_lightSource isFlashlightOn _weapon) exitWith {}; + + private ["_flashlight", "_properties", "_intensity", "_innerAngle", "_outerAngle", "_position", "_direction", "_directionToUnit", "_distance", "_angle"]; + + _flashlight = switch (_weapon) do { + case (primaryWeapon _lightSource): { + primaryWeaponItems _lightSource select 1 + }; + case (secondaryWeapon _lightSource): { + secondaryWeaponItems _lightSource select 1 + }; + case (handgunWeapon _lightSource): { + handgunItems _lightSource select 1 + }; + default {""}; + }; + + _properties = [_flashlight] call FUNC(getLightPropertiesWeapon); + + _innerAngle = (_properties select 3) / 2; + _outerAngle = (_properties select 4) / 2; + + _position = _lightSource modelToWorld (_lightSource selectionPosition "rightHand"); + _direction = _lightSource weaponDirection _weapon; + + _directionToUnit = _position vectorFromTo _unitPos; + + _distance = _unitPos distance _position; + _angle = acos (_direction vectorDotProduct _directionToUnit); + + _lightLevel = (linearConversion [0, 30, _distance, 1, 0, true]) * (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true]); + +} else { + // handle any object, strcutures, cars, tanks, etc. + + private "_lights"; + _lights = [_lightSource] call FUNC(getTurnedOnLights); + + { + private ["_properties", "_intensity", "_innerAngle", "_outerAngle", "_position", "_direction", "_directionToUnit", "_distance", "_angle"]; + + _properties = [_lightSource, _x] call FUNC(getLightProperties); + + // @todo intensity affects range? + //_intensity = _properties select 0; + + _innerAngle = (_properties select 3) / 2; + _outerAngle = (_properties select 4) / 2; + + // get world position and direction + _position = _lightSource modelToWorld (_lightSource selectionPosition (_properties select 1)); + _direction = _lightSource modelToWorld (_lightSource selectionPosition (_properties select 2)); + + _direction = _position vectorFromTo _direction; + _directionToUnit = _position vectorFromTo _unitPos; + + _distance = _unitPos distance _position; + _angle = acos (_direction vectorDotProduct _directionToUnit); + + _lightLevel = _lightLevel max ((linearConversion [0, 30, _distance, 1, 0, true]) * (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true])); + + //systemChat format ["%1 %2", (linearConversion [0, 30, _distance, 1, 0, true]), (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true])]; + + } forEach _lights; + +}; + +_lightLevel diff --git a/addons/common/functions/fnc_logModEntries.sqf b/addons/common/functions/fnc_logModEntries.sqf index 827802ad3f..4b94c557bc 100644 --- a/addons/common/functions/fnc_logModEntries.sqf +++ b/addons/common/functions/fnc_logModEntries.sqf @@ -7,11 +7,11 @@ _configs = "true" configClasses (configFile >> _this); _entries = []; { - { - _name = toLower configName _x; - if !(_name in _entries) then { - diag_log text _name; - _entries pushBack _name; - }; - } forEach configProperties [_x, "toLower configName _x find 'ace' == 0", false]; + { + _name = toLower configName _x; + if !(_name in _entries) then { + diag_log text _name; + _entries pushBack _name; + }; + } forEach configProperties [_x, "toLower configName _x find 'ace' == 0", false]; } forEach _configs; diff --git a/addons/common/functions/fnc_numberToString.sqf b/addons/common/functions/fnc_numberToString.sqf new file mode 100644 index 0000000000..e0ebf1d77f --- /dev/null +++ b/addons/common/functions/fnc_numberToString.sqf @@ -0,0 +1,25 @@ +/* + * Author: commy2 + * + * Converts a number to a string without losing as much precission as str or format. + * + * Argument: + * 0: A number (Number) + * + * Return value: + * The number as string (String) + */ +#include "script_component.hpp" + +private ["_number", "_decimals"]; + +_number = _this select 0; + +_decimals = str (abs(_number) mod 1); +_decimals = toArray _decimals; +_decimals deleteAt 0; + +if (_number < 0) exitWith { + format ["-%1%2", floor abs(_number), toString _decimals]; +}; +format ["%1%2", floor _number, toString _decimals]; diff --git a/addons/common/functions/fnc_sendDisplayInformationTo.sqf b/addons/common/functions/fnc_sendDisplayInformationTo.sqf index f22894e057..33254fa81e 100644 --- a/addons/common/functions/fnc_sendDisplayInformationTo.sqf +++ b/addons/common/functions/fnc_sendDisplayInformationTo.sqf @@ -18,30 +18,30 @@ _type = [_this, 3, 0,[0]] call BIS_fnc_Param; _parameters = [_this, 4, [], [[]]] call BIS_fnc_Param; if (isPlayer _reciever) then { - if (!local _reciever) then { - [_this, QUOTE(FUNC(sendDisplayInformationTo)), _reciever, false] call EFUNC(common,execRemoteFnc); - } else { - if (isLocalized _title) then { - _title = localize _title; - }; - _localizationArray = [_title]; - { - _localizationArray pushback _x; - }foreach _parameters; - _title = format _localizationArray; + if (!local _reciever) then { + [_this, QUOTE(FUNC(sendDisplayInformationTo)), _reciever, false] call EFUNC(common,execRemoteFnc); + } else { + if (isLocalized _title) then { + _title = localize _title; + }; + _localizationArray = [_title]; + { + _localizationArray pushback _x; + }foreach _parameters; + _title = format _localizationArray; - { - if (isLocalized _x) then { - _localizationArray = [localize _x]; - { - _localizationArray pushback _x; - }foreach _parameters; + { + if (isLocalized _x) then { + _localizationArray = [localize _x]; + { + _localizationArray pushback _x; + }foreach _parameters; - _content set [_foreachIndex, format _localizationArray]; - }; + _content set [_foreachIndex, format _localizationArray]; + }; - }foreach _content; + }foreach _content; - [_title,_content,_type] call EFUNC(common,displayInformation); - }; + [_title,_content,_type] call EFUNC(common,displayInformation); + }; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_sendDisplayMessageTo.sqf b/addons/common/functions/fnc_sendDisplayMessageTo.sqf index 3c5b399659..e042f69939 100644 --- a/addons/common/functions/fnc_sendDisplayMessageTo.sqf +++ b/addons/common/functions/fnc_sendDisplayMessageTo.sqf @@ -18,29 +18,29 @@ _type = [_this, 3, 0,[0]] call BIS_fnc_Param; _parameters = [_this, 4, [], [[]]] call BIS_fnc_Param; if (isPlayer _reciever) then { - if (!local _reciever) then { - [_this, QUOTE(FUNC(sendDisplayMessageTo)), _reciever, false] call EFUNC(common,execRemoteFnc); - } else { + if (!local _reciever) then { + [_this, QUOTE(FUNC(sendDisplayMessageTo)), _reciever, false] call EFUNC(common,execRemoteFnc); + } else { - if (isLocalized _title) then { - _title = localize _title; - }; - if (isLocalized _content) then { - _content = localize _content; - }; + if (isLocalized _title) then { + _title = localize _title; + }; + if (isLocalized _content) then { + _content = localize _content; + }; - _localizationArray = [_title]; - { - _localizationArray pushback _x; - }foreach _parameters; - _title = format _localizationArray; + _localizationArray = [_title]; + { + _localizationArray pushback _x; + }foreach _parameters; + _title = format _localizationArray; - _localizationArray = [_content]; - { - _localizationArray pushback _x; - }foreach _parameters; - _content = format _localizationArray; + _localizationArray = [_content]; + { + _localizationArray pushback _x; + }foreach _parameters; + _content = format _localizationArray; - [_title,_content,_type] call EFUNC(common,displayMessage); - }; + [_title,_content,_type] call EFUNC(common,displayMessage); + }; }; \ No newline at end of file diff --git a/addons/common/functions/script_component.hpp b/addons/common/functions/script_component.hpp index d1032476b6..95b7e86461 100644 --- a/addons/common/functions/script_component.hpp +++ b/addons/common/functions/script_component.hpp @@ -1,13 +1,13 @@ #include "\z\ace\addons\common\script_component.hpp" -#define VALIDHASH(hash) (IS_ARRAY(hash) && {(count hash) >= 2} && {IS_ARRAY(hash select 0)} && {IS_ARRAY(hash select 1)}) -#define ERROR(msg) throw msg + format[" @ %1:%2", _callFrom, _lineNo] -#define HANDLECATCH diag_log text _exception; assert(exception=="") +#define VALIDHASH(hash) (IS_ARRAY(hash) && {(count hash) >= 2} && {IS_ARRAY(hash select 0)} && {IS_ARRAY(hash select 1)}) +#define ERROR(msg) throw msg + format[" @ %1:%2", _callFrom, _lineNo] +#define HANDLECATCH diag_log text _exception; assert(exception=="") -#define ERRORDATA(c) private ["_callFrom", "_lineNo"];\ - _callFrom = "";\ - _lineNo = -1;\ - if((count _this) > c) then {\ - _callFrom = _this select c;\ - _lineNo = _this select c+1;\ - }; \ No newline at end of file +#define ERRORDATA(c) private ["_callFrom", "_lineNo"];\ + _callFrom = "";\ + _lineNo = -1;\ + if((count _this) > c) then {\ + _callFrom = _this select c;\ + _lineNo = _this select c+1;\ + }; \ No newline at end of file diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 71d7bcd5a0..bcd2b149aa 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -1,351 +1,349 @@  - + - - - ACE-Team - ACE-Team - ACE-Team - ACE-Team - ACE-Team - ACE-Team - Команда ACE - ACE-Team - ACE-Team - ACE-Team - - - Save - Speichern - Guardar - Zapisz - Uložit - Sauvegarder - Сохранить - Salvar - Mentés - Salva - - - Cancel - Abbrechen - Cancelar - Anuluj - Zrušit - Annuler - Отмена - Cancelar - Mégse - Annulla - - - ACE Options - ACE Optionen - Opciones ACE - Opcje ACE - ACE Nastavení - ACE Options - ACE Настройки - Opções do ACE - ACE Opciók - Opzioni ACE - - - - N - N - N - N - S - N - С - N - É - N - - - NNE - NNO - NNE - NNE - SSV - NNE - ССВ - NNE - ÉÉK - NNE - - - NE - NO - NE - NE - SV - NE - СВ - NE - ÉK - NE - - - ENE - ONO - ENE - ENE - VSV - ENE - ВСВ - LNE - KÉK - ENE - - - E - O - E - E - V - E - В - L - K - E - - - ESE - OSO - ESE - ESE - VJV - ESE - ВЮВ - LSE - KDK - ESE - - - SE - SO - SE - SE - JV - SE - ЮВ - SE - DK - SE - - - SSE - SSO - SSE - SSE - JJV - SSE - ЮЮВ - SSE - DDK - SSE - - - S - S - S - S - J - S - Ю - S - D - S - - - SSW - SSW - SSO - SSW - JJZ - SSO - ЮЮЗ - SSO - DDNy - SSO - - - SW - SW - SO - SW - JZ - SO - ЮЗ - SO - DNy - SO - - - WSW - WSW - OSO - WSW - ZJZ - OSO - ЗЮЗ - OSO - NyDNy - OSO - - - W - W - O - W - Z - O - З - O - Ny - O - - - WNW - WNW - ONO - WNW - ZSZ - ONO - ЗСЗ - ONO - NyÉNy - ONO - - - NW - NW - NO - NW - SZ - NO - СЗ - NO - ÉNy - NO - - - NNW - NNW - NNO - NNW - SSZ - NNO - ССЗ - NNO - ÉÉNy - NNO - - - Action cancelled. - Aktion abgebrochen. - Acción cancelada. - Przerwano czynność - Akce přerušena - Action annulée. - Действие отменено. - Ação cancelada. - Művelet megszakítva. - Azione cancellata. - - - [ACE] Miscellaneous Items - [ACE] Verschiedenes - [ACE] Objetos varios - [ACE] Różne przedmioty - [ACE] Ostatní předměty - [ACE] Objets divers - [ACE] Различные предметы - [ACE] Itens diversos - [ACE] Egyéb tárgyak - [ACE] Oggetti vari - - - Disable Command Menu - Befehlsmenü ausschalten - Desactivar menú de mando - Wyłącz menu dowodzenia - Vypnout velící menu - Désactiver Menu Commande - Выключить командное меню - Parancsnoki menü kikapcsolása - - - Unknown - Unbekannt - Desconocido - Nieznany - Neznámý - Неизвестно - Ismeretlen - - - No Voice - Keine Stimme - Sin voz - Brak głosu - Žádný hlas - Без голоса - Nincs hang - - - Accept Requests - Akceptuj prośby - Aceptar Peticiones - - - Decline Requests - Ignoruj prośby - Rechazar Peticiones - - - Accept Requests send by other players. These can be requests to use / share equipment, perform certain actions. - Akceptuj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności. - Acepta Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones. - - - Decline Requests send by other players. These can be requests to use / share equipment, perform certain actions. - Ignoruj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności. - Rechazar Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones. - - - Feedback icons - - - Select the position of or disable the feedback icons on your screen. These icons will show to provide extra feedback on your character status and actions performed. - - - Progress bar location - - - Set the desired location of the progress bar on your screen. - - - Hint Background color - - - The color of the background from the ACE hints. - - - Hint text font color - - - The color of the text font from the ACE hints. This color is the default color for all text displayed through the ACE Hint system, if the hint text has no other color specified. - - - - Banana - - - A banana is an edible fruit, botanically a berry, produced by several kinds of large herbaceous flowering plants in the genus Musa. - - - + + + ACE-Team + ACE-Team + ACE-Team + ACE-Team + ACE-Team + ACE-Team + Команда ACE + ACE-Team + ACE-Team + ACE-Team + + + Save + Speichern + Guardar + Zapisz + Uložit + Sauvegarder + Сохранить + Salvar + Mentés + Salva + + + Cancel + Abbrechen + Cancelar + Anuluj + Zrušit + Annuler + Отмена + Cancelar + Mégse + Annulla + + + ACE Options + ACE Optionen + Opciones ACE + Opcje ACE + ACE Nastavení + ACE Options + ACE Настройки + Opções do ACE + ACE Opciók + Opzioni ACE + + + + N + N + N + N + S + N + С + N + É + N + + + NNE + NNO + NNE + NNE + SSV + NNE + ССВ + NNE + ÉÉK + NNE + + + NE + NO + NE + NE + SV + NE + СВ + NE + ÉK + NE + + + ENE + ONO + ENE + ENE + VSV + ENE + ВСВ + LNE + KÉK + ENE + + + E + O + E + E + V + E + В + L + K + E + + + ESE + OSO + ESE + ESE + VJV + ESE + ВЮВ + LSE + KDK + ESE + + + SE + SO + SE + SE + JV + SE + ЮВ + SE + DK + SE + + + SSE + SSO + SSE + SSE + JJV + SSE + ЮЮВ + SSE + DDK + SSE + + + S + S + S + S + J + S + Ю + S + D + S + + + SSW + SSW + SSO + SSW + JJZ + SSO + ЮЮЗ + SSO + DDNy + SSO + + + SW + SW + SO + SW + JZ + SO + ЮЗ + SO + DNy + SO + + + WSW + WSW + OSO + WSW + ZJZ + OSO + ЗЮЗ + OSO + NyDNy + OSO + + + W + W + O + W + Z + O + З + O + Ny + O + + + WNW + WNW + ONO + WNW + ZSZ + ONO + ЗСЗ + ONO + NyÉNy + ONO + + + NW + NW + NO + NW + SZ + NO + СЗ + NO + ÉNy + NO + + + NNW + NNW + NNO + NNW + SSZ + NNO + ССЗ + NNO + ÉÉNy + NNO + + + Action cancelled. + Aktion abgebrochen. + Acción cancelada. + Przerwano czynność + Akce přerušena + Action annulée. + Действие отменено. + Ação cancelada. + Művelet megszakítva. + Azione cancellata. + + + [ACE] Miscellaneous Items + [ACE] Verschiedenes + [ACE] Objetos varios + [ACE] Różne przedmioty + [ACE] Ostatní předměty + [ACE] Objets divers + [ACE] Различные предметы + [ACE] Itens diversos + [ACE] Egyéb tárgyak + [ACE] Oggetti vari + + + Disable Command Menu + Befehlsmenü ausschalten + Desactivar menú de mando + Wyłącz menu dowodzenia + Vypnout velící menu + Désactiver Menu Commande + Выключить командное меню + Parancsnoki menü kikapcsolása + + + Unknown + Unbekannt + Desconocido + Nieznany + Neznámý + Неизвестно + Ismeretlen + + + No Voice + Keine Stimme + Sin voz + Brak głosu + Žádný hlas + Без голоса + Nincs hang + + + Akceptuj prośby + Aceptar Peticiones + Accept Requests + + + Ignoruj prośby + Rechazar Peticiones + Decline Requests + + + Akceptuj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności. + Acepta Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones. + Accept Requests send by other players. These can be requests to use / share equipment, perform certain actions. + + + Ignoruj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności. + Rechazar Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones. + Decline Requests send by other players. These can be requests to use / share equipment, perform certain actions. + + + Feedback icons + + + Select the position of or disable the feedback icons on your screen. These icons will show to provide extra feedback on your character status and actions performed. + + + Progress bar location + + + Set the desired location of the progress bar on your screen. + + + Hint Background color + + + The color of the background from the ACE hints. + + + Hint text font color + + + The color of the text font from the ACE hints. This color is the default color for all text displayed through the ACE Hint system, if the hint text has no other color specified. + + + Banana + + + A banana is an edible fruit, botanically a berry, produced by several kinds of large herbaceous flowering plants in the genus Musa. + + \ No newline at end of file diff --git a/addons/disposable/script_component.hpp b/addons/disposable/script_component.hpp index 6d26a5431c..375e44147d 100644 --- a/addons/disposable/script_component.hpp +++ b/addons/disposable/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_ATTACH - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_ATTACH - #define DEBUG_SETTINGS DEBUG_SETTINGS_ATTACH + #define DEBUG_SETTINGS DEBUG_SETTINGS_ATTACH #endif #include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/dragging/functions/fnc_getWeight.sqf b/addons/dragging/functions/fnc_getWeight.sqf index 2b44bf90d9..871c49db89 100644 --- a/addons/dragging/functions/fnc_getWeight.sqf +++ b/addons/dragging/functions/fnc_getWeight.sqf @@ -1,20 +1,20 @@ /* - Name: AGM_Drag_fnc_GetWeight - - Author(s): - L-H, edited by commy2 + Name: AGM_Drag_fnc_GetWeight + + Author(s): + L-H, edited by commy2 - Description: - Returns the weight of a crate. - - Parameters: - 0: OBJECT - Crate to get weight of - - Returns: - NUMBER - Weight - - Example: - _weight = Crate1 call AGM_Drag_fnc_GetWeight; + Description: + Returns the weight of a crate. + + Parameters: + 0: OBJECT - Crate to get weight of + + Returns: + NUMBER - Weight + + Example: + _weight = Crate1 call AGM_Drag_fnc_GetWeight; */ #include "script_component.hpp" @@ -25,24 +25,24 @@ _object = _this select 0; private ["_totalWeight", "_fnc","_fnc_Extra"]; _totalWeight = 0; _fnc_Extra = { - private ["_weight", "_items"]; - _items = _this select 0; - _weight = 0; - { - _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> (_this select 2) >> "mass") * ((_items select 1) select _foreachIndex)); - } foreach (_items select 0); - - _weight + private ["_weight", "_items"]; + _items = _this select 0; + _weight = 0; + { + _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> (_this select 2) >> "mass") * ((_items select 1) select _foreachIndex)); + } foreach (_items select 0); + + _weight }; _fnc = { - private ["_weight", "_items"]; - _items = _this select 0; - _weight = 0; - { - _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> "mass") * ((_items select 1) select _foreachIndex)); - } foreach (_items select 0); - - _weight + private ["_weight", "_items"]; + _items = _this select 0; + _weight = 0; + { + _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> "mass") * ((_items select 1) select _foreachIndex)); + } foreach (_items select 0); + + _weight }; _totalWeight = ([getMagazineCargo _object, "CfgMagazines"] call _fnc); _totalWeight = _totalWeight + ([getItemCargo _object, "CfgWeapons", "ItemInfo"] call _fnc_Extra); diff --git a/addons/explosives/CfgACE_Triggers.hpp b/addons/explosives/CfgACE_Triggers.hpp index 789786bb4f..6319444cb2 100644 --- a/addons/explosives/CfgACE_Triggers.hpp +++ b/addons/explosives/CfgACE_Triggers.hpp @@ -1,54 +1,54 @@ class CfgACE_Triggers { - /* onPlace parameters: - 0: OBJECT - unit placing - 1: OBJECT - Placed explosive - 2: STRING - Magazine classname - 3: ARRAY - vars - Last Index: CfgACE_Triggers config of trigger type. - onSetup parameters: - 0: STRING - Magazine Classname - */ - class Command { - displayName = $STR_ACE_Explosives_clacker_displayName; - picture = PATHTOF(Data\UI\Clacker.paa); - onPlace = QUOTE(_this call FUNC(AddClacker);false); - requires[] = {"ACE_Clacker"}; - }; - class MK16_Transmitter:Command { - displayName = $STR_ACE_Explosives_MK16_displayName; - picture = PATHTOF(Data\UI\MK16_Reciever_ca.paa); - requires[] = {"ACE_M26_Clacker"}; - }; - class DeadManSwitch:Command { - displayName = $STR_ACE_Explosives_DeadManSwitch_displayName; - picture = PATHTOF(Data\UI\DeadmanSwitch.paa); - requires[] = {"ACE_DeadManSwitch"}; - }; - class Cellphone:Command { - displayName = $STR_ACE_Explosives_cellphone_displayName; - picture = PATHTOF(Data\UI\Cellphone_UI.paa); - onPlace = QUOTE(_this call FUNC(addCellphoneIED);false); - requires[] = {"ACE_Cellphone"}; - }; - class PressurePlate { - displayName = $STR_ACE_Explosives_PressurePlate; - picture = PATHTOF(Data\UI\PressurePlate.paa); - onPlace = "_dist=GetNumber(ConfigFile >> 'CfgMagazines' >> (_this select 2) >> 'ACE_Triggers' >> 'PressurePlate' >> 'digDistance');_ex=_this select 1;_ex setPosATL ((getPosATL _ex) vectorDiff ((VectorUp _ex) vectorCrossProduct [0,0,_dist]));false"; - }; - class IRSensor { - displayName = $STR_ACE_Explosives_IRSensor; - picture = PATHTOF(Data\UI\PressurePlate.paa); - onPlace = "false"; - }; - class Timer { - displayName = $STR_ACE_Explosives_timerName; - picture = PATHTOF(data\UI\Timer.paa); - onPlace = QUOTE([ARR_2(_this select 1,(_this select 3) select 0)] call FUNC(startTimer);false); - onSetup = QUOTE(_this call FUNC(openTimerSetUI);true); - }; - class Tripwire { - displayName = $STR_ACE_Explosives_TripWire; - picture = PATHTOF(Data\UI\Tripwire.paa); - onPlace = "false"; - }; +/* onPlace parameters: +0: OBJECT - unit placing +1: OBJECT - Placed explosive +2: STRING - Magazine classname +3: ARRAY - vars +Last Index: CfgACE_Triggers config of trigger type. +onSetup parameters: +0: STRING - Magazine Classname +*/ + class Command { + displayName = $STR_ACE_Explosives_clacker_displayName; + picture = PATHTOF(Data\UI\Clacker.paa); + onPlace = QUOTE(_this call FUNC(AddClacker);false); + requires[] = {"ACE_Clacker"}; + }; + class MK16_Transmitter:Command { + displayName = $STR_ACE_Explosives_MK16_displayName; + picture = PATHTOF(Data\UI\MK16_Reciever_ca.paa); + requires[] = {"ACE_M26_Clacker"}; + }; + class DeadManSwitch:Command { + displayName = $STR_ACE_Explosives_DeadManSwitch_displayName; + picture = PATHTOF(Data\UI\DeadmanSwitch.paa); + requires[] = {"ACE_DeadManSwitch"}; + }; + class Cellphone:Command { + displayName = $STR_ACE_Explosives_cellphone_displayName; + picture = PATHTOF(Data\UI\Cellphone_UI.paa); + onPlace = QUOTE(_this call FUNC(addCellphoneIED);false); + requires[] = {"ACE_Cellphone"}; + }; + class PressurePlate { + displayName = $STR_ACE_Explosives_PressurePlate; + picture = PATHTOF(Data\UI\PressurePlate.paa); + onPlace = "_dist=GetNumber(ConfigFile >> 'CfgMagazines' >> (_this select 2) >> 'ACE_Triggers' >> 'PressurePlate' >> 'digDistance');_ex=_this select 1;_ex setPosATL ((getPosATL _ex) vectorDiff ((VectorUp _ex) vectorCrossProduct [0,0,_dist]));false"; + }; + class IRSensor { + displayName = $STR_ACE_Explosives_IRSensor; + picture = PATHTOF(Data\UI\PressurePlate.paa); + onPlace = "false"; + }; + class Timer { + displayName = $STR_ACE_Explosives_timerName; + picture = PATHTOF(data\UI\Timer.paa); + onPlace = QUOTE([ARR_2(_this select 1,(_this select 3) select 0)] call FUNC(startTimer);false); + onSetup = QUOTE(_this call FUNC(openTimerSetUI);true); + }; + class Tripwire { + displayName = $STR_ACE_Explosives_TripWire; + picture = PATHTOF(Data\UI\Tripwire.paa); + onPlace = "false"; + }; }; diff --git a/addons/explosives/CfgAmmo.hpp b/addons/explosives/CfgAmmo.hpp index 4a6e898886..fc9e4712dc 100644 --- a/addons/explosives/CfgAmmo.hpp +++ b/addons/explosives/CfgAmmo.hpp @@ -1,78 +1,78 @@ class CfgAmmo { - // All explosive based Ammo classes. These are all listed in case they become required. - class Default; + // All explosive based Ammo classes. These are all listed in case they become required. + class Default; - class TimeBombCore:Default { - ACE_DefuseTime = 5; - }; - /* - class BoundingMineCore:TimeBombCore; - class BoundingMineBase:BoundingMineCore; - class APERSBoundingMine_Range_Ammo:BoundingMineBase; + class TimeBombCore:Default { + ACE_DefuseTime = 5; + }; + /* + class BoundingMineCore:TimeBombCore; + class BoundingMineBase:BoundingMineCore; + class APERSBoundingMine_Range_Ammo:BoundingMineBase; - class MineCore: TimeBombCore; - class MineBase:MineCore; - class APERSMine_Range_Ammo:MineBase; - class ATMine_Range_Ammo:MineBase; + class MineCore: TimeBombCore; + class MineBase:MineCore; + class APERSMine_Range_Ammo:MineBase; + class ATMine_Range_Ammo:MineBase; - class UnderwaterMine_Range_Ammo:MineBase; - class UnderwaterMineAB_Range_Ammo:UnderwaterMine_Range_Ammo; - class UnderwaterMinePDM_Range_Ammo:UnderwaterMine_Range_Ammo; + class UnderwaterMine_Range_Ammo:MineBase; + class UnderwaterMineAB_Range_Ammo:UnderwaterMine_Range_Ammo; + class UnderwaterMinePDM_Range_Ammo:UnderwaterMine_Range_Ammo; - class DirectionalBombCore:TimeBombCore; - class DirectionalBombBase:DirectionalBombCore; - class APERSTripMine_Wire_Ammo:DirectionalBombBase; + class DirectionalBombCore:TimeBombCore; + class DirectionalBombBase:DirectionalBombCore; + class APERSTripMine_Wire_Ammo:DirectionalBombBase; - class SLAMDirectionalMine_Wire_Ammo:DirectionalBombBase; + class SLAMDirectionalMine_Wire_Ammo:DirectionalBombBase; - class PipeBombCore: TimeBombCore; - class PipeBombBase:PipeBombCore; - */ - class DirectionalBombBase; - class ClaymoreDirectionalMine_Remote_Ammo:DirectionalBombBase{ - ACE_Explosive = "ClaymoreDirectionalMine_Remote_Ammo_Scripted"; - soundActivation[] = {"",0,0,0}; - soundDeactivation[] = {"",0,0,0}; - }; - //class ClaymoreDirectionalMine_Remote_Ammo_Scripted:ClaymoreDirectionalMine_Remote_Ammo; + class PipeBombCore: TimeBombCore; + class PipeBombBase:PipeBombCore; + */ + class DirectionalBombBase; + class ClaymoreDirectionalMine_Remote_Ammo:DirectionalBombBase{ + ACE_Explosive = "ClaymoreDirectionalMine_Remote_Ammo_Scripted"; + soundActivation[] = {"",0,0,0}; + soundDeactivation[] = {"",0,0,0}; + }; + //class ClaymoreDirectionalMine_Remote_Ammo_Scripted:ClaymoreDirectionalMine_Remote_Ammo; - class SLAMDirectionalMine_Wire_Ammo:DirectionalBombBase{ - indirectHitRange = 20; - ACE_explodeOnDefuse = 1; - }; - class SLAMDirectionalMine_Command_Ammo:SLAMDirectionalMine_Wire_Ammo { - mineTrigger = "RemoteTrigger"; - ACE_explodeOnDefuse = 0; - }; - class SLAMDirectionalMine_Timer_Ammo:SLAMDirectionalMine_Wire_Ammo { - mineTrigger = "TimeTrigger"; - ACE_explodeOnDefuse = 0; - }; - class SLAMDirectionalMine_Magnetic_Ammo:SLAMDirectionalMine_Wire_Ammo { - mineTrigger = "MagneticTrigger"; - }; + class SLAMDirectionalMine_Wire_Ammo:DirectionalBombBase{ + indirectHitRange = 20; + ACE_explodeOnDefuse = 1; + }; + class SLAMDirectionalMine_Command_Ammo:SLAMDirectionalMine_Wire_Ammo { + mineTrigger = "RemoteTrigger"; + ACE_explodeOnDefuse = 0; + }; + class SLAMDirectionalMine_Timer_Ammo:SLAMDirectionalMine_Wire_Ammo { + mineTrigger = "TimeTrigger"; + ACE_explodeOnDefuse = 0; + }; + class SLAMDirectionalMine_Magnetic_Ammo:SLAMDirectionalMine_Wire_Ammo { + mineTrigger = "MagneticTrigger"; + }; - class PipeBombBase; - class DemoCharge_Remote_Ammo:PipeBombBase{ - ACE_Explosive = "DemoCharge_Remote_Ammo_Scripted"; - soundActivation[] = {"",0,0,0}; - soundDeactivation[] = {"",0,0,0}; - hit = 500; - indirectHit = 500; - indirectHitRange = 7; - }; - class SatchelCharge_Remote_Ammo:PipeBombBase{ - ACE_Explosive = "SatchelCharge_Remote_Ammo_Scripted"; - soundActivation[] = {"",0,0,0}; - soundDeactivation[] = {"",0,0,0}; - }; - /* - class DemoCharge_Remote_Ammo_Scripted:DemoCharge_Remote_Ammo; - class SatchelCharge_Remote_Ammo_Scripted:SatchelCharge_Remote_Ammo; + class PipeBombBase; + class DemoCharge_Remote_Ammo:PipeBombBase{ + ACE_Explosive = "DemoCharge_Remote_Ammo_Scripted"; + soundActivation[] = {"",0,0,0}; + soundDeactivation[] = {"",0,0,0}; + hit = 500; + indirectHit = 500; + indirectHitRange = 7; + }; + class SatchelCharge_Remote_Ammo:PipeBombBase{ + ACE_Explosive = "SatchelCharge_Remote_Ammo_Scripted"; + soundActivation[] = {"",0,0,0}; + soundDeactivation[] = {"",0,0,0}; + }; + /* + class DemoCharge_Remote_Ammo_Scripted:DemoCharge_Remote_Ammo; + class SatchelCharge_Remote_Ammo_Scripted:SatchelCharge_Remote_Ammo; TODO: Configure IEDs to use the system. - class IEDLandBig_Remote_Ammo:PipeBombBase{ - triggerWhenDestroyed = 1; + class IEDLandBig_Remote_Ammo:PipeBombBase{ + triggerWhenDestroyed = 1; }; class IEDLandSmall_Remote_Ammo:PipeBombBase{ triggerWhenDestroyed = 1; diff --git a/addons/explosives/CfgEventHandlers.hpp b/addons/explosives/CfgEventHandlers.hpp index cefc2fe389..8d0b110935 100644 --- a/addons/explosives/CfgEventHandlers.hpp +++ b/addons/explosives/CfgEventHandlers.hpp @@ -1,20 +1,20 @@ class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); - }; + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; }; class Extended_PostInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); - }; + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; }; /* TODO: Move the addEventHandlers out of PostInit into here or separate eventHandlers, - to enable them on all units, so unit switching works for explosives properly. +to enable them on all units, so unit switching works for explosives properly. class Extended_Init_EventHandlers { - class CAManBase { - init = ""; - } +class CAManBase { +init = ""; +} } */ diff --git a/addons/explosives/CfgMagazines.hpp b/addons/explosives/CfgMagazines.hpp index 51c85e607f..b89a207992 100644 --- a/addons/explosives/CfgMagazines.hpp +++ b/addons/explosives/CfgMagazines.hpp @@ -1,127 +1,127 @@ class CfgMagazines { - class CA_Magazine; - class ATMine_Range_Mag:CA_Magazine{ - ACE_Placeable = 1; - useAction = 0; - ACE_SetupObject = "ACE_Explosives_Place_ATMine"; // CfgVehicle class for setup object. - ACE_DelayTime = 2.5; - class ACE_Triggers { - SupportedTriggers[] = {"PressurePlate"}; - class PressurePlate { - digDistance = 0.1; - }; + class CA_Magazine; + class ATMine_Range_Mag:CA_Magazine{ + ACE_Placeable = 1; + useAction = 0; + ACE_SetupObject = "ACE_Explosives_Place_ATMine"; // CfgVehicle class for setup object. + ACE_DelayTime = 2.5; + class ACE_Triggers { + SupportedTriggers[] = {"PressurePlate"}; + class PressurePlate { + digDistance = 0.1; + }; + }; }; - }; - class APERSBoundingMine_Range_Mag:ATMine_Range_Mag{ - ACE_SetupObject = "ACE_Explosives_Place_APERSBoundingMine"; - class ACE_Triggers { - SupportedTriggers[] = {"PressurePlate"}; - class PressurePlate { - digDistance = 0.075; - }; + class APERSBoundingMine_Range_Mag:ATMine_Range_Mag{ + ACE_SetupObject = "ACE_Explosives_Place_APERSBoundingMine"; + class ACE_Triggers { + SupportedTriggers[] = {"PressurePlate"}; + class PressurePlate { + digDistance = 0.075; + }; + }; }; - }; - class APERSMine_Range_Mag:ATMine_Range_Mag{ - ACE_SetupObject = "ACE_Explosives_Place_APERSMine"; - class ACE_Triggers { - SupportedTriggers[] = {"PressurePlate"}; - class PressurePlate { - digDistance = 0.05; - }; + class APERSMine_Range_Mag:ATMine_Range_Mag{ + ACE_SetupObject = "ACE_Explosives_Place_APERSMine"; + class ACE_Triggers { + SupportedTriggers[] = {"PressurePlate"}; + class PressurePlate { + digDistance = 0.05; + }; + }; }; - }; - class APERSTripMine_Wire_Mag:ATMine_Range_Mag{ - ACE_SetupObject = "ACE_Explosives_Place_APERSTripwireMine"; - class ACE_Triggers { - SupportedTriggers[] = {"Tripwire"}; - class Tripwire; + class APERSTripMine_Wire_Mag:ATMine_Range_Mag{ + ACE_SetupObject = "ACE_Explosives_Place_APERSTripwireMine"; + class ACE_Triggers { + SupportedTriggers[] = {"Tripwire"}; + class Tripwire; + }; }; - }; - class ClaymoreDirectionalMine_Remote_Mag:CA_Magazine{ - ACE_Placeable = 1; - useAction = 0; - ACE_SetupObject = "ACE_Explosives_Place_Claymore"; - ACE_DelayTime = 1.5; - class ACE_Triggers { - SupportedTriggers[] = {"Command"}; - class Command { - FuseTime = 0.5; - }; + class ClaymoreDirectionalMine_Remote_Mag:CA_Magazine{ + ACE_Placeable = 1; + useAction = 0; + ACE_SetupObject = "ACE_Explosives_Place_Claymore"; + ACE_DelayTime = 1.5; + class ACE_Triggers { + SupportedTriggers[] = {"Command"}; + class Command { + FuseTime = 0.5; + }; + }; }; - }; - class SatchelCharge_Remote_Mag:CA_Magazine{ - ACE_Placeable = 1; - useAction = 0; - ACE_SetupObject = "ACE_Explosives_Place_SatchelCharge"; - ACE_DelayTime = 1; - class ACE_Triggers { - SupportedTriggers[] = {"Timer","Command", "MK16_Transmitter", "DeadmanSwitch"}; - class Timer { - FuseTime = 0.5; - }; - class Command { - FuseTime = 0.5; - }; - class MK16_Transmitter:Command{}; - class DeadmanSwitch:Command{}; + class SatchelCharge_Remote_Mag:CA_Magazine{ + ACE_Placeable = 1; + useAction = 0; + ACE_SetupObject = "ACE_Explosives_Place_SatchelCharge"; + ACE_DelayTime = 1; + class ACE_Triggers { + SupportedTriggers[] = {"Timer","Command", "MK16_Transmitter", "DeadmanSwitch"}; + class Timer { + FuseTime = 0.5; + }; + class Command { + FuseTime = 0.5; + }; + class MK16_Transmitter:Command{}; + class DeadmanSwitch:Command{}; + }; + }; + class DemoCharge_Remote_Mag:SatchelCharge_Remote_Mag{ + ACE_SetupObject = "ACE_Explosives_Place_DemoCharge"; + model = "\A3\Weapons_F\explosives\c4_charge_small_d"; }; - }; - class DemoCharge_Remote_Mag:SatchelCharge_Remote_Mag{ - ACE_SetupObject = "ACE_Explosives_Place_DemoCharge"; - model = "\A3\Weapons_F\explosives\c4_charge_small_d"; - }; - class SLAMDirectionalMine_Wire_Mag: ATMine_Range_Mag{ - ACE_SetupObject = "ACE_Explosives_Place_SLAM"; - class ACE_Triggers { - SupportedTriggers[] = {"IRSensor","PressurePlate","Timer","Command"}; - class PressurePlate{ - displayName = $STR_ACE_Explosives_SLAME_Magnetic; - digDistance = 0; - ammo = "SLAMDirectionalMine_Magnetic_Ammo"; - pitch = 90; - }; - class IRSensor{ - displayName = $STR_ACE_Explosives_SLAME_IRSensor; - }; - class Timer { - ammo = "SLAMDirectionalMine_Timer_Ammo"; - }; - class Command { - ammo = "SLAMDirectionalMine_Command_Ammo"; - fuseTime = 0.5; - }; + class SLAMDirectionalMine_Wire_Mag: ATMine_Range_Mag{ + ACE_SetupObject = "ACE_Explosives_Place_SLAM"; + class ACE_Triggers { + SupportedTriggers[] = {"IRSensor","PressurePlate","Timer","Command"}; + class PressurePlate{ + displayName = $STR_ACE_Explosives_SLAME_Magnetic; + digDistance = 0; + ammo = "SLAMDirectionalMine_Magnetic_Ammo"; + pitch = 90; + }; + class IRSensor{ + displayName = $STR_ACE_Explosives_SLAME_IRSensor; + }; + class Timer { + ammo = "SLAMDirectionalMine_Timer_Ammo"; + }; + class Command { + ammo = "SLAMDirectionalMine_Command_Ammo"; + fuseTime = 0.5; + }; + }; }; - }; - class IEDUrbanBig_Remote_Mag: DemoCharge_Remote_Mag { - ACE_SetupObject = "ACE_Explosives_Place_IEDUrbanBig"; - class ACE_Triggers { - SupportedTriggers[] = {"Command","DeadmanSwitch", "Cellphone"}; - class Command { - FuseTime = 0.5; - }; - class DeadmanSwitch:Command{}; - class Cellphone:Command{}; + class IEDUrbanBig_Remote_Mag: DemoCharge_Remote_Mag { + ACE_SetupObject = "ACE_Explosives_Place_IEDUrbanBig"; + class ACE_Triggers { + SupportedTriggers[] = {"Command","DeadmanSwitch", "Cellphone"}; + class Command { + FuseTime = 0.5; + }; + class DeadmanSwitch:Command{}; + class Cellphone:Command{}; + }; }; - }; - class IEDLandBig_Remote_Mag: IEDUrbanBig_Remote_Mag{ - ACE_SetupObject = "ACE_Explosives_Place_IEDLandBig"; - }; - class IEDUrbanSmall_Remote_Mag: DemoCharge_Remote_Mag { - ACE_SetupObject = "ACE_Explosives_Place_IEDUrbanSmall"; - class ACE_Triggers { - SupportedTriggers[] = {"Command","DeadmanSwitch", "Cellphone"}; - class Command { - FuseTime = 0.5; - }; - class DeadmanSwitch:Command{}; - class Cellphone:Command{}; + class IEDLandBig_Remote_Mag: IEDUrbanBig_Remote_Mag{ + ACE_SetupObject = "ACE_Explosives_Place_IEDLandBig"; + }; + class IEDUrbanSmall_Remote_Mag: DemoCharge_Remote_Mag { + ACE_SetupObject = "ACE_Explosives_Place_IEDUrbanSmall"; + class ACE_Triggers { + SupportedTriggers[] = {"Command","DeadmanSwitch", "Cellphone"}; + class Command { + FuseTime = 0.5; + }; + class DeadmanSwitch:Command{}; + class Cellphone:Command{}; + }; + }; + class IEDLandSmall_Remote_Mag: IEDUrbanSmall_Remote_Mag { + ACE_SetupObject = "ACE_Explosives_Place_IEDLandSmall"; }; - }; - class IEDLandSmall_Remote_Mag: IEDUrbanSmall_Remote_Mag { - ACE_SetupObject = "ACE_Explosives_Place_IEDLandSmall"; - }; }; diff --git a/addons/explosives/CfgModule.hpp b/addons/explosives/CfgModule.hpp index fe467cbb53..b4f7b65a83 100644 --- a/addons/explosives/CfgModule.hpp +++ b/addons/explosives/CfgModule.hpp @@ -1,44 +1,44 @@ class Module_F; class ACE_ModuleExplosive: Module_F { - author = "$STR_ACE_Common_ACETeam"; - category = "ACE"; - displayName = "Explosive System"; - function = QUOTE(FUNC(module)); - scope = 2; - isGlobal = 1; - icon = PATHTOF(UI\Icon_Module_Explosives_ca.paa); - class Arguments { - class RequireSpecialist { - displayName = "Require specialists?"; - description = "Require explosive specialists to disable explosives? Default: No"; - typeName = "BOOL"; - class values { - class Yes { - name = "Yes"; - value = 1; + author = "$STR_ACE_Common_ACETeam"; + category = "ACE"; + displayName = "Explosive System"; + function = QUOTE(FUNC(module)); + scope = 2; + isGlobal = 1; + icon = PATHTOF(UI\Icon_Module_Explosives_ca.paa); + class Arguments { + class RequireSpecialist { + displayName = "Require specialists?"; + description = "Require explosive specialists to disable explosives? Default: No"; + typeName = "BOOL"; + class values { + class Yes { + name = "Yes"; + value = 1; + }; + class No { + default = 1; + name = "No"; + value = 0; + }; + }; }; - class No { - default = 1; - name = "No"; - value = 0; + class PunishNonSpecialists { + displayName = "Punish non-specialists?"; + description = "Increase the time it takes to complete actions for non-specialists? Default: Yes"; + typeName = "BOOL"; + class values { + class Yes { + default = 1; + name = "Yes"; + value = 1; + }; + class No { + name = "No"; + value = 0; + }; + }; }; - }; }; - class PunishNonSpecialists { - displayName = "Punish non-specialists?"; - description = "Increase the time it takes to complete actions for non-specialists? Default: Yes"; - typeName = "BOOL"; - class values { - class Yes { - default = 1; - name = "Yes"; - value = 1; - }; - class No { - name = "No"; - value = 0; - }; - }; - }; - }; }; diff --git a/addons/explosives/CfgVehicles.hpp b/addons/explosives/CfgVehicles.hpp index af2ed90cb6..30e1ff151d 100644 --- a/addons/explosives/CfgVehicles.hpp +++ b/addons/explosives/CfgVehicles.hpp @@ -1,275 +1,327 @@ class CfgVehicles { - class Man; - - class CAManBase: Man { - class ACE_SelfActions { - class ACE_Explosives { - displayName = $STR_ACE_Explosives_Menu; - condition = QUOTE(!(_player getVariable [ARR_2('ace_explosives_PlantingExplosive',false)])); - statement = ""; - exceptions[] = {"isNotSwimming"}; - showDisabled = 1; - priority = 4; - icon = PATHTOF(UI\Explosives_Menu_ca.paa); - hotkey = "X"; - //Sub-menu items - class ACE_Detonate { - displayName = $STR_ACE_Explosives_Detonate; - condition = QUOTE([_player] call FUNC(canDetonate)); - statement = QUOTE([_player] call FUNC(openTransmitterUI);); - exceptions[] = {"isNotSwimming"}; - showDisabled = 1; - icon = PATHTOF(UI\Explosives_Menu_ca.paa); - priority = 2; - hotkey = "T"; + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_Explosives { + displayName = $STR_ACE_Explosives_Menu; + condition = QUOTE(!(_player getVariable [ARR_2('ace_explosives_PlantingExplosive',false)])); + statement = ""; + exceptions[] = {"isNotSwimming", "isNotInside"}; + showDisabled = 1; + priority = 4; + icon = PATHTOF(UI\Explosives_Menu_ca.paa); + hotkey = "X"; + //Sub-menu items + class ACE_Detonate { + displayName = $STR_ACE_Explosives_Detonate; + condition = QUOTE([_player] call FUNC(canDetonate)); + statement = ""; + insertChildren = QUOTE([_player] call FUNC(addTransmitterActions);); + exceptions[] = {"isNotSwimming", "isNotInside"}; + showDisabled = 1; + icon = PATHTOF(UI\Explosives_Menu_ca.paa); + priority = 2; + hotkey = "T"; + }; + class ACE_Place { + displayName = $STR_ACE_Explosives_Place; + condition = QUOTE((vehicle _player == _player) and {[_player] call FUNC(hasExplosives)}); + statement = ""; + insertChildren = QUOTE([_player] call FUNC(addExplosiveActions);); + exceptions[] = {"isNotSwimming"}; + showDisabled = 1; + icon = PATHTOF(UI\Place_Explosive_ca.paa); + priority = 1; + hotkey = "P"; + }; + class ACE_Cellphone { + displayName = $STR_ACE_Explosives_cellphone_displayName; + condition = "('ACE_Cellphone' in (items ace_player))"; + statement = "closeDialog 0;createDialog 'Rsc_ACE_PhoneInterface';"; + exceptions[] = {"isNotSwimming", "isNotInside"}; + showDisabled = 0; + icon = PATHTOF(Data\UI\Cellphone_UI.paa); + priority = 0.8; + }; + }; }; - class ACE_Place { - displayName = $STR_ACE_Explosives_Place; - condition = QUOTE((vehicle _player == _player) and {[_player] call FUNC(hasExplosives)}); - statement = QUOTE([_player] call FUNC(openPlaceUI);); - exceptions[] = {"isNotSwimming"}; - showDisabled = 1; - icon = PATHTOF(UI\Place_Explosive_ca.paa); - priority = 1; - hotkey = "P"; + }; + + class Items_base_F; + class ACE_DefuseObject: Items_base_F { + XEH_ENABLED; + author = "ACE"; + _generalMacro = "ACE_DefuseObject"; + displayName = "ACE Defuse Helper"; + mapSize = 0.2; + icon = "iconObject_1x2"; + model = "\A3\Weapons_f\dummyweapon.p3d"; + scope = 2; + scopeCurator = 1; + vehicleClass = "Cargo"; + class ACE_Actions { + class ACE_MainActions { + selection = ""; + distance = 5; + condition = "true"; + class ACE_Defuse { + displayName = $STR_ACE_Explosives_Defuse; + condition = QUOTE([ARR_2(_player,_target)] call FUNC(canDefuse)); + statement = QUOTE([ARR_2(_player,_target)] call FUNC(startDefuse);); + exceptions[] = {"isNotSwimming"}; + showDisabled = 0; + icon = PATHTOF(UI\Defuse_ca.paa); + priority = 0.8; + hotkey = "F"; + distance = 5; + }; + }; }; - class ACE_Defuse { - displayName = $STR_ACE_Explosives_Defuse; - condition = QUOTE([_player] call FUNC(canDefuse)); - statement = QUOTE([ARR_2(_player,EGVAR(Interaction,Target))] call FUNC(startDefuse);); - exceptions[] = {"isNotSwimming"}; - showDisabled = 0; - icon = PATHTOF(UI\Defuse_ca.paa); - priority = 0.8; - hotkey = "F"; + }; + class ACE_Explosives_Place: Items_base_F { + XEH_ENABLED; + author = "ACE"; + _generalMacro = "ACE_Explosives_Place"; + displayName = "Multi-meter"; + mapSize = 0.2; + icon = "iconObject_1x2"; + model = "\A3\Structures_F\Items\Tools\MultiMeter_F.p3d"; + scope = 2; + scopeCurator = 1; + vehicleClass = "Cargo"; + ACE_offset[] = {0,0,0}; + class ACE_Actions { + class ACE_MainActions { + selection = ""; + distance = 5; + condition = "true"; + class ACE_SetTrigger { + selection = ""; + displayName = "$STR_ACE_Explosives_TriggerMenu"; + distance = 4; + condition = "true"; + statement = ""; + insertChildren = QUOTE([ARR_3(_target getVariable QUOTE(QGVAR(class)),_target,_player)] call FUNC(addTriggerActions);); + showDisabled = 0; + exceptions[] = {}; + priority = 5; + icon = QUOTE(PATHTOF(UI\Explosives_Menu_ca.paa)); + }; + class ACE_PickUp { + selection = ""; + displayName = "$STR_ACE_Explosives_Pickup"; + distance = 4; + condition = "true"; + statement = QUOTE([ARR_2(_player,_target getVariable QUOTE(QGVAR(class)))] call EFUNC(common,addToInventory);deleteVehicle _target;); + showDisabled = 0; + exceptions[] = {}; + priority = 5; + icon = "\A3\ui_f\data\IGUI\Cfg\Actions\Obsolete\ui_action_takemine_ca.paa"; + }; + }; }; - class ACE_Cellphone { - displayName = $STR_ACE_Explosives_cellphone_displayName; - condition = "('ACE_Cellphone' in (items ace_player))"; - statement = "closeDialog 0;createDialog 'Rsc_ACE_PhoneInterface';"; - exceptions[] = {"isNotSwimming"}; - showDisabled = 0; - icon = PATHTOF(Data\UI\Cellphone_UI.paa); - priority = 0.8; + }; + + class ACE_Explosives_Place_DemoCharge:ACE_Explosives_Place { + displayName = "Demo Charge"; + model = "\A3\Weapons_F\explosives\c4_charge_small_d"; + }; + class ACE_Explosives_Place_APERSBoundingMine:ACE_Explosives_Place { + displayName = "APERS Bounding Mine"; + model = "\A3\Weapons_F\explosives\mine_AP_bouncing"; + }; + class ACE_Explosives_Place_APERSMine:ACE_Explosives_Place { + displayName = "APERS Mine"; + model = "\A3\Weapons_F\explosives\mine_ap"; + }; + class ACE_Explosives_Place_APERSTripwireMine:ACE_Explosives_Place { + displayName = "APERS Tripwire Mine"; + model = "\A3\Weapons_F\explosives\mine_AP_tripwire"; + ACE_offset[] = {1,0,0}; + }; + + class ACE_Explosives_Place_ATMine:ACE_Explosives_Place { + displayName = "AT Mine"; + model = "\A3\Weapons_f\Explosives\mine_at"; + }; + + class ACE_Explosives_Place_Claymore:ACE_Explosives_Place { + displayName = "Claymore"; + model = "\A3\Weapons_F\explosives\mine_AP_miniclaymore"; + }; + + class ACE_Explosives_Place_SatchelCharge:ACE_Explosives_Place { + displayName = "Satchel Charge"; + model = "\A3\Weapons_F\Explosives\satchel"; + }; + + class ACE_Explosives_Place_SLAM:ACE_Explosives_Place { + displayName = "SLAM"; + model = "\A3\Weapons_F\Explosives\mine_SLAM_directional"; + }; + + // IEDs + class ACE_Explosives_Place_IEDUrbanBig:ACE_Explosives_Place { + displayName = "IED Urban Big"; + model = "\A3\Weapons_F\Explosives\IED_urban_big"; + }; + + class ACE_Explosives_Place_IEDLandBig:ACE_Explosives_Place { + displayName = "IED Land Big"; + model = "\A3\Weapons_F\Explosives\IED_land_big"; + }; + + class ACE_Explosives_Place_IEDUrbanSmall:ACE_Explosives_Place { + displayName = "IED Urban Small"; + model = "\A3\Weapons_F\Explosives\IED_urban_small"; + }; + + class ACE_Explosives_Place_IEDLandSmall:ACE_Explosives_Place { + displayName = "IED Land Small"; + model = "\A3\Weapons_F\Explosives\IED_land_small"; + }; + + class NATO_Box_Base; + class EAST_Box_Base; + class IND_Box_Base; + class FIA_Box_Base_F; + class Box_NATO_Support_F; + + class Box_NATO_AmmoOrd_F: NATO_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_Clacker,12); + MACRO_ADDITEM(ACE_M26_Clacker,6); + MACRO_ADDITEM(ACE_DefusalKit,12); }; - }; }; - }; - class Items_base_F; - class ACE_Explosives_Place: Items_base_F { - author = "ACE"; - _generalMacro = "ACE_Explosives_Place"; - displayName = "Multi-meter"; - mapSize = 0.2; - icon = "iconObject_1x2"; - model = "\A3\Structures_F\Items\Tools\MultiMeter_F.p3d"; - scope = 2; - scopeCurator = 1; - vehicleClass = "Cargo"; - ACE_offset[] = {0,0,0}; - }; - - class ACE_Explosives_Place_DemoCharge:ACE_Explosives_Place { - displayName = "Demo Charge"; - model = "\A3\Weapons_F\explosives\c4_charge_small_d"; - }; - class ACE_Explosives_Place_APERSBoundingMine:ACE_Explosives_Place { - displayName = "APERS Bounding Mine"; - model = "\A3\Weapons_F\explosives\mine_AP_bouncing"; - }; - class ACE_Explosives_Place_APERSMine:ACE_Explosives_Place { - displayName = "APERS Mine"; - model = "\A3\Weapons_F\explosives\mine_ap"; - }; - class ACE_Explosives_Place_APERSTripwireMine:ACE_Explosives_Place { - displayName = "APERS Tripwire Mine"; - model = "\A3\Weapons_F\explosives\mine_AP_tripwire"; - ACE_offset[] = {1,0,0}; - }; - - class ACE_Explosives_Place_ATMine:ACE_Explosives_Place { - displayName = "AT Mine"; - model = "\A3\Weapons_f\Explosives\mine_at"; - }; - - class ACE_Explosives_Place_Claymore:ACE_Explosives_Place { - displayName = "Claymore"; - model = "\A3\Weapons_F\explosives\mine_AP_miniclaymore"; - }; - - class ACE_Explosives_Place_SatchelCharge:ACE_Explosives_Place { - displayName = "Satchel Charge"; - model = "\A3\Weapons_F\Explosives\satchel"; - }; - - class ACE_Explosives_Place_SLAM:ACE_Explosives_Place { - displayName = "SLAM"; - model = "\A3\Weapons_F\Explosives\mine_SLAM_directional"; - }; - - // IEDs - class ACE_Explosives_Place_IEDUrbanBig:ACE_Explosives_Place { - displayName = "IED Urban Big"; - model = "\A3\Weapons_F\Explosives\IED_urban_big"; - }; - - class ACE_Explosives_Place_IEDLandBig:ACE_Explosives_Place { - displayName = "IED Land Big"; - model = "\A3\Weapons_F\Explosives\IED_land_big"; - }; - - class ACE_Explosives_Place_IEDUrbanSmall:ACE_Explosives_Place { - displayName = "IED Urban Small"; - model = "\A3\Weapons_F\Explosives\IED_urban_small"; - }; - - class ACE_Explosives_Place_IEDLandSmall:ACE_Explosives_Place { - displayName = "IED Land Small"; - model = "\A3\Weapons_F\Explosives\IED_land_small"; - }; - - class NATO_Box_Base; - class EAST_Box_Base; - class IND_Box_Base; - class FIA_Box_Base_F; - class Box_NATO_Support_F; - - class Box_NATO_AmmoOrd_F: NATO_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_Clacker,12); - MACRO_ADDITEM(ACE_M26_Clacker,6); - MACRO_ADDITEM(ACE_DefusalKit,12); + class Box_East_AmmoOrd_F: EAST_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_Clacker,12); + MACRO_ADDITEM(ACE_M26_Clacker,6); + MACRO_ADDITEM(ACE_DefusalKit,12); + }; }; - }; - class Box_East_AmmoOrd_F: EAST_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_Clacker,12); - MACRO_ADDITEM(ACE_M26_Clacker,6); - MACRO_ADDITEM(ACE_DefusalKit,12); + class Box_IND_AmmoOrd_F: IND_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_Clacker,12); + MACRO_ADDITEM(ACE_M26_Clacker,6); + MACRO_ADDITEM(ACE_DefusalKit,12); + MACRO_ADDITEM(ACE_Deadmanswitch,2); + MACRO_ADDITEM(ACE_Cellphone,3); + }; }; - }; - class Box_IND_AmmoOrd_F: IND_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_Clacker,12); - MACRO_ADDITEM(ACE_M26_Clacker,6); - MACRO_ADDITEM(ACE_DefusalKit,12); - MACRO_ADDITEM(ACE_Deadmanswitch,2); - MACRO_ADDITEM(ACE_Cellphone,3); + class Box_FIA_Ammo_F: FIA_Box_Base_F { + class TransportItems { + MACRO_ADDITEM(ACE_Clacker,2); + MACRO_ADDITEM(ACE_M26_Clacker,2); + MACRO_ADDITEM(ACE_DefusalKit,2); + MACRO_ADDITEM(ACE_Deadmanswitch,1); + MACRO_ADDITEM(ACE_Cellphone,2); + }; }; - }; - class Box_FIA_Ammo_F: FIA_Box_Base_F { - class TransportItems { - MACRO_ADDITEM(ACE_Clacker,2); - MACRO_ADDITEM(ACE_M26_Clacker,2); - MACRO_ADDITEM(ACE_DefusalKit,2); - MACRO_ADDITEM(ACE_Deadmanswitch,1); - MACRO_ADDITEM(ACE_Cellphone,2); + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_Clacker,12); + MACRO_ADDITEM(ACE_M26_Clacker,6); + MACRO_ADDITEM(ACE_DefusalKit,12); + MACRO_ADDITEM(ACE_Deadmanswitch,6); + MACRO_ADDITEM(ACE_Cellphone,10); + }; }; - }; - class ACE_Box_Misc: Box_NATO_Support_F { - class TransportItems { - MACRO_ADDITEM(ACE_Clacker,12); - MACRO_ADDITEM(ACE_M26_Clacker,6); - MACRO_ADDITEM(ACE_DefusalKit,12); - MACRO_ADDITEM(ACE_Deadmanswitch,6); - MACRO_ADDITEM(ACE_Cellphone,10); + class B_Kitbag_rgr; + class B_Kitbag_rgr_Exp: B_Kitbag_rgr { + class TransportItems { + class _xx_ToolKit { // xXToOlKiT420mLgXx + count = 0; + }; + }; }; - }; - - class B_Kitbag_rgr; - class B_Kitbag_rgr_Exp: B_Kitbag_rgr { - class TransportItems { - class _xx_ToolKit { // xXToOlKiT420mLgXx - count = 0; - }; + class B_Carryall_ocamo; + class B_Carryall_ocamo_Exp: B_Carryall_ocamo { + class TransportItems { + class _xx_ToolKit { + count = 0; + }; + }; }; - }; - class B_Carryall_ocamo; - class B_Carryall_ocamo_Exp: B_Carryall_ocamo { - class TransportItems { - class _xx_ToolKit { - count = 0; - }; + class B_Carryall_oucamo; + class B_Carryall_oucamo_Exp: B_Carryall_oucamo { + class TransportItems { + class _xx_ToolKit { + count = 0; + }; + }; }; - }; - class B_Carryall_oucamo; - class B_Carryall_oucamo_Exp: B_Carryall_oucamo { - class TransportItems { - class _xx_ToolKit { - count = 0; - }; + class B_Carryall_oli; + class G_Carryall_Exp: B_Carryall_oli { + class TransportItems { + class _xx_ToolKit { + count = 0; + }; + }; }; - }; - class B_Carryall_oli; - class G_Carryall_Exp: B_Carryall_oli { - class TransportItems { - class _xx_ToolKit { - count = 0; - }; + class I_Carryall_oli_Exp: B_Carryall_oli { + class TransportItems { + class _xx_ToolKit { + count = 0; + }; + }; }; - }; - class I_Carryall_oli_Exp: B_Carryall_oli { - class TransportItems { - class _xx_ToolKit { - count = 0; - }; - }; - }; - #include "CfgModule.hpp" + #include "CfgModule.hpp" - // Add ACE_Clacker and ACE_DefusalKit to every explosive unit. - #define MACRO_ADDMINEKIT \ - items[] = {"FirstAidKit", "ACE_Clacker", "ACE_DefusalKit"}; \ - respawnitems[] = {"FirstAidKit", "ACE_Clacker", "ACE_DefusalKit"}; + // Add ACE_Clacker and ACE_DefusalKit to every explosive unit. + #define MACRO_ADDMINEKIT \ + items[] = {"FirstAidKit", "ACE_Clacker", "ACE_DefusalKit"}; \ + respawnitems[] = {"FirstAidKit", "ACE_Clacker", "ACE_DefusalKit"}; - class B_Soldier_base_F; class B_soldier_exp_F:B_Soldier_base_F {MACRO_ADDMINEKIT}; - class B_Soldier_03_f; class B_engineer_F:B_Soldier_03_f {MACRO_ADDMINEKIT}; - class B_Soldier_diver_base_F; class B_diver_exp_F:B_Soldier_diver_base_F {MACRO_ADDMINEKIT}; - class B_Soldier_recon_base; class B_recon_exp_F:B_Soldier_recon_base {MACRO_ADDMINEKIT}; - class B_CTRG_soldier_engineer_exp_F:B_Soldier_base_F {MACRO_ADDMINEKIT}; - class I_G_Soldier_base_F; class I_G_engineer_F:I_G_Soldier_base_F {MACRO_ADDMINEKIT}; - class I_G_Soldier_exp_F:I_G_Soldier_base_F {MACRO_ADDMINEKIT}; - class B_G_engineer_F:I_G_engineer_F {MACRO_ADDMINEKIT}; - class O_G_engineer_F:I_G_engineer_F {MACRO_ADDMINEKIT}; - class B_G_Soldier_exp_F:I_G_Soldier_exp_F {MACRO_ADDMINEKIT}; - class O_G_Soldier_exp_F:I_G_Soldier_exp_F {MACRO_ADDMINEKIT}; - class I_Soldier_02_F; class I_Soldier_exp_F:I_Soldier_02_F {MACRO_ADDMINEKIT}; - class I_Soldier_base_F; class I_engineer_F:I_Soldier_base_F {MACRO_ADDMINEKIT}; - class I_Soldier_diver_base_F; class I_diver_exp_F:I_Soldier_diver_base_F {MACRO_ADDMINEKIT}; - class O_Soldier_base_F; class O_soldier_exp_F:O_Soldier_base_F {MACRO_ADDMINEKIT}; - class O_engineer_F:O_Soldier_base_F {MACRO_ADDMINEKIT}; - class O_Soldier_diver_base_F; class O_diver_exp_F:O_Soldier_diver_base_F {MACRO_ADDMINEKIT}; - class O_Soldier_recon_base; class O_recon_exp_F:O_Soldier_recon_base {MACRO_ADDMINEKIT}; - class O_Soldier_Urban_base; class O_soldierU_exp_F:O_Soldier_Urban_base {MACRO_ADDMINEKIT}; - class O_engineer_U_F:O_Soldier_Urban_base {MACRO_ADDMINEKIT}; - class B_Protagonist_VR_F:B_Soldier_base_F {MACRO_ADDMINEKIT}; - class O_Protagonist_VR_F:O_Soldier_base_F {MACRO_ADDMINEKIT}; - class I_Protagonist_VR_F:I_Soldier_base_F {MACRO_ADDMINEKIT}; - class B_Soldier_F; class b_soldier_universal_f:B_Soldier_F {MACRO_ADDMINEKIT}; - class B_G_Soldier_F; class b_g_soldier_universal_f:B_G_Soldier_F {MACRO_ADDMINEKIT}; - class O_Soldier_F; class o_soldier_universal_f:O_Soldier_F {MACRO_ADDMINEKIT}; - class O_G_Soldier_F; class o_g_soldier_universal_f:O_G_Soldier_F {MACRO_ADDMINEKIT}; - class I_soldier_F; class i_soldier_universal_f:I_soldier_F {MACRO_ADDMINEKIT}; - class I_G_Soldier_F; class i_g_soldier_universal_f:I_G_Soldier_F {MACRO_ADDMINEKIT}; + class B_Soldier_base_F; class B_soldier_exp_F:B_Soldier_base_F {MACRO_ADDMINEKIT}; + class B_Soldier_03_f; class B_engineer_F:B_Soldier_03_f {MACRO_ADDMINEKIT}; + class B_Soldier_diver_base_F; class B_diver_exp_F:B_Soldier_diver_base_F {MACRO_ADDMINEKIT}; + class B_Soldier_recon_base; class B_recon_exp_F:B_Soldier_recon_base {MACRO_ADDMINEKIT}; + class B_CTRG_soldier_engineer_exp_F:B_Soldier_base_F {MACRO_ADDMINEKIT}; + class I_G_Soldier_base_F; class I_G_engineer_F:I_G_Soldier_base_F {MACRO_ADDMINEKIT}; + class I_G_Soldier_exp_F:I_G_Soldier_base_F {MACRO_ADDMINEKIT}; + class B_G_engineer_F:I_G_engineer_F {MACRO_ADDMINEKIT}; + class O_G_engineer_F:I_G_engineer_F {MACRO_ADDMINEKIT}; + class B_G_Soldier_exp_F:I_G_Soldier_exp_F {MACRO_ADDMINEKIT}; + class O_G_Soldier_exp_F:I_G_Soldier_exp_F {MACRO_ADDMINEKIT}; + class I_Soldier_02_F; class I_Soldier_exp_F:I_Soldier_02_F {MACRO_ADDMINEKIT}; + class I_Soldier_base_F; class I_engineer_F:I_Soldier_base_F {MACRO_ADDMINEKIT}; + class I_Soldier_diver_base_F; class I_diver_exp_F:I_Soldier_diver_base_F {MACRO_ADDMINEKIT}; + class O_Soldier_base_F; class O_soldier_exp_F:O_Soldier_base_F {MACRO_ADDMINEKIT}; + class O_engineer_F:O_Soldier_base_F {MACRO_ADDMINEKIT}; + class O_Soldier_diver_base_F; class O_diver_exp_F:O_Soldier_diver_base_F {MACRO_ADDMINEKIT}; + class O_Soldier_recon_base; class O_recon_exp_F:O_Soldier_recon_base {MACRO_ADDMINEKIT}; + class O_Soldier_Urban_base; class O_soldierU_exp_F:O_Soldier_Urban_base {MACRO_ADDMINEKIT}; + class O_engineer_U_F:O_Soldier_Urban_base {MACRO_ADDMINEKIT}; + class B_Protagonist_VR_F:B_Soldier_base_F {MACRO_ADDMINEKIT}; + class O_Protagonist_VR_F:O_Soldier_base_F {MACRO_ADDMINEKIT}; + class I_Protagonist_VR_F:I_Soldier_base_F {MACRO_ADDMINEKIT}; + class B_Soldier_F; class b_soldier_universal_f:B_Soldier_F {MACRO_ADDMINEKIT}; + class B_G_Soldier_F; class b_g_soldier_universal_f:B_G_Soldier_F {MACRO_ADDMINEKIT}; + class O_Soldier_F; class o_soldier_universal_f:O_Soldier_F {MACRO_ADDMINEKIT}; + class O_G_Soldier_F; class o_g_soldier_universal_f:O_G_Soldier_F {MACRO_ADDMINEKIT}; + class I_soldier_F; class i_soldier_universal_f:I_soldier_F {MACRO_ADDMINEKIT}; + class I_G_Soldier_F; class i_g_soldier_universal_f:I_G_Soldier_F {MACRO_ADDMINEKIT}; - // Add ACE_Clacker to snipers and spotters for setting off Claymores - #define MACRO_ADDCLAYMOREKIT \ - items[] = {"FirstAidKit","ACE_Clacker"}; \ - respawnitems[] = {"FirstAidKit","ACE_Clacker"}; + // Add ACE_Clacker to snipers and spotters for setting off Claymores + #define MACRO_ADDCLAYMOREKIT \ + items[] = {"FirstAidKit","ACE_Clacker"}; \ + respawnitems[] = {"FirstAidKit","ACE_Clacker"}; - class B_Soldier_sniper_base_F; - class B_sniper_F: B_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT}; - class B_spotter_F: B_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT}; - class I_Soldier_sniper_base_F; - class I_Sniper_F: I_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT}; - class I_Spotter_F: I_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT}; - class O_Soldier_sniper_base_F; - class O_sniper_F: O_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT}; - class O_spotter_F: O_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT}; + class B_Soldier_sniper_base_F; + class B_sniper_F: B_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT}; + class B_spotter_F: B_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT}; + class I_Soldier_sniper_base_F; + class I_Sniper_F: I_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT}; + class I_Spotter_F: I_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT}; + class O_Soldier_sniper_base_F; + class O_sniper_F: O_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT}; + class O_spotter_F: O_Soldier_sniper_base_F {MACRO_ADDCLAYMOREKIT}; }; diff --git a/addons/explosives/CfgWeapons.hpp b/addons/explosives/CfgWeapons.hpp index fd142019e8..a90b4d515f 100644 --- a/addons/explosives/CfgWeapons.hpp +++ b/addons/explosives/CfgWeapons.hpp @@ -1,69 +1,69 @@ class CfgWeapons { - class ACE_ItemCore; - class InventoryItem_Base_f; + class ACE_ItemCore; + class InventoryItem_Base_f; - class ACE_ExplosiveItem: InventoryItem_Base_f { - allowedSlots[] = {801,701,901}; - //type = 201; - }; - - class ACE_Clacker: ACE_ItemCore { - scope = 2; - displayName = $STR_ACE_Explosives_clacker_displayName; - descriptionShort = $STR_ACE_Explosives_clacker_description; - picture = PATHTOF(Data\UI\Clacker.paa); - model = "\A3\weapons_F\ammo\mag_univ.p3d"; - ACE_Range = 250; - ACE_Detonator = 1; - - class ItemInfo: ACE_ExplosiveItem { - mass = 3; - uniformModel = "\A3\weapons_F\ammo\mag_univ.p3d"; + class ACE_ExplosiveItem: InventoryItem_Base_f { + allowedSlots[] = {801,701,901}; + //type = 201; }; - }; - class ACE_M26_Clacker: ACE_Clacker { - displayName = $STR_ACE_Explosives_M26_displayName; - picture = PATHTOF(Data\UI\MK26_Transmitter_ca.paa); - ACE_Range = 5000; - }; - class ACE_DefusalKit: ACE_ItemCore { - scope = 2; - displayName = $STR_ACE_Explosives_DefusalKit_displayName; - descriptionShort = $STR_ACE_Explosives_DefusalKit_description; - picture = PATHTOF(Data\UI\Pliers.paa); - model = "\A3\Structures_F\Items\Tools\Pliers_F.p3d"; - class ItemInfo: ACE_ExplosiveItem { - mass = 5; - uniformModel = "\A3\Structures_F\Items\Tools\Pliers_F.p3d"; - }; - }; - class ACE_DeadManSwitch: ACE_ItemCore { - scope = 2; - displayName = $STR_ACE_Explosives_DeadManSwitch_displayName; - descriptionShort = $STR_ACE_Explosives_DeadManSwitch_description; - picture = PATHTOF(Data\UI\DeadmanSwitch.paa); - model = "\A3\weapons_F\ammo\mag_univ.p3d"; - ACE_Range = 100; - ACE_Detonator = 1; + class ACE_Clacker: ACE_ItemCore { + scope = 2; + displayName = $STR_ACE_Explosives_clacker_displayName; + descriptionShort = $STR_ACE_Explosives_clacker_description; + picture = PATHTOF(Data\UI\Clacker.paa); + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + ACE_Range = 250; + ACE_Detonator = 1; - class ItemInfo: ACE_ExplosiveItem { - mass = 2; - uniformModel = "\A3\weapons_F\ammo\mag_univ.p3d"; + class ItemInfo: ACE_ExplosiveItem { + mass = 3; + uniformModel = "\A3\weapons_F\ammo\mag_univ.p3d"; + }; }; - }; - class ACE_Cellphone: ACE_ItemCore { - scope = 2; - displayName = $STR_ACE_Explosives_cellphone_displayName; - descriptionShort = $STR_ACE_Explosives_cellphone_description; - picture = PATHTOF(Data\UI\Cellphone_UI.paa); - model = "\A3\weapons_F\ammo\mag_univ.p3d"; - ACE_Range = 15000; - ACE_Detonator = 1; + class ACE_M26_Clacker: ACE_Clacker { + displayName = $STR_ACE_Explosives_M26_displayName; + picture = PATHTOF(Data\UI\MK26_Transmitter_ca.paa); + ACE_Range = 5000; + }; + class ACE_DefusalKit: ACE_ItemCore { + scope = 2; + displayName = $STR_ACE_Explosives_DefusalKit_displayName; + descriptionShort = $STR_ACE_Explosives_DefusalKit_description; + picture = PATHTOF(Data\UI\Pliers.paa); + model = "\A3\Structures_F\Items\Tools\Pliers_F.p3d"; - class ItemInfo: ACE_ExplosiveItem { - mass = 2; - uniformModel = "\A3\weapons_F\ammo\mag_univ.p3d"; + class ItemInfo: ACE_ExplosiveItem { + mass = 5; + uniformModel = "\A3\Structures_F\Items\Tools\Pliers_F.p3d"; + }; + }; + class ACE_DeadManSwitch: ACE_ItemCore { + scope = 2; + displayName = $STR_ACE_Explosives_DeadManSwitch_displayName; + descriptionShort = $STR_ACE_Explosives_DeadManSwitch_description; + picture = PATHTOF(Data\UI\DeadmanSwitch.paa); + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + ACE_Range = 100; + ACE_Detonator = 1; + + class ItemInfo: ACE_ExplosiveItem { + mass = 2; + uniformModel = "\A3\weapons_F\ammo\mag_univ.p3d"; + }; + }; + class ACE_Cellphone: ACE_ItemCore { + scope = 2; + displayName = $STR_ACE_Explosives_cellphone_displayName; + descriptionShort = $STR_ACE_Explosives_cellphone_description; + picture = PATHTOF(Data\UI\Cellphone_UI.paa); + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + ACE_Range = 15000; + ACE_Detonator = 1; + + class ItemInfo: ACE_ExplosiveItem { + mass = 2; + uniformModel = "\A3\weapons_F\ammo\mag_univ.p3d"; + }; }; - }; }; diff --git a/addons/explosives/ExplosivesUI.hpp b/addons/explosives/ExplosivesUI.hpp index 769b3dc167..6871f95f92 100644 --- a/addons/explosives/ExplosivesUI.hpp +++ b/addons/explosives/ExplosivesUI.hpp @@ -14,275 +14,275 @@ class RscPicture; class RscEdit; class Rsc_ACE_CallScreen_Edit:RscEdit { - canModify = 1; - colorBackground[] = {0,0,0,1}; - colorText[] = {0,0,0,1}; - colorDisabled[] = {1,1,1,0.25}; - colorSelection[] = { - "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])", - "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])", - "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", - 1 - }; - 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; + canModify = 1; + colorBackground[] = {0,0,0,1}; + colorText[] = {0,0,0,1}; + colorDisabled[] = {1,1,1,0.25}; + colorSelection[] = { + "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])", + "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])", + "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", + 1 + }; + 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; }; class Rsc_ACE_HiddenButton:RscButton { - colorText[] = {0, 0, 0, 0}; - colorDisabled[] = {0, 0, 0, 0}; - colorBackground[] = {0, 0, 0, 0}; - colorBackgroundDisabled[] = {0, 0, 0, 0}; - colorBackgroundActive[] = {0, 0, 0, 0}; - colorFocused[] = {0, 0, 0, 0}; - colorShadow[] = {0, 0, 0, 0}; - colorBorder[] = {0, 0, 0, 0}; - w = 0.095589; - h = 0.039216; - shadow = 0; + colorText[] = {0, 0, 0, 0}; + colorDisabled[] = {0, 0, 0, 0}; + colorBackground[] = {0, 0, 0, 0}; + colorBackgroundDisabled[] = {0, 0, 0, 0}; + colorBackgroundActive[] = {0, 0, 0, 0}; + colorFocused[] = {0, 0, 0, 0}; + colorShadow[] = {0, 0, 0, 0}; + colorBorder[] = {0, 0, 0, 0}; + w = 0.095589; + h = 0.039216; + shadow = 0; }; class Rsc_ACE_Timer_Slider:RscXSliderH { - x = 0.4; - y = 0.2; - w = 0.3; - h = "1*((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0,0,0,0.5}; + x = 0.4; + y = 0.2; + w = 0.3; + h = "1*((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0,0,0,0.5}; }; class RscACE_SelectTimeUI { - idd = 8854; - movingEnable = 0; - class controls { - class back:IGUIBack { - x = X_OFFSET; - y = 0; - w = 0.5; - h = 0.2; - colorBackground[] = {0, 0, 0, 0.5}; + idd = 8854; + movingEnable = 0; + class controls { + class back:IGUIBack { + x = X_OFFSET; + y = 0; + w = 0.5; + h = 0.2; + colorBackground[] = {0, 0, 0, 0.5}; + }; + class header: RscText{ + idc = 8870; + x = X_OFFSET + 0.005; + y = 0.005; + w = 0.49; + h = 0.05; + style = ST_CENTER; + text = ""; + }; + class slider: Rsc_ACE_Timer_Slider { + idc = 8845; + x = X_OFFSET + 0.005; + y = 0.06; + w = 0.49; + h = 0.025; + onSliderPosChanged = "private ['_mins', '_secs'];_mins = floor((_this select 1)/60);_secs=floor((_this select 1) - (_mins*60));ctrlSetText [8870, format[localize 'STR_ACE_Explosives_TimerMenu',_mins, _secs]];"; + }; + class cancelBtn: RscButton { + idc = 8855; + x = X_OFFSET + 0.005; + w = 0.15; + h = 0.1; + y = 0.09; + style = ST_CENTER; + text = $STR_ACE_Explosives_Cancel; + action = "closeDialog 0;"; + }; + class approveBtn: RscButton { + idc = 8860; + x = X_OFFSET + 0.345; + y = 0.09; + h = 0.1; + w = 0.15; + style = ST_CENTER; + text = $STR_ACE_Explosives_SetTime; + action = "closeDialog 0;"; + }; }; - class header: RscText{ - idc = 8870; - x = X_OFFSET + 0.005; - y = 0.005; - w = 0.49; - h = 0.05; - style = ST_CENTER; - text = ""; - }; - class slider: Rsc_ACE_Timer_Slider { - idc = 8845; - x = X_OFFSET + 0.005; - y = 0.06; - w = 0.49; - h = 0.025; - onSliderPosChanged = "private ['_mins', '_secs'];_mins = floor((_this select 1)/60);_secs=floor((_this select 1) - (_mins*60));ctrlSetText [8870, format[localize 'STR_ACE_Explosives_TimerMenu',_mins, _secs]];"; - }; - class cancelBtn: RscButton { - idc = 8855; - x = X_OFFSET + 0.005; - w = 0.15; - h = 0.1; - y = 0.09; - style = ST_CENTER; - text = $STR_ACE_Explosives_Cancel; - action = "closeDialog 0;"; - }; - class approveBtn: RscButton { - idc = 8860; - x = X_OFFSET + 0.345; - y = 0.09; - h = 0.1; - w = 0.15; - style = ST_CENTER; - text = $STR_ACE_Explosives_SetTime; - action = "closeDialog 0;"; - }; - }; }; class Rsc_ACE_NumKeyButton: Rsc_ACE_HiddenButton{}; class Rsc_ACE_PhoneInterface { - idd = 8855; - movingEnable = 1; - onLoad = QUOTE(GVAR(IED_CurrentSpeedDial) = -1); - class controls { - class RscPicture_1200: RscPicture { - idc = 1200; - text = PATHTOF(Data\UI\Cellphone_Background.paa); - x = 0.231875 * safezoneW + safezoneX; - y = 0.104 * safezoneH + safezoneY; - w = 0.195937 * safezoneW; - h = 0.704 * safezoneH; + idd = 8855; + movingEnable = 1; + onLoad = QUOTE(GVAR(IED_CurrentSpeedDial) = -1); + class controls { + class RscPicture_1200: RscPicture { + idc = 1200; + text = PATHTOF(Data\UI\Cellphone_Background.paa); + 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; + 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; + 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; + 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; + 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; + 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; + 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; + 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; + 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; + 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; + 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; + tooltip = "$STR_ACE_Explosives_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; + tooltip = "$STR_ACE_Explosives_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; + tooltip = "$STR_ACE_Explosives_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; + tooltip = "$STR_ACE_Explosives_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; + tooltip = "$STR_ACE_Explosives_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; + text = "Name"; + }; + class speedDial_edit: Rsc_ACE_CallScreen_Edit { + idc = 1401; + 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; + text = "#"; + }; + class number_edit: Rsc_ACE_CallScreen_Edit { + canModify = 0; + idc = 1400; + y = 0.348 * safezoneH + safezoneY; + x = 0.3 * safezoneW + safezoneX; + }; }; - 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; - 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; - 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; - 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; - 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; - 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; - 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; - 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; - 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; - 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; - 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; - tooltip = "$STR_ACE_Explosives_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; - tooltip = "$STR_ACE_Explosives_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; - tooltip = "$STR_ACE_Explosives_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; - tooltip = "$STR_ACE_Explosives_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; - tooltip = "$STR_ACE_Explosives_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; - text = "Name"; - }; - class speedDial_edit: Rsc_ACE_CallScreen_Edit { - idc = 1401; - 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; - text = "#"; - }; - class number_edit: Rsc_ACE_CallScreen_Edit { - canModify = 0; - idc = 1400; - y = 0.348 * safezoneH + safezoneY; - x = 0.3 * safezoneW + safezoneX; - }; - }; }; diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index e3b40308c3..8ebf62090f 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -22,46 +22,46 @@ GVAR(CurrentSpeedDial) = 0; [{(_this select 0) call FUNC(handleScrollWheel);}] call EFUNC(Common,addScrollWheelEventHandler); player addEventHandler ["Killed", { - private "_deadman"; - call FUNC(place_Cancel); - _deadman = [(_this select 0), "DeadManSwitch"] call FUNC(getPlacedExplosives); - { - [(_this select 0), -1, _x, true] call FUNC(detonateExplosive); - } count _deadman; + private "_deadman"; + call FUNC(place_Cancel); + _deadman = [(_this select 0), "DeadManSwitch"] call FUNC(getPlacedExplosives); + { + [(_this select 0), -1, _x, true] call FUNC(detonateExplosive); + } count _deadman; }]; player addEventHandler ["Take", { - private ["_item", "_getter", "_giver", "_config"]; - _item = _this select 2; - _getter = _this select 0; - _giver = _this select 1; + private ["_item", "_getter", "_giver", "_config"]; + _item = _this select 2; + _getter = _this select 0; + _giver = _this select 1; - _config = ConfigFile >> "CfgWeapons" >> _item; - if (isClass _config && {getNumber(_config >> "ACE_Detonator") == 1}) then { - private ["_clackerItems"]; - _clackerItems = _giver getVariable [QGVAR(Clackers), []]; - _getter SetVariable [QGVAR(Clackers), (_getter getVariable [QGVAR(Clackers), []]) + _clackerItems, true]; + _config = ConfigFile >> "CfgWeapons" >> _item; + if (isClass _config && {getNumber(_config >> "ACE_Detonator") == 1}) then { + private ["_clackerItems"]; + _clackerItems = _giver getVariable [QGVAR(Clackers), []]; + _getter SetVariable [QGVAR(Clackers), (_getter getVariable [QGVAR(Clackers), []]) + _clackerItems, true]; - _detonators = [_giver] call FUNC(getDetonators); - if (count _detonators == 0) then { - _giver setVariable [QGVAR(Clackers), nil, true]; - }; - }; + _detonators = [_giver] call FUNC(getDetonators); + if (count _detonators == 0) then { + _giver setVariable [QGVAR(Clackers), nil, true]; + }; + }; }]; player addEventHandler ["Put", { - private ["_item", "_getter", "_giver", "_config"]; - _item = _this select 2; - _getter = _this select 1; - _giver = _this select 0; + private ["_item", "_getter", "_giver", "_config"]; + _item = _this select 2; + _getter = _this select 1; + _giver = _this select 0; - _config = ConfigFile >> "CfgWeapons" >> _item; - if (isClass _config && {getNumber(_config >> "ACE_Detonator") == 1}) then { - private ["_clackerItems"]; - _clackerItems = _giver getVariable [QGVAR(Clackers), []]; - _getter SetVariable [QGVAR(Clackers), (_getter getVariable [QGVAR(Clackers), []]) + _clackerItems, true]; + _config = ConfigFile >> "CfgWeapons" >> _item; + if (isClass _config && {getNumber(_config >> "ACE_Detonator") == 1}) then { + private ["_clackerItems"]; + _clackerItems = _giver getVariable [QGVAR(Clackers), []]; + _getter SetVariable [QGVAR(Clackers), (_getter getVariable [QGVAR(Clackers), []]) + _clackerItems, true]; - _detonators = [_giver] call FUNC(getDetonators); - if (count _detonators == 0) then { - _giver setVariable [QGVAR(Clackers), nil, true]; - }; - }; + _detonators = [_giver] call FUNC(getDetonators); + if (count _detonators == 0) then { + _giver setVariable [QGVAR(Clackers), nil, true]; + }; + }; }]; diff --git a/addons/explosives/XEH_preInit.sqf b/addons/explosives/XEH_preInit.sqf index 3747151d16..435624d2a5 100644 --- a/addons/explosives/XEH_preInit.sqf +++ b/addons/explosives/XEH_preInit.sqf @@ -19,7 +19,11 @@ ADDON = false; PREP(addCellphoneIED); PREP(addClacker); +PREP(addDetonateActions); +PREP(addExplosiveActions); PREP(addToSpeedDial); +PREP(addTransmitterActions); +PREP(addTriggerActions); PREP(canDefuse); PREP(canDetonate); PREP(defuseExplosive); @@ -36,11 +40,9 @@ PREP(getDetonators); PREP(getPlacedExplosives); PREP(getSpeedDialExplosive); -PREP(openDetonateUI); -PREP(openPlaceUI); -PREP(openTransmitterUI); +PREP(onLanded); + PREP(openTimerSetUI); -PREP(openTriggerSelectionUI); PREP(place_Approve); PREP(place_Cancel); diff --git a/addons/explosives/config.cpp b/addons/explosives/config.cpp index da95d45e7e..9652c38dd2 100644 --- a/addons/explosives/config.cpp +++ b/addons/explosives/config.cpp @@ -1,15 +1,15 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {"ACE_Clacker", "ACE_DefusalKit", "ACE_M26_Clacker", "ACE_DeadManSwitch", "ACE_Cellphone"}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common", "ace_interaction"}; - author[] = {"Garth 'L-H' de Wet"}; - authorUrl = "http://garth.snakebiteink.co.za/"; - VERSION_CONFIG; - }; + class ADDON { + units[] = {}; + weapons[] = {"ACE_Clacker", "ACE_DefusalKit", "ACE_M26_Clacker", "ACE_DeadManSwitch", "ACE_Cellphone"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interaction"}; + author[] = {"Garth 'L-H' de Wet"}; + authorUrl = "http://garth.snakebiteink.co.za/"; + VERSION_CONFIG; + }; }; #include "CfgEventHandlers.hpp" @@ -22,30 +22,30 @@ class CfgPatches { #include "ExplosivesUI.hpp" class CfgActions { - class None; - class Deactivate:None { - show = 0; - }; - class DeactivateMine:None { - show = 0; - }; + class None; + class Deactivate:None { + show = 0; + }; + class DeactivateMine:None { + show = 0; + }; }; class CfgMineTriggers { - class RangeTrigger; - class MagneticTrigger: RangeTrigger { - mineMagnetic = 1; - mineTriggerRange = 1; - }; + class RangeTrigger; + class MagneticTrigger: RangeTrigger { + mineMagnetic = 1; + mineTriggerRange = 1; + }; }; class ACE_Settings { - class GVAR(RequireSpecialist) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(PunishNonSpecialists) { - value = 1; - typeName = "BOOL"; - }; + class GVAR(RequireSpecialist) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(PunishNonSpecialists) { + value = 1; + typeName = "BOOL"; + }; }; diff --git a/addons/explosives/functions/fnc_addCellphoneIED.sqf b/addons/explosives/functions/fnc_addCellphoneIED.sqf index 84cb57cf4e..3be21df559 100644 --- a/addons/explosives/functions/fnc_addCellphoneIED.sqf +++ b/addons/explosives/functions/fnc_addCellphoneIED.sqf @@ -25,23 +25,23 @@ _requiredItems = getArray(_config >> "requires"); _hasRequired = true; _detonators = [_unit] call FUNC(getDetonators); { - if !(_x in _detonators) exitWith{ - _hasRequired = false; - }; + if !(_x in _detonators) exitWith{ + _hasRequired = false; + }; } count _requiredItems; private ["_code", "_count", "_codeSet"]; _codeSet = false; while {!_codeSet} do { - _code = str(round (random 9999)); - _count = 4 - count (toArray _code); - while {_count > 0} do { - _code = "0" + _code; - _count = _count - 1; - }; - _codeSet = (count ([_code] call FUNC(getSpeedDialExplosive))) == 0; + _code = str(round (random 9999)); + _count = 4 - count (toArray _code); + while {_count > 0} do { + _code = "0" + _code; + _count = _count - 1; + }; + _codeSet = (count ([_code] call FUNC(getSpeedDialExplosive))) == 0; }; if (isNil QGVAR(CellphoneIEDs)) then { - GVAR(CellphoneIEDs) = []; + GVAR(CellphoneIEDs) = []; }; _count = GVAR(CellphoneIEDs) pushBack [_explosive,_code,GetNumber(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> "Cellphone" >> "FuseTime")]; _count = _count + 1; diff --git a/addons/explosives/functions/fnc_addClacker.sqf b/addons/explosives/functions/fnc_addClacker.sqf index 4746dc66f5..1e12b79d62 100644 --- a/addons/explosives/functions/fnc_addClacker.sqf +++ b/addons/explosives/functions/fnc_addClacker.sqf @@ -17,10 +17,8 @@ * Public: Yes */ #include "script_component.hpp" -private ["_unit", "_explosive", "_clacker", "_config", "_magazineClass", "_requiredItems", "_hasRequired"]; -_unit = _this select 0; -_explosive = _this select 1; -_magazineClass = _this select 2; +private ["_clacker", "_config", "_requiredItems", "_hasRequired"]; +EXPLODE_3_PVT(_this,_unit,_explosive,_magazineClass); // Config is the last item in the list of passed in items. _config = (_this select 3) select (count (_this select 3) - 1); @@ -28,9 +26,9 @@ _requiredItems = getArray(_config >> "requires"); _hasRequired = true; _detonators = [_unit] call FUNC(getDetonators); { - if !(_x in _detonators) exitWith{ - _hasRequired = false; - }; + if !(_x in _detonators) exitWith{ + _hasRequired = false; + }; } count _requiredItems; if !(_hasRequired) exitWith {}; @@ -38,7 +36,9 @@ _config = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> co _clacker = _unit getVariable [QGVAR(Clackers), []]; GVAR(PlacedCount) = GVAR(PlacedCount) + 1; + _clacker pushBack [_explosive, getNumber(_config >> "FuseTime"), format [localize "STR_ACE_Explosives_DetonateCode", - GVAR(PlacedCount)], _magazineClass, configName ((_this select 3) select (count (_this select 3) - 1))]; + GVAR(PlacedCount)], _magazineClass, configName ((_this select 3) select (count (_this select 3) - 1))]; + _unit setVariable [QGVAR(Clackers), _clacker, true]; _unit sideChat format [localize "STR_ACE_Explosives_DetonateCode", GVAR(PlacedCount)]; diff --git a/addons/explosives/functions/fnc_addDetonateActions.sqf b/addons/explosives/functions/fnc_addDetonateActions.sqf new file mode 100644 index 0000000000..0017488458 --- /dev/null +++ b/addons/explosives/functions/fnc_addDetonateActions.sqf @@ -0,0 +1,49 @@ +/* + * Author: Garth 'L-H' de Wet + * Opens the UI for explosive detonation selection + * + * Arguments: + * 0: Unit + * 1: Trigger classname + * + * Return Value: + * None + * + * Example: + * [player, "ACE_M26_Clacker"] call ACE_Explosives_fnc_addDetonateActions; + * + * Public: No + */ +#include "script_component.hpp" +private ["_result", "_item", "_children"]; +call EFUNC(interaction,hideMenu); +EXPLODE_2_PVT(_this,_unit,_detonator); +_range = GetNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range"); + +_result = [_unit] call FUNC(getPlacedExplosives); +_children = []; +{ + if (!isNull(_x select 0)) then { + _required = getArray (ConfigFile >> "CfgACE_Triggers" >> (_x select 4) >> "requires"); + if (_detonator in _required) then { + _item = ConfigFile >> "CfgMagazines" >> (_x select 3); + + _children pushBack + [ + [ + format ["Explosive_%1", _forEachIndex], + _x select 2, + getText(_item >> "picture"), + {(_this select 2) call FUNC(detonateExplosive);}, + {true}, + {}, + [ACE_player,_range,_x] + ] call EFUNC(interact_menu,createAction), + [], + ACE_Player + ]; + }; + }; +} foreach _result; + +_children diff --git a/addons/explosives/functions/fnc_addExplosiveActions.sqf b/addons/explosives/functions/fnc_addExplosiveActions.sqf new file mode 100644 index 0000000000..29a2eed608 --- /dev/null +++ b/addons/explosives/functions/fnc_addExplosiveActions.sqf @@ -0,0 +1,56 @@ +/* + * Author: Garth 'L-H' de Wet and CAA-Picard + * + * + * Arguments: + * 0: Unit + * + * Return Value: + * Actions + * + * Public: No + */ +#include "script_component.hpp" +private ["_mags", "_item", "_index", "_children"]; + +EXPLODE_1_PVT(_this,_unit); + +_mags = magazines _unit; +_list = []; +_itemCount = []; +{ + _item = ConfigFile >> "CfgMagazines" >> _x; + if (getNumber(_item >> "ACE_Placeable") == 1) then { + _index = _list find _item; + if (_index != -1) then { + _itemCount set [_index, (_itemCount select _index) + 1]; + } else { + _list pushBack _item; + _itemCount pushBack 1; + }; + }; +} forEach _mags; + +_children = []; + +{ + private "_name"; + _name = if(isText(_x >> "displayNameShort") && {getText(_x >> "displayNameShort") != ""}) then + {getText (_x >> "displayNameShort")}else{getText(_x >> "displayName")}; + _children pushBack + [ + [ + format ["Explosive_%1", _forEachIndex], + format [_name + " (%1)", _itemCount select _foreachIndex], + getText(_x >> "picture"), + {(_this select 2) call FUNC(setupExplosive);}, + {true}, + {}, + [_unit, configName _x] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; +} foreach _list; + +_children diff --git a/addons/explosives/functions/fnc_addToSpeedDial.sqf b/addons/explosives/functions/fnc_addToSpeedDial.sqf index 142996e4c3..4f0772e601 100644 --- a/addons/explosives/functions/fnc_addToSpeedDial.sqf +++ b/addons/explosives/functions/fnc_addToSpeedDial.sqf @@ -22,16 +22,16 @@ _found = false; EXPLODE_2_PVT(_this,_name,_code); if ((_code) == "") ExitWith { - [_name] call FUNC(removeFromSpeedDial); + [_name] call FUNC(removeFromSpeedDial); }; { - if ((_x select 0) == _name) exitWith { - _speedDial set [_foreachindex, _this]; - _found = true; - }; + if ((_x select 0) == _name) exitWith { + _speedDial set [_foreachindex, _this]; + _found = true; + }; } foreach _speedDial; if (!_found) then { - _speedDial pushBack _this; + _speedDial pushBack _this; }; ace_player setVariable [QGVAR(SpeedDial), _speedDial]; diff --git a/addons/explosives/functions/fnc_addTransmitterActions.sqf b/addons/explosives/functions/fnc_addTransmitterActions.sqf new file mode 100644 index 0000000000..6408eb2ec7 --- /dev/null +++ b/addons/explosives/functions/fnc_addTransmitterActions.sqf @@ -0,0 +1,39 @@ +/* + * Author: Garth 'L-H' de Wet + * Opens the UI for selecting the transmitter + * + * Arguments: + * 0: Unit + * + * Return Value: + * Nothing + * + * Example: + * [player] call ACE_Explosives_fnc_addTransmitterActions; + * + * Public: No + */ +#include "script_component.hpp" +private ["_items", "_unit", "_children", "_config"]; +_unit = _this select 0; +_detonators = [_unit] call FUNC(getDetonators); +_children = []; +{ + _config = ConfigFile >> "CfgWeapons" >> _x; + _children pushBack + [ + [ + format ["Trigger_%1", _forEachIndex], + getText(_config >> "displayName"), + getText(_config >> "picture"), + {}, + {true}, + {(_this select 2) call FUNC(addDetonateActions);}, + [ACE_player,_x] + ] call EFUNC(interact_menu,createAction), + [], + ACE_Player + ]; +} foreach _detonators; + +_children diff --git a/addons/explosives/functions/fnc_addTriggerActions.sqf b/addons/explosives/functions/fnc_addTriggerActions.sqf new file mode 100644 index 0000000000..e9c2dca0e6 --- /dev/null +++ b/addons/explosives/functions/fnc_addTriggerActions.sqf @@ -0,0 +1,56 @@ +/* + * Author: Garth 'L-H' de Wet + * Opens the UI for explosive trigger selection + * + * Arguments: + * 0: Explosive Magazine + * 1: Explosive + * + * Return Value: + * None + * + * Example: + * [lbData [8866, lbCurSel 8866], _explosive] call ACE_Explosives_fnc_addTriggerActions; + * + * Public: No + */ +#include "script_component.hpp" +private ["_hasRequiredItems","_triggerTypes", "_children", + "_detonators", "_required", "_magTriggers"]; +EXPLODE_2_PVT(_this,_magazine,_explosive); +_detonators = [ACE_player] call FUNC(getDetonators); + +_triggerTypes = [_magazine] call FUNC(triggerType); +_magTriggers = ConfigFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers"; +_children = []; +{ + _required = getArray (_x >> "requires"); + _hasRequiredItems = true; + { + if !(_x in _detonators) exitWith { + _hasRequiredItems = false; + }; + } count _required; + if (_hasRequiredItems) then { + _children pushBack + [ + [ + format ["Trigger_%1", _forEachIndex], + if(isText(_magTriggers >> configName _x >> "displayName"))then + {getText(_magTriggers >> configName _x >> "displayName")} + else{getText(_x >> "displayName")}, + if(isText(_magTriggers >> configName _x >> "picture"))then + {getText(_magTriggers >> configName _x >> "picture")} + else{getText(_x >> "picture")}, + {(_this select 2) call FUNC(selectTrigger);}, + {true}, + {}, + [_explosive, _magazine, configName _x] + ] call EFUNC(interact_menu,createAction), + [], + ACE_Player + ]; + }; +} foreach _triggerTypes; + +_children diff --git a/addons/explosives/functions/fnc_canDefuse.sqf b/addons/explosives/functions/fnc_canDefuse.sqf index 566363c2ad..cd04564a9f 100644 --- a/addons/explosives/functions/fnc_canDefuse.sqf +++ b/addons/explosives/functions/fnc_canDefuse.sqf @@ -14,25 +14,15 @@ * Public: Yes */ #include "script_component.hpp" -private "_unit"; -_unit = _this select 0; +private ["_specialist"]; +EXPLODE_2_PVT(_this,_unit,_target); +if (isNull(_target getVariable [QGVAR(Explosive),objNull])) exitWith { + deleteVehicle _target; + false +}; if (vehicle _unit != _unit || {!("ACE_DefusalKit" in (items _unit))}) exitWith {false}; _isSpecialist = [_unit] call EFUNC(Common,isEOD); if (GVAR(RequireSpecialist) && {!_isSpecialist}) exitWith {false}; -_timeBombCore = nearestObject [_unit, "TimeBombCore"]; -_mineBase = nearestObject [_unit, "MineBase"]; - -_distCore = _unit distance _timeBombCore; -_distBase = _unit distance _mineBase; -_distance = 10; -if (_distCore < _distBase) then { - _distance = _distCore; - EGVAR(interaction,Target) = _timeBombCore; -}else{ - _distance = _distBase; - EGVAR(interaction,Target) = _mineBase; -}; -if (isNil "_distance") exitWith {false}; -_distance < 4 +true diff --git a/addons/explosives/functions/fnc_defuseExplosive.sqf b/addons/explosives/functions/fnc_defuseExplosive.sqf index 5836c9e210..5abfabe60f 100644 --- a/addons/explosives/functions/fnc_defuseExplosive.sqf +++ b/addons/explosives/functions/fnc_defuseExplosive.sqf @@ -15,12 +15,16 @@ * Public: Yes */ #include "script_component.hpp" -private ["_unit", "_explosive"]; -_unit = _this select 0; -_explosive = _this select 1; +EXPLODE_2_PVT(_this,_unit,_explosive); if (getNumber (ConfigFile >> "CfgAmmo" >> typeof _explosive >> "ACE_explodeOnDefuse") == 1) exitWith { - [_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive); + [_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive); }; +{ + detach _x; + deleteVehicle _x; + false +} count (attachedObjects (_explosive)); + _unit action ["Deactivate", _unit, _explosive]; diff --git a/addons/explosives/functions/fnc_detonateExplosive.sqf b/addons/explosives/functions/fnc_detonateExplosive.sqf index 697c8eeed7..f05a265c3a 100644 --- a/addons/explosives/functions/fnc_detonateExplosive.sqf +++ b/addons/explosives/functions/fnc_detonateExplosive.sqf @@ -6,8 +6,8 @@ * 0: Unit * 1: Max range (-1 to ignore) * 2: Explosive - * 0: Explosive - * 1: Fuse time + * 0: Explosive + * 1: Fuse time * * Return Value: * None @@ -19,33 +19,37 @@ * Public: Yes */ #include "script_component.hpp" -private ["_item","_result", "_ignoreRange", "_unit", "_range"]; -_unit = _this select 0; -_range = _this select 1; -_item = _this select 2; +private ["_result", "_ignoreRange", "_helper"]; +EXPLODE_3_PVT(_this,_unit,_range,_item); _ignoreRange = (_range == -1); _result = true; if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {false}; +_helper = (attachedTo (_item select 0)); +if (!isNull(_helper)) then { + detach (_item select 0); + deleteVehicle _helper; +}; + if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhenDestroyed") == 0) then { - private ["_exp", "_previousExp"]; - _previousExp = _item select 0; - _exp = getText (ConfigFile >> "CfgAmmo" >> typeof (_previousExp) >> "ACE_Explosive"); - if (_exp != "") then { - _exp = createVehicle [_exp, [0,0,15001], [], 0, "NONE"]; - _exp setDir (getDir _previousExp); - _item set [0, _exp]; - _pos = getPosASL _previousExp; - deleteVehicle _previousExp; - _exp setPosASL _pos; - }; + private ["_exp", "_previousExp"]; + _previousExp = _item select 0; + _exp = getText (ConfigFile >> "CfgAmmo" >> typeof (_previousExp) >> "ACE_Explosive"); + if (_exp != "") then { + _exp = createVehicle [_exp, [0,0,15001], [], 0, "NONE"]; + _exp setDir (getDir _previousExp); + _item set [0, _exp]; + _pos = getPosASL _previousExp; + deleteVehicle _previousExp; + _exp setPosASL _pos; + }; }; [{ - _explosive = _this; - if (!isNull _explosive) then { - _explosive setDamage 1; - }; + _explosive = _this; + if (!isNull _explosive) then { + _explosive setDamage 1; + }; }, _item select 0, _item select 1, 0] call EFUNC(common,waitAndExecute); _result diff --git a/addons/explosives/functions/fnc_dialPhone.sqf b/addons/explosives/functions/fnc_dialPhone.sqf index 41b2a4a4f7..f00fa8a970 100644 --- a/addons/explosives/functions/fnc_dialPhone.sqf +++ b/addons/explosives/functions/fnc_dialPhone.sqf @@ -24,19 +24,19 @@ _unit setVariable [QGVAR(Dialing), true, true]; _ran = (ceil(random 8)) + 1; _arr = []; for [{_i=0}, {_i<_ran}, {_i=_i+1}] do { - _arr = _arr + ['.','..','...','']; + _arr = _arr + ['.','..','...','']; }; if (_unit == ace_player) then { - ctrlSetText [1400,"Calling"]; - [FUNC(dialingPhone), 0.25, [_unit,4,_arr,_code]] call CALLSTACK(CBA_fnc_addPerFrameHandler); + ctrlSetText [1400,"Calling"]; + [FUNC(dialingPhone), 0.25, [_unit,4,_arr,_code]] call CALLSTACK(CBA_fnc_addPerFrameHandler); } else { - private ["_explosive"]; - _explosive = [_code] call FUNC(getSpeedDialExplosive); - if ((count _explosive) > 0) then { - [{ - playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_this select 1),3.16228,1,75]; - (_this select 0) setVariable [QGVAR(Dialing), false, true]; - }, [_unit,_explosive select 0], 0.25 * (count _arr - 4), 0] call EFUNC(common,waitAndExecute); - [_explosive select 0,(0.25 * (count _arr - 1)) + (_explosive select 2)] call FUNC(startTimer); - }; + private ["_explosive"]; + _explosive = [_code] call FUNC(getSpeedDialExplosive); + if ((count _explosive) > 0) then { + [{ + playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_this select 1),3.16228,1,75]; + (_this select 0) setVariable [QGVAR(Dialing), false, true]; + }, [_unit,_explosive select 0], 0.25 * (count _arr - 4), 0] call EFUNC(common,waitAndExecute); + [_explosive select 0,(0.25 * (count _arr - 1)) + (_explosive select 2)] call FUNC(startTimer); + }; }; diff --git a/addons/explosives/functions/fnc_getDetonators.sqf b/addons/explosives/functions/fnc_getDetonators.sqf index 83e0087acc..26bde9b190 100644 --- a/addons/explosives/functions/fnc_getDetonators.sqf +++ b/addons/explosives/functions/fnc_getDetonators.sqf @@ -20,10 +20,10 @@ _items = (items _unit); _result = []; { - _config = ConfigFile >> "CfgWeapons" >> _x; - if (getNumber (_config >> "ACE_Detonator") == 1) then { - _result pushBack _x; - }; + _config = ConfigFile >> "CfgWeapons" >> _x; + if (getNumber (_config >> "ACE_Detonator") == 1) then { + _result pushBack _x; + }; } forEach _items; _result diff --git a/addons/explosives/functions/fnc_getPlacedExplosives.sqf b/addons/explosives/functions/fnc_getPlacedExplosives.sqf index 4ebcdb8f0b..9b40002bbe 100644 --- a/addons/explosives/functions/fnc_getPlacedExplosives.sqf +++ b/addons/explosives/functions/fnc_getPlacedExplosives.sqf @@ -20,29 +20,29 @@ private ["_unit", "_clackerList", "_adjustedList", "_list", "_filter"]; _unit = _this select 0; _filter = nil; if (count _this > 1) then { - _filter = ConfigFile >> "CfgACE_Triggers" >> (_this select 1); + _filter = ConfigFile >> "CfgACE_Triggers" >> (_this select 1); }; _clackerList = []; _adjustedList = false; _clackerList = _unit getVariable [QGVAR(Clackers), []]; _list = []; { - if isNull (_x select 0) then { - _clackerList set [_foreachIndex, "X"]; - _adjustedList = true; - } else { - if (isNil "_filter" || {(ConfigFile >> "CfgACE_Triggers" >> (_x select 4)) == _filter}) then { - _list pushBack _x; - }; - }; + if (isNull (_x select 0)) then { + _clackerList set [_foreachIndex, "X"]; + _adjustedList = true; + } else { + if (isNil "_filter" || {(ConfigFile >> "CfgACE_Triggers" >> (_x select 4)) == _filter}) then { + _list pushBack _x; + }; + }; } foreach _clackerList; if (_adjustedList) then { - _clackerList = _clackerList - ["X"]; - if (count _clackerList == 0) then { - _unit SetVariable [QGVAR(Clackers), nil, true]; - } else { - _unit SetVariable [QGVAR(Clackers), _clackerList, true]; - }; + _clackerList = _clackerList - ["X"]; + if (count _clackerList == 0) then { + _unit SetVariable [QGVAR(Clackers), nil, true]; + } else { + _unit SetVariable [QGVAR(Clackers), _clackerList, true]; + }; }; _list diff --git a/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf b/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf index d6d5b57b3b..b57f4f9f16 100644 --- a/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf +++ b/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf @@ -19,9 +19,9 @@ private ["_explosive"]; if (isNil QGVAR(CellphoneIEDs)) exitWith {[]}; _explosive = []; { - if ((_x select 1) == _code) exitWith { - _explosive = _x; - }; - false + if ((_x select 1) == _code) exitWith { + _explosive = _x; + }; + false } count GVAR(CellphoneIEDs); _explosive diff --git a/addons/explosives/functions/fnc_handleScrollWheel.sqf b/addons/explosives/functions/fnc_handleScrollWheel.sqf index 8c842b8a05..3bef53e196 100644 --- a/addons/explosives/functions/fnc_handleScrollWheel.sqf +++ b/addons/explosives/functions/fnc_handleScrollWheel.sqf @@ -14,7 +14,6 @@ * Public: No */ #include "script_component.hpp" -private ["_obj"]; if (isNull(GVAR(Setup)) || {ACE_Modifier == 0} || !GVAR(pfeh_running)) exitWith {false}; _this = _this * 5; GVAR(Setup) setDir ((getDir GVAR(Setup)) + _this); diff --git a/addons/explosives/functions/fnc_hasExplosives.sqf b/addons/explosives/functions/fnc_hasExplosives.sqf index ef1deef28a..794cebc57d 100644 --- a/addons/explosives/functions/fnc_hasExplosives.sqf +++ b/addons/explosives/functions/fnc_hasExplosives.sqf @@ -19,9 +19,9 @@ _result = false; _unit = _this select 0; _magazines = magazines _unit; { - if (getNumber (ConfigFile >> "CfgMagazines" >> _x >> "ACE_Placeable") == 1) exitWith { - _result = true; - }; + if (getNumber (ConfigFile >> "CfgMagazines" >> _x >> "ACE_Placeable") == 1) exitWith { + _result = true; + }; } count _magazines; _result diff --git a/addons/explosives/functions/fnc_module.sqf b/addons/explosives/functions/fnc_module.sqf index 432671b551..3e522e9a70 100644 --- a/addons/explosives/functions/fnc_module.sqf +++ b/addons/explosives/functions/fnc_module.sqf @@ -20,7 +20,9 @@ _activated = _this select 2; if !(_activated) exitWith {}; -[_logic, QGVAR(RequireSpecialist), "RequireSpecialist" ] call EFUNC(Common,readSettingFromModule); -[_logic, QGVAR(PunishNonSpecialists), "PunishNonSpecialists" ] call EFUNC(Common,readSettingFromModule); +[_logic, QGVAR(RequireSpecialist), "RequireSpecialist"] + call EFUNC(Common,readSettingFromModule); +[_logic, QGVAR(PunishNonSpecialists),"PunishNonSpecialists"] + call EFUNC(Common,readSettingFromModule); diag_log text "[ACE]: Explosive Module Initialized."; diff --git a/addons/explosives/functions/fnc_onLanded.sqf b/addons/explosives/functions/fnc_onLanded.sqf new file mode 100644 index 0000000000..409b6a286f --- /dev/null +++ b/addons/explosives/functions/fnc_onLanded.sqf @@ -0,0 +1,39 @@ +/* + * Author: Garth 'L-H' de Wet + * + * Arguments: + * + * Return Value: + * None + * + * Example: + * object addEventHandler ["EpeContactStart", ACE_explosive_fnc_onLanded]; + * + * Public: No + */ +#include "script_component.hpp" +EXPLODE_2_PVT(_this,_explosive,_hitTarget); + +if ((_explosive getVariable [QGVAR(Handled), false])) exitWith {}; + +_explosive setVariable [QGVAR(Handled), true]; +if (!isNull _hitTarget && {_hitTarget isKindOf "AllVehicles"}) then { + _explosive attachTo [_hitTarget]; + private "_dir"; + _dir = _setup getVariable [QGVAR(Direction), 0]; + _dir = _dir - (getDir _hitTarget); + [[_explosive, _dir, 0], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc); +} else { + [{ + EXPLODE_2_PVT(_this,_player,_explosive); + private "_pos"; + _player setVariable [QGVAR(PlantingExplosive), false]; + if (surfaceIsWater _pos) then { + _pos = getPosASL _explosive; + _explosive setPosASL _pos; + }else{ + _pos = getPosATL _explosive; + _explosive setPosATL _pos; + }; + }, [ACE_player, _explosive], 0.5, 0.1] call EFUNC(common,waitAndExecute); +}; diff --git a/addons/explosives/functions/fnc_openDetonateUI.sqf b/addons/explosives/functions/fnc_openDetonateUI.sqf deleted file mode 100644 index a14865bc20..0000000000 --- a/addons/explosives/functions/fnc_openDetonateUI.sqf +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet - * Opens the UI for explosive detonation selection - * - * Arguments: - * 0: Unit - * 1: Trigger classname - * - * Return Value: - * None - * - * Example: - * [player, "ACE_M26_Clacker"] call ACE_Explosives_fnc_openDetonateUI; - * - * Public: No - */ -#include "script_component.hpp" -private ["_unit","_result", "_item"]; -call EFUNC(interaction,hideMenu); -_unit = _this select 0; -_detonator = _this select 1; -_range = GetNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range"); - -_result = [_unit] call FUNC(getPlacedExplosives); -_actions = [localize "STR_ACE_Explosives_DetonateMenu", localize "STR_ACE_Explosives_Detonate"] - call EFUNC(interaction,prepareSelectMenu); -_count = 0; -{ - if (!isNull(_x select 0)) then { - _required = getArray (ConfigFile >> "CfgACE_Triggers" >> (_x select 4) >> "requires"); - if (_detonator in _required) then { - _item = ConfigFile >> "CfgMagazines" >> (_x select 3); - _actions = [ - _actions, - _x select 2, - getText(_item >> "picture"), - [_foreachIndex, _range] - ] call EFUNC(interaction,AddSelectableItem); - _count = _count + 1; - }; - }; -} foreach _result; -if (_count > 0) then { - [ - _actions, - { - [ - ACE_player, - [_this select 1] call EFUNC(common,toNumber), - (ACE_player getVariable [QGVAR(Clackers), []]) select ([_this select 0] call EFUNC(common,toNumber)), - false - ] call FUNC(detonateExplosive); - call EFUNC(interaction,hideMenu); - }, - {[ACE_player] call FUNC(openTransmitterUI);} - ] call EFUNC(interaction,openSelectMenu); -}else{ - call EFUNC(interaction,hideMenu); - [ACE_player] call FUNC(openTransmitterUI); - [localize "STR_ACE_Explosives_NoExplosivesAvailable"] call EFUNC(common,displayTextStructured); -}; diff --git a/addons/explosives/functions/fnc_openPlaceUI.sqf b/addons/explosives/functions/fnc_openPlaceUI.sqf deleted file mode 100644 index 6eb2d478bf..0000000000 --- a/addons/explosives/functions/fnc_openPlaceUI.sqf +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet - * Opens the UI for explosive placement selection - * - * Arguments: - * 0: Unit - * - * Return Value: - * None - * - * Example: - * [player] call ACE_Explosives_fnc_openPlaceUI; - * - * Public: No - */ -#include "script_component.hpp" -private ["_unit","_mags", "_item", "_index", "_actions"]; -_unit = _this select 0; -call FUNC(place_Cancel); - -_mags = magazines _unit; -_list = []; -_itemCount = []; -{ - _item = ConfigFile >> "CfgMagazines" >> _x; - if (getNumber(_item >> "ACE_Placeable") == 1) then { - _index = _list find _item; - if (_index != -1) then { - _itemCount set [_index, (_itemCount select _index) + 1]; - } else { - _list pushBack _item; - _itemCount pushBack 1; - }; - }; -} forEach _mags; -_actions = [localize "STR_ACE_Explosives_PlaceMenu", localize "STR_ACE_Explosives_Place"] - call EFUNC(interaction,prepareSelectMenu); -{ - _actions = [ - _actions, - format [getText(_x >> "displayName") + " (%1)", _itemCount select _foreachIndex], - getText(_x >> "picture"), - configName _x - ] call EFUNC(interaction,AddSelectableItem); -} foreach _list; - -[ - _actions, - { - [_this] call FUNC(openTriggerSelectionUI); - }, - { - call EFUNC(interaction,hideMenu); - } -] call EFUNC(interaction,openSelectMenu); diff --git a/addons/explosives/functions/fnc_openTimerSetUI.sqf b/addons/explosives/functions/fnc_openTimerSetUI.sqf index d7f6ef30d8..e37bef06e3 100644 --- a/addons/explosives/functions/fnc_openTimerSetUI.sqf +++ b/addons/explosives/functions/fnc_openTimerSetUI.sqf @@ -3,24 +3,39 @@ * Opens the UI for timer setting of an explosive * * Arguments: - * 0: Magazine + * 0: Explosive + * 1: Magazine * * Return Value: * None * * Example: - * ["SatchelCharge_Remote_Mag"] call ACE_Explosives_fnc_openTimerSetUI; + * [_explosive, "SatchelCharge_Remote_Mag"] call ACE_Explosives_fnc_openTimerSetUI; * * Public: No */ #include "script_component.hpp" -private ["_mag"]; -_mag = _this select 0; +EXPLODE_2_PVT(_this,_explosive,_mag); createDialog "RscACE_SelectTimeUI"; sliderSetRange [8845, 5, 900]; // 5seconds - 15minutes sliderSetPosition [8845, 30]; -buttonSetAction [8860, format[QUOTE([ARR_4(ACE_player,'%1','Timer',floor sliderPosition 8845)] call FUNC(setupExplosive);closeDialog 0;), _mag]]; -buttonSetAction [8855, format[QUOTE(['%1'] call FUNC(openTriggerSelectionUI);), _mag]]; +GVAR(explosive) = _explosive; + +DFUNC(SetTimer) = { + [ + ACE_player, + getPosATL GVAR(explosive), + GVAR(explosive) getVariable QGVAR(Direction), + GVAR(explosive) getVariable QGVAR(class), + "Timer", + [floor sliderPosition 8845], + GVAR(explosive) + ] call FUNC(placeExplosive); + closeDialog 0; +}; + +buttonSetAction [8860, QUOTE(call DFUNC(SetTimer);)]; +buttonSetAction [8855, QUOTE(closeDialog 0;)]; ctrlSetText [8870, format[localize "STR_ACE_Explosives_TimerMenu",0, 30]]; diff --git a/addons/explosives/functions/fnc_openTransmitterUI.sqf b/addons/explosives/functions/fnc_openTransmitterUI.sqf deleted file mode 100644 index f90636474e..0000000000 --- a/addons/explosives/functions/fnc_openTransmitterUI.sqf +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet - * Opens the UI for selecting the transmitter - * - * Arguments: - * 0: Unit - * - * Return Value: - * Nothing - * - * Example: - * [player] call ACE_Explosives_fnc_openTransmitterUI; - * - * Public: No - */ -#include "script_component.hpp" -private ["_items", "_unit", "_count", "_actions", "_config"]; -_unit = _this select 0; -_items = (items _unit); - -_actions = [localize "STR_ACE_Explosives_TriggerMenu", localize "STR_ACE_Explosives_SelectTrigger"] - call EFUNC(interaction,prepareSelectMenu); -_detonators = [_unit] call FUNC(getDetonators); -{ - _config = ConfigFile >> "CfgWeapons" >> _x; - _actions = [ - _actions, - getText(_config >> "displayName"), - getText(_config >> "picture"), - _x - ] call EFUNC(interaction,addSelectableItem); -} count _detonators; - -if (count _detonators == 0) then { - call EFUNC(interaction,hideMenu); - "ACE_Explosives" call EFUNC(interaction,openMenuSelf); - [format[localize "STR_ACE_Explosives_NoTriggersAvailable", "player"]] call EFUNC(Common,displayTextStructured); -}else{ - [ - _actions, - { - [ACE_player, _this] call FUNC(openDetonateUI); - }, - { - call EFUNC(interaction,hideMenu); - } - ] call EFUNC(interaction,openSelectMenu); -}; diff --git a/addons/explosives/functions/fnc_openTriggerSelectionUI.sqf b/addons/explosives/functions/fnc_openTriggerSelectionUI.sqf deleted file mode 100644 index 011bda9bee..0000000000 --- a/addons/explosives/functions/fnc_openTriggerSelectionUI.sqf +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet - * Opens the UI for explosive trigger selection - * - * Arguments: - * 0: Explosive Magazine - * - * Return Value: - * None - * - * Example: - * [lbData [8866, lbCurSel 8866]] call ACE_Explosives_fnc_openTriggerSelectionUI; - * - * Public: No - */ -#include "script_component.hpp" -private ["_magazine", "_hasRequiredItems","_triggerTypes", "_actions", "_detonators", "_required", "_magTriggers"]; -_magazine = _this select 0; -_detonators = [ACE_player] call FUNC(getDetonators); - -_triggerTypes = [_magazine] call FUNC(triggerType); -_magTriggers = ConfigFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers"; -_actions = [localize "STR_ACE_Explosives_TriggerMenu", localize "STR_ACE_Explosives_SelectTrigger"] - call EFUNC(interaction,prepareSelectMenu); -_count = 0; -{ - _required = getArray (_x >> "requires"); - _hasRequiredItems = true; - { - if !(_x in _detonators) exitWith { - _hasRequiredItems = false; - }; - } count _required; - if (_hasRequiredItems) then { - _actions = [ - _actions, - if(isText(_magTriggers >> configName _x >> "displayName"))then{getText(_magTriggers >> configName _x >> "displayName")}else{getText(_x >> "displayName")}, - if(isText(_magTriggers >> configName _x >> "picture"))then{getText(_magTriggers >> configName _x >> "picture")}else{getText(_x >> "picture")}, - [configName _x, _magazine] - ] call EFUNC(interaction,addSelectableItem); - _count = _count + 1; - }; -} count _triggerTypes; - -if (_count == 0) then { - [ACE_player] call FUNC(openPlaceUI); - [format[localize "STR_ACE_Explosives_NoTriggersAvailable", - getText(configFile >> "CfgMagazines" >> _magazine >> "DisplayName")]] call EFUNC(Common,displayTextStructured); -}else{ - [ - _actions, - { - [_this select 1, _this select 0] call FUNC(selectTrigger); - }, - {[ACE_player] call FUNC(openPlaceUI);} - ] call EFUNC(interaction,openSelectMenu); -}; diff --git a/addons/explosives/functions/fnc_placeExplosive.sqf b/addons/explosives/functions/fnc_placeExplosive.sqf index ce43698309..90997fd2ad 100644 --- a/addons/explosives/functions/fnc_placeExplosive.sqf +++ b/addons/explosives/functions/fnc_placeExplosive.sqf @@ -7,55 +7,57 @@ * 1: Position to place explosive * 2: Rotation * 3: Magazine class - * 4: Config of trigger + * 4: Config of trigger * 5: Variables required for the trigger type - * 6: Should direction be set + * 6: Explosive placeholder * * Return Value: * Placed explosive * * Example: * _explosive = [player, player modelToWorldVisual [0,0.5, 0.1], 134, - * "SatchelCharge_Remote_Mag", "Command", []] call ACE_Explosives_fnc_placeExplosive; + * "SatchelCharge_Remote_Mag", "Command", []] call ACE_Explosives_fnc_placeExplosive; * * Public: Yes */ #include "script_component.hpp" -private ["_pos", "_dir", "_magazineClass", "_ammo", "_triggerSpecificVars", "_unit", "_triggerConfig", "_explosive"]; -_unit = _this select 0; -_pos = _this select 1; -_dir = _this select 2; -_magazineClass = _this select 3; -_triggerConfig = _this select 4; -_triggerSpecificVars = _this select 5; -_setDir = true; +private ["_ammo", "_explosive"]; +EXPLODE_6_PVT(_this,_unit,_pos,_dir,_magazineClass,_triggerConfig,_triggerSpecificVars); if (count _this > 6) then { - _setDir = _this select 6; + deleteVehicle (_this select 6); }; if (isNil "_triggerConfig") exitWith { - diag_log format ["ACE_Explosives: Error config not passed to PlaceExplosive: %1", _this]; - objNull + diag_log format ["ACE_Explosives: Error config not passed to PlaceExplosive: %1", _this]; + objNull }; _magazineTrigger = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> _triggerConfig; _triggerConfig = ConfigFile >> "CfgACE_Triggers" >> _triggerConfig; if (isNil "_triggerConfig") exitWith { - diag_log format ["ACE_Explosives: Error config not found in PlaceExplosive: %1", _this]; - objNull + diag_log format ["ACE_Explosives: Error config not found in PlaceExplosive: %1", _this]; + objNull }; _ammo = getText(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ammo"); if (isText(_magazineTrigger >> "ammo")) then { - _ammo = getText (_magazineTrigger >> "ammo"); + _ammo = getText (_magazineTrigger >> "ammo"); }; _triggerSpecificVars pushBack _triggerConfig; +private ["_defuseHelper"]; +_defuseHelper = createVehicle ["ACE_DefuseObject", _pos, [], 0, "NONE"]; +_defuseHelper setPosATL _pos; + _explosive = createVehicle [_ammo, _pos, [], 0, "NONE"]; +_defuseHelper attachTo [_explosive, [0,0,0], ""]; +_defuseHelper setVariable [QGVAR(Explosive),_explosive,true]; + +_expPos = getPosATL _explosive; +_defuseHelper setPosATL (((getPosATL _defuseHelper) vectorAdd (_pos vectorDiff _expPos))); +_explosive setPosATL _pos; + if (isText(_triggerConfig >> "onPlace") && {[_unit,_explosive,_magazineClass,_triggerSpecificVars] - call compile (getText (_triggerConfig >> "onPlace"))}) exitWith {_explosive}; -if (_setDir) then { - [[_explosive, _dir, getNumber (_magazineTrigger >> "pitch")], QFUNC(setPosition)] - call EFUNC(common,execRemoteFnc); -}; + call compile (getText (_triggerConfig >> "onPlace"))}) exitWith {_explosive}; +[[_explosive, _dir, getNumber (_magazineTrigger >> "pitch")], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc); _explosive diff --git a/addons/explosives/functions/fnc_place_Approve.sqf b/addons/explosives/functions/fnc_place_Approve.sqf index 77cfbb92a1..dc94bf3731 100644 --- a/addons/explosives/functions/fnc_place_Approve.sqf +++ b/addons/explosives/functions/fnc_place_Approve.sqf @@ -16,90 +16,30 @@ */ #include "script_component.hpp" if (GVAR(pfeh_running)) then { - [QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler); - GVAR(pfeh_running) = false; + [QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler); + GVAR(pfeh_running) = false; }; private ["_mag", "_setup", "_player"]; _setup = GVAR(Setup); GVAR(Setup) = objNull; [GVAR(placer), "ACE_Explosives", false] call EFUNC(Common,setForceWalkStatus); +[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Place), -1]] call EFUNC(Common,removeActionEventHandler); +[ACE_player, "MenuBack", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); GVAR(placer) = objNull; _player = ACE_player; -[_player, "DefaultAction", _player getVariable [QGVAR(Place), -1]] call EFUNC(Common,removeActionEventHandler); -[_player, "MenuBack", _player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); call EFUNC(interaction,hideMouseHint); if ((_setup getVariable [QGVAR(Class), ""]) == "") exitWith { - deleteVehicle _setup; + deleteVehicle _setup; }; _dir = (getDir _setup); if (_dir > 180) then { - _dir = _dir - 180; + _dir = _dir - 180; } else { - _dir = 180 + _dir; + _dir = 180 + _dir; }; _setup setVariable [QGVAR(Direction), _dir]; _player setVariable [QGVAR(PlantingExplosive), true]; -_setup addEventHandler ["EpeContactStart", { - if (!((_this select 0) getVariable [QGVAR(Handled), false])) then { - private ["_player", "_pos", "_attachTo"]; - _player = ACE_player; - _player setVariable [QGVAR(PlantingExplosive), false]; - _pos = getPosATL (_this select 0); - (_this select 0) enableSimulationGlobal false; - if (surfaceIsWater _pos) then { - _pos = getPosASL (_this select 0); - (_this select 0) setPosASL _pos; - }else{ - (_this select 0) setPosATL _pos; - }; - (_this select 0) setVariable [QGVAR(Handled), true]; - _attachTo = objNull; - if (!isNull (_this select 1) && {(_this select 1) isKindOf "AllVehicles"}) then { - _attachTo = (_this select 1); - }; - [(_this select 0),_attachTo, _pos] spawn { // TODO: Change to scheduled delay execution - private ["_mag", "_setup", "_dir", "_player"]; - _setup = _this select 0; - _player = ACE_player; - _mag = _setup getVariable [QGVAR(Class), ""]; - _dir = _setup getVariable [QGVAR(Direction), 0]; - - sleep getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "ACE_DelayTime"); - _explosive = [_player, _this select 2, _dir, _mag, _setup getVariable QGVAR(Trigger), - [_setup getVariable QGVAR(Timer)], isNull (_this select 1)] call FUNC(placeExplosive); - deleteVehicle _setup; - if (!isNull(_explosive)) then { - _player RemoveMagazine _mag; - if (!isNull (_this select 1)) then { - _explosive attachTo [(_this select 1)]; - _dir = _dir - (getDir (_this select 1)); - [[_explosive, _dir, 0], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc); - }; - }; - }; - }; -}]; +_setup addEventHandler ["EpeContactStart", FUNC(onLanded)]; _setup enableSimulationGlobal true; _player playActionNow "MedicOther"; -[_setup] spawn { // TODO: Change to scheduled delay execution - private ["_setup", "_player"]; - _setup = _this select 0; - _player = ACE_player; - sleep 5; - _player setVariable [QGVAR(PlantingExplosive), false]; - if (!isNull _setup) then { - private ["_mag", "_dir", "_delayTime"]; - _mag = _setup getVariable [QGVAR(Class), ""]; - _dir = _setup getVariable [QGVAR(Direction), 0]; - _delayTime = (getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "ACE_DelayTime")) - 5; - if (_delayTime > 0) then { - sleep _delayTime; - }; - if (!isNull _setup) then { - [_player, GetPosATL _setup, _dir, _mag, _setup getVariable QGVAR(Trigger), - [_setup getVariable QGVAR(Timer)], true] call FUNC(placeExplosive); - deleteVehicle _setup; - _player RemoveMagazine _mag; - }; - }; -}; +_player removeMagazine (_setup getVariable [QGVAR(Class), ""]); diff --git a/addons/explosives/functions/fnc_place_Cancel.sqf b/addons/explosives/functions/fnc_place_Cancel.sqf index c149d35584..78d718e283 100644 --- a/addons/explosives/functions/fnc_place_Cancel.sqf +++ b/addons/explosives/functions/fnc_place_Cancel.sqf @@ -15,18 +15,18 @@ */ #include "script_component.hpp" if (GVAR(pfeh_running)) then { - [QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler); - GVAR(pfeh_running) = false; + [QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler); + GVAR(pfeh_running) = false; }; if (!isNull (GVAR(Setup))) then { - deleteVehicle GVAR(Setup); + deleteVehicle GVAR(Setup); }; GVAR(Setup) = objNull; if (isNil {GVAR(placer)}) then { - GVAR(placer) = objNull; + GVAR(placer) = objNull; }; [GVAR(placer), "ACE_Explosives", false] call EFUNC(Common,setForceWalkStatus); GVAR(placer) = objNull; call EFUNC(interaction,hideMouseHint); [ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Place), -1]] call EFUNC(Common,removeActionEventHandler); -[ACE_player, "MenuBack", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); +[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); diff --git a/addons/explosives/functions/fnc_removeFromSpeedDial.sqf b/addons/explosives/functions/fnc_removeFromSpeedDial.sqf index c0a467e6f1..c67313966c 100644 --- a/addons/explosives/functions/fnc_removeFromSpeedDial.sqf +++ b/addons/explosives/functions/fnc_removeFromSpeedDial.sqf @@ -18,9 +18,9 @@ private "_speedDial"; _speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; if (count _speedDial == 0) exitWith {}; { - if ((_x select 0) == (_this select 0)) exitWith { - _speedDial set [_foreachIndex, "x"]; - _speedDial = _speedDial - ["x"]; - ace_player setVariable [QGVAR(SpeedDial),_speedDial]; - }; + if ((_x select 0) == (_this select 0)) exitWith { + _speedDial set [_foreachIndex, "x"]; + _speedDial = _speedDial - ["x"]; + ace_player setVariable [QGVAR(SpeedDial),_speedDial]; + }; } foreach _speedDial; diff --git a/addons/explosives/functions/fnc_selectTrigger.sqf b/addons/explosives/functions/fnc_selectTrigger.sqf index 8c51fd2c9c..a27d512475 100644 --- a/addons/explosives/functions/fnc_selectTrigger.sqf +++ b/addons/explosives/functions/fnc_selectTrigger.sqf @@ -3,26 +3,26 @@ * Selects a trigger for an explosive. * * Arguments: - * 0: Magazine - * 1: Trigger mode + * 0: Explosive + * 1: Magazine + * 2: Trigger mode * * Return Value: * None * * Example: - * ["SatchelCharge_Remote_Mag","Timer"] call ACE_Explosives_fnc_selectTrigger; + * [_explosive, "SatchelCharge_Remote_Mag","Timer"] call ACE_Explosives_fnc_selectTrigger; * * Public: No */ #include "script_component.hpp" -private ["_magazine","_trigger"]; +private ["_config"]; closeDialog 0; -_magazine = _this select 0; -_trigger = _this select 1; -_config = ConfigFile >> "CfgACE_Triggers" >> _trigger; call EFUNC(interaction,hideMenu); +EXPLODE_3_PVT(_this,_explosive,_magazine,_trigger); +_config = ConfigFile >> "CfgACE_Triggers" >> _trigger; // If the onSetup function returns true, it is handled elsewhere -if (isText(_config >> "onSetup") && {[_magazine] call compile getText (_config >> "onSetup")}) exitWith {}; +if (isText(_config >> "onSetup") && {[_explosive,_magazine] call compile getText (_config >> "onSetup")}) exitWith {}; -[ACE_player, _magazine, _trigger] call FUNC(setupExplosive); +[ACE_player, getPosATL _explosive, _explosive getVariable [QGVAR(Direction), 0],_magazine, _trigger, [], _explosive] call ACE_Explosives_fnc_placeExplosive; diff --git a/addons/explosives/functions/fnc_setPosition.sqf b/addons/explosives/functions/fnc_setPosition.sqf index 2f61c522aa..dcf2537776 100644 --- a/addons/explosives/functions/fnc_setPosition.sqf +++ b/addons/explosives/functions/fnc_setPosition.sqf @@ -16,10 +16,8 @@ * Public: Yes */ #include "script_component.hpp" -private "_ex"; -_ex = _this select 0; -_ex setDir (_this select 1); -if ((_this select 2) != 0) then { - [_ex, _this select 2, 0] call CALLSTACK(BIS_fnc_setPitchBank); +EXPLODE_3_PVT(_this,_explosive,_direction,_pitch); +_explosive setDir _direction; +if (_pitch != 0) then { + [_explosive, _pitch, 0] call CALLSTACK(BIS_fnc_setPitchBank); }; -//_ex setVectorUp (surfaceNormal _pos); diff --git a/addons/explosives/functions/fnc_setupExplosive.sqf b/addons/explosives/functions/fnc_setupExplosive.sqf index 7f80ba7e63..ea3a086274 100644 --- a/addons/explosives/functions/fnc_setupExplosive.sqf +++ b/addons/explosives/functions/fnc_setupExplosive.sqf @@ -5,60 +5,45 @@ * Arguments: * 0: Unit * 1: Classname of explosive to place. (CfgMagazine class) - * 2: Trigger Config - * 3: Timer (optional) * * Return Value: * None * * Example: - * [player, "SatchelCharge_Remote_Mag", "Command"] call ACE_Explosives_fnc_SetupExplosive; + * [player, "SatchelCharge_Remote_Mag"] call ACE_Explosives_fnc_SetupExplosive; * * Public: Yes */ #include "script_component.hpp" -private ["_unit", "_class", "_config", "_timer"]; -_unit = _this select 0; -_class = _this select 1; -_config = _this select 2; -_timer = _this select 3; +closeDialog 0; +EXPLODE_2_PVT(_this,_unit,_class); GVAR(placer) = _unit; -// Commented out due to the fact there is a distinction between who can deactivate mines and who can plant them in standard configs. -// Would require custom config entries (ACE_ExplosiveSpecialist/ACE_Specialist) which excludes custom mods. -//if (ACE_Explosives_RequireSpecialist && {!([_unit] call ACE_Core_fnc_isEOD)}) exitWith {}; -if (isNil "_config") then { - _config = getArray(ConfigFile >> "CfgMagazines" >> _class >> "ACE_Triggers" >> "SupportedTriggers") select 0; -}; - -GVAR(Setup) = getText(ConfigFile >> "CfgMagazines" >> _class >> "ACE_SetupObject") createVehicleLocal [0,0,-10000]; +// TODO: check MP performance and MP compatible. +GVAR(Setup) = createVehicle [getText(ConfigFile >> "CfgMagazines" >> _class >> "ACE_SetupObject"),[0,0,-10000],[], 0, "NONE"]; GVAR(Setup) enableSimulationGlobal false; -GVAR(Setup) setVariable [QGVAR(Class), _class]; -GVAR(Setup) setVariable [QGVAR(Trigger), _config]; -//GVAR(Setup) setVariable [QGVAR(Offset), GetArray(ConfigFile >> "CfgVehicles" >> typeof GVAR(Setup) >> "ACE_Offset")]; -if (!isNil "_timer") then { - GVAR(Setup) setVariable [QGVAR(Timer), _timer]; -}; +GVAR(Setup) setVariable [QGVAR(class), _class, true]; [_unit, "ACE_Explosives", true] call EFUNC(common,setForceWalkStatus); GVAR(TweakedAngle) = 180; + [QGVAR(Placement),"OnEachFrame", { - private "_player"; - _player = ACE_player; - if (GVAR(placer) != _player) exitWith { - call FUNC(place_Cancel); - }; - GVAR(pfeh_running) = true; - _pos = (ASLtoATL eyePos _player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]); - //_pos = _pos vectorAdd ((VectorDir GVAR(Setup)) vectorCrossProduct (GVAR(Setup) getVariable [QGVAR(Offset), [0,0,0]])); - GVAR(Setup) setPosATL _pos; - if (ACE_Modifier == 0) then { - GVAR(Setup) setDir (GVAR(TweakedAngle) + getDir _player); - }; + private "_player"; + _player = ACE_player; + if (GVAR(placer) != _player) exitWith { + call FUNC(place_Cancel); + }; + GVAR(pfeh_running) = true; + _pos = (ASLtoATL eyePos _player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]); + GVAR(Setup) setPosATL _pos; + if (ACE_Modifier == 0) then { + GVAR(Setup) setDir (GVAR(TweakedAngle) + getDir _player); + }; }] call CALLSTACK(BIS_fnc_addStackedEventHandler); + [localize "STR_ACE_Explosives_PlaceAction", localize "STR_ACE_Explosives_CancelAction", - localize "STR_ACE_Explosives_ScrollAction"] call EFUNC(interaction,showMouseHint); + localize "STR_ACE_Explosives_ScrollAction"] call EFUNC(interaction,showMouseHint); _unit setVariable [QGVAR(Place), [_unit, "DefaultAction", - {GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call FUNC(place_Approve);}] call EFUNC(common,AddActionEventHandler)]; -_unit setVariable [QGVAR(Cancel), [_unit, "MenuBack", - {GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call FUNC(place_Cancel);}] call EFUNC(common,AddActionEventHandler)]; + {GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call FUNC(place_Approve);}] call EFUNC(common,AddActionEventHandler)]; +_unit setVariable [QGVAR(Cancel), [_unit, "zoomtemp", + {GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call FUNC(place_Cancel);}] call EFUNC(common,AddActionEventHandler)]; diff --git a/addons/explosives/functions/fnc_startDefuse.sqf b/addons/explosives/functions/fnc_startDefuse.sqf index 35e5e682df..7eacdd33e1 100644 --- a/addons/explosives/functions/fnc_startDefuse.sqf +++ b/addons/explosives/functions/fnc_startDefuse.sqf @@ -15,49 +15,48 @@ * Public: Yes */ #include "script_component.hpp" -private ["_unit","_target"]; -_unit = _this select 0; -_target = _this select 1; +EXPLODE_2_PVT(_this,_unit,_target); +_target = attachedTo (_target); _fnc_DefuseTime = { - _target = _this select 1; + EXPLODE_2_PVT(_this,_specialist,_target); - _defuseTime = 5; - if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime")) then { - _defuseTime = getNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime"); - }; - if (!(_this select 0) && {GVAR(PunishNonSpecialists)}) then { - _defuseTime = _defuseTime * 1.5; - }; - _defuseTime + _defuseTime = 5; + if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime")) then { + _defuseTime = getNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime"); + }; + if (!_specialist && {GVAR(PunishNonSpecialists)}) then { + _defuseTime = _defuseTime * 1.5; + }; + _defuseTime }; _actionToPlay = "MedicOther"; if (STANCE _unit == "Prone") then { - _actionToPlay = "PutDown"; + _actionToPlay = "PutDown"; }; if (ACE_player != _unit) then { - // If the unit is a player, call the function on the player. - if (isPlayer _unit) then { - [[_unit, _target], QFUNC(startDefuse), _unit] call EFUNC(common,execRemoteFnc); - } else { - // TODO: use scheduled delay execution - [_unit, _target, [[_unit] call EFUNC(Common,isEOD), _target] call _fnc_DefuseTime] spawn { - (_this select 0) playActionNow _actionToPlay; - (_this select 0) disableAI "MOVE"; - (_this select 0) disableAI "TARGET"; - sleep (_this select 2); - [(_this select 0), (_this select 1)] call FUNC(defuseExplosive); - (_this select 0) enableAI "MOVE"; - (_this select 0) enableAI "TARGET"; + // If the unit is a player, call the function on the player. + if (isPlayer _unit) then { + [[_unit, _target], QFUNC(startDefuse), _unit] call EFUNC(common,execRemoteFnc); + } else { + // TODO: use scheduled delay execution + [_unit, _target, [[_unit] call EFUNC(Common,isEOD), _target] call _fnc_DefuseTime] spawn { + (_this select 0) playActionNow _actionToPlay; + (_this select 0) disableAI "MOVE"; + (_this select 0) disableAI "TARGET"; + sleep (_this select 2); + [(_this select 0), (_this select 1)] call FUNC(defuseExplosive); + (_this select 0) enableAI "MOVE"; + (_this select 0) enableAI "TARGET"; + }; }; - }; } else { - _unit playActionNow _actionToPlay; - private ["_defuseSeconds", "_isEOD"]; - _isEOD = [_unit] call EFUNC(Common,isEOD); - _defuseSeconds = [_isEOD, _target] call _fnc_DefuseTime; - if (_isEOD || {!GVAR(RequireSpecialist)}) then { - [_defuseSeconds, [_unit,_target], {(_this select 0) call FUNC(defuseExplosive)}, {}, (localize "STR_ACE_Explosives_DefusingExplosive")] call EFUNC(common,progressBar); - }; + _unit playActionNow _actionToPlay; + private ["_defuseSeconds", "_isEOD"]; + _isEOD = [_unit] call EFUNC(Common,isEOD); + _defuseSeconds = [_isEOD, _target] call _fnc_DefuseTime; + if (_isEOD || {!GVAR(RequireSpecialist)}) then { + [_defuseSeconds, [_unit,_target], {(_this select 0) call FUNC(defuseExplosive)}, {}, (localize "STR_ACE_Explosives_DefusingExplosive")] call EFUNC(common,progressBar); + }; }; diff --git a/addons/explosives/functions/fnc_startTimer.sqf b/addons/explosives/functions/fnc_startTimer.sqf index f4b0876866..13da62ec29 100644 --- a/addons/explosives/functions/fnc_startTimer.sqf +++ b/addons/explosives/functions/fnc_startTimer.sqf @@ -21,6 +21,6 @@ EXPLODE_2_PVT(_this,_explosive,_delay); [{ _explosive = _this; if (!isNull _explosive) then { - [_explosive, -1, [_explosive, 0], true] call FUNC(detonateExplosive); + [_explosive, -1, [_explosive, 0]] call FUNC(detonateExplosive); }; }, _explosive, _delay, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/explosives/functions/fnc_triggerType.sqf b/addons/explosives/functions/fnc_triggerType.sqf index 4dba9a8d8e..8ebcbf6699 100644 --- a/addons/explosives/functions/fnc_triggerType.sqf +++ b/addons/explosives/functions/fnc_triggerType.sqf @@ -20,6 +20,6 @@ _config = getArray (ConfigFile >> "CfgMagazines" >> (_this select 0) >> "ACE_Tri _count = count _config; for "_index" from 0 to (_count - 1) do { - _result set [_index, ConfigFile >> "CfgACE_Triggers" >> (_config select _index)]; + _result set [_index, ConfigFile >> "CfgACE_Triggers" >> (_config select _index)]; }; _result diff --git a/addons/explosives/script_component.hpp b/addons/explosives/script_component.hpp index fa8b2bac4d..60c7e88d06 100644 --- a/addons/explosives/script_component.hpp +++ b/addons/explosives/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_EXPLOSIVES - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_EXPLOSIVES - #define DEBUG_SETTINGS DEBUG_SETTINGS_EXPLOSIVES + #define DEBUG_SETTINGS DEBUG_SETTINGS_EXPLOSIVES #endif #include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index c19c65ccb2..57ef190460 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -1,494 +1,497 @@ - - - Explosives - Sprengstoffe - Explosivos - Ładunki wybuchowe - Explosifs - Výbušniny - Esplosivi - Robbanóanyagok - Explosivos - Взрывчатка - - - Place >> - Platzieren >> - Colocar >> - Umieść >> - Placer >> - Položit >> - Piazza >> - Lerakás >> - Colocar >> - Установить >> - - - Detonate >> - Zünden >> - Detonar >> - Detonuj >> - Mise à feu >> - Odpálit >> - Detona >> - Robbantás >> - Detonar >> - Подрыв >> - - - Explosive code: %1 - Sprengstoffcode: %1 - Código del explosivo: %1 - Kod ładunku: %1 - Code explosif: %1 - Kód výbušniny: %1 - Codice dell'esplosivo : %1 - Robbanóanyag kódja: %1 - Código do explosivo: %1 - Взрывная код: %1 - - - Place - Platzieren - Colocar - Umieść - Placer - Položit - Piazza - Elhelyezés - Colocar - Положить - - - Cancel - Abbrechen - Cancelar - Anuluj - Annuler - Zrušit - Annulla - Mégsem - Cancelar - Отмена - - - + Modifier, rotates - + Modifikator, drehen - + Modificador, girar - + Modificateur, tourner - + Modificatore, rotazione - + Otočit - + Változtatás, forgatás - + modyfikator, obracanie - + Modificador, rotaciona - + Bращать - - - Turn On Thor III - Thor III aktivieren - Encender Thor III - Włącz Thor III - Allumer Thor III - Zapnout Thor III - Accendi Thor III - Thor III bekapcsolása - Ativar Thor III - Активировать Thor III - - - Turn Off Thor III - Thor III deaktivieren - Apagar Thor III - Wyłącz Thor III - Éteindre Thor III - Vypnout Thor III - Spegni Thor III - Thor III kikapcsolása - Desativar Thor III - Деактивировать Thor III - - - Cellphone - Mobiltelefon - Télefono móvil - Telefon komórkowy - Téléphone Portable - Telefon - Cellulare - Mobil - Celular - Сотовый телефон - - - Used to remotely trigger explosives - Wird benutzt um Sprengstoffe fernzuzünden - Usado para detonar remotamente explosivos - Używany do zdalnego detonowania ładunków wybuchowych - Utilisé pour déclencher des explosifs à distance - Používaný ke vzdálenému odpalování výbušnin - Usato per l'attivazione a distanza degli esplosivi - Robbanóanyagok távoli robbantásához - Usado para acionar explosivos remotamente - Используется для удаленного запуска взрывчатку - - - M57 Firing Device - M57 Zündvorrichtung - Dispositivo de detonación M57 - Zapalnik M57 - M57 Dispositif de mise à feu - M57 Odpalovací Zařízení - Detonatore M57 - M57 Detonátor - M57 Dispositivo de Detonação - Взрыватель M57 - - - Used to remotely trigger explosives - Wird benutzt um Sprengstoffe fernzuzünden - Usado para detonar remotamente explosivos - Używany do zdalnego detonowania ładunków wybuchowych - Utilisé pour déclencher des explosifs à distance - Použévané ke vzdálenému odpalování výbušnin - Usato per l'attivazione a distanza degli esplosivi - Robbanóanyagok távoli robbantásához - Usado para acionar explosivos remotamente - Используется для удаленного запуска взрывчатку - - - M26 Firing Device - M26 Zündvorrichtung - Dispositivo de detonación MK26 - Zapalnik M26 - M26 Dispositif de mise à feu - M26 Odpalovací Zařízení - Detonatore M26 - M26 Detonátor - M26 Dispositivo de Detonação - Взрыватель M26 - - - M152 RAMS - M152 RAMS - M152 RAMS - M152 RAMS - M152 RAMS - M152 RAMS - M152 RAMS - M152 RAMS - M152 RAMS - M152 RAMS - - - Defusal Kit - Entschärfungskit - Kit de desactivación - Zestaw do rozbrajania - Kit de désamorçage - Zneškodňovací sada - Kit E.O.D. - Hatástalanító felszerelés - Kit de desarme - Разминирование комплект - - - Allows defusing of explosives - Erlaubt die Entschärfung von Sprengstoffen - Permite desactivar explosivos - Umożliwia rozbrajanie ładunków wybuchowych - Permet de désamorçer des explosifs - Dovoluje zneškodňování výbušnin - Consente la disattivazione degli ordigni esplosivi - Robbanóanyagok hatástalanításához - Permite o desarme de explosivos - Allows defusing of explosives - - - Add to Speed Dial - Zur Schnellauswahl hinzufügen - Agregar a marcado rápido - Dodaj do szybkiego wybierania - Ajouter à la composition rapide - Přidat jako rychlou volbu - Aggiungi alla selezione rapida - Hozzáadás gyorshíváshoz - Adicionar à ligação rápida - Добавить в ускоренный набор - - - Clear - Löschen - Borrar - Usuń - Désamorçé - Čistý - Libera - Törlés - Limpar - Pассеиваться - - - Dial - Wählen - Marcar - Wybierz mumer - Composer - Vytočit - Composizione numero - Tárcsázás - Discar - Hабрать - - - Up - Hoch - Arriba - W górę - Haut - Nahoru - Sopra - Fel - Cima - Поднять - - - Down - Runter - Abajo - W dół - Bas - Dolu - Sotto - Le - Baixo - Опустить - - - Cancel - Abbrechen - Cancelar - Anuluj - Annuler - Zrušit - Annulla - Mégsem - Cancelar - Отмена - - - Detonate Menu - "Zünden"-Menü - Menú de detonación - Menu detonowania - Menu de mise à feu - Menu Detonace - Menù di detonazione - Robbantás menü - Menu de detonação - Меню Подрыв - - - Place Menu - "Platzieren"-Menü - Menú de colocación - Menu umieszczania - Menu Placement - Menu Umístění - Menù di collocamento - Lerakás menü - Menu de posicionamento - Меню Установить - - - Defuse - Entschärfen - Desactivar - Rozbrój - Désamorçer - Zneškodnit - Disinnesca - Hatástalanítás - Desarmar - Обезвредить - - - Defusing Explosive... - Entschärfe Sprengstoff... - Desactivando explosivo... - Rozbrajanie ładunku... - Désamorçage des explosifs... - Zneškodňuji Výbušninu... - Esposivo in fase di disattivazione... - Robbanóanyag hatástalaníása... - Desarmando Explosivo... - Обезвреживание... - - - Timer - Zeitzünder - Temporizador - Czasomierz - Retard - Časovač - Cronometro - Időzített - Timer - Временной - - - Time: %1m %2s - Zeit: %1m %2s - Tiempo: %1m %2s - Czas: %1m %2s - Temps : %1m %2s - Čas: %1m %2s - Tempo : %1m %2s - Idő: %1m %2s - Tempo: %1m %2s - Tемп: %1m %2c - - - Set Time - Zeit einstellen - Configurar tiempo - Ustaw czas - Régler retard - Nastavit Čas - Modifica il conto alla rovescia - Idő állítása - Configurar Tempo - Xронометр - - - Select a Trigger - Wähle einen Zünder - Seleccionar un disparador - Wybierz zapalnik - Sélectionner une mise à feu - Zvolit Detonátor - Seleziona un Attivatore - Detonátor kiválasztása - Selecionar um Gatilho - Выберите - - - Select - Wählen - Seleccionar - Wybierz - Sélectionner - Zvolit - Seleziona - Kiválasztás - Selecionar - Выбрать защелка - - - Pressure Plate - Płyta naciskowa - Placa de presión - Druckplatte - Plaque de pression - Nášlapná nástraha - Piastra a Pressione - Nyomólap - Placa de pressão - Давление - - - Tripwire - Linka naciągu - Cable trampa - Stolperdraht - Fil de butée - Nástražný drát - Filo a Inciampo - Botlódrót - Linha de tração - Натяжной - - - IR Sensor - Czujnik podczerwieni - Sensor IR - Infrarotsensor - Capteur IR - IR Značkovač - Sensore IR - IR szenzor - Sensor IV - ИК - - - No triggers available for %1 - Brak dostępnych zapalników dla %1 - No hay detonadores disponibles para %1 - Keine Auslöser vorhanden für %1 - Pas de mise à feu disponible pour %1 - Žádný detonátor k dispozici pro %1 - Nessun attivatore disponibile per %1 - Nincs detonátor a %1 - Nenhum gatilho disponível para %1 - Нет защелка доступны для %1 - - - IR Sensor (Side Attack) - Czujnik podczerwieni (wybuch na bok) - Sensor IR (ataque lateral) - Infrarotsensor (Seitenangriff) - Capteur IR (de flanc) - IR Značkovač (Výbuch stranou) - Sensore IR (Attacco laterale) - IR Sensor (Side Attack) - Sensor infravermelho (ataque lateral) - ИК (боковая атака) - - - Magnetic Influence Sensor (Bottom Attack) - Czujnik magnetyczny (wybuch w górę) - Sensor IM (ataque inferior) - Magnetfeldsensor (Bodenangriff) - Capteur Magnétique (par le bas) - Magnetický Senzor (Výbuch ze spoda) - Sensore Magnetico di Prossimità (Attacco inferiore) - Mágneses (Bottom Attack) - Influência magnética (ataque inferior) - Магнитный (дно атака) - - - No explosives on trigger. - Keine Sprengladungen auf diesem Auslöser. - Ningún explosivo en el detonador. - Pas d'explosif à mettre à feu. - Nessun esplosivo sul sensore. - Žádná výbušnina k odpálení. - Nincs robbanóanyag a detonátorhoz. - Brak ładunków na zapalnik. - Nenhum explosivo no gatilho. - Нет взрывчатки на курок. - - - Dead Man's Switch - Totmannschalter - Mise à feu par relâchement de pression - Spínač mrtvého muže - Czuwak - Detonador de hombre muerto - Dead Man's Switch - Кнопка мертвеца - - - Used to remotely trigger explosives when released. - Zündet Sprengladungen wenn losgelassen. - Déclenche la mise à feu d'un explosif lorsqu'il est libéré. - Používaný k vzdálenému odpálení, při uvolnění odpálí výbušniny - Używany w celu zdalnej detonacji ładunków kiedy jego operator zostanie zabity. - Utilizado para detonar explosivos remotamente al soltarlo. - Robbanóanyagok távoli robbantásához - Используется для дистанционного подрыва, после смерти оператора. - - + + + Explosives + Sprengstoffe + Explosivos + Ładunki wybuchowe + Explosifs + Výbušniny + Esplosivi + Robbanóanyagok + Explosivos + Взрывчатка + + + Place >> + Platzieren >> + Colocar >> + Umieść >> + Placer >> + Položit >> + Piazza >> + Lerakás >> + Colocar >> + Установить >> + + + Detonate >> + Zünden >> + Detonar >> + Detonuj >> + Mise à feu >> + Odpálit >> + Detona >> + Robbantás >> + Detonar >> + Подрыв >> + + + Explosive code: %1 + Sprengstoffcode: %1 + Código del explosivo: %1 + Kod ładunku: %1 + Code explosif: %1 + Kód výbušniny: %1 + Codice dell'esplosivo : %1 + Robbanóanyag kódja: %1 + Código do explosivo: %1 + Взрывная код: %1 + + + Place + Platzieren + Colocar + Umieść + Placer + Položit + Piazza + Elhelyezés + Colocar + Положить + + + Cancel + Abbrechen + Cancelar + Anuluj + Annuler + Zrušit + Annulla + Mégsem + Cancelar + Отмена + + + + Modifier, rotates + + Modifikator, drehen + + Modificador, girar + + Modificateur, tourner + + Modificatore, rotazione + + Otočit + + Változtatás, forgatás + + modyfikator, obracanie + + Modificador, rotaciona + + Bращать + + + Turn On Thor III + Thor III aktivieren + Encender Thor III + Włącz Thor III + Allumer Thor III + Zapnout Thor III + Accendi Thor III + Thor III bekapcsolása + Ativar Thor III + Активировать Thor III + + + Turn Off Thor III + Thor III deaktivieren + Apagar Thor III + Wyłącz Thor III + Éteindre Thor III + Vypnout Thor III + Spegni Thor III + Thor III kikapcsolása + Desativar Thor III + Деактивировать Thor III + + + Cellphone + Mobiltelefon + Télefono móvil + Telefon komórkowy + Téléphone Portable + Telefon + Cellulare + Mobil + Celular + Сотовый телефон + + + Used to remotely trigger explosives + Wird benutzt um Sprengstoffe fernzuzünden + Usado para detonar remotamente explosivos + Używany do zdalnego detonowania ładunków wybuchowych + Utilisé pour déclencher des explosifs à distance + Používaný ke vzdálenému odpalování výbušnin + Usato per l'attivazione a distanza degli esplosivi + Robbanóanyagok távoli robbantásához + Usado para acionar explosivos remotamente + Используется для удаленного запуска взрывчатку + + + M57 Firing Device + M57 Zündvorrichtung + Dispositivo de detonación M57 + Zapalnik M57 + M57 Dispositif de mise à feu + M57 Odpalovací Zařízení + Detonatore M57 + M57 Detonátor + M57 Dispositivo de Detonação + Взрыватель M57 + + + Used to remotely trigger explosives + Wird benutzt um Sprengstoffe fernzuzünden + Usado para detonar remotamente explosivos + Używany do zdalnego detonowania ładunków wybuchowych + Utilisé pour déclencher des explosifs à distance + Použévané ke vzdálenému odpalování výbušnin + Usato per l'attivazione a distanza degli esplosivi + Robbanóanyagok távoli robbantásához + Usado para acionar explosivos remotamente + Используется для удаленного запуска взрывчатку + + + M26 Firing Device + M26 Zündvorrichtung + Dispositivo de detonación MK26 + Zapalnik M26 + M26 Dispositif de mise à feu + M26 Odpalovací Zařízení + Detonatore M26 + M26 Detonátor + M26 Dispositivo de Detonação + Взрыватель M26 + + + M152 RAMS + M152 RAMS + M152 RAMS + M152 RAMS + M152 RAMS + M152 RAMS + M152 RAMS + M152 RAMS + M152 RAMS + M152 RAMS + + + Defusal Kit + Entschärfungskit + Kit de desactivación + Zestaw do rozbrajania + Kit de désamorçage + Zneškodňovací sada + Kit E.O.D. + Hatástalanító felszerelés + Kit de desarme + Разминирование комплект + + + Allows defusing of explosives + Erlaubt die Entschärfung von Sprengstoffen + Permite desactivar explosivos + Umożliwia rozbrajanie ładunków wybuchowych + Permet de désamorçer des explosifs + Dovoluje zneškodňování výbušnin + Consente la disattivazione degli ordigni esplosivi + Robbanóanyagok hatástalanításához + Permite o desarme de explosivos + Allows defusing of explosives + + + Add to Speed Dial + Zur Schnellauswahl hinzufügen + Agregar a marcado rápido + Dodaj do szybkiego wybierania + Ajouter à la composition rapide + Přidat jako rychlou volbu + Aggiungi alla selezione rapida + Hozzáadás gyorshíváshoz + Adicionar à ligação rápida + Добавить в ускоренный набор + + + Clear + Löschen + Borrar + Usuń + Désamorçé + Čistý + Libera + Törlés + Limpar + Pассеиваться + + + Dial + Wählen + Marcar + Wybierz mumer + Composer + Vytočit + Composizione numero + Tárcsázás + Discar + Hабрать + + + Up + Hoch + Arriba + W górę + Haut + Nahoru + Sopra + Fel + Cima + Поднять + + + Down + Runter + Abajo + W dół + Bas + Dolu + Sotto + Le + Baixo + Опустить + + + Cancel + Abbrechen + Cancelar + Anuluj + Annuler + Zrušit + Annulla + Mégsem + Cancelar + Отмена + + + Detonate Menu + "Zünden"-Menü + Menú de detonación + Menu detonowania + Menu de mise à feu + Menu Detonace + Menù di detonazione + Robbantás menü + Menu de detonação + Меню Подрыв + + + Place Menu + "Platzieren"-Menü + Menú de colocación + Menu umieszczania + Menu Placement + Menu Umístění + Menù di collocamento + Lerakás menü + Menu de posicionamento + Меню Установить + + + Defuse + Entschärfen + Desactivar + Rozbrój + Désamorçer + Zneškodnit + Disinnesca + Hatástalanítás + Desarmar + Обезвредить + + + Defusing Explosive... + Entschärfe Sprengstoff... + Desactivando explosivo... + Rozbrajanie ładunku... + Désamorçage des explosifs... + Zneškodňuji Výbušninu... + Esposivo in fase di disattivazione... + Robbanóanyag hatástalaníása... + Desarmando Explosivo... + Обезвреживание... + + + Timer + Zeitzünder + Temporizador + Czasomierz + Retard + Časovač + Cronometro + Időzített + Timer + Временной + + + Time: %1m %2s + Zeit: %1m %2s + Tiempo: %1m %2s + Czas: %1m %2s + Temps : %1m %2s + Čas: %1m %2s + Tempo : %1m %2s + Idő: %1m %2s + Tempo: %1m %2s + Tемп: %1m %2c + + + Set Time + Zeit einstellen + Configurar tiempo + Ustaw czas + Régler retard + Nastavit Čas + Modifica il conto alla rovescia + Idő állítása + Configurar Tempo + Xронометр + + + Select a Trigger + Wähle einen Zünder + Seleccionar un disparador + Wybierz zapalnik + Sélectionner une mise à feu + Zvolit Detonátor + Seleziona un Attivatore + Detonátor kiválasztása + Selecionar um Gatilho + Выберите + + + Select + Wählen + Seleccionar + Wybierz + Sélectionner + Zvolit + Seleziona + Kiválasztás + Selecionar + Выбрать защелка + + + Pressure Plate + Płyta naciskowa + Placa de presión + Druckplatte + Plaque de pression + Nášlapná nástraha + Piastra a Pressione + Nyomólap + Placa de pressão + Давление + + + Tripwire + Linka naciągu + Cable trampa + Stolperdraht + Fil de butée + Nástražný drát + Filo a Inciampo + Botlódrót + Linha de tração + Натяжной + + + IR Sensor + Czujnik podczerwieni + Sensor IR + Infrarotsensor + Capteur IR + IR Značkovač + Sensore IR + IR szenzor + Sensor IV + ИК + + + No triggers available for %1 + Brak dostępnych zapalników dla %1 + No hay detonadores disponibles para %1 + Keine Auslöser vorhanden für %1 + Pas de mise à feu disponible pour %1 + Žádný detonátor k dispozici pro %1 + Nessun attivatore disponibile per %1 + Nincs detonátor a %1 + Nenhum gatilho disponível para %1 + Нет защелка доступны для %1 + + + IR Sensor (Side Attack) + Czujnik podczerwieni (wybuch na bok) + Sensor IR (ataque lateral) + Infrarotsensor (Seitenangriff) + Capteur IR (de flanc) + IR Značkovač (Výbuch stranou) + Sensore IR (Attacco laterale) + IR Sensor (Side Attack) + Sensor infravermelho (ataque lateral) + ИК (боковая атака) + + + Magnetic Influence Sensor (Bottom Attack) + Czujnik magnetyczny (wybuch w górę) + Sensor IM (ataque inferior) + Magnetfeldsensor (Bodenangriff) + Capteur Magnétique (par le bas) + Magnetický Senzor (Výbuch ze spoda) + Sensore Magnetico di Prossimità (Attacco inferiore) + Mágneses (Bottom Attack) + Influência magnética (ataque inferior) + Магнитный (дно атака) + + + No explosives on trigger. + Keine Sprengladungen auf diesem Auslöser. + Ningún explosivo en el detonador. + Pas d'explosif à mettre à feu. + Nessun esplosivo sul sensore. + Žádná výbušnina k odpálení. + Nincs robbanóanyag a detonátorhoz. + Brak ładunków na zapalnik. + Nenhum explosivo no gatilho. + Нет взрывчатки на курок. + + + Dead Man's Switch + Totmannschalter + Mise à feu par relâchement de pression + Spínač mrtvého muže + Czuwak + Detonador de hombre muerto + Dead Man's Switch + Кнопка мертвеца + + + Used to remotely trigger explosives when released. + Zündet Sprengladungen wenn losgelassen. + Déclenche la mise à feu d'un explosif lorsqu'il est libéré. + Používaný k vzdálenému odpálení, při uvolnění odpálí výbušniny + Używany w celu zdalnej detonacji ładunków kiedy jego operator zostanie zabity. + Utilizado para detonar explosivos remotamente al soltarlo. + Robbanóanyagok távoli robbantásához + Используется для дистанционного подрыва, после смерти оператора. + + + Pick up + + diff --git a/addons/fcs/CfgOptics.hpp b/addons/fcs/CfgOptics.hpp index 3c17e760f0..e32a01b3d1 100644 --- a/addons/fcs/CfgOptics.hpp +++ b/addons/fcs/CfgOptics.hpp @@ -147,6 +147,14 @@ class RscInGameUI { MACRO_RANGEFINDER }; }; + }; + class Rsc_ACE_Helo_UI_Turret: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; }; class RscOptics_Heli_Attack_01_gunner: RscUnitInfo { onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; diff --git a/addons/fcs/functions/fnc_firedEH.sqf b/addons/fcs/functions/fnc_firedEH.sqf index 67c7e1d301..698a9bef22 100644 --- a/addons/fcs/functions/fnc_firedEH.sqf +++ b/addons/fcs/functions/fnc_firedEH.sqf @@ -48,7 +48,14 @@ _offset = 0; _velocityCorrection = (vectorMagnitude velocity _projectile) - getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); -[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, _velocityCorrection] call EFUNC(common,changeProjectileDirection); +[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, -_velocityCorrection] call EFUNC(common,changeProjectileDirection); + +// Remove the platform velocity +if( (vectorMagnitude velocity _vehicle) > 2) then { + _sumVelocity = (velocity _projectile) vectorDiff (velocity _vehicle); + _projectile setVelocity _sumVelocity; +}; + // Air burst missile // handle locally only diff --git a/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf b/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf index 7e8480ce18..31c2540790 100644 --- a/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf +++ b/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf @@ -5,7 +5,7 @@ _projectile = _this select 0 select 1; _zeroing = _this select 0 select 2; if (isNull _projectile || {!alive _projectile}) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_this select 1] call CBA_fnc_removePerFrameHandler; }; if (_projectile distance _vehicle < _zeroing) exitWith {}; diff --git a/addons/fcs/functions/fnc_keyUp.sqf b/addons/fcs/functions/fnc_keyUp.sqf index f0b1f1b137..433053178b 100644 --- a/addons/fcs/functions/fnc_keyUp.sqf +++ b/addons/fcs/functions/fnc_keyUp.sqf @@ -12,7 +12,7 @@ #include "script_component.hpp" -private ["_vehicle", "_turret", "_turretConfig", "_distance", "_magazines", "_userChange"]; +private ["_vehicle", "_turret", "_turretConfig", "_distance", "_magazines", "_showHint", "_playSound"]; _vehicle = _this select 0; _turret = _this select 1; @@ -162,11 +162,20 @@ _FCSElevation = []; [_vehicle, format ["%1_%2", QGVAR(Elevation), _turret], _FCSElevation] call EFUNC(common,setVariablePublic); [_vehicle, format ["%1_%2", QGVAR(Azimuth), _turret], _FCSAzimuth] call EFUNC(common,setVariablePublic); -_userChange = true; +_showHint = false; if( (count _this) > 3) then { - _userChange = _this select 3; + _showHint = _this select 3; }; -if(_userChange) then { +_playSound = true; +if( (count _this) > 3) then { + _playSound = _this select 4; +}; + +if(_playSound) then { + playSound "ACE_Sound_Click"; +}; + +if(_showHint) then { [format ["%1: %2", localize "STR_ACE_FCS_ZeroedTo", _distance]] call EFUNC(common,displayTextStructured); }; \ No newline at end of file diff --git a/addons/fcs/functions/fnc_onForceUpdate.sqf b/addons/fcs/functions/fnc_onForceUpdate.sqf index c911fc38de..6f477fd3f6 100644 --- a/addons/fcs/functions/fnc_onForceUpdate.sqf +++ b/addons/fcs/functions/fnc_onForceUpdate.sqf @@ -4,4 +4,4 @@ if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) ex if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false}; [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -1, false] call FUNC(keyDown); -[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -1, false] call FUNC(keyUp); \ No newline at end of file +[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -1, false, false] call FUNC(keyUp); \ No newline at end of file diff --git a/addons/frag/CfgAmmo.hpp b/addons/frag/CfgAmmo.hpp index 58ed5573e1..8ad76e6ae8 100644 --- a/addons/frag/CfgAmmo.hpp +++ b/addons/frag/CfgAmmo.hpp @@ -1,352 +1,352 @@ -#define BASE_DRAG -0.01 -#define HD_MULT 5 -#define BASE_DRAG_HD (BASE_DRAG*HD_MULT) +#define BASE_DRAG -0.01 +#define HD_MULT 5 +#define BASE_DRAG_HD (BASE_DRAG*HD_MULT) class CfgAmmo { - //class ace_arty_105mm_m1_m782_time; - //class ace_arty_105mm_m1_m782_prox: ace_arty_105mm_m1_m782_time {}; - //class ace_arty_105mm_m1_m782_delay: ace_arty_105mm_m1_m782_prox { - // ACE_FRAG_SKIP = 1; - //}; - class Bo_GBU12_LGB; - class Nou_GBU12 : Bo_GBU12_LGB { - ACE_FRAG_CLASSES[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; - ACE_FRAG_METAL = 140000; - ACE_FRAG_CHARGE = 87000; - ACE_FRAG_GURNEY_C = 2320; - ACE_FRAG_GURNEY_K = 1/2; - sideAirFriction = 0.04; - airFriction = 0.04; - laserLock = 0; - }; - - class GrenadeBase; - class Grenade; - class GrenadeHand: Grenade { - ACE_FRAG_SKIP = 0; - ACE_FRAG_FORCE = 1; - // This is a good high-drag frag type for grenades. - ACE_FRAG_CLASSES[] = {"ACE_frag_tiny_HD"}; - /* - These values are based on the M67 Grenade, should be tweaked for - individual grenades. - */ - ACE_FRAG_METAL = 210; // metal in grams - ACE_FRAG_CHARGE = 185; // explosive in grams - ACE_FRAG_GURNEY_C = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations - ACE_FRAG_GURNEY_K = 3/5; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations - }; - class GrenadeHand_stone: GrenadeHand { - ACE_FRAG_SKIP = 1; - }; - class SmokeShell: GrenadeHand { - ACE_FRAG_SKIP = 1; - }; - - class RocketBase; - //class R_Hydra_HE: RocketBase { - // ACE_FRAG_SKIP = 1; - //}; - - //class R_57mm_HE: RocketBase { - // ACE_FRAG_SKIP = 1; - //}; - - class R_80mm_HE: RocketBase { - ACE_FRAG_SKIP = 1; - }; - - //class R_S8T_AT: RocketBase { - // ACE_FRAG_SKIP = 1; - //}; - - class BombCore; - class Bo_Mk82: BombCore { - ACE_FRAG_CLASSES[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; - ACE_FRAG_METAL = 140000; - ACE_FRAG_CHARGE = 87000; - ACE_FRAG_GURNEY_C = 2320; - ACE_FRAG_GURNEY_K = 1/2; - }; - - - class G_40mm_HE: GrenadeBase { - ACE_FRAG_SKIP = 0; - ACE_FRAG_FORCE = 1; - }; - - class ACE_G_40mm_HEDP: G_40mm_HE { - }; - class ACE_G_40mm_HE: ACE_G_40mm_HEDP { - }; - class ACE_G_40mm_Practice: ACE_G_40mm_HE { - ACE_FRAG_SKIP = 1; - }; - class ACE_G40mm_HE_VOG25P: G_40mm_HE { - ACE_FRAG_SKIP = 0; - ACE_FRAG_FORCE = 1; - }; - - //class R_SMAW_HEDP; - //class R_MEEWS_HEDP : R_SMAW_HEDP { - // ACE_FRAG_FORCE = 1; - // ACE_FRAG_MULTIPLIER = 1.2; - //}; - - //class MissileBase; - //class M_Hellfire_AT: MissileBase { - // ACE_FRAG_FORCE = 1; - // ACE_FRAG_MULTIPLIER = 1.75; - //}; - - /* - class B_762x51_Ball; - class ACE_frag_base: B_762x51_Ball { ////TODO: B_762x45_Ball no longer exists, is this a valid replacement? - model = "\A3\Weapons_f\ammo\shell"; - timeToLive = 12; - typicalSpeed = 800; - // Fix sounds - effectFly = "AmmoClassic"; - soundDefault1[] = {"A3\sounds_f\weapons\hits\concrete_1.wav",0.158114,1,30}; - soundDefault2[] = {"A3\sounds_f\weapons\hits\concrete_2.wav",0.158114,1,30}; - soundDefault3[] = {"A3\sounds_f\weapons\hits\concrete_3.wav",0.158114,1,30}; - soundDefault4[] = {"A3\sounds_f\weapons\hits\concrete_4.wav",0.158114,1,30}; - soundDefault5[] = {"A3\sounds_f\weapons\hits\concrete_5.wav",0.158114,1,30}; - soundDefault6[] = {"A3\sounds_f\weapons\hits\concrete_6.wav",0.158114,1,30}; - soundDefault7[] = {"A3\sounds_f\weapons\hits\concrete_7.wav",0.158114,1,30}; - soundDefault8[] = {"A3\sounds_f\weapons\hits\concrete_8.wav",0.158114,1,30}; - soundGroundSoft1[] = {"A3\sounds_f\weapons\hits\soft_ground_1.wav",0.02811705,1,30}; - soundGroundSoft2[] = {"A3\sounds_f\weapons\hits\soft_ground_2.wav",0.02811705,1,30}; - soundGroundSoft3[] = {"A3\sounds_f\weapons\hits\soft_ground_3.wav",0.02811705,1,30}; - soundGroundSoft4[] = {"A3\sounds_f\weapons\hits\soft_ground_4.wav",0.02811705,1,30}; - soundGroundSoft5[] = {"A3\sounds_f\weapons\hits\soft_ground_5.wav",0.02811705,1,30}; - soundGroundSoft6[] = {"A3\sounds_f\weapons\hits\soft_ground_6.wav",0.02811705,1,30}; - soundGroundSoft7[] = {"A3\sounds_f\weapons\hits\soft_ground_7.wav",0.02811705,1,30}; - soundGroundSoft8[] = {"A3\sounds_f\weapons\hits\soft_ground_8.wav",0.02811705,1,30}; - soundGroundHard1[] = {"A3\sounds_f\weapons\hits\hard_ground_1.wav",0.62946,1,40}; - soundGroundHard2[] = {"A3\sounds_f\weapons\hits\hard_ground_2.wav",0.62946,1,40}; - soundGroundHard3[] = {"A3\sounds_f\weapons\hits\hard_ground_3.wav",0.62946,1,40}; - soundGroundHard4[] = {"A3\sounds_f\weapons\hits\hard_ground_4.wav",0.62946,1,40}; - soundGroundHard5[] = {"A3\sounds_f\weapons\hits\hard_ground_5.wav",0.62946,1,40}; - soundGroundHard6[] = {"A3\sounds_f\weapons\hits\hard_ground_6.wav",0.62946,1,40}; - soundGroundHard7[] = {"A3\sounds_f\weapons\hits\hard_ground_7.wav",0.62946,1,40}; - soundGroundHard8[] = {"A3\sounds_f\weapons\hits\hard_ground_8.wav",0.62946,1,40}; - soundMetal1[] = {"A3\sounds_f\weapons\hits\metal_1.wav",0.158114,1,45}; - soundMetal2[] = {"A3\sounds_f\weapons\hits\metal_2.wav",0.158114,1,45}; - soundMetal3[] = {"A3\sounds_f\weapons\hits\metal_3.wav",0.158114,1,45}; - soundMetal4[] = {"A3\sounds_f\weapons\hits\metal_4.wav",0.158114,1,45}; - soundMetal5[] = {"A3\sounds_f\weapons\hits\metal_5.wav",0.158114,1,45}; - soundMetal6[] = {"A3\sounds_f\weapons\hits\metal_6.wav",0.158114,1,45}; - soundMetal7[] = {"A3\sounds_f\weapons\hits\metal_7.wav",0.158114,1,45}; - soundMetal8[] = {"A3\sounds_f\weapons\hits\metal_8.wav",0.158114,1,45}; - soundGlass1[] = {"A3\sounds_f\weapons\hits\glass_1.wav",0.177828,1,25}; - soundGlass2[] = {"A3\sounds_f\weapons\hits\glass_2.wav",0.177828,1,25}; - soundGlass3[] = {"A3\sounds_f\weapons\hits\glass_3.wav",0.177828,1,25}; - soundGlass4[] = {"A3\sounds_f\weapons\hits\glass_4.wav",0.177828,1,25}; - soundGlass5[] = {"A3\sounds_f\weapons\hits\glass_5.wav",0.177828,1,25}; - soundGlass6[] = {"A3\sounds_f\weapons\hits\glass_6.wav",0.177828,1,25}; - soundGlass7[] = {"A3\sounds_f\weapons\hits\glass_7.wav",0.177828,1,25}; - soundGlass8[] = {"A3\sounds_f\weapons\hits\glass_8.wav",0.177828,1,25}; - soundGlassArmored1[] = {"A3\sounds_f\weapons\hits\glass_arm_1.wav",0.177828,1,30}; - soundGlassArmored2[] = {"A3\sounds_f\weapons\hits\glass_arm_2.wav",0.177828,1,30}; - soundGlassArmored3[] = {"A3\sounds_f\weapons\hits\glass_arm_3.wav",0.177828,1,30}; - soundGlassArmored4[] = {"A3\sounds_f\weapons\hits\glass_arm_4.wav",0.177828,1,30}; - soundGlassArmored5[] = {"A3\sounds_f\weapons\hits\glass_arm_5.wav",0.177828,1,30}; - soundGlassArmored6[] = {"A3\sounds_f\weapons\hits\glass_arm_6.wav",0.177828,1,30}; - soundGlassArmored7[] = {"A3\sounds_f\weapons\hits\glass_arm_7.wav",0.177828,1,30}; - soundGlassArmored8[] = {"A3\sounds_f\weapons\hits\glass_arm_8.wav",0.177828,1,30}; - soundVehiclePlate1[] = {"A3\sounds_f\weapons\hits\metal_plate_1.wav",0.281170,1,40}; - soundVehiclePlate2[] = {"A3\sounds_f\weapons\hits\metal_plate_2.wav",0.281170,1,40}; - soundVehiclePlate3[] = {"A3\sounds_f\weapons\hits\metal_plate_3.wav",0.281170,1,40}; - soundVehiclePlate4[] = {"A3\sounds_f\weapons\hits\metal_plate_4.wav",0.281170,1,40}; - soundVehiclePlate5[] = {"A3\sounds_f\weapons\hits\metal_plate_5.wav",0.281170,1,40}; - soundVehiclePlate6[] = {"A3\sounds_f\weapons\hits\metal_plate_6.wav",0.281170,1,40}; - soundVehiclePlate7[] = {"A3\sounds_f\weapons\hits\metal_plate_7.wav",0.281170,1,40}; - soundVehiclePlate8[] = {"A3\sounds_f\weapons\hits\metal_plate_8.wav",0.281170,1,40}; - soundWood1[] = {"A3\sounds_f\weapons\hits\wood_1.wav",0.158114,1,30}; - soundWood2[] = {"A3\sounds_f\weapons\hits\wood_2.wav",0.158114,1,30}; - soundWood3[] = {"A3\sounds_f\weapons\hits\wood_3.wav",0.158114,1,30}; - soundWood4[] = {"A3\sounds_f\weapons\hits\wood_4.wav",0.158114,1,30}; - soundWood5[] = {"A3\sounds_f\weapons\hits\wood_5.wav",0.158114,1,30}; - soundWood6[] = {"A3\sounds_f\weapons\hits\wood_6.wav",0.158114,1,30}; - soundWood7[] = {"A3\sounds_f\weapons\hits\wood_7.wav",0.158114,1,30}; - soundWood8[] = {"A3\sounds_f\weapons\hits\wood_8.wav",0.158114,1,30}; - soundHitBody1[] = {"A3\sounds_f\weapons\hits\body_1.wav",0.0177828,1,25}; - soundHitBody2[] = {"A3\sounds_f\weapons\hits\body_2.wav",0.0177828,1,25}; - soundHitBody3[] = {"A3\sounds_f\weapons\hits\body_3.wav",0.0177828,1,25}; - soundHitBody4[] = {"A3\sounds_f\weapons\hits\body_4.wav",0.0177828,1,25}; - soundHitBody5[] = {"A3\sounds_f\weapons\hits\body_5.wav",0.0177828,1,25}; - soundHitBody6[] = {"A3\sounds_f\weapons\hits\body_6.wav",0.0177828,1,25}; - soundHitBody7[] = {"A3\sounds_f\weapons\hits\body_7.wav",0.0177828,1,25}; - soundHitBody8[] = {"A3\sounds_f\weapons\hits\body_8.wav",0.0177828,1,25}; - soundHitBuilding1[] = {"A3\sounds_f\weapons\hits\building_1.wav",0.251189,1,30}; - soundHitBuilding2[] = {"A3\sounds_f\weapons\hits\building_2.wav",0.251189,1,30}; - soundHitBuilding3[] = {"A3\sounds_f\weapons\hits\building_3.wav",0.251189,1,30}; - soundHitBuilding4[] = {"A3\sounds_f\weapons\hits\building_4.wav",0.251189,1,30}; - soundHitBuilding5[] = {"A3\sounds_f\weapons\hits\building_5.wav",0.251189,1,30}; - soundHitBuilding6[] = {"A3\sounds_f\weapons\hits\building_6.wav",0.251189,1,30}; - soundHitBuilding7[] = {"A3\sounds_f\weapons\hits\building_7.wav",0.251189,1,30}; - soundHitBuilding8[] = {"A3\sounds_f\weapons\hits\building_8.wav",0.251189,1,30}; - soundHitFoliage1[] = {"A3\sounds_f\weapons\hits\foliage_1.wav",0.177828,1,25}; - soundHitFoliage2[] = {"A3\sounds_f\weapons\hits\foliage_2.wav",0.177828,1,25}; - soundHitFoliage3[] = {"A3\sounds_f\weapons\hits\foliage_3.wav",0.177828,1,25}; - soundHitFoliage4[] = {"A3\sounds_f\weapons\hits\foliage_4.wav",0.177828,1,25}; - soundHitFoliage5[] = {"A3\sounds_f\weapons\hits\foliage_5.wav",0.177828,1,25}; - soundHitFoliage6[] = {"A3\sounds_f\weapons\hits\foliage_6.wav",0.177828,1,25}; - soundHitFoliage7[] = {"A3\sounds_f\weapons\hits\foliage_7.wav",0.177828,1,25}; - soundHitFoliage8[] = {"A3\sounds_f\weapons\hits\foliage_8.wav",0.177828,1,25}; - soundPlastic1[] = {"A3\sounds_f\weapons\hits\plastic_1.wav",0.177828,1,25}; - soundPlastic2[] = {"A3\sounds_f\weapons\hits\plastic_2.wav",0.177828,1,25}; - soundPlastic3[] = {"A3\sounds_f\weapons\hits\plastic_3.wav",0.177828,1,25}; - soundPlastic4[] = {"A3\sounds_f\weapons\hits\plastic_4.wav",0.177828,1,25}; - soundPlastic5[] = {"A3\sounds_f\weapons\hits\plastic_5.wav",0.177828,1,25}; - soundPlastic6[] = {"A3\sounds_f\weapons\hits\plastic_6.wav",0.177828,1,25}; - soundPlastic7[] = {"A3\sounds_f\weapons\hits\plastic_7.wav",0.177828,1,25}; - soundPlastic8[] = {"A3\sounds_f\weapons\hits\plastic_8.wav",0.177828,1,25}; - soundConcrete1[] = {"A3\sounds_f\weapons\hits\concrete_1.wav",0.177828,1,35}; - soundConcrete2[] = {"A3\sounds_f\weapons\hits\concrete_2.wav",0.177828,1,35}; - soundConcrete3[] = {"A3\sounds_f\weapons\hits\concrete_3.wav",0.177828,1,35}; - soundConcrete4[] = {"A3\sounds_f\weapons\hits\concrete_4.wav",0.177828,1,35}; - soundConcrete5[] = {"A3\sounds_f\weapons\hits\concrete_5.wav",0.177828,1,35}; - soundConcrete6[] = {"A3\sounds_f\weapons\hits\concrete_6.wav",0.177828,1,35}; - soundConcrete7[] = {"A3\sounds_f\weapons\hits\concrete_7.wav",0.177828,1,35}; - soundConcrete8[] = {"A3\sounds_f\weapons\hits\concrete_8.wav",0.177828,1,35}; - soundRubber1[] = {"A3\sounds_f\weapons\hits\tyre_1.wav",0.158114,1,25}; - soundRubber2[] = {"A3\sounds_f\weapons\hits\tyre_2.wav",0.158114,1,25}; - soundRubber3[] = {"A3\sounds_f\weapons\hits\tyre_3.wav",0.158114,1,25}; - soundRubber4[] = {"A3\sounds_f\weapons\hits\tyre_4.wav",0.158114,1,25}; - soundRubber5[] = {"A3\sounds_f\weapons\hits\tyre_5.wav",0.158114,1,25}; - soundRubber6[] = {"A3\sounds_f\weapons\hits\tyre_6.wav",0.158114,1,25}; - soundRubber7[] = {"A3\sounds_f\weapons\hits\tyre_7.wav",0.158114,1,25}; - soundRubber8[] = {"A3\sounds_f\weapons\hits\tyre_8.wav",0.158114,1,25}; - soundWater1[] = {"A3\sounds_f\weapons\hits\water_01.wav",0.158114,1,25}; - soundWater2[] = {"A3\sounds_f\weapons\hits\water_02.wav",0.158114,1,25}; - soundWater3[] = {"A3\sounds_f\weapons\hits\water_03.wav",0.158114,1,25}; - soundWater4[] = {"A3\sounds_f\weapons\hits\water_04.wav",0.158114,1,25}; - soundWater5[] = {"A3\sounds_f\weapons\hits\water_05.wav",0.158114,1,25}; - soundWater6[] = {"A3\sounds_f\weapons\hits\water_06.wav",0.158114,1,25}; - soundWater7[] = {"A3\sounds_f\weapons\hits\water_07.wav",0.158114,1,25}; - soundWater8[] = {"A3\sounds_f\weapons\hits\water_08.wav",0.158114,1,25}; - hitGroundSoft[] = {"soundGroundSoft1",0.2,"soundGroundSoft2",0.2,"soundGroundSoft3",0.1,"soundGroundSoft4",0.1,"soundGroundSoft5",0.1,"soundGroundSoft6",0.1,"soundGroundSoft7",0.1,"soundGroundSoft8",0.1}; - hitGroundHard[] = {"soundGroundHard1",0.2,"soundGroundHard2",0.2,"soundGroundHard3",0.1,"soundGroundHard4",0.1,"soundGroundHard5",0.1,"soundGroundHard6",0.1,"soundGroundHard7",0.1,"soundGroundHard8",0.1}; - hitMan[] = {"soundHitBody1",0.125,"soundHitBody2",0.125,"soundHitBody3",0.125,"soundHitBody4",0.125,"soundHitBody5",0.125,"soundHitBody6",0.125,"soundHitBody7",0.125,"soundHitBody8",0.125}; - hitArmor[] = {"soundVehiclePlate1",0.125,"soundVehiclePlate2",0.125,"soundVehiclePlate3",0.125,"soundVehiclePlate4",0.125,"soundVehiclePlate5",0.125,"soundVehiclePlate6",0.125,"soundVehiclePlate7",0.125,"soundVehiclePlate8",0.125}; - hitBuilding[] = {"soundHitBuilding1",0.2,"soundHitBuilding2",0.2,"soundHitBuilding3",0.1,"soundHitBuilding4",0.1,"soundHitBuilding5",0.1,"soundHitBuilding6",0.1,"soundHitBuilding7",0.1,"soundHitBuilding8",0.1}; - hitFoliage[] = {"soundHitFoliage1",0.125,"soundHitFoliage2",0.125,"soundHitFoliage3",0.125,"soundHitFoliage4",0.125,"soundHitFoliage5",0.125,"soundHitFoliage6",0.125,"soundHitFoliage7",0.125,"soundHitFoliage8",0.125}; - hitWood[] = {"soundWood1",0.125,"soundWood2",0.125,"soundWood3",0.125,"soundWood4",0.125,"soundWood5",0.125,"soundWood6",0.125,"soundWood7",0.125,"soundWood8",0.125}; - hitGlass[] = {"soundGlass1",0.125,"soundGlass2",0.125,"soundGlass3",0.125,"soundGlass4",0.125,"soundGlass5",0.125,"soundGlass6",0.125,"soundGlass7",0.125,"soundGlass8",0.125}; - hitGlassArmored[] = {"soundGlassArmored1",0.125,"soundGlassArmored2",0.125,"soundGlassArmored3",0.125,"soundGlassArmored4",0.125,"soundGlassArmored5",0.125,"soundGlassArmored6",0.125,"soundGlassArmored7",0.125,"soundGlassArmored8",0.125}; - hitConcrete[] = {"soundConcrete1",0.125,"soundConcrete2",0.125,"soundConcrete3",0.125,"soundConcrete4",0.125,"soundConcrete5",0.125,"soundConcrete6",0.125,"soundConcrete7",0.125,"soundConcrete8",0.125}; - hitRubber[] = {"soundRubber1",0.125,"soundRubber2",0.125,"soundRubber3",0.125,"soundRubber4",0.125,"soundRubber5",0.125,"soundRubber6",0.125,"soundRubber7",0.125,"soundRubber8",0.125}; - hitPlastic[] = {"soundPlastic1",0.125,"soundPlastic2",0.125,"soundPlastic3",0.125,"soundPlastic4",0.125,"soundPlastic5",0.125,"soundPlastic6",0.125,"soundPlastic7",0.125,"soundPlastic8",0.125}; - hitDefault[] = {"soundDefault1",0.2,"soundDefault2",0.2,"soundDefault3",0.1,"soundDefault4",0.1,"soundDefault5",0.1,"soundDefault6",0.1,"soundDefault7",0.1,"soundDefault8",0.1}; - hitMetal[] = {"soundMetal1",0.125,"soundMetal2",0.125,"soundMetal3",0.125,"soundMetal4",0.125,"soundMetal5",0.125,"soundMetal6",0.125,"soundMetal7",0.125,"soundMetal8",0.125}; - hitMetalplate[] = {"soundVehiclePlate1",0.125,"soundVehiclePlate2",0.125,"soundVehiclePlate3",0.125,"soundVehiclePlate4",0.125,"soundVehiclePlate5",0.125,"soundVehiclePlate6",0.125,"soundVehiclePlate7",0.125,"soundVehiclePlate8",0.125}; - hitWater[] = {"soundWater1",0.125,"soundWater2",0.125,"soundWater3",0.125,"soundWater4",0.125,"soundWater5",0.125,"soundWater6",0.125,"soundWater7",0.125,"soundWater8",0.125}; - bulletFly1[] = {"A3\sounds_f\weapons\hits\bullet_by_1.wav",1,1,35}; - bulletFly2[] = {"A3\sounds_f\weapons\hits\bullet_by_2.wav",1,1,35}; - bulletFly3[] = {"A3\sounds_f\weapons\hits\bullet_by_3.wav",1,1,35}; - bulletFly4[] = {"A3\sounds_f\weapons\hits\bullet_by_4.wav",1,1,35}; - bulletFly5[] = {"A3\sounds_f\weapons\hits\bullet_by_5.wav",1,1,35}; - bulletFly6[] = {"A3\sounds_f\weapons\hits\bullet_by_6.wav",1,1,35}; - bulletFly7[] = {"A3\sounds_f\weapons\hits\bullet_by_7.wav",1,1,35}; - bulletFly8[] = {"A3\sounds_f\weapons\hits\bullet_by_8.wav",1,1,35}; - bulletFly[] = {"bulletFly1",0.166,"bulletFly2",0.166,"bulletFly3",0.166,"bulletFly4",0.166,"bulletFly5",0.166,"bulletFly6",0.167,"bulletFly7",0.166,"bulletFly8",0.167}; - supersonicCrackNear[] = {"A3\sounds_f\weapons\hits\sscrack1.wav",1,1,35}; - supersonicCrackFar[] = {"A3\sounds_f\weapons\hits\sscrack2.wav",1,1,135}; - }; - */ - - class B_65x39_Caseless; - class ACE_frag_base: B_65x39_Caseless { - timeToLive = 12; - typicalSpeed = 1500; - deflecting = 65; - }; - - class ACE_frag_tiny: ACE_frag_base { - hit = 6; - airFriction = BASE_DRAG; - caliber = 0.75; - }; - - class ACE_frag_tiny_HD: ACE_frag_base { - hit = 6; - airFriction = BASE_DRAG_HD; - caliber = 0.75; - }; - - class ACE_frag_small: ACE_frag_base { - hit = 12; - airFriction = BASE_DRAG*0.9; - }; - - class ACE_frag_small_HD: ACE_frag_base { - hit = 12; - airFriction = BASE_DRAG_HD*0.9; - }; - - class ACE_frag_medium: ACE_frag_base { - hit = 14; - airFriction = BASE_DRAG*0.75; - caliber = 1.2; - }; - - class ACE_frag_medium_HD: ACE_frag_base { - hit = 14; - airFriction = BASE_DRAG_HD*0.75; - caliber = 1.2; - }; - - class ACE_frag_large: ACE_frag_base { - hit = 28; - indirectHit = 2; - indirectHitRange = 0.25; - airFriction = BASE_DRAG*0.65; - caliber = 2; - explosive = 0; - - }; - - class ACE_frag_large_HD: ACE_frag_large { - hit = 28; - indirectHit = 2; - indirectHitRange = 0.25; - airFriction = BASE_DRAG_HD*0.65; - caliber = 2; - - - }; - - class ACE_frag_huge: ACE_frag_large { - hit = 40; - indirectHit = 4; - indirectHitRange = 0.5; - airFriction = BASE_DRAG*0.5; - caliber = 2.8; - }; - - class ACE_frag_huge_HD: ACE_frag_large { - hit = 40; - indirectHit = 4; - indirectHitRange = 0.5; - airFriction = BASE_DRAG_HD*0.5; - caliber = 2.8; - }; - - class ACE_frag_spall_small: ACE_frag_small { - timeToLive = 0.1; - }; - - class ACE_frag_spall_medium: ACE_frag_medium { - timeToLive = 0.15; - }; - - class ACE_frag_spall_large: ACE_frag_large { - timeToLive = 0.25; - }; - - class ACE_frag_spall_huge: ACE_frag_huge { - timeToLive = 0.3; - }; + //class ace_arty_105mm_m1_m782_time; + //class ace_arty_105mm_m1_m782_prox: ace_arty_105mm_m1_m782_time {}; + //class ace_arty_105mm_m1_m782_delay: ace_arty_105mm_m1_m782_prox { + // ACE_FRAG_SKIP = 1; + //}; + class Bo_GBU12_LGB; + class Nou_GBU12 : Bo_GBU12_LGB { + ACE_FRAG_CLASSES[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; + ACE_FRAG_METAL = 140000; + ACE_FRAG_CHARGE = 87000; + ACE_FRAG_GURNEY_C = 2320; + ACE_FRAG_GURNEY_K = 1/2; + sideAirFriction = 0.04; + airFriction = 0.04; + laserLock = 0; + }; + + class GrenadeBase; + class Grenade; + class GrenadeHand: Grenade { + ACE_FRAG_SKIP = 0; + ACE_FRAG_FORCE = 1; + // This is a good high-drag frag type for grenades. + ACE_FRAG_CLASSES[] = {"ACE_frag_tiny_HD"}; + /* + These values are based on the M67 Grenade, should be tweaked for + individual grenades. + */ + ACE_FRAG_METAL = 210; // metal in grams + ACE_FRAG_CHARGE = 185; // explosive in grams + ACE_FRAG_GURNEY_C = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations + ACE_FRAG_GURNEY_K = 3/5; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations + }; + class GrenadeHand_stone: GrenadeHand { + ACE_FRAG_SKIP = 1; + }; + class SmokeShell: GrenadeHand { + ACE_FRAG_SKIP = 1; + }; + + class RocketBase; + //class R_Hydra_HE: RocketBase { + // ACE_FRAG_SKIP = 1; + //}; + + //class R_57mm_HE: RocketBase { + // ACE_FRAG_SKIP = 1; + //}; + + class R_80mm_HE: RocketBase { + ACE_FRAG_SKIP = 1; + }; + + //class R_S8T_AT: RocketBase { + // ACE_FRAG_SKIP = 1; + //}; + + class BombCore; + class Bo_Mk82: BombCore { + ACE_FRAG_CLASSES[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; + ACE_FRAG_METAL = 140000; + ACE_FRAG_CHARGE = 87000; + ACE_FRAG_GURNEY_C = 2320; + ACE_FRAG_GURNEY_K = 1/2; + }; + + + class G_40mm_HE: GrenadeBase { + ACE_FRAG_SKIP = 0; + ACE_FRAG_FORCE = 1; + }; + + class ACE_G_40mm_HEDP: G_40mm_HE { + }; + class ACE_G_40mm_HE: ACE_G_40mm_HEDP { + }; + class ACE_G_40mm_Practice: ACE_G_40mm_HE { + ACE_FRAG_SKIP = 1; + }; + class ACE_G40mm_HE_VOG25P: G_40mm_HE { + ACE_FRAG_SKIP = 0; + ACE_FRAG_FORCE = 1; + }; + + //class R_SMAW_HEDP; + //class R_MEEWS_HEDP : R_SMAW_HEDP { + // ACE_FRAG_FORCE = 1; + // ACE_FRAG_MULTIPLIER = 1.2; + //}; + + //class MissileBase; + //class M_Hellfire_AT: MissileBase { + // ACE_FRAG_FORCE = 1; + // ACE_FRAG_MULTIPLIER = 1.75; + //}; + + /* + class B_762x51_Ball; + class ACE_frag_base: B_762x51_Ball { ////TODO: B_762x45_Ball no longer exists, is this a valid replacement? + model = "\A3\Weapons_f\ammo\shell"; + timeToLive = 12; + typicalSpeed = 800; + // Fix sounds + effectFly = "AmmoClassic"; + soundDefault1[] = {"A3\sounds_f\weapons\hits\concrete_1.wav",0.158114,1,30}; + soundDefault2[] = {"A3\sounds_f\weapons\hits\concrete_2.wav",0.158114,1,30}; + soundDefault3[] = {"A3\sounds_f\weapons\hits\concrete_3.wav",0.158114,1,30}; + soundDefault4[] = {"A3\sounds_f\weapons\hits\concrete_4.wav",0.158114,1,30}; + soundDefault5[] = {"A3\sounds_f\weapons\hits\concrete_5.wav",0.158114,1,30}; + soundDefault6[] = {"A3\sounds_f\weapons\hits\concrete_6.wav",0.158114,1,30}; + soundDefault7[] = {"A3\sounds_f\weapons\hits\concrete_7.wav",0.158114,1,30}; + soundDefault8[] = {"A3\sounds_f\weapons\hits\concrete_8.wav",0.158114,1,30}; + soundGroundSoft1[] = {"A3\sounds_f\weapons\hits\soft_ground_1.wav",0.02811705,1,30}; + soundGroundSoft2[] = {"A3\sounds_f\weapons\hits\soft_ground_2.wav",0.02811705,1,30}; + soundGroundSoft3[] = {"A3\sounds_f\weapons\hits\soft_ground_3.wav",0.02811705,1,30}; + soundGroundSoft4[] = {"A3\sounds_f\weapons\hits\soft_ground_4.wav",0.02811705,1,30}; + soundGroundSoft5[] = {"A3\sounds_f\weapons\hits\soft_ground_5.wav",0.02811705,1,30}; + soundGroundSoft6[] = {"A3\sounds_f\weapons\hits\soft_ground_6.wav",0.02811705,1,30}; + soundGroundSoft7[] = {"A3\sounds_f\weapons\hits\soft_ground_7.wav",0.02811705,1,30}; + soundGroundSoft8[] = {"A3\sounds_f\weapons\hits\soft_ground_8.wav",0.02811705,1,30}; + soundGroundHard1[] = {"A3\sounds_f\weapons\hits\hard_ground_1.wav",0.62946,1,40}; + soundGroundHard2[] = {"A3\sounds_f\weapons\hits\hard_ground_2.wav",0.62946,1,40}; + soundGroundHard3[] = {"A3\sounds_f\weapons\hits\hard_ground_3.wav",0.62946,1,40}; + soundGroundHard4[] = {"A3\sounds_f\weapons\hits\hard_ground_4.wav",0.62946,1,40}; + soundGroundHard5[] = {"A3\sounds_f\weapons\hits\hard_ground_5.wav",0.62946,1,40}; + soundGroundHard6[] = {"A3\sounds_f\weapons\hits\hard_ground_6.wav",0.62946,1,40}; + soundGroundHard7[] = {"A3\sounds_f\weapons\hits\hard_ground_7.wav",0.62946,1,40}; + soundGroundHard8[] = {"A3\sounds_f\weapons\hits\hard_ground_8.wav",0.62946,1,40}; + soundMetal1[] = {"A3\sounds_f\weapons\hits\metal_1.wav",0.158114,1,45}; + soundMetal2[] = {"A3\sounds_f\weapons\hits\metal_2.wav",0.158114,1,45}; + soundMetal3[] = {"A3\sounds_f\weapons\hits\metal_3.wav",0.158114,1,45}; + soundMetal4[] = {"A3\sounds_f\weapons\hits\metal_4.wav",0.158114,1,45}; + soundMetal5[] = {"A3\sounds_f\weapons\hits\metal_5.wav",0.158114,1,45}; + soundMetal6[] = {"A3\sounds_f\weapons\hits\metal_6.wav",0.158114,1,45}; + soundMetal7[] = {"A3\sounds_f\weapons\hits\metal_7.wav",0.158114,1,45}; + soundMetal8[] = {"A3\sounds_f\weapons\hits\metal_8.wav",0.158114,1,45}; + soundGlass1[] = {"A3\sounds_f\weapons\hits\glass_1.wav",0.177828,1,25}; + soundGlass2[] = {"A3\sounds_f\weapons\hits\glass_2.wav",0.177828,1,25}; + soundGlass3[] = {"A3\sounds_f\weapons\hits\glass_3.wav",0.177828,1,25}; + soundGlass4[] = {"A3\sounds_f\weapons\hits\glass_4.wav",0.177828,1,25}; + soundGlass5[] = {"A3\sounds_f\weapons\hits\glass_5.wav",0.177828,1,25}; + soundGlass6[] = {"A3\sounds_f\weapons\hits\glass_6.wav",0.177828,1,25}; + soundGlass7[] = {"A3\sounds_f\weapons\hits\glass_7.wav",0.177828,1,25}; + soundGlass8[] = {"A3\sounds_f\weapons\hits\glass_8.wav",0.177828,1,25}; + soundGlassArmored1[] = {"A3\sounds_f\weapons\hits\glass_arm_1.wav",0.177828,1,30}; + soundGlassArmored2[] = {"A3\sounds_f\weapons\hits\glass_arm_2.wav",0.177828,1,30}; + soundGlassArmored3[] = {"A3\sounds_f\weapons\hits\glass_arm_3.wav",0.177828,1,30}; + soundGlassArmored4[] = {"A3\sounds_f\weapons\hits\glass_arm_4.wav",0.177828,1,30}; + soundGlassArmored5[] = {"A3\sounds_f\weapons\hits\glass_arm_5.wav",0.177828,1,30}; + soundGlassArmored6[] = {"A3\sounds_f\weapons\hits\glass_arm_6.wav",0.177828,1,30}; + soundGlassArmored7[] = {"A3\sounds_f\weapons\hits\glass_arm_7.wav",0.177828,1,30}; + soundGlassArmored8[] = {"A3\sounds_f\weapons\hits\glass_arm_8.wav",0.177828,1,30}; + soundVehiclePlate1[] = {"A3\sounds_f\weapons\hits\metal_plate_1.wav",0.281170,1,40}; + soundVehiclePlate2[] = {"A3\sounds_f\weapons\hits\metal_plate_2.wav",0.281170,1,40}; + soundVehiclePlate3[] = {"A3\sounds_f\weapons\hits\metal_plate_3.wav",0.281170,1,40}; + soundVehiclePlate4[] = {"A3\sounds_f\weapons\hits\metal_plate_4.wav",0.281170,1,40}; + soundVehiclePlate5[] = {"A3\sounds_f\weapons\hits\metal_plate_5.wav",0.281170,1,40}; + soundVehiclePlate6[] = {"A3\sounds_f\weapons\hits\metal_plate_6.wav",0.281170,1,40}; + soundVehiclePlate7[] = {"A3\sounds_f\weapons\hits\metal_plate_7.wav",0.281170,1,40}; + soundVehiclePlate8[] = {"A3\sounds_f\weapons\hits\metal_plate_8.wav",0.281170,1,40}; + soundWood1[] = {"A3\sounds_f\weapons\hits\wood_1.wav",0.158114,1,30}; + soundWood2[] = {"A3\sounds_f\weapons\hits\wood_2.wav",0.158114,1,30}; + soundWood3[] = {"A3\sounds_f\weapons\hits\wood_3.wav",0.158114,1,30}; + soundWood4[] = {"A3\sounds_f\weapons\hits\wood_4.wav",0.158114,1,30}; + soundWood5[] = {"A3\sounds_f\weapons\hits\wood_5.wav",0.158114,1,30}; + soundWood6[] = {"A3\sounds_f\weapons\hits\wood_6.wav",0.158114,1,30}; + soundWood7[] = {"A3\sounds_f\weapons\hits\wood_7.wav",0.158114,1,30}; + soundWood8[] = {"A3\sounds_f\weapons\hits\wood_8.wav",0.158114,1,30}; + soundHitBody1[] = {"A3\sounds_f\weapons\hits\body_1.wav",0.0177828,1,25}; + soundHitBody2[] = {"A3\sounds_f\weapons\hits\body_2.wav",0.0177828,1,25}; + soundHitBody3[] = {"A3\sounds_f\weapons\hits\body_3.wav",0.0177828,1,25}; + soundHitBody4[] = {"A3\sounds_f\weapons\hits\body_4.wav",0.0177828,1,25}; + soundHitBody5[] = {"A3\sounds_f\weapons\hits\body_5.wav",0.0177828,1,25}; + soundHitBody6[] = {"A3\sounds_f\weapons\hits\body_6.wav",0.0177828,1,25}; + soundHitBody7[] = {"A3\sounds_f\weapons\hits\body_7.wav",0.0177828,1,25}; + soundHitBody8[] = {"A3\sounds_f\weapons\hits\body_8.wav",0.0177828,1,25}; + soundHitBuilding1[] = {"A3\sounds_f\weapons\hits\building_1.wav",0.251189,1,30}; + soundHitBuilding2[] = {"A3\sounds_f\weapons\hits\building_2.wav",0.251189,1,30}; + soundHitBuilding3[] = {"A3\sounds_f\weapons\hits\building_3.wav",0.251189,1,30}; + soundHitBuilding4[] = {"A3\sounds_f\weapons\hits\building_4.wav",0.251189,1,30}; + soundHitBuilding5[] = {"A3\sounds_f\weapons\hits\building_5.wav",0.251189,1,30}; + soundHitBuilding6[] = {"A3\sounds_f\weapons\hits\building_6.wav",0.251189,1,30}; + soundHitBuilding7[] = {"A3\sounds_f\weapons\hits\building_7.wav",0.251189,1,30}; + soundHitBuilding8[] = {"A3\sounds_f\weapons\hits\building_8.wav",0.251189,1,30}; + soundHitFoliage1[] = {"A3\sounds_f\weapons\hits\foliage_1.wav",0.177828,1,25}; + soundHitFoliage2[] = {"A3\sounds_f\weapons\hits\foliage_2.wav",0.177828,1,25}; + soundHitFoliage3[] = {"A3\sounds_f\weapons\hits\foliage_3.wav",0.177828,1,25}; + soundHitFoliage4[] = {"A3\sounds_f\weapons\hits\foliage_4.wav",0.177828,1,25}; + soundHitFoliage5[] = {"A3\sounds_f\weapons\hits\foliage_5.wav",0.177828,1,25}; + soundHitFoliage6[] = {"A3\sounds_f\weapons\hits\foliage_6.wav",0.177828,1,25}; + soundHitFoliage7[] = {"A3\sounds_f\weapons\hits\foliage_7.wav",0.177828,1,25}; + soundHitFoliage8[] = {"A3\sounds_f\weapons\hits\foliage_8.wav",0.177828,1,25}; + soundPlastic1[] = {"A3\sounds_f\weapons\hits\plastic_1.wav",0.177828,1,25}; + soundPlastic2[] = {"A3\sounds_f\weapons\hits\plastic_2.wav",0.177828,1,25}; + soundPlastic3[] = {"A3\sounds_f\weapons\hits\plastic_3.wav",0.177828,1,25}; + soundPlastic4[] = {"A3\sounds_f\weapons\hits\plastic_4.wav",0.177828,1,25}; + soundPlastic5[] = {"A3\sounds_f\weapons\hits\plastic_5.wav",0.177828,1,25}; + soundPlastic6[] = {"A3\sounds_f\weapons\hits\plastic_6.wav",0.177828,1,25}; + soundPlastic7[] = {"A3\sounds_f\weapons\hits\plastic_7.wav",0.177828,1,25}; + soundPlastic8[] = {"A3\sounds_f\weapons\hits\plastic_8.wav",0.177828,1,25}; + soundConcrete1[] = {"A3\sounds_f\weapons\hits\concrete_1.wav",0.177828,1,35}; + soundConcrete2[] = {"A3\sounds_f\weapons\hits\concrete_2.wav",0.177828,1,35}; + soundConcrete3[] = {"A3\sounds_f\weapons\hits\concrete_3.wav",0.177828,1,35}; + soundConcrete4[] = {"A3\sounds_f\weapons\hits\concrete_4.wav",0.177828,1,35}; + soundConcrete5[] = {"A3\sounds_f\weapons\hits\concrete_5.wav",0.177828,1,35}; + soundConcrete6[] = {"A3\sounds_f\weapons\hits\concrete_6.wav",0.177828,1,35}; + soundConcrete7[] = {"A3\sounds_f\weapons\hits\concrete_7.wav",0.177828,1,35}; + soundConcrete8[] = {"A3\sounds_f\weapons\hits\concrete_8.wav",0.177828,1,35}; + soundRubber1[] = {"A3\sounds_f\weapons\hits\tyre_1.wav",0.158114,1,25}; + soundRubber2[] = {"A3\sounds_f\weapons\hits\tyre_2.wav",0.158114,1,25}; + soundRubber3[] = {"A3\sounds_f\weapons\hits\tyre_3.wav",0.158114,1,25}; + soundRubber4[] = {"A3\sounds_f\weapons\hits\tyre_4.wav",0.158114,1,25}; + soundRubber5[] = {"A3\sounds_f\weapons\hits\tyre_5.wav",0.158114,1,25}; + soundRubber6[] = {"A3\sounds_f\weapons\hits\tyre_6.wav",0.158114,1,25}; + soundRubber7[] = {"A3\sounds_f\weapons\hits\tyre_7.wav",0.158114,1,25}; + soundRubber8[] = {"A3\sounds_f\weapons\hits\tyre_8.wav",0.158114,1,25}; + soundWater1[] = {"A3\sounds_f\weapons\hits\water_01.wav",0.158114,1,25}; + soundWater2[] = {"A3\sounds_f\weapons\hits\water_02.wav",0.158114,1,25}; + soundWater3[] = {"A3\sounds_f\weapons\hits\water_03.wav",0.158114,1,25}; + soundWater4[] = {"A3\sounds_f\weapons\hits\water_04.wav",0.158114,1,25}; + soundWater5[] = {"A3\sounds_f\weapons\hits\water_05.wav",0.158114,1,25}; + soundWater6[] = {"A3\sounds_f\weapons\hits\water_06.wav",0.158114,1,25}; + soundWater7[] = {"A3\sounds_f\weapons\hits\water_07.wav",0.158114,1,25}; + soundWater8[] = {"A3\sounds_f\weapons\hits\water_08.wav",0.158114,1,25}; + hitGroundSoft[] = {"soundGroundSoft1",0.2,"soundGroundSoft2",0.2,"soundGroundSoft3",0.1,"soundGroundSoft4",0.1,"soundGroundSoft5",0.1,"soundGroundSoft6",0.1,"soundGroundSoft7",0.1,"soundGroundSoft8",0.1}; + hitGroundHard[] = {"soundGroundHard1",0.2,"soundGroundHard2",0.2,"soundGroundHard3",0.1,"soundGroundHard4",0.1,"soundGroundHard5",0.1,"soundGroundHard6",0.1,"soundGroundHard7",0.1,"soundGroundHard8",0.1}; + hitMan[] = {"soundHitBody1",0.125,"soundHitBody2",0.125,"soundHitBody3",0.125,"soundHitBody4",0.125,"soundHitBody5",0.125,"soundHitBody6",0.125,"soundHitBody7",0.125,"soundHitBody8",0.125}; + hitArmor[] = {"soundVehiclePlate1",0.125,"soundVehiclePlate2",0.125,"soundVehiclePlate3",0.125,"soundVehiclePlate4",0.125,"soundVehiclePlate5",0.125,"soundVehiclePlate6",0.125,"soundVehiclePlate7",0.125,"soundVehiclePlate8",0.125}; + hitBuilding[] = {"soundHitBuilding1",0.2,"soundHitBuilding2",0.2,"soundHitBuilding3",0.1,"soundHitBuilding4",0.1,"soundHitBuilding5",0.1,"soundHitBuilding6",0.1,"soundHitBuilding7",0.1,"soundHitBuilding8",0.1}; + hitFoliage[] = {"soundHitFoliage1",0.125,"soundHitFoliage2",0.125,"soundHitFoliage3",0.125,"soundHitFoliage4",0.125,"soundHitFoliage5",0.125,"soundHitFoliage6",0.125,"soundHitFoliage7",0.125,"soundHitFoliage8",0.125}; + hitWood[] = {"soundWood1",0.125,"soundWood2",0.125,"soundWood3",0.125,"soundWood4",0.125,"soundWood5",0.125,"soundWood6",0.125,"soundWood7",0.125,"soundWood8",0.125}; + hitGlass[] = {"soundGlass1",0.125,"soundGlass2",0.125,"soundGlass3",0.125,"soundGlass4",0.125,"soundGlass5",0.125,"soundGlass6",0.125,"soundGlass7",0.125,"soundGlass8",0.125}; + hitGlassArmored[] = {"soundGlassArmored1",0.125,"soundGlassArmored2",0.125,"soundGlassArmored3",0.125,"soundGlassArmored4",0.125,"soundGlassArmored5",0.125,"soundGlassArmored6",0.125,"soundGlassArmored7",0.125,"soundGlassArmored8",0.125}; + hitConcrete[] = {"soundConcrete1",0.125,"soundConcrete2",0.125,"soundConcrete3",0.125,"soundConcrete4",0.125,"soundConcrete5",0.125,"soundConcrete6",0.125,"soundConcrete7",0.125,"soundConcrete8",0.125}; + hitRubber[] = {"soundRubber1",0.125,"soundRubber2",0.125,"soundRubber3",0.125,"soundRubber4",0.125,"soundRubber5",0.125,"soundRubber6",0.125,"soundRubber7",0.125,"soundRubber8",0.125}; + hitPlastic[] = {"soundPlastic1",0.125,"soundPlastic2",0.125,"soundPlastic3",0.125,"soundPlastic4",0.125,"soundPlastic5",0.125,"soundPlastic6",0.125,"soundPlastic7",0.125,"soundPlastic8",0.125}; + hitDefault[] = {"soundDefault1",0.2,"soundDefault2",0.2,"soundDefault3",0.1,"soundDefault4",0.1,"soundDefault5",0.1,"soundDefault6",0.1,"soundDefault7",0.1,"soundDefault8",0.1}; + hitMetal[] = {"soundMetal1",0.125,"soundMetal2",0.125,"soundMetal3",0.125,"soundMetal4",0.125,"soundMetal5",0.125,"soundMetal6",0.125,"soundMetal7",0.125,"soundMetal8",0.125}; + hitMetalplate[] = {"soundVehiclePlate1",0.125,"soundVehiclePlate2",0.125,"soundVehiclePlate3",0.125,"soundVehiclePlate4",0.125,"soundVehiclePlate5",0.125,"soundVehiclePlate6",0.125,"soundVehiclePlate7",0.125,"soundVehiclePlate8",0.125}; + hitWater[] = {"soundWater1",0.125,"soundWater2",0.125,"soundWater3",0.125,"soundWater4",0.125,"soundWater5",0.125,"soundWater6",0.125,"soundWater7",0.125,"soundWater8",0.125}; + bulletFly1[] = {"A3\sounds_f\weapons\hits\bullet_by_1.wav",1,1,35}; + bulletFly2[] = {"A3\sounds_f\weapons\hits\bullet_by_2.wav",1,1,35}; + bulletFly3[] = {"A3\sounds_f\weapons\hits\bullet_by_3.wav",1,1,35}; + bulletFly4[] = {"A3\sounds_f\weapons\hits\bullet_by_4.wav",1,1,35}; + bulletFly5[] = {"A3\sounds_f\weapons\hits\bullet_by_5.wav",1,1,35}; + bulletFly6[] = {"A3\sounds_f\weapons\hits\bullet_by_6.wav",1,1,35}; + bulletFly7[] = {"A3\sounds_f\weapons\hits\bullet_by_7.wav",1,1,35}; + bulletFly8[] = {"A3\sounds_f\weapons\hits\bullet_by_8.wav",1,1,35}; + bulletFly[] = {"bulletFly1",0.166,"bulletFly2",0.166,"bulletFly3",0.166,"bulletFly4",0.166,"bulletFly5",0.166,"bulletFly6",0.167,"bulletFly7",0.166,"bulletFly8",0.167}; + supersonicCrackNear[] = {"A3\sounds_f\weapons\hits\sscrack1.wav",1,1,35}; + supersonicCrackFar[] = {"A3\sounds_f\weapons\hits\sscrack2.wav",1,1,135}; + }; + */ + + class B_65x39_Caseless; + class ACE_frag_base: B_65x39_Caseless { + timeToLive = 12; + typicalSpeed = 1500; + deflecting = 65; + }; + + class ACE_frag_tiny: ACE_frag_base { + hit = 6; + airFriction = BASE_DRAG; + caliber = 0.75; + }; + + class ACE_frag_tiny_HD: ACE_frag_base { + hit = 6; + airFriction = BASE_DRAG_HD; + caliber = 0.75; + }; + + class ACE_frag_small: ACE_frag_base { + hit = 12; + airFriction = BASE_DRAG*0.9; + }; + + class ACE_frag_small_HD: ACE_frag_base { + hit = 12; + airFriction = BASE_DRAG_HD*0.9; + }; + + class ACE_frag_medium: ACE_frag_base { + hit = 14; + airFriction = BASE_DRAG*0.75; + caliber = 1.2; + }; + + class ACE_frag_medium_HD: ACE_frag_base { + hit = 14; + airFriction = BASE_DRAG_HD*0.75; + caliber = 1.2; + }; + + class ACE_frag_large: ACE_frag_base { + hit = 28; + indirectHit = 2; + indirectHitRange = 0.25; + airFriction = BASE_DRAG*0.65; + caliber = 2; + explosive = 0; + + }; + + class ACE_frag_large_HD: ACE_frag_large { + hit = 28; + indirectHit = 2; + indirectHitRange = 0.25; + airFriction = BASE_DRAG_HD*0.65; + caliber = 2; + + + }; + + class ACE_frag_huge: ACE_frag_large { + hit = 40; + indirectHit = 4; + indirectHitRange = 0.5; + airFriction = BASE_DRAG*0.5; + caliber = 2.8; + }; + + class ACE_frag_huge_HD: ACE_frag_large { + hit = 40; + indirectHit = 4; + indirectHitRange = 0.5; + airFriction = BASE_DRAG_HD*0.5; + caliber = 2.8; + }; + + class ACE_frag_spall_small: ACE_frag_small { + timeToLive = 0.1; + }; + + class ACE_frag_spall_medium: ACE_frag_medium { + timeToLive = 0.15; + }; + + class ACE_frag_spall_large: ACE_frag_large { + timeToLive = 0.25; + }; + + class ACE_frag_spall_huge: ACE_frag_huge { + timeToLive = 0.3; + }; }; diff --git a/addons/frag/CfgEventhandlers.hpp b/addons/frag/CfgEventhandlers.hpp index 121b24d062..1e631e07eb 100644 --- a/addons/frag/CfgEventhandlers.hpp +++ b/addons/frag/CfgEventhandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_pre_init)); - }; + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_pre_init)); + }; }; class Extended_PostInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_post_init)); - }; + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_post_init)); + }; }; class Extended_FiredBIS_EventHandlers { - class AllVehicles { - ADDON = QUOTE(_this call FUNC(fired)); - }; + class AllVehicles { + ADDON = QUOTE(_this call FUNC(fired)); + }; }; diff --git a/addons/frag/XEH_post_init.sqf b/addons/frag/XEH_post_init.sqf index ed0e715376..9769148871 100644 --- a/addons/frag/XEH_post_init.sqf +++ b/addons/frag/XEH_post_init.sqf @@ -1,18 +1,18 @@ #include "script_component.hpp" if(isServer) then { - [QGVAR(frag_eh), { _this call FUNC(frago); }] call ace_common_fnc_addEventHandler; + [QGVAR(frag_eh), { _this call FUNC(frago); }] call ace_common_fnc_addEventHandler; }; /* GVAR(replacedBisArtyWrapper) = false; [] spawn { - waitUntil { - if(!(isNil "BIS_ARTY_F_ShellFlight")) then { - ACE_WRAPPER_BIS_ARTY_F_ShellFlight = BIS_ARTY_F_ShellFlight; - BIS_ARTY_F_ShellFlight = FUNC(BIS_ARTY_WRAPPER); - GVAR(replacedBisArtyWrapper) = true; - }; - sleep 4; - GVAR(replacedBisArtyWrapper) - }; + waitUntil { + if(!(isNil "BIS_ARTY_F_ShellFlight")) then { + ACE_WRAPPER_BIS_ARTY_F_ShellFlight = BIS_ARTY_F_ShellFlight; + BIS_ARTY_F_ShellFlight = FUNC(BIS_ARTY_WRAPPER); + GVAR(replacedBisArtyWrapper) = true; + }; + sleep 4; + GVAR(replacedBisArtyWrapper) + }; }; */ \ No newline at end of file diff --git a/addons/frag/config.cpp b/addons/frag/config.cpp index 98a159a78e..d4fa788e97 100644 --- a/addons/frag/config.cpp +++ b/addons/frag/config.cpp @@ -1,13 +1,13 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { "A3_Misc_F", "A3_Weapons_F" }; - author[] = {"Nou"}; - VERSION_CONFIG; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { "A3_Misc_F", "A3_Weapons_F" }; + author[] = {"Nou"}; + VERSION_CONFIG; + }; }; //PRELOAD_ADDONS; diff --git a/addons/frag/functions/fnc_BIS_ARTY_WRAPPER.sqf b/addons/frag/functions/fnc_BIS_ARTY_WRAPPER.sqf index ee7881277b..0d71cf58ac 100644 --- a/addons/frag/functions/fnc_BIS_ARTY_WRAPPER.sqf +++ b/addons/frag/functions/fnc_BIS_ARTY_WRAPPER.sqf @@ -1,13 +1,13 @@ #include "script_component.hpp" _ret = [(_this select 6)] call FUNC(removeTrack); if(!_ret) then { - [(_this select 6)] call FUNC(addBlackList); + [(_this select 6)] call FUNC(addBlackList); }; _this call ACE_WRAPPER_BIS_ARTY_F_ShellFlight; _catEntry = BIS_ARTY_SHELLCAT select ((count BIS_ARTY_SHELLCAT) - 1); _shell = _catEntry select 0; _ARTY_DeployOnImpact = getText (configFile >> "CfgAmmo" >> "ARTY_DeployOnImpact"); if(_ARTY_DeployOnImpact == "") then { - _this set[6, _shell]; - _this call FUNC(fired); + _this set[6, _shell]; + _this call FUNC(fired); }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_addManualTrack.sqf b/addons/frag/functions/fnc_addManualTrack.sqf index 066499f6aa..3dc14cc748 100644 --- a/addons/frag/functions/fnc_addManualTrack.sqf +++ b/addons/frag/functions/fnc_addManualTrack.sqf @@ -2,6 +2,6 @@ private ["_round"]; _round = _this select 0; if(alive _round) then { - GVAR(trackedObjects) set[(count GVAR(trackedObjects)), _round]; - [DFUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), (typeOf _round), time, objNull, false, 0, 0]] call cba_fnc_addPerFrameHandler; + GVAR(trackedObjects) set[(count GVAR(trackedObjects)), _round]; + [DFUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), (typeOf _round), time, objNull, false, 0, 0]] call cba_fnc_addPerFrameHandler; }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_addTrack.sqf b/addons/frag/functions/fnc_addTrack.sqf index 65ad3b6a22..2beea1dd56 100644 --- a/addons/frag/functions/fnc_addTrack.sqf +++ b/addons/frag/functions/fnc_addTrack.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" if(GVAR(autoTrace)) then { - [] call FUNC(startTracing); + [] call FUNC(startTracing); }; // setAccTime 0.05; @@ -9,7 +9,7 @@ _obj = _this select 1; _origin = _this select 0; _color = [1,0,0,1]; if((count _this) > 2) then { - _color = _this select 2; + _color = _this select 2; }; _positions = []; _objVel = velocity _obj; diff --git a/addons/frag/functions/fnc_denyFrag.sqf b/addons/frag/functions/fnc_denyFrag.sqf index 5459f0160a..6c4aa9bf8d 100644 --- a/addons/frag/functions/fnc_denyFrag.sqf +++ b/addons/frag/functions/fnc_denyFrag.sqf @@ -3,5 +3,5 @@ private ["_ret"]; _ret = [(_this select 0)] call FUNC(removeTrack); if(!_ret) then { - [(_this select 0)] call FUNC(addBlackList); + [(_this select 0)] call FUNC(addBlackList); }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf index 5560a4f0af..761490fa90 100644 --- a/addons/frag/functions/fnc_doSpall.sqf +++ b/addons/frag/functions/fnc_doSpall.sqf @@ -1,14 +1,14 @@ //fnc_doSpall.sqf #include "script_component.hpp" #ifdef DEBUG_MODE_FULL - GVAR(traceFrags) = true; + GVAR(traceFrags) = true; #endif // player sideChat "WAAAAAAAAAAAAAAAAAAAAA"; private ["_params", "_initialData", "_hpData", "_roundType", "_round", "_object", "_caliber", "_explosive", - "_idh", "_alive", "_exit", "_vm", "_velocity", "_unitDir", "_oldVelocity", "_curVelocity", "_diff", "_polar", - "_pos", "_spallPos", "_i", "_pos1", "_pos2", "_blah", "_data", "_spallPolar", "_c", "_warn", "_m", "_k", - "_gC", "_shellType", "_fragPower", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", - "_fragment"]; + "_idh", "_alive", "_exit", "_vm", "_velocity", "_unitDir", "_oldVelocity", "_curVelocity", "_diff", "_polar", + "_pos", "_spallPos", "_i", "_pos1", "_pos2", "_blah", "_data", "_spallPolar", "_c", "_warn", "_m", "_k", + "_gC", "_shellType", "_fragPower", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", + "_fragment"]; _params = _this select 0; @@ -23,7 +23,7 @@ _object removeEventHandler ["hitPart", _initialData select 0]; _foundObjects = _initialData select 7; _index = _foundObjects find _object; if(_index != -1) then { - _foundObjecsts set[_index, nil]; + _foundObjecsts set[_index, nil]; }; _roundType = (_initialData select 2); @@ -36,131 +36,131 @@ _idh = getNumber(configFile >> "CfgAmmo" >> _roundType >> "indirectHitRange"); _alive = true; if(!alive _round && (_initialData select 6) == 1) then { - _alive = false; + _alive = false; }; if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { - // player sideChat format["BBBB"]; - _exit = false; - _vm = 1; - _velocity = _initialData select 5; - - _oldVelocity = _velocity call BIS_fnc_magnitude; - _curVelocity = (velocity _round) call BIS_fnc_magnitude; - - if(alive _round) then { - _diff = _velocity vectorDiff (velocity _round); - _polar = _diff call CBA_fnc_vect2polar; - // player sideChat format["polar: %1", _polar]; - if((abs(_polar select 1) > 45 || abs(_polar select 2) > 45)) then { - if(_caliber < 2.5) then { - // player sideChat format["exit!"]; - _exit = true; - } else { - _vm = 1-(_curVelocity/_oldVelocity); - }; - }; - }; - if(!_exit) then { - _unitDir = vectorNormalized _velocity; - _pos = _hpData select 3; - _spallPos = nil; - for "_i" from 0 to 100 do { - _pos1 = [ - (_pos select 0) + (((_unitDir select 0)*0.01)*_i), - (_pos select 1) + (((_unitDir select 1)*0.01)*_i), - (_pos select 2) + (((_unitDir select 2)*0.01)*_i) - ]; - _pos2 = [ - (_pos select 0) + (((_unitDir select 0)*0.01)*(_i+1)), - (_pos select 1) + (((_unitDir select 1)*0.01)*(_i+1)), - (_pos select 2) + (((_unitDir select 2)*0.01)*(_i+1)) - ]; - // _blah = [_object, "FIRE"] intersect [_object worldToModel (ASLtoATL _pos1), _object worldToModel (ASLtoATL _pos2)]; - // diag_log text format["b: %1", _blah]; - - // _data = [nil, nil, nil, 1, [[ASLtoATL _pos1, 1], [ASLtoATL _pos2, 1]]]; - // NOU_TRACES set[(count NOU_TRACES), _data]; - - if(!lineIntersects [_pos1, _pos2]) exitWith { - // player sideChat format["FOUND!"]; - _spallPos = _pos2; - }; - }; - if(!isNil "_spallPos") then { - _spallPolar = _velocity call CBA_fnc_vect2polar; - - if(_explosive > 0) then { - // player sideChat format["EXPLOSIVE!"]; - _warn = false; - _c = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_CHARGE"); - if(_c == 0) then { _c = 1; _warn = true;}; - _m = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_METAL"); - if(_m == 0) then { _m = 2; _warn = true;}; - _k = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_GURNEY_K"); - if(_k == 0) then { _k = 1/2; _warn = true;}; - _gC = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_GURNEY_C"); - if(_gC == 0) then { _gC = 2440; _warn = true;}; + // player sideChat format["BBBB"]; + _exit = false; + _vm = 1; + _velocity = _initialData select 5; + + _oldVelocity = _velocity call BIS_fnc_magnitude; + _curVelocity = (velocity _round) call BIS_fnc_magnitude; + + if(alive _round) then { + _diff = _velocity vectorDiff (velocity _round); + _polar = _diff call CBA_fnc_vect2polar; + // player sideChat format["polar: %1", _polar]; + if((abs(_polar select 1) > 45 || abs(_polar select 2) > 45)) then { + if(_caliber < 2.5) then { + // player sideChat format["exit!"]; + _exit = true; + } else { + _vm = 1-(_curVelocity/_oldVelocity); + }; + }; + }; + if(!_exit) then { + _unitDir = vectorNormalized _velocity; + _pos = _hpData select 3; + _spallPos = nil; + for "_i" from 0 to 100 do { + _pos1 = [ + (_pos select 0) + (((_unitDir select 0)*0.01)*_i), + (_pos select 1) + (((_unitDir select 1)*0.01)*_i), + (_pos select 2) + (((_unitDir select 2)*0.01)*_i) + ]; + _pos2 = [ + (_pos select 0) + (((_unitDir select 0)*0.01)*(_i+1)), + (_pos select 1) + (((_unitDir select 1)*0.01)*(_i+1)), + (_pos select 2) + (((_unitDir select 2)*0.01)*(_i+1)) + ]; + // _blah = [_object, "FIRE"] intersect [_object worldToModel (ASLtoATL _pos1), _object worldToModel (ASLtoATL _pos2)]; + // diag_log text format["b: %1", _blah]; + + // _data = [nil, nil, nil, 1, [[ASLtoATL _pos1, 1], [ASLtoATL _pos2, 1]]]; + // NOU_TRACES set[(count NOU_TRACES), _data]; + + if(!lineIntersects [_pos1, _pos2]) exitWith { + // player sideChat format["FOUND!"]; + _spallPos = _pos2; + }; + }; + if(!isNil "_spallPos") then { + _spallPolar = _velocity call CBA_fnc_vect2polar; + + if(_explosive > 0) then { + // player sideChat format["EXPLOSIVE!"]; + _warn = false; + _c = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_CHARGE"); + if(_c == 0) then { _c = 1; _warn = true;}; + _m = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_METAL"); + if(_m == 0) then { _m = 2; _warn = true;}; + _k = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_GURNEY_K"); + if(_k == 0) then { _k = 1/2; _warn = true;}; + _gC = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_GURNEY_C"); + if(_gC == 0) then { _gC = 2440; _warn = true;}; - if(_warn) then { - diag_log text format["Ammo class %1 lacks proper explosive properties definitions for frag!", _roundType]; //TODO: turn this off when we get closer to release - }; + if(_warn) then { + diag_log text format["Ammo class %1 lacks proper explosive properties definitions for frag!", _roundType]; //TODO: turn this off when we get closer to release + }; - _fragPower = (((_m/_c)+_k)^-(1/2))*_gC; - _spallPolar set[0, _fragPower*0.66]; - }; - - _fragTypes = [ - "ACE_frag_spall_small", "ACE_frag_spall_small", "ACE_frag_spall_small", - "ACE_frag_spall_small","ACE_frag_spall_medium","ACE_frag_spall_medium","ACE_frag_spall_medium", - "ACE_frag_spall_medium", "ACE_frag_spall_large", "ACE_frag_spall_large", "ACE_frag_spall_huge", - "ACE_frag_spall_huge" + _fragPower = (((_m/_c)+_k)^-(1/2))*_gC; + _spallPolar set[0, _fragPower*0.66]; + }; + + _fragTypes = [ + "ACE_frag_spall_small", "ACE_frag_spall_small", "ACE_frag_spall_small", + "ACE_frag_spall_small","ACE_frag_spall_medium","ACE_frag_spall_medium","ACE_frag_spall_medium", + "ACE_frag_spall_medium", "ACE_frag_spall_large", "ACE_frag_spall_large", "ACE_frag_spall_huge", + "ACE_frag_spall_huge" - ]; - - // diag_log text format["SPALL POWER: %1", _spallPolar select 0]; - _spread = 15+(random 25); - _spallCount = 5+(random 10); - for "_i" from 1 to _spallCount do { - _elev = ((_spallPolar select 2)-_spread)+(random (_spread*2)); - _dir = ((_spallPolar select 1)-_spread)+(random (_spread*2)); - if(abs _elev > 90) then { - _dir = _dir + 180; - }; - _dir = _dir % 360; - _vel = (_spallPolar select 0)*0.33*_vm; - _vel = (_vel-(_vel*0.25))+(random (_vel*0.5)); - - _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; - _fragType = round (random ((count _fragTypes)-1)); - _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; - _fragment setPosASL _spallPos; - _fragment setVelocity _spallFragVect; - if(GVAR(traceFrags)) then { - [player, _fragment, [1,0.5,0,1]] call FUNC(addTrack); - }; - }; - _spread = 5+(random 5); - _spallCount = 3+(random 5); - for "_i" from 1 to _spallCount do { - _elev = ((_spallPolar select 2)-_spread)+(random (_spread*2)); - _dir = ((_spallPolar select 1)-_spread)+(random (_spread*2)); - if(abs _elev > 90) then { - _dir = _dir + 180; - }; - _dir = _dir % 360; - _vel = (_spallPolar select 0)*0.55*_vm; - _vel = (_vel-(_vel*0.25))+(random (_vel*0.5)); - - _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; - _fragType = round (random ((count _fragTypes)-1)); - _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; - _fragment setPosASL _spallPos; - _fragment setVelocity _spallFragVect; - if(GVAR(traceFrags)) then { - [player, _fragment, [1,0,0,1]] call FUNC(addTrack); - }; - }; - }; - }; + ]; + + // diag_log text format["SPALL POWER: %1", _spallPolar select 0]; + _spread = 15+(random 25); + _spallCount = 5+(random 10); + for "_i" from 1 to _spallCount do { + _elev = ((_spallPolar select 2)-_spread)+(random (_spread*2)); + _dir = ((_spallPolar select 1)-_spread)+(random (_spread*2)); + if(abs _elev > 90) then { + _dir = _dir + 180; + }; + _dir = _dir % 360; + _vel = (_spallPolar select 0)*0.33*_vm; + _vel = (_vel-(_vel*0.25))+(random (_vel*0.5)); + + _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; + _fragType = round (random ((count _fragTypes)-1)); + _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; + _fragment setPosASL _spallPos; + _fragment setVelocity _spallFragVect; + if(GVAR(traceFrags)) then { + [player, _fragment, [1,0.5,0,1]] call FUNC(addTrack); + }; + }; + _spread = 5+(random 5); + _spallCount = 3+(random 5); + for "_i" from 1 to _spallCount do { + _elev = ((_spallPolar select 2)-_spread)+(random (_spread*2)); + _dir = ((_spallPolar select 1)-_spread)+(random (_spread*2)); + if(abs _elev > 90) then { + _dir = _dir + 180; + }; + _dir = _dir % 360; + _vel = (_spallPolar select 0)*0.55*_vm; + _vel = (_vel-(_vel*0.25))+(random (_vel*0.5)); + + _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; + _fragType = round (random ((count _fragTypes)-1)); + _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; + _fragment setPosASL _spallPos; + _fragment setVelocity _spallFragVect; + if(GVAR(traceFrags)) then { + [player, _fragment, [1,0,0,1]] call FUNC(addTrack); + }; + }; + }; + }; }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_drawTraces.sqf b/addons/frag/functions/fnc_drawTraces.sqf index 8e3ab6146e..b9645bab97 100644 --- a/addons/frag/functions/fnc_drawTraces.sqf +++ b/addons/frag/functions/fnc_drawTraces.sqf @@ -1,32 +1,32 @@ #include "script_component.hpp" { - _positions = _x select 4; - _color = _x select 5; - _index = 0; - _max = count _positions; - _startSpeed = (_positions select 0) select 1; - if(_startSpeed <= 0) then { - _startSpeed = 0.01; - }; - _lastSpd = []; - _lastPos = []; - while {_index < _max} do { - _data1 = _positions select _index; - _data2 = nil; - if(_index + ACE_TRACE_DRAW_INC >= _max) then { - _data2 = _positions select (_max - 1); - } else { - _data2 = _positions select (_index + ACE_TRACE_DRAW_INC); - }; - - _pos1 = _data1 select 0; - _pos2 = _data2 select 0; - _index = _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, "PuristaMedium"]; + _positions = _x select 4; + _color = _x select 5; + _index = 0; + _max = count _positions; + _startSpeed = (_positions select 0) select 1; + if(_startSpeed <= 0) then { + _startSpeed = 0.01; + }; + _lastSpd = []; + _lastPos = []; + while {_index < _max} do { + _data1 = _positions select _index; + _data2 = nil; + if(_index + ACE_TRACE_DRAW_INC >= _max) then { + _data2 = _positions select (_max - 1); + } else { + _data2 = _positions select (_index + ACE_TRACE_DRAW_INC); + }; + + _pos1 = _data1 select 0; + _pos2 = _data2 select 0; + _index = _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, "PuristaMedium"]; } forEach GVAR(traces); \ No newline at end of file diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index a6e934c667..e7d7d09682 100644 --- a/addons/frag/functions/fnc_fired.sqf +++ b/addons/frag/functions/fnc_fired.sqf @@ -7,42 +7,42 @@ _type = _this select 4; _round = _this select 6; if(_round in GVAR(blackList)) exitWith { - GVAR(blackList) = GVAR(blackList) - [_round]; + GVAR(blackList) = GVAR(blackList) - [_round]; }; _doFragTrack = false; if(_gun == player) then { - _doFragTrack = true; + _doFragTrack = true; } else { - if((gunner _gun) == player) then { - _doFragTrack = true; - } else { - if(local _gun && {!(isPlayer (gunner _gun))} && {!(isPlayer _gun)}) then { - _doFragTrack = true; - }; - }; + if((gunner _gun) == player) then { + _doFragTrack = true; + } else { + if(local _gun && {!(isPlayer (gunner _gun))} && {!(isPlayer _gun)}) then { + _doFragTrack = true; + }; + }; }; _doSpall = false; if(_doSpall) then { - if(GVAR(spallIsTrackingCount) <= 0) then { - GVAR(spallHPData) = []; - }; - if(GVAR(spallIsTrackingCount) > 5) then { - // player sideChat "LIMT!"; - _doSpall = false; - } else { - GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1; - }; + if(GVAR(spallIsTrackingCount) <= 0) then { + GVAR(spallHPData) = []; + }; + if(GVAR(spallIsTrackingCount) > 5) then { + // player sideChat "LIMT!"; + _doSpall = false; + } else { + GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1; + }; }; // player sideChat format["c: %1", GVAR(spallIsTrackingCount)]; [player, _round, [1,0,0,1]] call nou_fnc_addTrack; if(_doFragTrack && alive _round) then { - GVAR(trackedObjects) pushBack _round; - _spallTrack = []; - _spallTrackID = []; - [DFUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), _type, time, _gun, _doSpall, _spallTrack, _spallTrackID]] call cba_fnc_addPerFrameHandler; - if(_doSpall) then { - [_round, 2, _spallTrack, _spallTrackID] call FUNC(spallTrack); - }; - // player sideChat "WTF2"; + GVAR(trackedObjects) pushBack _round; + _spallTrack = []; + _spallTrackID = []; + [DFUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), _type, time, _gun, _doSpall, _spallTrack, _spallTrackID]] call cba_fnc_addPerFrameHandler; + if(_doSpall) then { + [_round, 2, _spallTrack, _spallTrackID] call FUNC(spallTrack); + }; + // player sideChat "WTF2"; }; diff --git a/addons/frag/functions/fnc_frag_trace.sqf b/addons/frag/functions/fnc_frag_trace.sqf index f4e14fa12a..664e117793 100644 --- a/addons/frag/functions/fnc_frag_trace.sqf +++ b/addons/frag/functions/fnc_frag_trace.sqf @@ -4,7 +4,7 @@ private ["_params", "_shell"]; _params = _this select 0; _shell = _params select 0; if(alive _shell) then { - drop ["\Ca\Data\Cl_basic","","Billboard",1,30,(getPos _shell),[0,0,0],1,1.275,1.0,0.0,[0.5],[[0,1,0,1]],[0],0.0,2.0,"","",""]; + drop ["\Ca\Data\Cl_basic","","Billboard",1,30,(getPos _shell),[0,0,0],1,1.275,1.0,0.0,[0.5],[[0,1,0,1]],[0],0.0,2.0,"","",""]; } else { - [_this select 1] call cba_fnc_removePerFrameHandler; + [_this select 1] call cba_fnc_removePerFrameHandler; }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index 79eea53cd7..1b737dc70d 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -10,43 +10,43 @@ if(!isServer) exitWith { }; // _startTime = diag_tickTime; private ["_round", "_lastPos", "_lastVel", "_shellType", "_gun", "_fragTypes", "_warn", "_atlPos", "_isArmed", - "_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom", - "_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_target", "_boundingBox", - "_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir", - "_currentCount", "_count", "_vecVar", "_i", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount", - "_sectorSize", "_sectorOffset", "_randomDir"]; - - + "_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom", + "_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_target", "_boundingBox", + "_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir", + "_currentCount", "_count", "_vecVar", "_i", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount", + "_sectorSize", "_sectorOffset", "_randomDir"]; + + _round = _this select 0; _lastPos = _this select 1; _lastVel = _this select 2; _shellType = _this select 3; _gun = nil; if((count _this) > 5) then { - _gun = _this select 5; + _gun = _this select 5; }; _fragTypes = [ - "ACE_frag_tiny", "ACE_frag_tiny", "ACE_frag_tiny", - "ACE_frag_tiny_HD", "ACE_frag_tiny_HD", "ACE_frag_tiny_HD", - "ACE_frag_small","ACE_frag_small","ACE_frag_small","ACE_frag_small", - "ACE_frag_small_HD","ACE_frag_small_HD","ACE_frag_small_HD","ACE_frag_small_HD", - "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD" - ]; + "ACE_frag_tiny", "ACE_frag_tiny", "ACE_frag_tiny", + "ACE_frag_tiny_HD", "ACE_frag_tiny_HD", "ACE_frag_tiny_HD", + "ACE_frag_small","ACE_frag_small","ACE_frag_small","ACE_frag_small", + "ACE_frag_small_HD","ACE_frag_small_HD","ACE_frag_small_HD","ACE_frag_small_HD", + "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD" + ]; _warn = false; if(isArray (configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CLASSES")) then { - _fragTypes = getArray (configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CLASSES"); + _fragTypes = getArray (configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CLASSES"); } else { - _warn = true; + _warn = true; }; _atlPos = ASLtoATL _lastPos; _isArmed = true; if(!isNil "_gun") then { - _fuseDist = getNumber(configFile >> "CfgAmmo" >> _shellType >> "fuseDistance"); - _isArmed = ((getPosASL _gun) distance _lastPos > _fuseDist); + _fuseDist = getNumber(configFile >> "CfgAmmo" >> _shellType >> "fuseDistance"); + _isArmed = ((getPosASL _gun) distance _lastPos > _fuseDist); }; _indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _shellType >> "indirecthitrange"); @@ -72,7 +72,7 @@ _gC = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_GURNEY_C"); if(_gC == 0) then { _gC = 2440; _warn = true;}; if(_warn) then { - diag_log text format["Ammo class %1 lacks proper explosive properties definitions for frag!", _shellType]; //TODO: turn this off when we get closer to release + diag_log text format["Ammo class %1 lacks proper explosive properties definitions for frag!", _shellType]; //TODO: turn this off when we get closer to release }; _fragPower = (((_m/_c)+_k)^-(1/2))*_gC; @@ -80,7 +80,7 @@ _fragPower = _fragPower*0.8; // Gunery equation is for a non-fragmenting metal, _fragPowerRandom = _fragPower*0.5; if((_atlPos select 2) < 0.5) then { - _lastPos set[2, (_lastPos select 2)+0.5]; + _lastPos set[2, (_lastPos select 2)+0.5]; }; // _manObjects = _atlPos nearEntities ["CaManBase", _fragRange]; @@ -108,123 +108,123 @@ _fragArcs = []; _fragArcs set[360, 0]; #ifdef DEBUG_MODE_FULL - player sideChat format["_fragRange: %1", _fragRange]; - player sideChat format["_objects: %1", _objects]; + player sideChat format["_fragRange: %1", _fragRange]; + player sideChat format["_objects: %1", _objects]; #endif _doRandom = false; if(_isArmed && (count _objects) > 0) then { - { - //if(random(1) > 0.5) then { - _target = _x; - if(alive _target) then { - _boundingBox = boundingBox _target; - _targetPos = (getPosASL _target); - _distance = _targetPos distance _lastPos; - _add = (((_boundingBox select 1) select 2)/2)+((((_distance-(_fragpower/8)) max 0)/_fragPower)*10); - _bbX = (abs((_boundingBox select 0) select 0))+((_boundingBox select 1) select 0); - _bbY = (abs((_boundingBox select 0) select 1))+((_boundingBox select 1) select 1); - _bbZ = (abs((_boundingBox select 0) select 2))+((_boundingBox select 1) select 2); - _cubic = _bbX*_bbY*_bbZ; - if(_cubic > 1) then { - _doRandom = true; - - _targetVel = (velocity _target); - - - _targetPos set[0, (_targetPos select 0)+((_targetVel select 0)*(_distance/_fragPower))]; - _targetPos set[1, (_targetPos select 1)+((_targetVel select 1)*(_distance/_fragPower))]; - _targetPos set[2, (_targetPos select 2)+_add]; + { + //if(random(1) > 0.5) then { + _target = _x; + if(alive _target) then { + _boundingBox = boundingBox _target; + _targetPos = (getPosASL _target); + _distance = _targetPos distance _lastPos; + _add = (((_boundingBox select 1) select 2)/2)+((((_distance-(_fragpower/8)) max 0)/_fragPower)*10); + _bbX = (abs((_boundingBox select 0) select 0))+((_boundingBox select 1) select 0); + _bbY = (abs((_boundingBox select 0) select 1))+((_boundingBox select 1) select 1); + _bbZ = (abs((_boundingBox select 0) select 2))+((_boundingBox select 1) select 2); + _cubic = _bbX*_bbY*_bbZ; + if(_cubic > 1) then { + _doRandom = true; + + _targetVel = (velocity _target); + + + _targetPos set[0, (_targetPos select 0)+((_targetVel select 0)*(_distance/_fragPower))]; + _targetPos set[1, (_targetPos select 1)+((_targetVel select 1)*(_distance/_fragPower))]; + _targetPos set[2, (_targetPos select 2)+_add]; _baseVec = _lastPos vectorFromTo _targetPos; - - _dir = floor(_baseVec call CBA_fnc_vectDir); - _currentCount = _fragArcs select _dir; - if(isNil "_currentCount") then { - _currentCount = 0; - }; - if(_currentCount < 20) then { - _count = ceil(random(sqrt(_m/1000))); - _vecVar = FRAG_VEC_VAR; - if(!(_target isKindOf "Man")) then { - _vecVar = ((sqrt _cubic)/2000)+FRAG_VEC_VAR; - if((count (crew _target)) == 0 && _count > 0) then { - _count = 0 max (_count/2); - }; - }; - for "_i" from 1 to _count do { - _vec = +_baseVec; - - _vec set[0, (_vec select 0)-(_vecVar/2)+(random _vecVar)]; - _vec set[1, (_vec select 1)-(_vecVar/2)+(random _vecVar)]; - _vec set[2, (_vec select 2)-(_vecVar/2)+(random _vecVar)]; - - _fp = (_fragPower-(random (_fragPowerRandom))); - _vel = [ - (_vec select 0)*_fp, - (_vec select 1)*_fp, - (_vec select 2)*_fp - ]; - - _fragType = round (random ((count _fragTypes)-1)); - _fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; - // diag_log text format["fp: %1 %2", _fp, typeOf _fragObj]; - _fragObj setPosASL _lastPos; - _fragObj setVectorDir _vec; - _fragObj setVelocity _vel; - #ifdef DEBUG_MODE_FULL - GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1; - GVAR(traceFrags) = true; - #endif - if(GVAR(traceFrags)) then { - [player, _fragObj, [1,0,0,1]] call FUNC(addTrack); - }; - _fragCount = _fragCount + 1; - _currentCount = _currentCount + 1; - }; - _fragArcs set[_dir, _currentCount]; - }; - }; - }; - //}; - if(_fragCount > MAX_FRAG_COUNT) exitWith {}; - } forEach _objects; - if(_fragCount > MAX_FRAG_COUNT) exitWith {}; - _randomCount = (ceil((MAX_FRAG_COUNT-_fragCount)*0.1)) max 0; - _sectorSize = 360 / (_randomCount max 1); - // _doRandom = false; - if(_doRandom) then { - for "_i" from 1 to _randomCount do { - // Distribute evenly - _sectorOffset = 360 * (_i - 1) / (_randomCount max 1); - _randomDir = random(_sectorSize); - _vec = [cos(_sectorOffset + _randomDir), sin(_sectorOffset + _randomDir), sin(30 - (random 45))]; - - _fp = (_fragPower-(random (_fragPowerRandom))); - - _vel = [ - (_vec select 0)*_fp, - (_vec select 1)*_fp, - (_vec select 2)*_fp - ]; - - _fragType = round (random ((count _fragTypes)-1)); - _fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; - _fragObj setPosASL _lastPos; - _fragObj setVectorDir _vec; - _fragObj setVelocity _vel; - #ifdef DEBUG_MODE_FULL - GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1; - GVAR(traceFrags) = true; - #endif - if(GVAR(traceFrags)) then { - [player, _fragObj, [1,0.5,0,1]] call FUNC(addTrack); - }; - _fragCount = _fragCount + 1; - }; - }; + + _dir = floor(_baseVec call CBA_fnc_vectDir); + _currentCount = _fragArcs select _dir; + if(isNil "_currentCount") then { + _currentCount = 0; + }; + if(_currentCount < 20) then { + _count = ceil(random(sqrt(_m/1000))); + _vecVar = FRAG_VEC_VAR; + if(!(_target isKindOf "Man")) then { + _vecVar = ((sqrt _cubic)/2000)+FRAG_VEC_VAR; + if((count (crew _target)) == 0 && _count > 0) then { + _count = 0 max (_count/2); + }; + }; + for "_i" from 1 to _count do { + _vec = +_baseVec; + + _vec set[0, (_vec select 0)-(_vecVar/2)+(random _vecVar)]; + _vec set[1, (_vec select 1)-(_vecVar/2)+(random _vecVar)]; + _vec set[2, (_vec select 2)-(_vecVar/2)+(random _vecVar)]; + + _fp = (_fragPower-(random (_fragPowerRandom))); + _vel = [ + (_vec select 0)*_fp, + (_vec select 1)*_fp, + (_vec select 2)*_fp + ]; + + _fragType = round (random ((count _fragTypes)-1)); + _fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; + // diag_log text format["fp: %1 %2", _fp, typeOf _fragObj]; + _fragObj setPosASL _lastPos; + _fragObj setVectorDir _vec; + _fragObj setVelocity _vel; + #ifdef DEBUG_MODE_FULL + GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1; + GVAR(traceFrags) = true; + #endif + if(GVAR(traceFrags)) then { + [player, _fragObj, [1,0,0,1]] call FUNC(addTrack); + }; + _fragCount = _fragCount + 1; + _currentCount = _currentCount + 1; + }; + _fragArcs set[_dir, _currentCount]; + }; + }; + }; + //}; + if(_fragCount > MAX_FRAG_COUNT) exitWith {}; + } forEach _objects; + if(_fragCount > MAX_FRAG_COUNT) exitWith {}; + _randomCount = (ceil((MAX_FRAG_COUNT-_fragCount)*0.1)) max 0; + _sectorSize = 360 / (_randomCount max 1); + // _doRandom = false; + if(_doRandom) then { + for "_i" from 1 to _randomCount do { + // Distribute evenly + _sectorOffset = 360 * (_i - 1) / (_randomCount max 1); + _randomDir = random(_sectorSize); + _vec = [cos(_sectorOffset + _randomDir), sin(_sectorOffset + _randomDir), sin(30 - (random 45))]; + + _fp = (_fragPower-(random (_fragPowerRandom))); + + _vel = [ + (_vec select 0)*_fp, + (_vec select 1)*_fp, + (_vec select 2)*_fp + ]; + + _fragType = round (random ((count _fragTypes)-1)); + _fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; + _fragObj setPosASL _lastPos; + _fragObj setVectorDir _vec; + _fragObj setVelocity _vel; + #ifdef DEBUG_MODE_FULL + GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1; + GVAR(traceFrags) = true; + #endif + if(GVAR(traceFrags)) then { + [player, _fragObj, [1,0.5,0,1]] call FUNC(addTrack); + }; + _fragCount = _fragCount + 1; + }; + }; }; // #ifdef DEBUG_MODE_FULL - // player sideChat format["total frags: %1", GVAR(TOTALFRAGS)]; - // player sideChat format["tracks: %1", (count GVAR(trackedObjects))]; + // player sideChat format["total frags: %1", GVAR(TOTALFRAGS)]; + // player sideChat format["tracks: %1", (count GVAR(trackedObjects))]; // #endif // _endTime = diag_tickTime; diff --git a/addons/frag/functions/fnc_removeTrack.sqf b/addons/frag/functions/fnc_removeTrack.sqf index b72830051a..804719a7ca 100644 --- a/addons/frag/functions/fnc_removeTrack.sqf +++ b/addons/frag/functions/fnc_removeTrack.sqf @@ -3,12 +3,12 @@ private ["_ret"]; _ret = true; if(IS_ARRAY((_this select 0))) then { - _ret = false; + _ret = false; } else { - if((_this select 0) in GVAR(trackedObjects)) then { - GVAR(trackedObjects) = GVAR(trackedObjects) - [(_this select 0)]; - } else { - _ret = false; - }; + if((_this select 0) in GVAR(trackedObjects)) then { + GVAR(trackedObjects) = GVAR(trackedObjects) - [(_this select 0)]; + } else { + _ret = false; + }; }; _ret \ No newline at end of file diff --git a/addons/frag/functions/fnc_spallHP.sqf b/addons/frag/functions/fnc_spallHP.sqf index 89ba572ce2..fb894be499 100644 --- a/addons/frag/functions/fnc_spallHP.sqf +++ b/addons/frag/functions/fnc_spallHP.sqf @@ -3,27 +3,27 @@ private ["_initialData", "_currentCount", "_hpData", "_round", "_hpRound"]; //player sideChat format["f: %1 c: %2", (_this select 0), (count GVAR(spallHPData))]; if((_this select 0) <= (count GVAR(spallHPData))) then { - _initialData = GVAR(spallHPData) select (_this select 0); - if(!isNil "_initialData") then { - _hpRound = ((_this select 1) select 0) select 2; - _round = _initialData select 3; - _hpDirect = ((_this select 1) select 0) select 10; - if(_hpDirect && {_round == _hpRound}) then { - - { - _hpData = _x; - _round = _initialData select 3; - // 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), 0, [_this, _forEachIndex]] call cba_fnc_addPerFrameHandler; - // player sideChat "WEEE"; - } forEach (_this select 1); - }; - }; + _initialData = GVAR(spallHPData) select (_this select 0); + if(!isNil "_initialData") then { + _hpRound = ((_this select 1) select 0) select 2; + _round = _initialData select 3; + _hpDirect = ((_this select 1) select 0) select 10; + if(_hpDirect && {_round == _hpRound}) then { + + { + _hpData = _x; + _round = _initialData select 3; + // 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), 0, [_this, _forEachIndex]] call cba_fnc_addPerFrameHandler; + // player sideChat "WEEE"; + } forEach (_this select 1); + }; + }; }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_spallTrack.sqf b/addons/frag/functions/fnc_spallTrack.sqf index 31e9c228bb..a264e1ded9 100644 --- a/addons/frag/functions/fnc_spallTrack.sqf +++ b/addons/frag/functions/fnc_spallTrack.sqf @@ -12,29 +12,29 @@ _curPos = getPosASL _round; _velocity = velocity _round; _velocityStep = [ - (_velocity select 0)*_delta, - (_velocity select 1)*_delta, - (_velocity select 2)*_delta - ]; + (_velocity select 0)*_delta, + (_velocity select 1)*_delta, + (_velocity select 2)*_delta + ]; _forwardPos = [ - (_curPos select 0) + (_velocityStep select 0), - (_curPos select 1) + (_velocityStep select 1), - (_curPos select 2) + (_velocityStep select 2) - ]; - + (_curPos select 0) + (_velocityStep select 0), + (_curPos select 1) + (_velocityStep select 1), + (_curPos select 2) + (_velocityStep select 2) + ]; + _intersectsWith = lineIntersectsWith [_curPos, _forwardPos]; if(count _intersectsWith > 0) then { - // player sideChat format["inter: %1", _intersectsWith]; - { - if(!(_x in _foundObjects)) then { - // diag_log text format["Adding HP: %1", _x]; - _index = (count GVAR(spallHPData)); - _hpId = _x addEventHandler ["hitPart", format["[%1, _this] call " + QUOTE(FUNC(spallHP)), _index]]; - _foundObjects set[(count _foundObjects), _x]; - _foundObjectHPIds set[(count _foundObjectHPIds), _hpId]; - _data = [_hpId, _x, typeOf _round, _round, _curPos, _velocity, 0, _foundObjects, _foundObjectHPIds]; - GVAR(spallHPData) set[_index, _data]; - }; - } forEach _intersectsWith; + // player sideChat format["inter: %1", _intersectsWith]; + { + if(!(_x in _foundObjects)) then { + // diag_log text format["Adding HP: %1", _x]; + _index = (count GVAR(spallHPData)); + _hpId = _x addEventHandler ["hitPart", format["[%1, _this] call " + QUOTE(FUNC(spallHP)), _index]]; + _foundObjects set[(count _foundObjects), _x]; + _foundObjectHPIds set[(count _foundObjectHPIds), _hpId]; + _data = [_hpId, _x, typeOf _round, _round, _curPos, _velocity, 0, _foundObjects, _foundObjectHPIds]; + GVAR(spallHPData) set[_index, _data]; + }; + } forEach _intersectsWith; }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_startTracing.sqf b/addons/frag/functions/fnc_startTracing.sqf index 31f4b99762..4ed9240ed6 100644 --- a/addons/frag/functions/fnc_startTracing.sqf +++ b/addons/frag/functions/fnc_startTracing.sqf @@ -1,5 +1,5 @@ #include "script_component.hpp" if(!GVAR(tracesStarted)) then { - GVAR(tracesStarted) = true; - GVAR(traceID) = [FUNC(drawTraces), 0, []] call cba_fnc_addPerFrameHandler; + GVAR(tracesStarted) = true; + GVAR(traceID) = [FUNC(drawTraces), 0, []] call cba_fnc_addPerFrameHandler; }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_stopTracing.sqf b/addons/frag/functions/fnc_stopTracing.sqf index 693390fff2..56d7508d6b 100644 --- a/addons/frag/functions/fnc_stopTracing.sqf +++ b/addons/frag/functions/fnc_stopTracing.sqf @@ -1,5 +1,5 @@ #include "script_component.hpp" if(GVAR(tracesStarted)) then { - GVAR(tracesStarted) = false; - [GVAR(traceID)] call cba_fnc_removePerFrameHandler; + GVAR(tracesStarted) = false; + [GVAR(traceID)] call cba_fnc_removePerFrameHandler; }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_trackFragRound.sqf b/addons/frag/functions/fnc_trackFragRound.sqf index 0a8e3948d0..586bbc0166 100644 --- a/addons/frag/functions/fnc_trackFragRound.sqf +++ b/addons/frag/functions/fnc_trackFragRound.sqf @@ -12,41 +12,41 @@ _spallTrack = _params select 7; _foundObjectHPIds = _params select 8; if (!alive _round) then { - [_this select 1] call cba_fnc_removePerFrameHandler; - if(_time != time && {_round in GVAR(trackedObjects)} && {!(_round in GVAR(blackList))}) then { - GVAR(trackedObjects) = GVAR(trackedObjects) - [_round]; - _skip = getNumber (configFile >> "CfgAmmo" >> _type >> "ACE_FRAG_SKIP"); - if(_skip == 0) then { - _explosive = getNumber (configFile >> "CfgAmmo" >> _type >> "explosive"); - _indirectRange = getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"); - _force = getNumber (configFile >> "CfgAmmo" >> _type >> "ACE_FRAG_FORCE"); - _fragPower = getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt(_indirectRange)); - if((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1} ) then { - [QGVAR(frag_eh), _params] call ace_common_fnc_serverEvent; - GVAR(trackedObjects) = GVAR(trackedObjects) - [_round]; - }; - }; - }; - if(_doSpall) then { - GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) - 1; - // diag_log text format["F: %1", _foundObjectHPIds]; - { - if(!isNil "_x") then { - _x removeEventHandler ["hitPart", _foundObjectHPIds select _forEachIndex]; - }; - } forEach _spallTrack; - }; + [_this select 1] call cba_fnc_removePerFrameHandler; + if(_time != time && {_round in GVAR(trackedObjects)} && {!(_round in GVAR(blackList))}) then { + GVAR(trackedObjects) = GVAR(trackedObjects) - [_round]; + _skip = getNumber (configFile >> "CfgAmmo" >> _type >> "ACE_FRAG_SKIP"); + if(_skip == 0) then { + _explosive = getNumber (configFile >> "CfgAmmo" >> _type >> "explosive"); + _indirectRange = getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"); + _force = getNumber (configFile >> "CfgAmmo" >> _type >> "ACE_FRAG_FORCE"); + _fragPower = getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt(_indirectRange)); + if((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1} ) then { + [QGVAR(frag_eh), _params] call ace_common_fnc_serverEvent; + GVAR(trackedObjects) = GVAR(trackedObjects) - [_round]; + }; + }; + }; + if(_doSpall) then { + GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) - 1; + // diag_log text format["F: %1", _foundObjectHPIds]; + { + if(!isNil "_x") then { + _x removeEventHandler ["hitPart", _foundObjectHPIds select _forEachIndex]; + }; + } forEach _spallTrack; + }; } else { - if(!(_round in GVAR(trackedObjects)) || {_round in GVAR(blackList)}) then { - [_this select 1] call cba_fnc_removePerFrameHandler; - if(_round in GVAR(blackList)) then { - GVAR(blackList) = GVAR(blackList) - [_round]; - }; - }; - - _params set[1, (getPosASL _round)]; - _params set[2, (velocity _round)]; - if(_doSpall) then { - [_round, 1, _spallTrack, _foundObjectHPIds] call FUNC(spallTrack); - }; + if(!(_round in GVAR(trackedObjects)) || {_round in GVAR(blackList)}) then { + [_this select 1] call cba_fnc_removePerFrameHandler; + if(_round in GVAR(blackList)) then { + GVAR(blackList) = GVAR(blackList) - [_round]; + }; + }; + + _params set[1, (getPosASL _round)]; + _params set[2, (velocity _round)]; + if(_doSpall) then { + [_round, 1, _spallTrack, _foundObjectHPIds] call FUNC(spallTrack); + }; }; diff --git a/addons/frag/functions/fnc_trackTrace.sqf b/addons/frag/functions/fnc_trackTrace.sqf index 628fece605..b0f3f06633 100644 --- a/addons/frag/functions/fnc_trackTrace.sqf +++ b/addons/frag/functions/fnc_trackTrace.sqf @@ -4,11 +4,11 @@ _tracerObj = _params select 0; _index = _params select 1; if(alive _tracerObj && (count GVAR(traces)) > 0) then { - _data = GVAR(traces) select _index; - _positions = _data select 4; - _objVel = velocity _tracerObj; - _objTVel = sqrt((_objVel select 0)^2 + (_objVel select 1)^2 + (_objVel select 2)^2); - _positions set[(count _positions), [(getPos _tracerObj), _objTVel]]; + _data = GVAR(traces) select _index; + _positions = _data select 4; + _objVel = velocity _tracerObj; + _objTVel = sqrt((_objVel select 0)^2 + (_objVel select 1)^2 + (_objVel select 2)^2); + _positions set[(count _positions), [(getPos _tracerObj), _objTVel]]; } else { - [(_this select 1)] call cba_fnc_removePerFrameHandler; -}; \ No newline at end of file + [(_this select 1)] call cba_fnc_removePerFrameHandler; +}; \ No newline at end of file diff --git a/addons/frag/script_component.hpp b/addons/frag/script_component.hpp index 371067db3e..3740ed23fa 100644 --- a/addons/frag/script_component.hpp +++ b/addons/frag/script_component.hpp @@ -4,13 +4,13 @@ //#define DEBUG_ENABLED_FRAG #ifdef DEBUG_ENABLED_FRAG - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_FRAG - #define DEBUG_SETTINGS DEBUG_SETTINGS_FRAG + #define DEBUG_SETTINGS DEBUG_SETTINGS_FRAG #endif #include "\z\ace\Addons\main\script_macros.hpp" -#define ACE_TRACE_DRAW_INC 1 \ No newline at end of file +#define ACE_TRACE_DRAW_INC 1 \ No newline at end of file diff --git a/addons/gforces/script_component.hpp b/addons/gforces/script_component.hpp index bd52732420..cf665c21ec 100644 --- a/addons/gforces/script_component.hpp +++ b/addons/gforces/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_GFORCES - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_GFORCES - #define DEBUG_SETTINGS DEBUG_SETTINGS_GFORCES + #define DEBUG_SETTINGS DEBUG_SETTINGS_GFORCES #endif #include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/goggles/RscTitles.hpp b/addons/goggles/RscTitles.hpp index 57975e052f..6c1b9870b6 100644 --- a/addons/goggles/RscTitles.hpp +++ b/addons/goggles/RscTitles.hpp @@ -1,42 +1,42 @@ class RscTitles{ - #include "define.hpp" - - class RscACE_Goggles_BaseTitle{ - idd = -1; - onLoad = "uiNamespace setVariable ['ACE_Goggles_Display', _this select 0]"; - onUnload = "uiNamespace setVariable ['ACE_Goggles_Display', displayNull]"; - fadeIn=0.5; - fadeOut=0.5; - movingEnable = false; - duration = 10e10; - name = "RscACE_Goggles_BaseTitle"; - class controls; - }; - - class RscACE_Goggles:RscACE_Goggles_BaseTitle{ - idd = 1044; - name = "RscACE_Goggles"; - class controls{ - class gogglesImage: RscPicture{ - idc = 10650; - }; - }; - }; - - class RscACE_GogglesEffects:RscACE_Goggles_BaseTitle{ - idd = 1045; - onLoad = "uiNamespace setVariable ['ACE_Goggles_DisplayEffects', _this select 0]"; - onUnload = "uiNamespace setVariable ['ACE_Goggles_DisplayEffects', displayNull]"; - name = "RscACE_GogglesEffects"; - fadeIn=0; - fadeOut=0.5; - class controls{ - class dirtImage: RscPicture { - idc = 10660; - }; - class dustImage: RscPicture { - idc = 10662; - }; - }; - }; + #include "define.hpp" + + class RscACE_Goggles_BaseTitle{ + idd = -1; + onLoad = "uiNamespace setVariable ['ACE_Goggles_Display', _this select 0]"; + onUnload = "uiNamespace setVariable ['ACE_Goggles_Display', displayNull]"; + fadeIn=0.5; + fadeOut=0.5; + movingEnable = false; + duration = 10e10; + name = "RscACE_Goggles_BaseTitle"; + class controls; + }; + + class RscACE_Goggles:RscACE_Goggles_BaseTitle{ + idd = 1044; + name = "RscACE_Goggles"; + class controls{ + class gogglesImage: RscPicture{ + idc = 10650; + }; + }; + }; + + class RscACE_GogglesEffects:RscACE_Goggles_BaseTitle{ + idd = 1045; + onLoad = "uiNamespace setVariable ['ACE_Goggles_DisplayEffects', _this select 0]"; + onUnload = "uiNamespace setVariable ['ACE_Goggles_DisplayEffects', displayNull]"; + name = "RscACE_GogglesEffects"; + fadeIn=0; + fadeOut=0.5; + class controls{ + class dirtImage: RscPicture { + idc = 10660; + }; + class dustImage: RscPicture { + idc = 10662; + }; + }; + }; }; \ No newline at end of file diff --git a/addons/goggles/config.cpp b/addons/goggles/config.cpp index dcc9c6ed0e..efda9b5436 100644 --- a/addons/goggles/config.cpp +++ b/addons/goggles/config.cpp @@ -3,279 +3,279 @@ #define COLOUR 8.0 class CfgPatches { class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common"}; - author[] = {"Garth 'L-H' de Wet"}; - authorUrl = "http://garth.snakebiteink.co.za/"; - VERSION_CONFIG; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"Garth 'L-H' de Wet"}; + authorUrl = "http://garth.snakebiteink.co.za/"; + VERSION_CONFIG; }; }; #include "CfgEventHandlers.hpp" -#define COMBAT_GOGGLES ACE_Overlay = QUOTE(PATHTOF(textures\HUD\CombatGoggles.paa)); \ - ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\CombatGogglesCracked.paa)); \ - ACE_Resistance = 2; \ - ACE_Protection = 1; +#define COMBAT_GOGGLES ACE_Overlay = QUOTE(PATHTOF(textures\HUD\CombatGoggles.paa)); \ + ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\CombatGogglesCracked.paa)); \ + ACE_Resistance = 2; \ + ACE_Protection = 1; class CfgGlasses { - class None { - ACE_Color[] = {0,0,0}; - ACE_TintAmount=0; - ACE_Overlay = ""; - ACE_OverlayDirt = "A3\Ui_f\data\igui\rsctitles\HealthTextures\dust_upper_ca.paa"; - ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\Cracked.paa)); - ACE_Resistance = 0; - ACE_Protection = 0; - ACE_DustPath = QUOTE(PATHTOF(textures\fx\dust\%1.paa)); - }; + class None { + ACE_Color[] = {0,0,0}; + ACE_TintAmount=0; + ACE_Overlay = ""; + ACE_OverlayDirt = "A3\Ui_f\data\igui\rsctitles\HealthTextures\dust_upper_ca.paa"; + ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\Cracked.paa)); + ACE_Resistance = 0; + ACE_Protection = 0; + ACE_DustPath = QUOTE(PATHTOF(textures\fx\dust\%1.paa)); + }; - class G_Combat:None { - COMBAT_GOGGLES - }; + class G_Combat:None { + COMBAT_GOGGLES + }; - class G_Diving { - ACE_Overlay = QUOTE(PATHTOF(textures\HUD\DivingGoggles.paa)); - ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\DivingGogglesCracked.paa)); - ACE_Resistance = 2; - ACE_Protection = 1; - }; + class G_Diving { + ACE_Overlay = QUOTE(PATHTOF(textures\HUD\DivingGoggles.paa)); + ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\DivingGogglesCracked.paa)); + ACE_Resistance = 2; + ACE_Protection = 1; + }; - class G_Lowprofile:None { - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 2; - ACE_Protection = 1; - }; + class G_Lowprofile:None { + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 2; + ACE_Protection = 1; + }; - class G_Shades_Black:None { - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 1; - }; + class G_Shades_Black:None { + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; - class G_Shades_Blue:None{ - ACE_Color[] = {0,0,1}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Shades_Blue:None{ + ACE_Color[] = {0,0,1}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Shades_Green:None{ - ACE_Color[] = {0,1,0}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Shades_Green:None{ + ACE_Color[] = {0,1,0}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Shades_Red:None{ - ACE_Color[] = {1,0,0}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Shades_Red:None{ + ACE_Color[] = {1,0,0}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Spectacles:None{ - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Spectacles:None{ + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Spectacles_Tinted:None{ - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 1; - }; + class G_Spectacles_Tinted:None{ + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; - class G_Sport_Blackred:None{ - ACE_Color[] = {1,0,0}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Sport_Blackred:None{ + ACE_Color[] = {1,0,0}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Sport_BlackWhite:None{ - ACE_Color[] = {0,0,1}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Sport_BlackWhite:None{ + ACE_Color[] = {0,0,1}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Sport_Blackyellow:None{ - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 1; - }; + class G_Sport_Blackyellow:None{ + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; - class G_Sport_Checkered:None{ - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 1; - }; + class G_Sport_Checkered:None{ + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; - class G_Sport_Greenblack:None{ - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 1; - }; + class G_Sport_Greenblack:None{ + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; - class G_Sport_Red:None{ - ACE_TintAmount=COLOUR*2; - ACE_Color[] = {0,0,0}; - ACE_Resistance = 1; - }; + class G_Sport_Red:None{ + ACE_TintAmount=COLOUR*2; + ACE_Color[] = {0,0,0}; + ACE_Resistance = 1; + }; - class G_Squares:None{ - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Squares:None{ + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Squares_Tinted:None{ - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Squares_Tinted:None{ + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Tactical_Black:None{ - ACE_TintAmount=COLOUR; - ACE_Color[] = {0,0,-1.5}; - ACE_Resistance = 1; - }; + class G_Tactical_Black:None{ + ACE_TintAmount=COLOUR; + ACE_Color[] = {0,0,-1.5}; + ACE_Resistance = 1; + }; - class G_Tactical_Clear:None{ - ACE_TintAmount=COLOUR; - ACE_Color[] = {0,0,-1}; - ACE_Resistance = 1; - }; + class G_Tactical_Clear:None{ + ACE_TintAmount=COLOUR; + ACE_Color[] = {0,0,-1}; + ACE_Resistance = 1; + }; - class G_Aviator:None{ - ACE_Color[] = {0,0,-1}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Aviator:None{ + ACE_Color[] = {0,0,-1}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Lady_Blue:None{ - ACE_Color[] = {0,0,1}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Lady_Blue:None{ + ACE_Color[] = {0,0,1}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Lady_Red:None{ - ACE_Color[] = {1,0,0}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Lady_Red:None{ + ACE_Color[] = {1,0,0}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Lady_Dark:None{ - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 1; - }; + class G_Lady_Dark:None{ + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; - class G_Lady_Mirror:None{ - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Lady_Mirror:None{ + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class AV_ESS_blk:None{ - COMBAT_GOGGLES - }; + class AV_ESS_blk:None{ + COMBAT_GOGGLES + }; - class G_Balaclava_blk; + class G_Balaclava_blk; - class G_Balaclava_combat:G_Balaclava_blk { - COMBAT_GOGGLES - }; + class G_Balaclava_combat:G_Balaclava_blk { + COMBAT_GOGGLES + }; - class G_Balaclava_lowprofile:G_Balaclava_blk { - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 2; - ACE_Protection = 1; - }; + class G_Balaclava_lowprofile:G_Balaclava_blk { + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 2; + ACE_Protection = 1; + }; - class G_Bandanna_blk; - class G_Bandanna_shades:G_Bandanna_blk { - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 1; - ACE_Protection = 1; - }; - class G_Bandanna_sport:G_Bandanna_blk { - ACE_Color[] = {1,0,0}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - ACE_Protection = 1; - }; - class G_Bandanna_aviator:G_Bandanna_blk { - ACE_Color[] = {0,0,-1}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - ACE_Protection = 1; - }; + class G_Bandanna_blk; + class G_Bandanna_shades:G_Bandanna_blk { + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + ACE_Protection = 1; + }; + class G_Bandanna_sport:G_Bandanna_blk { + ACE_Color[] = {1,0,0}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + ACE_Protection = 1; + }; + class G_Bandanna_aviator:G_Bandanna_blk { + ACE_Color[] = {0,0,-1}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + ACE_Protection = 1; + }; }; #include "RscTitles.hpp" class CfgMovesBasic { - class ManActions { - GestureWipeFace[] = {"GestureWipeFace", "gesture"}; - }; + class ManActions { + GestureWipeFace[] = {"GestureWipeFace", "gesture"}; + }; }; class CfgGesturesMale { - class States { - class GestureFreezeStand; - class GestureWipeFace: GestureFreezeStand { - file = QUOTE(PATHTOF(anim\WipeGlasses.rtm)); - canPullTrigger = 0; - }; - }; + class States { + class GestureFreezeStand; + class GestureWipeFace: GestureFreezeStand { + file = QUOTE(PATHTOF(anim\WipeGlasses.rtm)); + canPullTrigger = 0; + }; + }; }; class CfgWeapons { - class H_HelmetB; + class H_HelmetB; - class H_CrewHelmetHeli_B:H_HelmetB { - ACE_Protection = 1; - }; - class H_PilotHelmetHeli_B:H_HelmetB { - ACE_Protection = 1; - }; - class H_PilotHelmetFighter_B:H_HelmetB { - ACE_Protection = 1; - }; + class H_CrewHelmetHeli_B:H_HelmetB { + ACE_Protection = 1; + }; + class H_PilotHelmetHeli_B:H_HelmetB { + ACE_Protection = 1; + }; + class H_PilotHelmetFighter_B:H_HelmetB { + ACE_Protection = 1; + }; }; class RifleAssaultCloud { - ACE_Goggles_BulletCount = 4; + ACE_Goggles_BulletCount = 4; }; class MachineGunCloud { - ACE_Goggles_BulletCount = 3; + ACE_Goggles_BulletCount = 3; }; class SniperCloud { - ACE_Goggles_BulletCount = 1; + ACE_Goggles_BulletCount = 1; }; class ACE_Settings { - class GVAR(showInThirdPerson) { - value = 0; - typeName = "BOOL"; - isClientSetable = 1; - displayName = "$STR_ACE_Goggles_ShowInThirdPerson"; - }; + class GVAR(showInThirdPerson) { + value = 0; + typeName = "BOOL"; + isClientSetable = 1; + displayName = "$STR_ACE_Goggles_ShowInThirdPerson"; + }; }; class CfgCloudlets { - class Default; - class ACERainEffect:Default { - interval = 0.001; - particleShape = "\A3\data_f\ParticleEffects\Universal\Refract"; - particleFSNtieth = 1; - particleFSIndex = 0; - particleFSFrameCount = 1; - particleFSLoop = 1; + class Default; + class ACERainEffect:Default { + interval = 0.001; + particleShape = "\A3\data_f\ParticleEffects\Universal\Refract"; + particleFSNtieth = 1; + particleFSIndex = 0; + particleFSFrameCount = 1; + particleFSLoop = 1; - particleType = "Billboard"; - lifeTime = 0.5; - rotationVelocity = 1; - weight = 100; - volume = 0.000; - rubbing = 1.7; - size[] = {0.1}; - color[] = {{1,1,1,1}}; - animationSpeed[] = {0,1}; - randomDirectionPeriod = 0.2; - randomDirectionIntensity = 1.2; - positionVar[] = {2, 2, 2.5}; - sizeVar = 0.01; - colorVar[] = {0, 0, 0, 0.1}; - destroyOnWaterSurface = 1; - }; + particleType = "Billboard"; + lifeTime = 0.5; + rotationVelocity = 1; + weight = 100; + volume = 0.000; + rubbing = 1.7; + size[] = {0.1}; + color[] = {{1,1,1,1}}; + animationSpeed[] = {0,1}; + randomDirectionPeriod = 0.2; + randomDirectionIntensity = 1.2; + positionVar[] = {2, 2, 2.5}; + sizeVar = 0.01; + colorVar[] = {0, 0, 0, 0.1}; + destroyOnWaterSurface = 1; + }; }; diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirtEffect.sqf index f12cf74f29..182ffac910 100644 --- a/addons/goggles/functions/fnc_applyDirtEffect.sqf +++ b/addons/goggles/functions/fnc_applyDirtEffect.sqf @@ -22,12 +22,12 @@ _effects set [DIRT, true]; SETGLASSES(ace_player,_effects); if ([ace_player] call FUNC(isGogglesVisible)) then{ - _dirtImage = getText(ConfigFile >> "CfgGlasses" >> (goggles ace_player) >> "ACE_OverlayDirt"); - if (_dirtImage != "") then { - 100 cutRsc["RscACE_GogglesEffects", "PLAIN",0.1, false]; + _dirtImage = getText(ConfigFile >> "CfgGlasses" >> (goggles ace_player) >> "ACE_OverlayDirt"); + if (_dirtImage != "") then { + 100 cutRsc["RscACE_GogglesEffects", "PLAIN",0.1, false]; - (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText _dirtImage; - }; + (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText _dirtImage; + }; }; true diff --git a/addons/goggles/functions/fnc_applyDust.sqf b/addons/goggles/functions/fnc_applyDust.sqf index 311a993904..197b50b30d 100644 --- a/addons/goggles/functions/fnc_applyDust.sqf +++ b/addons/goggles/functions/fnc_applyDust.sqf @@ -16,10 +16,10 @@ #include "script_component.hpp" if (call FUNC(ExternalCamera)) exitWith {}; if ([ace_player] call FUNC(isGogglesVisible)) exitWith { - 100 cutRsc["RscACE_GogglesEffects", "PLAIN",2,false]; - (uiNamespace getVariable ["ACE_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText format[getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_DustPath"), GETDUSTT(DAMOUNT)+1]; - SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,1)); - SETDUST(DBULLETS,0); + 100 cutRsc["RscACE_GogglesEffects", "PLAIN",2,false]; + (uiNamespace getVariable ["ACE_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText format[getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_DustPath"), GETDUSTT(DAMOUNT)+1]; + SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,1)); + SETDUST(DBULLETS,0); }; if (GETVAR(ace_player,ACE_EyesDamaged,false)) exitWith {SETDUST(DACTIVE,false);SETDUST(DBULLETS,0);SETDUST(DAMOUNT,0);}; @@ -34,26 +34,26 @@ GVAR(PostProcessEyes) ppEffectEnable true; SETDUST(DBULLETS,0); if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA - [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(DustHandler) = -1; + [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(DustHandler) = -1; }; GVAR(DustHandler) = [{ - if (diag_tickTime >= GETDUSTT(DTIME) + 3) then { - SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); - private "_amount"; - _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); - if !(ace_player getVariable ["ACE_EyesDamaged", false]) then { - GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]]; - GVAR(PostProcessEyes) ppEffectCommit 0.5; - }; - if (GETDUSTT(DAMOUNT) <= 0) then { - GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]]; - GVAR(PostProcessEyes) ppEffectCommit 2; - [{GVAR(PostProcessEyes) ppEffectEnable false;}, [], 2, 0.5] call EFUNC(common,waitAndExecute); - SETDUST(DACTIVE,false); - SETDUST(DBULLETS,0); - [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(DustHandler) = -1; - }; - }; + if (diag_tickTime >= GETDUSTT(DTIME) + 3) then { + SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); + private "_amount"; + _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); + if !(ace_player getVariable ["ACE_EyesDamaged", false]) then { + GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 0.5; + }; + if (GETDUSTT(DAMOUNT) <= 0) then { + GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 2; + [{GVAR(PostProcessEyes) ppEffectEnable false;}, [], 2, 0.5] call EFUNC(common,waitAndExecute); + SETDUST(DACTIVE,false); + SETDUST(DBULLETS,0); + [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(DustHandler) = -1; + }; + }; },0,[]] call CALLSTACK(cba_fnc_addPerFrameHandler); diff --git a/addons/goggles/functions/fnc_applyGlassesEffect.sqf b/addons/goggles/functions/fnc_applyGlassesEffect.sqf index 1d69041d81..8c2edb531e 100644 --- a/addons/goggles/functions/fnc_applyGlassesEffect.sqf +++ b/addons/goggles/functions/fnc_applyGlassesEffect.sqf @@ -26,29 +26,29 @@ call FUNC(removeGlassesEffect); GVAR(EffectsActive) = true; if (_postProcessTintAmount != 0 && {GVAR(UsePP)}) then { - _postProcessColour set [3, _postProcessTintAmount/100]; - GVAR(PostProcess) ppEffectAdjust[0.9, 1.1, 0.004, _postProcessColour, [0,0,0,1],[0,0,0,0]]; - GVAR(PostProcess) ppEffectCommit 0; - GVAR(PostProcess) ppEffectEnable true; - _postProcessColour set [3, _postProcessTintAmount/250]; - GVAR(PostProcess) ppEffectAdjust[0.9, 1.1, 0.004, _postProcessColour, [0,0,0,1],[0,0,0,0]]; - GVAR(PostProcess) ppEffectCommit 30; + _postProcessColour set [3, _postProcessTintAmount/100]; + GVAR(PostProcess) ppEffectAdjust[0.9, 1.1, 0.004, _postProcessColour, [0,0,0,1],[0,0,0,0]]; + GVAR(PostProcess) ppEffectCommit 0; + GVAR(PostProcess) ppEffectEnable true; + _postProcessColour set [3, _postProcessTintAmount/250]; + GVAR(PostProcess) ppEffectAdjust[0.9, 1.1, 0.004, _postProcessColour, [0,0,0,1],[0,0,0,0]]; + GVAR(PostProcess) ppEffectCommit 30; }; _glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_Overlay"); if GETBROKEN then { - _glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_OverlayCracked"); + _glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_OverlayCracked"); }; if (_glassImagePath != "") then { - 150 cutRsc["RscACE_Goggles", "PLAIN",1, false]; - (GLASSDISPLAY displayCtrl 10650) ctrlSetText _glassImagePath; + 150 cutRsc["RscACE_Goggles", "PLAIN",1, false]; + (GLASSDISPLAY displayCtrl 10650) ctrlSetText _glassImagePath; }; if GETDIRT then { - call FUNC(applyDirtEffect); + call FUNC(applyDirtEffect); }; if GETDUSTT(DACTIVE) then { - SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); - call FUNC(applyDust); + SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); + call FUNC(applyDust); }; diff --git a/addons/goggles/functions/fnc_checkGoggles.sqf b/addons/goggles/functions/fnc_checkGoggles.sqf index 6d8f493c3e..f222ea9881 100644 --- a/addons/goggles/functions/fnc_checkGoggles.sqf +++ b/addons/goggles/functions/fnc_checkGoggles.sqf @@ -17,30 +17,30 @@ #include "script_component.hpp" if (!alive ace_player) exitWith {}; if (true) then { - // Detect if curator interface is open and disable effects - if (!isNull(findDisplay 312)) exitWith { - if (GVAR(EffectsActive)) then { - call FUNC(removeGlassesEffect); - }; - }; - call FUNC(checkGlasses); - if !([ace_player] call FUNC(isGogglesVisible)) exitWith { - if (GVAR(EffectsActive)) then { - call FUNC(removeGlassesEffect); - }; - }; - if (call FUNC(externalCamera)) exitWith { - if (GVAR(EffectsActive)) then { - call FUNC(removeGlassesEffect); - }; - }; - if !(GVAR(EffectsActive)) then { - [goggles ace_player] call FUNC(applyGlassesEffect); - } else { - if ([goggles ace_player] call FUNC(isDivingGoggles) && {underwater ace_player}) then { - call FUNC(removeRainEffect); - call FUNC(removeDirtEffect); - call FUNC(removeDustEffect); - }; - }; + // Detect if curator interface is open and disable effects + if (!isNull(findDisplay 312)) exitWith { + if (GVAR(EffectsActive)) then { + call FUNC(removeGlassesEffect); + }; + }; + call FUNC(checkGlasses); + if !([ace_player] call FUNC(isGogglesVisible)) exitWith { + if (GVAR(EffectsActive)) then { + call FUNC(removeGlassesEffect); + }; + }; + if (call FUNC(externalCamera)) exitWith { + if (GVAR(EffectsActive)) then { + call FUNC(removeGlassesEffect); + }; + }; + if !(GVAR(EffectsActive)) then { + [goggles ace_player] call FUNC(applyGlassesEffect); + } else { + if ([goggles ace_player] call FUNC(isDivingGoggles) && {underwater ace_player}) then { + call FUNC(removeRainEffect); + call FUNC(removeDirtEffect); + call FUNC(removeDustEffect); + }; + }; }; diff --git a/addons/goggles/functions/fnc_clearGlasses.sqf b/addons/goggles/functions/fnc_clearGlasses.sqf index fb2e9bfa91..b70b962940 100644 --- a/addons/goggles/functions/fnc_clearGlasses.sqf +++ b/addons/goggles/functions/fnc_clearGlasses.sqf @@ -23,12 +23,12 @@ _effects set [BROKEN, _broken]; SETGLASSES(ace_player,_effects); if ((stance ace_player) != "PRONE") then { - ace_player playActionNow "gestureWipeFace"; + ace_player playActionNow "gestureWipeFace"; }; [{ - if (cameraView == "INTERNAL") then { - addCamShake [5, 1.75, 2]; - }; + if (cameraView == "INTERNAL") then { + addCamShake [5, 1.75, 2]; + }; }, [], 0.3, 0] call EFUNC(common,waitAndExecute); call FUNC(removeDirtEffect); diff --git a/addons/goggles/functions/fnc_dustHandler.sqf b/addons/goggles/functions/fnc_dustHandler.sqf index 979a4a1bf0..9624fc21b3 100644 --- a/addons/goggles/functions/fnc_dustHandler.sqf +++ b/addons/goggles/functions/fnc_dustHandler.sqf @@ -24,11 +24,11 @@ if (rain > 0.1) exitWith {true}; if ((stance _unit) != "PRONE") exitWith {true}; if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect")) then { - _cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect" >> "effectName"); + _cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect" >> "effectName"); } else { - if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "effect1")) then { - _cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "effect1" >> "effectName"); - }; + if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "effect1")) then { + _cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "effect1" >> "effectName"); + }; }; if (_cloudType == "") exitWith {true}; @@ -49,7 +49,7 @@ if (!_found) exitWith {}; _bullets = GETDUSTT(DBULLETS); if ((diag_tickTime - GETDUSTT(DTIME)) > 1) then { - _bullets = 0; + _bullets = 0; }; _bullets = _bullets + 1; @@ -57,15 +57,15 @@ SETDUST(DBULLETS,_bullets); SETDUST(DTIME,diag_tickTime); if (GETDUSTT(DAMOUNT) < 2) then { - private "_bulletsRequired"; - _bulletsRequired = 100; - if (isNumber (ConfigFile >> _cloudType >> "ACE_Goggles_BulletCount")) then { - _bulletsRequired = getNumber (ConfigFile >> _cloudType >> "ACE_Goggles_BulletCount"); - }; + private "_bulletsRequired"; + _bulletsRequired = 100; + if (isNumber (ConfigFile >> _cloudType >> "ACE_Goggles_BulletCount")) then { + _bulletsRequired = getNumber (ConfigFile >> _cloudType >> "ACE_Goggles_BulletCount"); + }; - if (_bulletsRequired <= _bullets) then { - SETDUST(DACTIVE,true); - call FUNC(applyDust); - }; + if (_bulletsRequired <= _bullets) then { + SETDUST(DACTIVE,true); + call FUNC(applyDust); + }; }; true diff --git a/addons/goggles/functions/fnc_getExplosionIndex.sqf b/addons/goggles/functions/fnc_getExplosionIndex.sqf index 5b81c63655..5519bf397c 100644 --- a/addons/goggles/functions/fnc_getExplosionIndex.sqf +++ b/addons/goggles/functions/fnc_getExplosionIndex.sqf @@ -16,10 +16,10 @@ private ["_effectIndex"]; _effectIndex = switch true do { - case (_this <= 0.04): {0}; - case (_this <= 0.06): {1}; - case (_this <= 0.09): {2}; - default {3}; + case (_this <= 0.04): {0}; + case (_this <= 0.06): {1}; + case (_this <= 0.09): {2}; + default {3}; }; _effectIndex diff --git a/addons/goggles/functions/fnc_isGogglesVisible.sqf b/addons/goggles/functions/fnc_isGogglesVisible.sqf index 3d87499b90..9206965995 100644 --- a/addons/goggles/functions/fnc_isGogglesVisible.sqf +++ b/addons/goggles/functions/fnc_isGogglesVisible.sqf @@ -23,14 +23,14 @@ _result = false; if ((vehicle _unit) != _unit) exitWith {(cameraView != "GUNNER")}; if (_currentGlasses != "") then { - _position =(getPosASLW _unit); - if (surfaceIsWater _position && {((_position select 2) < 0.25)}) exitWith { - _result = ([_currentGlasses] call FUNC(isDivingGoggles)); - }; - if (getNumber (ConfigFile >> "CfgGlasses" >> _currentGlasses >> "ACE_Resistance") == 0) exitWith { - _result = false; - }; - _result = !([_currentGlasses] call FUNC(isDivingGoggles)); + _position =(getPosASLW _unit); + if (surfaceIsWater _position && {((_position select 2) < 0.25)}) exitWith { + _result = ([_currentGlasses] call FUNC(isDivingGoggles)); + }; + if (getNumber (ConfigFile >> "CfgGlasses" >> _currentGlasses >> "ACE_Resistance") == 0) exitWith { + _result = false; + }; + _result = !([_currentGlasses] call FUNC(isDivingGoggles)); }; _result diff --git a/addons/goggles/functions/fnc_isInRotorWash.sqf b/addons/goggles/functions/fnc_isInRotorWash.sqf index 0d9e22f7da..ef6391fdc6 100644 --- a/addons/goggles/functions/fnc_isInRotorWash.sqf +++ b/addons/goggles/functions/fnc_isInRotorWash.sqf @@ -8,8 +8,8 @@ * * Return Value: * : - * 0: In rotorwash - * 1: Amount of rotor wash. + * 0: In rotorwash + * 1: Amount of rotor wash. * * Example: * if (([ace_player, 10] call ace_goggles_fnc_isInRotorWash) select 0) then { hint "Rotor wash"; }; @@ -22,25 +22,25 @@ private ["_heli", "_unit", "_result", "_radius"]; _unit = _this select 0; _radius = 15; if (count _this > 1) then { - _radius = _this select 1; + _radius = _this select 1; }; _result = [false, _radius + 2]; _heli = (getPosATL _unit) nearEntities [["Helicopter"], _radius]; { - if !(_x isKindOf "ParachuteBase") then { - if (isEngineOn _x) then { - private "_distance"; - _distance = (_radius - (_unit distance _x)); - if (_distance != 0) then { - _distance = _distance / _radius; - }; - if (_distance < (_result select 1)) then { - _result = [true, _distance]; - }; - }; - }; - false + if !(_x isKindOf "ParachuteBase") then { + if (isEngineOn _x) then { + private "_distance"; + _distance = (_radius - (_unit distance _x)); + if (_distance != 0) then { + _distance = _distance / _radius; + }; + if (_distance < (_result select 1)) then { + _result = [true, _distance]; + }; + }; + }; + false } count _heli; _result diff --git a/addons/goggles/functions/fnc_onEachFrame.sqf b/addons/goggles/functions/fnc_onEachFrame.sqf index a3c65cac6b..863046da7f 100644 --- a/addons/goggles/functions/fnc_onEachFrame.sqf +++ b/addons/goggles/functions/fnc_onEachFrame.sqf @@ -17,62 +17,62 @@ if (isNull(ace_player)) exitWith {}; GVAR(FrameEvent) set [0, !(GVAR(FrameEvent) select 0)]; if (GVAR(FrameEvent) select 0) exitWith { - if (vehicle ace_player != ace_player && {!([ace_player] call EFUNC(common,isTurnedOut))}) exitWith {(GVAR(FrameEvent) select 1) set [0, false]; }; - GVAR(FrameEvent) set [1, ([ace_player] call FUNC(isInRotorWash))]; + if (vehicle ace_player != ace_player && {!([ace_player] call EFUNC(common,isTurnedOut))}) exitWith {(GVAR(FrameEvent) select 1) set [0, false]; }; + GVAR(FrameEvent) set [1, ([ace_player] call FUNC(isInRotorWash))]; }; private ["_rotorWash","_safe"]; _rotorWash = GVAR(FrameEvent) select 1; _safe = false; if !(_rotorWash select 0) exitWith { - if (GVAR(PostProcessEyes_Enabled)) then { - GVAR(PostProcessEyes_Enabled) = false; - if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA - [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(DustHandler) = -1; - }; - GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]]; - GVAR(PostProcessEyes) ppEffectCommit 2; - GVAR(DustHandler) = [{ - GVAR(PostProcessEyes) ppEffectEnable false; - GVAR(DustHandler) = -1; - }, [], 2, 0.5] call EFUNC(common,waitAndExecute); - }; + if (GVAR(PostProcessEyes_Enabled)) then { + GVAR(PostProcessEyes_Enabled) = false; + if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA + [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(DustHandler) = -1; + }; + GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 2; + GVAR(DustHandler) = [{ + GVAR(PostProcessEyes) ppEffectEnable false; + GVAR(DustHandler) = -1; + }, [], 2, 0.5] call EFUNC(common,waitAndExecute); + }; }; if ((headgear ace_player) != "") then { - _safe = (getNumber (ConfigFile >> "CfgWeapons" >> (headgear ace_player) >> "ACE_Protection") == 1); + _safe = (getNumber (ConfigFile >> "CfgWeapons" >> (headgear ace_player) >> "ACE_Protection") == 1); }; if !(_safe) then { - if !([ace_player] call FUNC(isGogglesVisible)) exitWith{}; - if (GETDUSTT(DAMOUNT) < 2) then { - if (!GETDUSTT(DACTIVE)) then { - SETDUST(DACTIVE,true); - call FUNC(ApplyDust); - } else { - if ((_rotorWash select 1) > 0.5) then { - call FUNC(ApplyDust); - }; - }; - }; - _safe = (getNumber (ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Protection") == 1); + if !([ace_player] call FUNC(isGogglesVisible)) exitWith{}; + if (GETDUSTT(DAMOUNT) < 2) then { + if (!GETDUSTT(DACTIVE)) then { + SETDUST(DACTIVE,true); + call FUNC(ApplyDust); + } else { + if ((_rotorWash select 1) > 0.5) then { + call FUNC(ApplyDust); + }; + }; + }; + _safe = (getNumber (ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Protection") == 1); }; if (_safe) exitWith {}; if ((_rotorWash select 1) <= 15) then { - private "_scale"; - _scale = 0.7; - if ((_rotorWash select 1) != 0) then { - _scale = CLAMP(0.3*(_rotorWash select 1),0.1,0.3); - } else { - _scale = 0.1; - }; - _scale = 1 - _scale; - if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA - [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(DustHandler) = -1; - }; - if !(ace_player getVariable ["ACE_EyesDamaged", false]) then { - GVAR(PostProcessEyes_Enabled) = true; - 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; - }; + private "_scale"; + _scale = 0.7; + if ((_rotorWash select 1) != 0) then { + _scale = CLAMP(0.3*(_rotorWash select 1),0.1,0.3); + } else { + _scale = 0.1; + }; + _scale = 1 - _scale; + if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA + [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(DustHandler) = -1; + }; + if !(ace_player getVariable ["ACE_EyesDamaged", false]) then { + GVAR(PostProcessEyes_Enabled) = true; + 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; + }; }; diff --git a/addons/goggles/functions/fnc_rainEffect.sqf b/addons/goggles/functions/fnc_rainEffect.sqf index 37ffbf64f6..b5badef6f2 100644 --- a/addons/goggles/functions/fnc_rainEffect.sqf +++ b/addons/goggles/functions/fnc_rainEffect.sqf @@ -17,37 +17,37 @@ private ["_fnc_underCover"]; if (isNull(ace_player) || {!(alive ace_player)}) exitWith {}; _fnc_underCover = { - private ["_pos", "_unit"]; - _unit = (_this select 0); - if (vehicle _unit != _unit && {!([_unit] call EFUNC(common,isTurnedOut))}) exitWith {true}; - _pos = eyePos _unit; - ((positionCameraToWorld [0,0,1] select 2) < ((positionCameraToWorld [0,0,0] select 2) - 0.4)) || {(lineIntersects [_pos, _pos vectorAdd [0,0,15], _unit])} + private ["_pos", "_unit"]; + _unit = (_this select 0); + if (vehicle _unit != _unit && {!([_unit] call EFUNC(common,isTurnedOut))}) exitWith {true}; + _pos = eyePos _unit; + ((positionCameraToWorld [0,0,1] select 2) < ((positionCameraToWorld [0,0,0] select 2) - 0.4)) || {(lineIntersects [_pos, _pos vectorAdd [0,0,15], _unit])} }; if (!isNull(findDisplay 312)) exitWith { - if (GVAR(RainActive)) then { - call FUNC(RemoveRainEffect); - }; + if (GVAR(RainActive)) then { + call FUNC(RemoveRainEffect); + }; }; // Ignore if ace_player is under water if (!GVAR(EffectsActive) || {underwater ace_player}) exitWith{call FUNC(RemoveRainEffect);}; if (GVAR(RainLastLevel) != rain) then { - call FUNC(RemoveRainEffect); - GVAR(RainLastLevel) = rain; - // Rain is happening - if (GVAR(RainLastLevel) > 0.05 && {!([ace_player] call _fnc_underCover)}) then { - GVAR(RainActive) = true; - GVAR(RainDrops) = "#particlesource" createVehicleLocal GetPos ace_player; - GVAR(RainDrops) setParticleClass "ACERainEffect"; - GVAR(RainDrops) setDropInterval (0.07 * (1.1 - GVAR(RainLastLevel))); - GVAR(RainDrops) attachTo [vehicle ace_player,[0,0,0]]; - }; + call FUNC(RemoveRainEffect); + GVAR(RainLastLevel) = rain; + // Rain is happening + if (GVAR(RainLastLevel) > 0.05 && {!([ace_player] call _fnc_underCover)}) then { + GVAR(RainActive) = true; + GVAR(RainDrops) = "#particlesource" createVehicleLocal GetPos ace_player; + GVAR(RainDrops) setParticleClass "ACERainEffect"; + GVAR(RainDrops) setDropInterval (0.07 * (1.1 - GVAR(RainLastLevel))); + GVAR(RainDrops) attachTo [vehicle ace_player,[0,0,0]]; + }; }else{ - if (GVAR(RainLastLevel) > 0.05) then { - if (GVAR(RainActive) && {[ace_player] call _fnc_underCover}) exitWith { - call FUNC(RemoveRainEffect); - }; - if (!GVAR(RainActive)) then { - GVAR(RainLastLevel) = -1; - }; - }; + if (GVAR(RainLastLevel) > 0.05) then { + if (GVAR(RainActive) && {[ace_player] call _fnc_underCover}) exitWith { + call FUNC(RemoveRainEffect); + }; + if (!GVAR(RainActive)) then { + GVAR(RainLastLevel) = -1; + }; + }; }; diff --git a/addons/goggles/functions/fnc_removeDirtEffect.sqf b/addons/goggles/functions/fnc_removeDirtEffect.sqf index 20812d6140..f7efd39af3 100644 --- a/addons/goggles/functions/fnc_removeDirtEffect.sqf +++ b/addons/goggles/functions/fnc_removeDirtEffect.sqf @@ -15,5 +15,5 @@ */ #include "script_component.hpp" if (!isNull(GETUVAR(GVAR(DisplayEffects),displayNull))) then { - (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText ""; + (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText ""; }; diff --git a/addons/goggles/functions/fnc_removeDustEffect.sqf b/addons/goggles/functions/fnc_removeDustEffect.sqf index 7bd4be7c22..1e179ed6b4 100644 --- a/addons/goggles/functions/fnc_removeDustEffect.sqf +++ b/addons/goggles/functions/fnc_removeDustEffect.sqf @@ -15,5 +15,5 @@ */ #include "script_component.hpp" if (!isNull(GETUVAR(GVAR(DisplayEffects),displayNull))) then { - (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10662) ctrlSetText ""; + (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10662) ctrlSetText ""; }; diff --git a/addons/goggles/functions/fnc_removeGlassesEffect.sqf b/addons/goggles/functions/fnc_removeGlassesEffect.sqf index f409f3c16e..c7965fefbc 100644 --- a/addons/goggles/functions/fnc_removeGlassesEffect.sqf +++ b/addons/goggles/functions/fnc_removeGlassesEffect.sqf @@ -1,7 +1,7 @@ /* * Author: Garth 'L-H' de Wet - * Removes the glasses effect from the screen, removes dirt effect, removes rain effect, - * removes dust effect. Does not reset array (glasses will still be broken, dirty, ect.) + * Removes the glasses effect from the screen, removes dirt effect, removes rain effect, + * removes dust effect. Does not reset array (glasses will still be broken, dirty, ect.) * * Arguments: * None @@ -19,7 +19,7 @@ GVAR(EffectsActive) = false; GVAR(PostProcess) ppEffectEnable false; if (!isNull(GLASSDISPLAY)) then { - GLASSDISPLAY closeDisplay 0; + GLASSDISPLAY closeDisplay 0; }; call FUNC(removeDirtEffect); diff --git a/addons/goggles/functions/fnc_removeRainEffect.sqf b/addons/goggles/functions/fnc_removeRainEffect.sqf index fbbf1b9b7b..0d322e12da 100644 --- a/addons/goggles/functions/fnc_removeRainEffect.sqf +++ b/addons/goggles/functions/fnc_removeRainEffect.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" if (!isNull (GVAR(RainDrops))) then { - deleteVehicle (GVAR(RainDrops)); + deleteVehicle (GVAR(RainDrops)); }; GVAR(RainActive) = false; GVAR(RainLastLevel) = 0; diff --git a/addons/hearing/script_component.hpp b/addons/hearing/script_component.hpp index 15023f2509..6d4df68370 100644 --- a/addons/hearing/script_component.hpp +++ b/addons/hearing/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_HEARING - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_HEARING - #define DEBUG_SETTINGS DEBUG_SETTINGS_HEARING + #define DEBUG_SETTINGS DEBUG_SETTINGS_HEARING #endif #include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/interact_menu/functions/fnc_splitPath.sqf b/addons/interact_menu/functions/fnc_splitPath.sqf index 609f26f972..935e947b30 100644 --- a/addons/interact_menu/functions/fnc_splitPath.sqf +++ b/addons/interact_menu/functions/fnc_splitPath.sqf @@ -19,9 +19,9 @@ for [{_i = 0},{_i < (count _this) - 1},{_i = _i + 1}] do { _parentPath pushBack (_this select _i); }; _actionName = if (count _this > 0) then { - _this select ((count _this) - 1); + _this select ((count _this) - 1); } else { - "" + "" }; [_parentPath, _actionName] diff --git a/addons/interaction/functions/fnc_AddSelectableItem.sqf b/addons/interaction/functions/fnc_AddSelectableItem.sqf index 966c4fe043..498b852635 100644 --- a/addons/interaction/functions/fnc_AddSelectableItem.sqf +++ b/addons/interaction/functions/fnc_AddSelectableItem.sqf @@ -1,19 +1,19 @@ /* - Author: Garth de Wet (LH) + Author: Garth de Wet (LH) - Description: - Adds an item to the select menu + Description: + Adds an item to the select menu - Parameters: - 0: ARRAY/NUMBER - List container - 1: String - Display Name - 2: String - Picture - 3: String/code - data + Parameters: + 0: ARRAY/NUMBER - List container + 1: String - Display Name + 2: String - Picture + 3: String/code - data - Returns: - ARRAY/Number + Returns: + ARRAY/Number - Example: + Example: */ #include "script_component.hpp" @@ -26,7 +26,7 @@ _picture = _this select 2; _data = _this select 3; if (_picture == "" || _picture == "PictureThing") then { - _picture = QUOTE(PATHTOF(UI\dot_ca.paa)); + _picture = QUOTE(PATHTOF(UI\dot_ca.paa)); }; _index = lbAdd [_container, _displayName]; diff --git a/addons/interaction/functions/fnc_MoveDown.sqf b/addons/interaction/functions/fnc_MoveDown.sqf index 2221deab62..eac30e4008 100644 --- a/addons/interaction/functions/fnc_MoveDown.sqf +++ b/addons/interaction/functions/fnc_MoveDown.sqf @@ -1,18 +1,18 @@ /* - Author: Garth de Wet (LH) + Author: Garth de Wet (LH) - Description: - Depending on the passed value, either scrolls down through the list or up. + Description: + Depending on the passed value, either scrolls down through the list or up. - Parameters: - NUMBER - Amount to increase current interaction target + Parameters: + NUMBER - Amount to increase current interaction target - Returns: - Nothing + Returns: + Nothing - Example: - 1 call FUNC(MoveDown); - -1 call FUNC(MoveDown); + Example: + 1 call FUNC(MoveDown); + -1 call FUNC(MoveDown); */ #include "script_component.hpp" @@ -31,27 +31,27 @@ _dlgInteractionDialog = uiNamespace getVariable QGVAR(Flow_Display); _top = GVAR(SelectedButton) - 2; _i = 0; while {_i <= 4} do { - _index =_i + _top; - _ctrl = _dlgInteractionDialog displayCtrl (1200 + _i); - if (_index >= 0 && {_index <= _count}) then { - _action = GVAR(Buttons) select _index; - _ctrl ctrlShow true; - _ctrl ctrlSetText (_action select 5); - _color = [1,1,1,1]; - if !([_target, _player] call (_action select 2)) then { - _color = [0.3,0.3,0.3,0.8]; - }; - if (_i == 0 || _i == 4) then { - _color set [3, 0.5]; - }; - if (_i == 1 || _i == 3) then { - _color set [3, 0.75]; - }; - _ctrl ctrlSetTextColor _color; - }else{ - _ctrl ctrlShow false; - }; - _i = _i + 1; + _index =_i + _top; + _ctrl = _dlgInteractionDialog displayCtrl (1200 + _i); + if (_index >= 0 && {_index <= _count}) then { + _action = GVAR(Buttons) select _index; + _ctrl ctrlShow true; + _ctrl ctrlSetText (_action select 5); + _color = [1,1,1,1]; + if !([_target, _player] call (_action select 2)) then { + _color = [0.3,0.3,0.3,0.8]; + }; + if (_i == 0 || _i == 4) then { + _color set [3, 0.5]; + }; + if (_i == 1 || _i == 3) then { + _color set [3, 0.75]; + }; + _ctrl ctrlSetTextColor _color; + }else{ + _ctrl ctrlShow false; + }; + _i = _i + 1; }; _ctrl = _dlgInteractionDialog displayCtrl 1000; @@ -60,7 +60,7 @@ _ctrl = _dlgInteractionDialog displayCtrl 1100; _current = (GVAR(Buttons) select GVAR(SelectedButton)); _infoText = ""; if !([_target, _player] call (_current select 2)) then { - _infoText = "Unavailable"; + _infoText = "Unavailable"; }; _ctrl ctrlSetText _infoText; _ctrl ctrlShow (_infoText != ""); diff --git a/addons/interaction/functions/fnc_applyButtons.sqf b/addons/interaction/functions/fnc_applyButtons.sqf index 7459b1a7bf..be35b34877 100644 --- a/addons/interaction/functions/fnc_applyButtons.sqf +++ b/addons/interaction/functions/fnc_applyButtons.sqf @@ -13,12 +13,12 @@ _dlgInteractionDialog = uiNamespace getVariable QGVAR(Dialog); /* for "_a" from 0 to (_count - 1) do { - _action = GVAR(Buttons) select _a; + _action = GVAR(Buttons) select _a; - _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _a); - _ctrlInteractionDialog ctrlShow true; - _ctrlInteractionDialog ctrlSetText (_action select 0); - _ctrlInteractionDialog ctrlEnable (call (_action select 2)); + _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _a); + _ctrlInteractionDialog ctrlShow true; + _ctrlInteractionDialog ctrlSetText (_action select 0); + _ctrlInteractionDialog ctrlEnable (call (_action select 2)); }; */ @@ -27,27 +27,27 @@ _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl 3; GVAR(MainButton) = "(findDisplay 1713999) closeDisplay 1;"; if (_object isKindOf "Man") then { - _ctrlInteractionDialog ctrlSetText (if (alive _object) then {name _object} else {_object getVariable ["ACE_Name", "Unknown"]}); + _ctrlInteractionDialog ctrlSetText (if (alive _object) then {name _object} else {_object getVariable ["ACE_Name", "Unknown"]}); } else { - _ctrlInteractionDialog ctrlSetText (getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName")); + _ctrlInteractionDialog ctrlSetText (getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName")); }; for "_index" from 0 to 9 do { - _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _index); - _ctrlInteractionDialog ctrlShow true; + _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _index); + _ctrlInteractionDialog ctrlShow true; - _ctrlInteractionDialogIcon = _dlgInteractionDialog displayCtrl (20 + _index); + _ctrlInteractionDialogIcon = _dlgInteractionDialog displayCtrl (20 + _index); - if (_index < _count) then { - _action = GVAR(Buttons) select _index; - _ctrlInteractionDialog ctrlSetText (_action select 0); - _ctrlInteractionDialog ctrlEnable (call (_action select 2)); + if (_index < _count) then { + _action = GVAR(Buttons) select _index; + _ctrlInteractionDialog ctrlSetText (_action select 0); + _ctrlInteractionDialog ctrlEnable (call (_action select 2)); - _ctrlInteractionDialogIcon ctrlSetText (_action select 5); - } else { - _ctrlInteractionDialog ctrlSetText ""; - _ctrlInteractionDialog ctrlEnable false; + _ctrlInteractionDialogIcon ctrlSetText (_action select 5); + } else { + _ctrlInteractionDialog ctrlSetText ""; + _ctrlInteractionDialog ctrlEnable false; - _ctrlInteractionDialogIcon ctrlSetText ""; - }; + _ctrlInteractionDialogIcon ctrlSetText ""; + }; }; diff --git a/addons/interaction/functions/fnc_getDoorAnimations.sqf b/addons/interaction/functions/fnc_getDoorAnimations.sqf index ebb820584a..ca59ec177c 100644 --- a/addons/interaction/functions/fnc_getDoorAnimations.sqf +++ b/addons/interaction/functions/fnc_getDoorAnimations.sqf @@ -7,101 +7,101 @@ _house = _this select 0; _door = _this select 1; _index = [ - "door_1", - "door_2", - "door_3", - "door_4", - "door_5", - "door_6", - "door_7", - "door_8", - "door_9", - "door_10", - "door_11", - "door_12", - "door_13", - "Door_14", - "door_15", - "door_16", - "door_17", - "door_18", - "door_19", - "door_20", - "door_21", - "door_22", + "door_1", + "door_2", + "door_3", + "door_4", + "door_5", + "door_6", + "door_7", + "door_8", + "door_9", + "door_10", + "door_11", + "door_12", + "door_13", + "Door_14", + "door_15", + "door_16", + "door_17", + "door_18", + "door_19", + "door_20", + "door_21", + "door_22", - "hatch_1", - "hatch_2", - "hatch_3", - "hatch_4", - "hatch_5", - "hatch_6" + "hatch_1", + "hatch_2", + "hatch_3", + "hatch_4", + "hatch_5", + "hatch_6" ] find toLower _door; if (_index == -1) exitWith {[[],""]}; _animations = [ - ["Door_1_rot", "Door_Handle_1_rot_1", "Door_Handle_1_rot_2"], - ["Door_2_rot", "Door_Handle_2_rot_1", "Door_Handle_2_rot_2"], - ["Door_3_rot", "Door_Handle_3_rot_1", "Door_Handle_3_rot_2"], - ["Door_4_rot", "Door_Handle_4_rot_1", "Door_Handle_4_rot_2"], - ["Door_5_rot", "Door_Handle_5_rot_1", "Door_Handle_5_rot_2"], - ["Door_6_rot", "Door_Handle_6_rot_1", "Door_Handle_6_rot_2"], - ["Door_7_rot", "Door_Handle_7_rot_1", "Door_Handle_7_rot_2"], - ["Door_8_rot", "Door_Handle_8_rot_1", "Door_Handle_8_rot_2"], - ["Door_9_rot", "Door_Handle_9_rot_1", "Door_Handle_9_rot_2"], - ["Door_10_rot", "Door_Handle_10_rot_1", "Door_Handle_10_rot_2"], - ["Door_11_rot", "Door_Handle_11_rot_1", "Door_Handle_11_rot_2"], - ["Door_12_rot", "Door_Handle_12_rot_1", "Door_Handle_12_rot_2"], - ["Door_13_rot", "Door_Handle_13_rot_1", "Door_Handle_13_rot_2"], - ["Door_14_rot", "Door_Handle_14_rot_1", "Door_Handle_14_rot_2"], - ["Door_15_rot", "Door_Handle_15_rot_1", "Door_Handle_15_rot_2"], - ["Door_16_rot", "Door_Handle_16_rot_1", "Door_Handle_16_rot_2"], - ["Door_17_rot", "Door_Handle_17_rot_1", "Door_Handle_17_rot_2"], - ["Door_18_rot", "Door_Handle_18_rot_1", "Door_Handle_18_rot_2"], - ["Door_19_rot", "Door_Handle_19_rot_1", "Door_Handle_19_rot_2"], - ["Door_20_rot", "Door_Handle_20_rot_1", "Door_Handle_20_rot_2"], - ["Door_21_rot", "Door_Handle_21_rot_1", "Door_Handle_21_rot_2"], - ["Door_22_rot", "Door_Handle_22_rot_1", "Door_Handle_22_rot_2"], + ["Door_1_rot", "Door_Handle_1_rot_1", "Door_Handle_1_rot_2"], + ["Door_2_rot", "Door_Handle_2_rot_1", "Door_Handle_2_rot_2"], + ["Door_3_rot", "Door_Handle_3_rot_1", "Door_Handle_3_rot_2"], + ["Door_4_rot", "Door_Handle_4_rot_1", "Door_Handle_4_rot_2"], + ["Door_5_rot", "Door_Handle_5_rot_1", "Door_Handle_5_rot_2"], + ["Door_6_rot", "Door_Handle_6_rot_1", "Door_Handle_6_rot_2"], + ["Door_7_rot", "Door_Handle_7_rot_1", "Door_Handle_7_rot_2"], + ["Door_8_rot", "Door_Handle_8_rot_1", "Door_Handle_8_rot_2"], + ["Door_9_rot", "Door_Handle_9_rot_1", "Door_Handle_9_rot_2"], + ["Door_10_rot", "Door_Handle_10_rot_1", "Door_Handle_10_rot_2"], + ["Door_11_rot", "Door_Handle_11_rot_1", "Door_Handle_11_rot_2"], + ["Door_12_rot", "Door_Handle_12_rot_1", "Door_Handle_12_rot_2"], + ["Door_13_rot", "Door_Handle_13_rot_1", "Door_Handle_13_rot_2"], + ["Door_14_rot", "Door_Handle_14_rot_1", "Door_Handle_14_rot_2"], + ["Door_15_rot", "Door_Handle_15_rot_1", "Door_Handle_15_rot_2"], + ["Door_16_rot", "Door_Handle_16_rot_1", "Door_Handle_16_rot_2"], + ["Door_17_rot", "Door_Handle_17_rot_1", "Door_Handle_17_rot_2"], + ["Door_18_rot", "Door_Handle_18_rot_1", "Door_Handle_18_rot_2"], + ["Door_19_rot", "Door_Handle_19_rot_1", "Door_Handle_19_rot_2"], + ["Door_20_rot", "Door_Handle_20_rot_1", "Door_Handle_20_rot_2"], + ["Door_21_rot", "Door_Handle_21_rot_1", "Door_Handle_21_rot_2"], + ["Door_22_rot", "Door_Handle_22_rot_1", "Door_Handle_22_rot_2"], - ["Hatch_1_rot"], - ["Hatch_2_rot"], - ["Hatch_3_rot"], - ["Hatch_4_rot"], - ["Hatch_5_rot"], - ["Hatch_6_rot"] + ["Hatch_1_rot"], + ["Hatch_2_rot"], + ["Hatch_3_rot"], + ["Hatch_4_rot"], + ["Hatch_5_rot"], + ["Hatch_6_rot"] ] select _index; _lockedVariable = [ - ["BIS_Disabled_Door_1", "Door_Handle_1_rot_1", "Door_Locked_1_rot"], - ["BIS_Disabled_Door_2", "Door_Handle_2_rot_1", "Door_Locked_2_rot"], - ["BIS_Disabled_Door_3", "Door_Handle_3_rot_1", "Door_Locked_3_rot"], - ["BIS_Disabled_Door_4", "Door_Handle_4_rot_1", "Door_Locked_4_rot"], - ["BIS_Disabled_Door_5", "Door_Handle_5_rot_1", "Door_Locked_5_rot"], - ["BIS_Disabled_Door_6", "Door_Handle_6_rot_1", "Door_Locked_6_rot"], - ["BIS_Disabled_Door_7", "Door_Handle_7_rot_1", "Door_Locked_7_rot"], - ["BIS_Disabled_Door_8", "Door_Handle_8_rot_1", "Door_Locked_8_rot"], - ["BIS_Disabled_Door_9", "Door_Handle_9_rot_1", "Door_Locked_9_rot"], - ["BIS_Disabled_Door_10", "Door_Handle_10_rot_1", "Door_Locked_10_rot"], - ["BIS_Disabled_Door_11", "Door_Handle_11_rot_1", "Door_Locked_11_rot"], - ["BIS_Disabled_Door_12", "Door_Handle_12_rot_1", "Door_Locked_12_rot"], - ["BIS_Disabled_Door_13", "Door_Handle_13_rot_1", "Door_Locked_13_rot"], - ["BIS_Disabled_Door_14", "Door_Handle_14_rot_1", "Door_Locked_14_rot"], - ["BIS_Disabled_Door_15", "Door_Handle_15_rot_1", "Door_Locked_15_rot"], - ["BIS_Disabled_Door_16", "Door_Handle_16_rot_1", "Door_Locked_16_rot"], - ["BIS_Disabled_Door_17", "Door_Handle_17_rot_1", "Door_Locked_17_rot"], - ["BIS_Disabled_Door_18", "Door_Handle_18_rot_1", "Door_Locked_18_rot"], - ["BIS_Disabled_Door_19", "Door_Handle_19_rot_1", "Door_Locked_19_rot"], - ["BIS_Disabled_Door_20", "Door_Handle_20_rot_1", "Door_Locked_20_rot"], - ["BIS_Disabled_Door_21", "Door_Handle_21_rot_1", "Door_Locked_21_rot"], - ["BIS_Disabled_Door_22", "Door_Handle_22_rot_1", "Door_Locked_22_rot"], + ["BIS_Disabled_Door_1", "Door_Handle_1_rot_1", "Door_Locked_1_rot"], + ["BIS_Disabled_Door_2", "Door_Handle_2_rot_1", "Door_Locked_2_rot"], + ["BIS_Disabled_Door_3", "Door_Handle_3_rot_1", "Door_Locked_3_rot"], + ["BIS_Disabled_Door_4", "Door_Handle_4_rot_1", "Door_Locked_4_rot"], + ["BIS_Disabled_Door_5", "Door_Handle_5_rot_1", "Door_Locked_5_rot"], + ["BIS_Disabled_Door_6", "Door_Handle_6_rot_1", "Door_Locked_6_rot"], + ["BIS_Disabled_Door_7", "Door_Handle_7_rot_1", "Door_Locked_7_rot"], + ["BIS_Disabled_Door_8", "Door_Handle_8_rot_1", "Door_Locked_8_rot"], + ["BIS_Disabled_Door_9", "Door_Handle_9_rot_1", "Door_Locked_9_rot"], + ["BIS_Disabled_Door_10", "Door_Handle_10_rot_1", "Door_Locked_10_rot"], + ["BIS_Disabled_Door_11", "Door_Handle_11_rot_1", "Door_Locked_11_rot"], + ["BIS_Disabled_Door_12", "Door_Handle_12_rot_1", "Door_Locked_12_rot"], + ["BIS_Disabled_Door_13", "Door_Handle_13_rot_1", "Door_Locked_13_rot"], + ["BIS_Disabled_Door_14", "Door_Handle_14_rot_1", "Door_Locked_14_rot"], + ["BIS_Disabled_Door_15", "Door_Handle_15_rot_1", "Door_Locked_15_rot"], + ["BIS_Disabled_Door_16", "Door_Handle_16_rot_1", "Door_Locked_16_rot"], + ["BIS_Disabled_Door_17", "Door_Handle_17_rot_1", "Door_Locked_17_rot"], + ["BIS_Disabled_Door_18", "Door_Handle_18_rot_1", "Door_Locked_18_rot"], + ["BIS_Disabled_Door_19", "Door_Handle_19_rot_1", "Door_Locked_19_rot"], + ["BIS_Disabled_Door_20", "Door_Handle_20_rot_1", "Door_Locked_20_rot"], + ["BIS_Disabled_Door_21", "Door_Handle_21_rot_1", "Door_Locked_21_rot"], + ["BIS_Disabled_Door_22", "Door_Handle_22_rot_1", "Door_Locked_22_rot"], - ["", ""], - ["", ""], - ["", ""], - ["", ""], - ["", ""], - ["", ""] + ["", ""], + ["", ""], + ["", ""], + ["", ""], + ["", ""], + ["", ""] ] select _index; [_animations, _lockedVariable] diff --git a/addons/interaction/functions/fnc_hideMenu.sqf b/addons/interaction/functions/fnc_hideMenu.sqf index 43444b7d99..54263ef032 100644 --- a/addons/interaction/functions/fnc_hideMenu.sqf +++ b/addons/interaction/functions/fnc_hideMenu.sqf @@ -1,17 +1,17 @@ /* - Author: Garth de Wet (LH) + Author: Garth de Wet (LH) - Description: - Closes the Interaction menu + Description: + Closes the Interaction menu - Parameters: - Nothing + Parameters: + Nothing - Returns: - Nothing + Returns: + Nothing - Example: - call FUNC(hideMenu); + Example: + call FUNC(hideMenu); */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_hideMouseHint.sqf b/addons/interaction/functions/fnc_hideMouseHint.sqf index 4efc4a3094..d910352076 100644 --- a/addons/interaction/functions/fnc_hideMouseHint.sqf +++ b/addons/interaction/functions/fnc_hideMouseHint.sqf @@ -1,18 +1,18 @@ /* - Author(s): - Garth de Wet (LH) + Author(s): + Garth de Wet (LH) - Description: - Hides the interaction helper text with the mouse buttons at the bottom middle of the screen + Description: + Hides the interaction helper text with the mouse buttons at the bottom middle of the screen - Parameters: - Nothing + Parameters: + Nothing - Returns: - Nothing + Returns: + Nothing - Example: - call FUNC(hideMouseHint); + Example: + call FUNC(hideMouseHint); */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_isInRange.sqf b/addons/interaction/functions/fnc_isInRange.sqf index 24b5793d6f..5048b66001 100644 --- a/addons/interaction/functions/fnc_isInRange.sqf +++ b/addons/interaction/functions/fnc_isInRange.sqf @@ -43,8 +43,8 @@ _position1 = ATLToASL positionCameraToWorld [0, 0, _distance]; _position1 set [2, (_position1 select 2) - (getTerrainHeightASL _position1 min 0)]; if (_vehicle in lineIntersectsWith [_position0, _position1] || {_player distance _vehicle < _distance}) then { - true + true } else { - ["Not in Range"] call FUNC(addToTooltip); - false + ["Not in Range"] call FUNC(addToTooltip); + false } diff --git a/addons/interaction/functions/fnc_joinTeam.sqf b/addons/interaction/functions/fnc_joinTeam.sqf index d0aeccc3ad..2e4d1f2898 100644 --- a/addons/interaction/functions/fnc_joinTeam.sqf +++ b/addons/interaction/functions/fnc_joinTeam.sqf @@ -10,12 +10,12 @@ _unit setVariable [QGVAR(assignedFireTeam), _team, true]; [_unit, format ["{_this assignTeam '%1'}", _team]] call EFUNC(common,execRemoteFnc); if (_unit == ACE_player) then { - _message = if (_team == "MAIN") then { - localize "STR_ACE_Interaction_LeftTeam"; - } else { - _team = localize format ["STR_ACE_Interaction_Team%1", _team]; - format [localize "STR_ACE_Interaction_JoinedTeam", _team]; - }; + _message = if (_team == "MAIN") then { + localize "STR_ACE_Interaction_LeftTeam"; + } else { + _team = localize format ["STR_ACE_Interaction_Team%1", _team]; + format [localize "STR_ACE_Interaction_JoinedTeam", _team]; + }; - [_message] call EFUNC(common,displayTextStructured); + [_message] call EFUNC(common,displayTextStructured); }; diff --git a/addons/interaction/functions/fnc_onButtonUp.sqf b/addons/interaction/functions/fnc_onButtonUp.sqf index 44c4e340f0..cee524c55f 100644 --- a/addons/interaction/functions/fnc_onButtonUp.sqf +++ b/addons/interaction/functions/fnc_onButtonUp.sqf @@ -11,9 +11,9 @@ _count = count GVAR(Buttons); _index = call FUNC(getSelectedButton); _action = if (_index != -1 && {_index < _count}) then { - GVAR(Buttons) select _index + GVAR(Buttons) select _index } else { - ["", {}, {false}, 0, [], "", "", {false}, [], 0] + ["", {}, {false}, 0, [], "", "", {false}, [], 0] }; (findDisplay 1713999) closeDisplay 1; @@ -28,5 +28,5 @@ _exceptions = _action select 8;// _distance = _action select 9; if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { - [_target, _player] call _statement; + [_target, _player] call _statement; }; diff --git a/addons/interaction/functions/fnc_onClick.sqf b/addons/interaction/functions/fnc_onClick.sqf index 39581db3a3..29fffb8b94 100644 --- a/addons/interaction/functions/fnc_onClick.sqf +++ b/addons/interaction/functions/fnc_onClick.sqf @@ -10,35 +10,35 @@ _count = count GVAR(Buttons); _index = _this; _action = if (_index != -1 && {_index < _count}) then { - GVAR(Buttons) select _index + GVAR(Buttons) select _index } else { - ["", {}, {false}, 0, [], "", "", {false}, [], 0] + ["", {}, {false}, 0, [], "", "", {false}, [], 0] }; _subMenu = _action select 4; // back if (_index == -1) exitWith { - call GVAR(MainButton); + call GVAR(MainButton); }; if (count _subMenu < 2) then { - (findDisplay 1713999) closeDisplay 1; - closeDialog 0; + (findDisplay 1713999) closeDisplay 1; + closeDialog 0; - _statement = _action select 1; - _condition = _action select 2; - _conditionShow = _action select 7; - _exceptions = _action select 8;// - _distance = _action select 9; + _statement = _action select 1; + _condition = _action select 2; + _conditionShow = _action select 7; + _exceptions = _action select 8;// + _distance = _action select 9; - if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { - [_target, _player] call _statement; - }; + if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { + [_target, _player] call _statement; + }; } else { - if (_subMenu select 1 < 1) then { - [_subMenu select 0] call FUNC(openSubMenu); - } else { - [_subMenu select 0] call FUNC(openSubMenuSelf); - }; + if (_subMenu select 1 < 1) then { + [_subMenu select 0] call FUNC(openSubMenu); + } else { + [_subMenu select 0] call FUNC(openSubMenuSelf); + }; }; diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index dc9150491d..e175e752cb 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -18,40 +18,40 @@ _animations = _animations select 0; if (count _animations == 0) exitWith {}; if (_house animationPhase (_animations select 0) <= 0 && {_house getVariable [_lockedVariable select 0, 0] == 1}) exitWith { - _lockedVariable set [0, _house]; - _lockedVariable spawn compile preprocessFileLineNumbers "\A3\Structures_F\scripts\LockedDoor_open.sqf"; + _lockedVariable set [0, _house]; + _lockedVariable spawn compile preprocessFileLineNumbers "\A3\Structures_F\scripts\LockedDoor_open.sqf"; }; GVAR(isOpeningDoor) = true; playSound "ACE_Sound_Click"; [_house, _animations] spawn { - _house = _this select 0; - _animations = _this select 1; + _house = _this select 0; + _animations = _this select 1; - _phase = _house animationPhase (_animations select 0); - _position = getPosASL ACE_player; + _phase = _house animationPhase (_animations select 0); + _position = getPosASL ACE_player; - _time = time + 0.2; - _usedMouseWheel = false; - waitUntil { - if (inputAction "PrevAction" > 0 || {inputAction "NextAction" > 0}) then { - _usedMouseWheel = true; - }; + _time = time + 0.2; + _usedMouseWheel = false; + waitUntil { + if (inputAction "PrevAction" > 0 || {inputAction "NextAction" > 0}) then { + _usedMouseWheel = true; + }; - _phase = _phase + (inputAction "PrevAction" / 12) min 1; - _phase = _phase - (inputAction "NextAction" / 12) max 0; + _phase = _phase + (inputAction "PrevAction" / 12) min 1; + _phase = _phase - (inputAction "NextAction" / 12) max 0; - {_house animate [_x, _phase]} forEach _animations; + {_house animate [_x, _phase]} forEach _animations; - !GVAR(isOpeningDoor) || {getPosASL ACE_player distance _position > 1} - }; + !GVAR(isOpeningDoor) || {getPosASL ACE_player distance _position > 1} + }; - if (!_usedMouseWheel && {time < _time} && {[ACE_player, objNull, []] call EFUNC(common,canInteractWith)}) then { - _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5); + if (!_usedMouseWheel && {time < _time} && {[ACE_player, objNull, []] call EFUNC(common,canInteractWith)}) then { + _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5); - {_house animate [_x, _phase]} forEach _animations; - }; + {_house animate [_x, _phase]} forEach _animations; + }; - GVAR(isOpeningDoor) = false; + GVAR(isOpeningDoor) = false; }; diff --git a/addons/interaction/functions/fnc_openSelectMenu.sqf b/addons/interaction/functions/fnc_openSelectMenu.sqf index ba2cf7ce10..de5459f88c 100644 --- a/addons/interaction/functions/fnc_openSelectMenu.sqf +++ b/addons/interaction/functions/fnc_openSelectMenu.sqf @@ -1,43 +1,43 @@ /* - Author: Garth de Wet (LH) + Author: Garth de Wet (LH) - Description: - Opens the select menu UI and sets up the UI + Description: + Opens the select menu UI and sets up the UI - Parameters: - 0: ARRAY - items - ARRAY - 0 = Text - 1 = statement to execute - 2 = condition before execute - 3 = showDisabled - 4 = priority - 5 = icon - 6 = extra variables. Passed to the code. - 1: Code - select action - 2: Code - Cancel Action - Returns: - Nothing + Parameters: + 0: ARRAY - items + ARRAY + 0 = Text + 1 = statement to execute + 2 = condition before execute + 3 = showDisabled + 4 = priority + 5 = icon + 6 = extra variables. Passed to the code. + 1: Code - select action + 2: Code - Cancel Action + Returns: + Nothing - Example: + Example: */ #include "script_component.hpp" if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) then { - GVAR(SelectAccept) = _this select 1; - GVAR(SelectCancel) = _this select 2; - buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // cancel - buttonSetAction [8860, QUOTE( (call compile (lbData [ARR_2(8866, lbCurSel 8866)])) call GVAR(SelectAccept); )]; // accept - lbSetCurSel [8866, 0]; + GVAR(SelectAccept) = _this select 1; + GVAR(SelectCancel) = _this select 2; + buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // cancel + buttonSetAction [8860, QUOTE( (call compile (lbData [ARR_2(8866, lbCurSel 8866)])) call GVAR(SelectAccept); )]; // accept + lbSetCurSel [8866, 0]; }else{ - _customActions = _this select 0; - _count = count _customActions; - if (_count == 0) exitWith {}; - _customActions call FUNC(sortOptionsByPriority); - for "_i" from 0 to _count -1 do { - _action = _customActions select _i; - _action set [1, (_this select 1)]; - }; - GVAR(Buttons) = _customActions; - [(_this select 2), true, true, false, ACE_player] call FUNC(initialiseInteraction); + _customActions = _this select 0; + _count = count _customActions; + if (_count == 0) exitWith {}; + _customActions call FUNC(sortOptionsByPriority); + for "_i" from 0 to _count -1 do { + _action = _customActions select _i; + _action set [1, (_this select 1)]; + }; + GVAR(Buttons) = _customActions; + [(_this select 2), true, true, false, ACE_player] call FUNC(initialiseInteraction); }; diff --git a/addons/interaction/functions/fnc_prepareSelectMenu.sqf b/addons/interaction/functions/fnc_prepareSelectMenu.sqf index acff7fa5e2..593f0d4c47 100644 --- a/addons/interaction/functions/fnc_prepareSelectMenu.sqf +++ b/addons/interaction/functions/fnc_prepareSelectMenu.sqf @@ -1,18 +1,18 @@ /* - Author: Garth de Wet (LH) + Author: Garth de Wet (LH) - Description: - Prepares the select menu for use. + Description: + Prepares the select menu for use. - Parameters: - 0: TEXT - Header text - 1: TEXT - Approve button text + Parameters: + 0: TEXT - Header text + 1: TEXT - Approve button text - Returns: - ARRAY/NUMBER - container object for use with AddSelectableItem. + Returns: + ARRAY/NUMBER - container object for use with AddSelectableItem. - Example: - ["Select Explosive", "Place"] call FUNC(prepareSelectMenu); + Example: + ["Select Explosive", "Place"] call FUNC(prepareSelectMenu); */ #include "script_component.hpp" @@ -21,7 +21,7 @@ closeDialog 0; _header = _this select 0; _buttonText = _this select 1; if (isNil "_buttonText" or {_buttonText == ""}) then { - _buttonText = localize "STR_ACE_Interaction_MakeSelection"; + _buttonText = localize "STR_ACE_Interaction_MakeSelection"; }; createDialog "RscACE_SelectAnItem"; ctrlSetText [8860, _buttonText]; diff --git a/addons/interaction/functions/fnc_removeTag.sqf b/addons/interaction/functions/fnc_removeTag.sqf index 7a9b9b4bc0..0894520149 100644 --- a/addons/interaction/functions/fnc_removeTag.sqf +++ b/addons/interaction/functions/fnc_removeTag.sqf @@ -2,19 +2,19 @@ #include "script_component.hpp" 0 spawn { - waitUntil {player getVariable ["ACE_Name", ""] != ""}; + waitUntil {player getVariable ["ACE_Name", ""] != ""}; - _name = player getVariable ["ACE_Name", ""]; - _name = toArray _name; + _name = player getVariable ["ACE_Name", ""]; + _name = toArray _name; - _index = _name find (toArray "]" select 0); + _index = _name find (toArray "]" select 0); - if (_index != -1) then { - for "_index" from 0 to _index do { - _name set [_index, -1]; - }; - _name = _name - [-1]; - _name = toString _name; - player setVariable ["ACE_Name", _name, true]; - }; + if (_index != -1) then { + for "_index" from 0 to _index do { + _name set [_index, -1]; + }; + _name = _name - [-1]; + _name = toString _name; + player setVariable ["ACE_Name", _name, true]; + }; }; diff --git a/addons/interaction/functions/fnc_showMouseHint.sqf b/addons/interaction/functions/fnc_showMouseHint.sqf index b162754b13..5cb96a0eae 100644 --- a/addons/interaction/functions/fnc_showMouseHint.sqf +++ b/addons/interaction/functions/fnc_showMouseHint.sqf @@ -1,20 +1,20 @@ /* - Author(s): - Garth de Wet (LH) + Author(s): + Garth de Wet (LH) - Description: - Shows the interaction helper text with the mouse buttons at the bottom middle of the screen + Description: + Shows the interaction helper text with the mouse buttons at the bottom middle of the screen - Parameters: - 0: STRING - Left click text - 1: STRING - Right click text - 3: STRING - (Optional) Scroll text + Parameters: + 0: STRING - Left click text + 1: STRING - Right click text + 3: STRING - (Optional) Scroll text - Returns: - Nothing + Returns: + Nothing - Example: - ["Place Explosive", "Cancel"] call FUNC(showMouseHint); + Example: + ["Place Explosive", "Cancel"] call FUNC(showMouseHint); */ #include "script_component.hpp" @@ -25,7 +25,7 @@ _leftClick = _this select 0; _rightClick = _this select 1; _scroll = ""; if (count _this > 2) then { - _scroll = _this select 2; + _scroll = _this select 2; }; (QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutRsc [QGVAR(InteractionHelper), "PLAIN",0.5, false]; @@ -42,13 +42,13 @@ if (isNull _display) exitWith{}; (_display displayCtrl 1201) ctrlShow (_rightClick != ""); if (_scroll == "") exitWith { - (_display displayCtrl 1002) ctrlShow false; - (_display displayCtrl 1202) ctrlShow false; + (_display displayCtrl 1002) ctrlShow false; + (_display displayCtrl 1202) ctrlShow false; - (_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 8 * GUI_GRID_W, 1.5 * GUI_GRID_H]; - (_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1 * GUI_GRID_W, 1 * GUI_GRID_H]; - (_display displayCtrl 1001) ctrlCommit 0; - (_display displayCtrl 1201) ctrlCommit 0; + (_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 8 * GUI_GRID_W, 1.5 * GUI_GRID_H]; + (_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1 * GUI_GRID_W, 1 * GUI_GRID_H]; + (_display displayCtrl 1001) ctrlCommit 0; + (_display displayCtrl 1201) ctrlCommit 0; }; (_display displayCtrl 1002) ctrlSetText _scroll; showHUD false; \ No newline at end of file diff --git a/addons/interaction/functions/fnc_sortOptionsByPriority.sqf b/addons/interaction/functions/fnc_sortOptionsByPriority.sqf index d29ebd3e5f..28daa4e7e5 100644 --- a/addons/interaction/functions/fnc_sortOptionsByPriority.sqf +++ b/addons/interaction/functions/fnc_sortOptionsByPriority.sqf @@ -8,14 +8,14 @@ _count = count _actions; _index = 0; while {_index < _count - 1} do { - _actionN = + _actions select _index; - _actionM = + _actions select (_index + 1); + _actionN = + _actions select _index; + _actionM = + _actions select (_index + 1); - if (_actionN select 3 < _actionM select 3) then { - _actions set [_index, _actionM]; - _actions set [_index + 1, _actionN]; - _index = 0; - } else { - _index = _index + 1; - }; + if (_actionN select 3 < _actionM select 3) then { + _actions set [_index, _actionM]; + _actions set [_index + 1, _actionN]; + _index = 0; + } else { + _index = _index + 1; + }; }; diff --git a/addons/interaction/functions/fnc_updateTooltipPosition.sqf b/addons/interaction/functions/fnc_updateTooltipPosition.sqf index c4b2a6e102..27148c5aa3 100644 --- a/addons/interaction/functions/fnc_updateTooltipPosition.sqf +++ b/addons/interaction/functions/fnc_updateTooltipPosition.sqf @@ -5,9 +5,9 @@ disableSerialization; _ctrl = ctrlParent (_this select 0) displayCtrl 40; _ctrl ctrlSetPosition [ - (_this select 1) + 0.01 * safezoneW, - (_this select 2) + 0.01 * safezoneH, - 2.0 / 16 * safezoneW, - 0.3 / 9 * safezoneH + (_this select 1) + 0.01 * safezoneW, + (_this select 2) + 0.01 * safezoneH, + 2.0 / 16 * safezoneW, + 0.3 / 9 * safezoneH ]; _ctrl ctrlCommit 0; diff --git a/addons/interaction/script_component.hpp b/addons/interaction/script_component.hpp index 07fcac5740..caa87ce3ce 100644 --- a/addons/interaction/script_component.hpp +++ b/addons/interaction/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_INTERACTION - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_INTERACTION - #define DEBUG_SETTINGS DEBUG_SETTINGS_INTERACTION + #define DEBUG_SETTINGS DEBUG_SETTINGS_INTERACTION #endif #include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/laser_selfdesignate/functions/fnc_initDesignatorActions.sqf b/addons/laser_selfdesignate/functions/fnc_initDesignatorActions.sqf index cd45c45d32..af361425aa 100644 --- a/addons/laser_selfdesignate/functions/fnc_initDesignatorActions.sqf +++ b/addons/laser_selfdesignate/functions/fnc_initDesignatorActions.sqf @@ -20,6 +20,7 @@ _initializedClasses = GETGVAR(initializedClasses,[]); // do nothing if the class is already initialized if (_type in _initializedClasses) exitWith {}; _initializedClasses pushBack _type; +GVAR(initializedClasses) = _initializedClasses; { private ["_turretConfig","_onAction","_offAction"]; diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf index f44fb2e2b9..f0fdc8458f 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf @@ -1,9 +1,9 @@ -// #define DEBUG_MODE_FULL +//#define DEBUG_MODE_FULL #include "script_component.hpp" TRACE_1("enter", _this); -#define FCS_UPDATE_DELAY 2.0 +#define FCS_UPDATE_DELAY 1 FUNC(magnitude) = { _this distance [0, 0, 0] @@ -68,14 +68,13 @@ FUNC(laserHudDesignatePFH) = { ["ace_fcs_forceUpdate", []] call ace_common_fnc_localEvent; }; - if( ((getPosASL _laserTarget) vectorDistance _pos) > 2) then { + if( (_laserTarget distance _pos) > 0.1) then { TRACE_1("LaserPos Update", ""); _laserTarget setPosATL (ASLToATL _pos); - - }; + }; if(diag_tickTime > _forceUpdateTime) then { - _args set[3, diag_tickTime + FCS_UPDATE_DELAY]; + _args set[2, diag_tickTime + FCS_UPDATE_DELAY]; }; #ifdef DEBUG_MODE_FULL drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], (getPosATL _laserTarget), 0.75, 0.75, 0, "", 0.5, 0.025, "TahomaB"]; @@ -101,7 +100,7 @@ if(isNil QGVAR(laser)) then { GVAR(laserActive) = true; - _handle = [FUNC(laserHudDesignatePFH), 0, [_laserTarget, player]] call cba_fnc_addPerFrameHandler; + _handle = [FUNC(laserHudDesignatePFH), 0.1, [_laserTarget, player]] call cba_fnc_addPerFrameHandler; _laserTarget setVariable ["ACE_PFH_HANDLE", _handle, false]; GVAR(laser) = _laserTarget; diff --git a/addons/laserpointer/XEH_postInit.sqf b/addons/laserpointer/XEH_postInit.sqf index 58c47e3de2..14e4c384d8 100644 --- a/addons/laserpointer/XEH_postInit.sqf +++ b/addons/laserpointer/XEH_postInit.sqf @@ -1,6 +1,9 @@ // by commy2 #include "script_component.hpp" +// fixes laser when being captured. Needed, because the selectionpsoition of the right hand is used +["SetHandcuffed", {if (_this select 1) then {(_this select 0) action ["GunLightOff", _this select 0]};}] call EFUNC(common,addEventHandler); + if !(hasInterface) exitWith {}; GVAR(nearUnits) = []; diff --git a/addons/laserpointer/stringtable.xml b/addons/laserpointer/stringtable.xml index 1da46607d4..87b36618a6 100644 --- a/addons/laserpointer/stringtable.xml +++ b/addons/laserpointer/stringtable.xml @@ -17,7 +17,6 @@ - <t color='#9cf953'>Use: </t>Turn Laser ON/OFF <t color='#9cf953'>Use: </t>Turn Laser ON/OFF <t color='#9cf953'>Použití: </t>Zapnout/vypnout laser <t color='#9cf953'>Utiliser : </t>laser on/off diff --git a/addons/magazines/CfgEventHandlers.hpp b/addons/magazines/CfgEventHandlers.hpp deleted file mode 100644 index b5577d09b7..0000000000 --- a/addons/magazines/CfgEventHandlers.hpp +++ /dev/null @@ -1,13 +0,0 @@ -class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); - }; -}; - -class Extended_FiredBIS_EventHandlers { - class AllVehicles { - class ADDON { - firedBIS = QUOTE(_this call FUNC(forceMagazineMuzzleVelocity)); - }; - }; -}; diff --git a/addons/magazines/CfgMagazines.hpp b/addons/magazines/CfgMagazines.hpp index 1c0242bd6d..86cb6d9e1b 100644 --- a/addons/magazines/CfgMagazines.hpp +++ b/addons/magazines/CfgMagazines.hpp @@ -22,7 +22,6 @@ class CfgMagazines { descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_mag_SDDescription"; picture = "\A3\weapons_f\data\ui\m_30stanag_caseless_green_CA.paa"; initSpeed = 320; - GVAR(forceMagazineMuzzleVelocity) = 1; }; class ACE_30Rnd_65x39_caseless_mag_AP: 30Rnd_65x39_caseless_mag { @@ -58,7 +57,6 @@ class CfgMagazines { displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_SDNameShort"; descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_SDDescription"; initSpeed = 320; - GVAR(forceMagazineMuzzleVelocity) = 1; }; class ACE_30Rnd_65x39_caseless_green_mag_AP: 30Rnd_65x39_caseless_green { @@ -90,7 +88,6 @@ class CfgMagazines { displayNameShort = "$STR_ACE_30Rnd_556x45_mag_SDNameShort"; descriptionShort = "$STR_ACE_30Rnd_556x45_mag_SDDescription"; initSpeed = 320; - GVAR(forceMagazineMuzzleVelocity) = 1; picture = "\A3\weapons_f\data\ui\m_30stanag_green_ca.paa"; }; @@ -130,7 +127,6 @@ class CfgMagazines { displayNameShort = "$STR_ACE_20Rnd_762x51_mag_SDNameShort"; descriptionShort = "$STR_ACE_20Rnd_762x51_mag_SDDescription"; initSpeed = 320; - GVAR(forceMagazineMuzzleVelocity) = 1; }; class ACE_20Rnd_762x51_Mag_AP: 20Rnd_762x51_Mag { diff --git a/addons/magazines/XEH_preInit.sqf b/addons/magazines/XEH_preInit.sqf deleted file mode 100644 index 8e611f370a..0000000000 --- a/addons/magazines/XEH_preInit.sqf +++ /dev/null @@ -1,7 +0,0 @@ -#include "script_component.hpp" - -ADDON = false; - -PREP(forceMagazineMuzzleVelocity); - -ADDON = true; diff --git a/addons/magazines/config.cpp b/addons/magazines/config.cpp index 58c1dfa467..c757d62f5c 100644 --- a/addons/magazines/config.cpp +++ b/addons/magazines/config.cpp @@ -12,8 +12,6 @@ class CfgPatches { }; }; -#include "CfgEventHandlers.hpp" - #include "CfgAmmo.hpp" #include "CfgMagazines.hpp" #include "CfgVehicles.hpp" diff --git a/addons/magazines/functions/fnc_forceMagazineMuzzleVelocity.sqf b/addons/magazines/functions/fnc_forceMagazineMuzzleVelocity.sqf deleted file mode 100644 index 414dbb40e8..0000000000 --- a/addons/magazines/functions/fnc_forceMagazineMuzzleVelocity.sqf +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Author: commy2 - * - * DESCRIPTION. - * - * Arguments: - * firedBIS - * - * Return Value: - * None - */ - -#include "script_component.hpp" - -private ["_weapon", "_magazine", "_projectile"]; - -_weapon = _this select 1; -_magazine = _this select 5; -_projectile = _this select 6; - -if (getNumber (configFile >> "CfgMagazines" >> _magazine >> QGVAR(forceMagazineMuzzleVelocity)) != 1) exitWith { - //hint str (speed _projectile / 3.6); -}; - -private ["_initSpeedWeapon", "_initSpeedMagazine"]; - -_initSpeedWeapon = getNumber (configFile >> "CfgWeapons" >> _weapon >> "initSpeed"); -_initSpeedMagazine = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); - -//systemChat format ["W: %1m/s, M: %2m/s", _initSpeedWeapon, _initSpeedMagazine]; - -// force magazine initSpeed - -private ["_credit", "_debit"]; - -_credit = vectorMagnitude velocity _projectile; -_debit = _credit + (_initSpeedMagazine - _initSpeedWeapon); - -_projectile setVelocity ((velocity _projectile) vectorMultiply (_debit / _credit)); - -//hint str (speed _projectile / 3.6); diff --git a/addons/magazines/functions/script_component.hpp b/addons/magazines/functions/script_component.hpp deleted file mode 100644 index 2849ae3632..0000000000 --- a/addons/magazines/functions/script_component.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "\z\ace\addons\magazines\script_component.hpp" \ No newline at end of file diff --git a/addons/main/About.hpp b/addons/main/About.hpp index 814fab7454..c455c43cc3 100644 --- a/addons/main/About.hpp +++ b/addons/main/About.hpp @@ -1,35 +1,35 @@ #include "script_dialog_defines.hpp" class ACE_ABOUT_DLG { - idd = 114137; - movingEnable = 0; - onLoad = "with uiNameSpace do { ACE_ABOUT_DLG = _this select 0; };"; - onKeyDown = "if((_this select 1) == 1) then {ACE_ABOUT_STP = true;};"; - class controlsBackground { - class Contents : RscStructuredText { - idc = 1141371; - colorBackground[] = { 0, 0, 0, 0 }; - __SX(0.45); - __SY(0.25); - __SW(0.45); - __SH(0.6); - size = "0.025 * SafeZoneH"; - class Attributes { - font = "TahomaB"; - color = "#C8C8C8"; - align = "left"; - valign = "middle"; - shadow = true; - shadowColor = "#191970"; - size = "1"; - }; - }; - class ACE_ABOUT_NEXT : ACE_ABOUT_CTRL { //dummy visible - idc = 1141372; - __SX(0.065); - __SW(0.03); - text = ""; - action = ""; - }; - }; //controlsBackground + idd = 114137; + movingEnable = 0; + onLoad = "with uiNameSpace do { ACE_ABOUT_DLG = _this select 0; };"; + onKeyDown = "if((_this select 1) == 1) then {ACE_ABOUT_STP = true;};"; + class controlsBackground { + class Contents : RscStructuredText { + idc = 1141371; + colorBackground[] = { 0, 0, 0, 0 }; + __SX(0.45); + __SY(0.25); + __SW(0.45); + __SH(0.6); + size = "0.025 * SafeZoneH"; + class Attributes { + font = "TahomaB"; + color = "#C8C8C8"; + align = "left"; + valign = "middle"; + shadow = true; + shadowColor = "#191970"; + size = "1"; + }; + }; + class ACE_ABOUT_NEXT : ACE_ABOUT_CTRL { //dummy visible + idc = 1141372; + __SX(0.065); + __SW(0.03); + text = ""; + action = ""; + }; + }; //controlsBackground }; diff --git a/addons/main/CfgModuleCategories.hpp b/addons/main/CfgModuleCategories.hpp index ad8e18f15a..1f86959585 100644 --- a/addons/main/CfgModuleCategories.hpp +++ b/addons/main/CfgModuleCategories.hpp @@ -1,8 +1,8 @@ class CfgFactionClasses { - class NO_CATEGORY; - class ACE: NO_CATEGORY { - displayName = "ACE"; - priority = 2; - side = 7; - }; + class NO_CATEGORY; + class ACE: NO_CATEGORY { + displayName = "ACE"; + priority = 2; + side = 7; + }; }; \ No newline at end of file diff --git a/addons/main/about.sqf b/addons/main/about.sqf index 5d500c60d5..c9004edfe1 100644 --- a/addons/main/about.sqf +++ b/addons/main/about.sqf @@ -26,184 +26,184 @@ __cr_testers, ]; _pkeynam = { //local function - _shift = if (_shift > 0) then {42} else {0}; - _ctrl = if (_ctrl > 0) then {56} else {0}; - _alt = if (_alt > 0) then {29} else {0}; - _keys = [_shift,_ctrl,_alt,_key]; - _keystrg = "^"; - { - _mod = _x in [42,56,29]; - _knaml = call compile format["format['%2',%1]",(keyName _x),"%1"]; - _knaml = [_knaml, " "] call CBA_fnc_split; - _knam = "^"; - {_k = _x; if (!_mod || (_k != (localize "STR_ACE_KN_LEFT") && _k != (localize "STR_ACE_KN_RIGHT"))) then {_knam = _knam + " " + _k}} forEach _knaml; - _knam = [_knam, "^ ", ""] call CBA_fnc_replace; - _keystrg = _keystrg + "-" + _knam; - } forEach _keys; - _keystrg = [_keystrg, "^ ", ""] call CBA_fnc_replace; - _keystrg = [_keystrg, "^-", ""] call CBA_fnc_replace; - _keystrg = [_keystrg, "^", "None"] call CBA_fnc_replace; - _keystrg + _shift = if (_shift > 0) then {42} else {0}; + _ctrl = if (_ctrl > 0) then {56} else {0}; + _alt = if (_alt > 0) then {29} else {0}; + _keys = [_shift,_ctrl,_alt,_key]; + _keystrg = "^"; + { + _mod = _x in [42,56,29]; + _knaml = call compile format["format['%2',%1]",(keyName _x),"%1"]; + _knaml = [_knaml, " "] call CBA_fnc_split; + _knam = "^"; + {_k = _x; if (!_mod || (_k != (localize "STR_ACE_KN_LEFT") && _k != (localize "STR_ACE_KN_RIGHT"))) then {_knam = _knam + " " + _k}} forEach _knaml; + _knam = [_knam, "^ ", ""] call CBA_fnc_replace; + _keystrg = _keystrg + "-" + _knam; + } forEach _keys; + _keystrg = [_keystrg, "^ ", ""] call CBA_fnc_replace; + _keystrg = [_keystrg, "^-", ""] call CBA_fnc_replace; + _keystrg = [_keystrg, "^", "None"] call CBA_fnc_replace; + _keystrg }; _pkeys = { - _pary = []; - _tpages = []; - _cEvents = configFile/"CfgSettings"/"CBA"/"events"; - for "_i" from 0 to (count _cEvents) - 1 do { - _cSys = _cEvents select _i; - _tSys = configName _cSys; - if (isNumber ((_cSys select 0)/"key")) then { - //format system name - _aSys = [_tSys, "_"] call CBA_fnc_split; - _tS = "^"; - {if (_x != "ace" && _x != "sys") then {_tS = _tS + " " + _x}} forEach _aSys; - _tS = [_tS, "^ ", ""] call CBA_fnc_replace; - _tS = format["%1:",_tS]; - PUSH(_pary,_tS); - for "_j" from 0 to (count _cSys) - 1 do { - _c = _cSys select _j; - _tC = configName _c; - _tC = [_tC, "_", " "] call CBA_fnc_replace; - //key - _key = getNumber (_c/"key"); - _shift = getNumber (_c/"shift"); - _ctrl = getNumber (_c/"ctrl"); - _alt = getNumber (_c/"alt"); - _keyn = [_key,_shift,_ctrl,_alt] call _pkeynam; - _tC = format[" %1: %2",_tC,_keyn]; - PUSH(_pary,_tC); - }; - }; - if (count _pary > 20) then { //split full page - PUSH(_tpages,_pary); - _pary = []; - }; - }; - if (count _pary > 0) then { //partial page - PUSH(_tpages,_pary); - _pary = []; - }; - _tpages + _pary = []; + _tpages = []; + _cEvents = configFile/"CfgSettings"/"CBA"/"events"; + for "_i" from 0 to (count _cEvents) - 1 do { + _cSys = _cEvents select _i; + _tSys = configName _cSys; + if (isNumber ((_cSys select 0)/"key")) then { + //format system name + _aSys = [_tSys, "_"] call CBA_fnc_split; + _tS = "^"; + {if (_x != "ace" && _x != "sys") then {_tS = _tS + " " + _x}} forEach _aSys; + _tS = [_tS, "^ ", ""] call CBA_fnc_replace; + _tS = format["%1:",_tS]; + PUSH(_pary,_tS); + for "_j" from 0 to (count _cSys) - 1 do { + _c = _cSys select _j; + _tC = configName _c; + _tC = [_tC, "_", " "] call CBA_fnc_replace; + //key + _key = getNumber (_c/"key"); + _shift = getNumber (_c/"shift"); + _ctrl = getNumber (_c/"ctrl"); + _alt = getNumber (_c/"alt"); + _keyn = [_key,_shift,_ctrl,_alt] call _pkeynam; + _tC = format[" %1: %2",_tC,_keyn]; + PUSH(_pary,_tC); + }; + }; + if (count _pary > 20) then { //split full page + PUSH(_tpages,_pary); + _pary = []; + }; + }; + if (count _pary > 0) then { //partial page + PUSH(_tpages,_pary); + _pary = []; + }; + _tpages }; //pages (make sure each will fit within 24 lines, word wrap is on) switch(_menu) do { - case "MAIN": { //note: not all scripting commands available on main menu (not compiled yet?) - _fadet = 13; - _page1 = _pcredits; - }; - case "SING": { - _fadet = 20; //fade time - _color = [1,1,1,1]; - //_bcolor = [0,0,0,0.3]; - _page1 = _pcredits; - _newpages = [] call _pkeys; - _pstart = 2; - _pcount = count _newpages; - _pnext = _pstart + _pcount; - }; - case "MULT": { - _fadet = 20; - _color = [1,1,1,1]; - //_bcolor = [0,0,0,0.3]; - _page1 = _pcredits; - _newpages = [] call _pkeys; - _pstart = 2; - _pcount = count _newpages; - _pnext = _pstart + _pcount; - }; - default {}; + case "MAIN": { //note: not all scripting commands available on main menu (not compiled yet?) + _fadet = 13; + _page1 = _pcredits; + }; + case "SING": { + _fadet = 20; //fade time + _color = [1,1,1,1]; + //_bcolor = [0,0,0,0.3]; + _page1 = _pcredits; + _newpages = [] call _pkeys; + _pstart = 2; + _pcount = count _newpages; + _pnext = _pstart + _pcount; + }; + case "MULT": { + _fadet = 20; + _color = [1,1,1,1]; + //_bcolor = [0,0,0,0.3]; + _page1 = _pcredits; + _newpages = [] call _pkeys; + _pstart = 2; + _pcount = count _newpages; + _pnext = _pstart + _pcount; + }; + default {}; }; //main menu display if (typeName(_data select 0) == "DISPLAY") then { - _display = _data select 0; + _display = _data select 0; }; if (typeName(_data select 0) == "CONTROL") then { - _control = _data select 0; - _display = ctrlParent _control; + _control = _data select 0; + _display = ctrlParent _control; }; //dynamic pages _pnames = []; for "_x" from _pstart to _pnext - 1 do { - _pnam = format ["_page%1",_x]; - PUSH(_pnames,_pnam); + _pnam = format ["_page%1",_x]; + PUSH(_pnames,_pnam); }; private _pnames; for "_x" from 0 to _pcount - 1 do { - call compile format ["%1 = %2", _pnames select _x, _newpages select _x]; + call compile format ["%1 = %2", _pnames select _x, _newpages select _x]; }; //get num pages _pages = 0; _run = true; while {_run} do { - INC(_pages); - if (isNil format ["_page%1", _pages]) exitWith {_pages = _pages - 1; _run = false}; + INC(_pages); + if (isNil format ["_page%1", _pages]) exitWith {_pages = _pages - 1; _run = false}; }; if (_pages > 0) then { - //Dialog - createDialog "ACE_ABOUT_DLG"; - _disp = uiNamespace getVariable "ACE_ABOUT_DLG"; - _ctrl = _disp displayCtrl 1141371; - _next = _disp displayCtrl 1141372; + //Dialog + createDialog "ACE_ABOUT_DLG"; + _disp = uiNamespace getVariable "ACE_ABOUT_DLG"; + _ctrl = _disp displayCtrl 1141371; + _next = _disp displayCtrl 1141372; - if (_pages > 1) then {_next ctrlSetText "Next"}; + if (_pages > 1) then {_next ctrlSetText "Next"}; - _ctrl ctrlSetFade 1; - _ctrl ctrlCommit 0; - _ctrl ctrlSetFade 0; - _ctrl ctrlCommit 3; + _ctrl ctrlSetFade 1; + _ctrl ctrlCommit 0; + _ctrl ctrlSetFade 0; + _ctrl ctrlCommit 3; - ACE_ABOUT_INC = 0; - _input = { //local function - _nesc = isNil "ACE_ABOUT_STP"; - if (_pages == 1) then {ACE_ABOUT_INC = 0}; //ignore special control - _unset = (ACE_ABOUT_INC == 0) && ACE_ABOUT_RUN; - if (_unset && _nesc) then {false} else {_fadet = _fadet + 5; true}; - }; + ACE_ABOUT_INC = 0; + _input = { //local function + _nesc = isNil "ACE_ABOUT_STP"; + if (_pages == 1) then {ACE_ABOUT_INC = 0}; //ignore special control + _unset = (ACE_ABOUT_INC == 0) && ACE_ABOUT_RUN; + if (_unset && _nesc) then {false} else {_fadet = _fadet + 5; true}; + }; - //by default cycle - for "_p" from 1 to _pages do { - _text = ""; - _page = call compile format["_page%1",_p]; - _curPage = _p; - { - _text = _text + _x + "
"; - _ctrl ctrlSetStructuredText parseText _text; - if (call _input) exitWith {_p = _pages}; - if (_x != "") then {uisleep 0.8}; - } forEach _page; - }; + //by default cycle + for "_p" from 1 to _pages do { + _text = ""; + _page = call compile format["_page%1",_p]; + _curPage = _p; + { + _text = _text + _x + "
"; + _ctrl ctrlSetStructuredText parseText _text; + if (call _input) exitWith {_p = _pages}; + if (_x != "") then {uisleep 0.8}; + } forEach _page; + }; - _run = true; - while {if (isNil "ACE_ABOUT_STP") then {_run} else {false}} do { - _ctrl ctrlSetFade 0; - _ctrl ctrlCommit 0; - if (!isNil "_color") then {_ctrl ctrlSetTextColor _color}; - if (!isNil "_bcolor") then {_ctrl ctrlSetBackgroundColor _bcolor}; + _run = true; + while {if (isNil "ACE_ABOUT_STP") then {_run} else {false}} do { + _ctrl ctrlSetFade 0; + _ctrl ctrlCommit 0; + if (!isNil "_color") then {_ctrl ctrlSetTextColor _color}; + if (!isNil "_bcolor") then {_ctrl ctrlSetBackgroundColor _bcolor}; - _curPage = _curPage + ACE_ABOUT_INC; - if (_curPage > _pages) then {_curPage = 1}; - if (_curPage <= 0) then {_curPage = 1}; - ACE_ABOUT_INC = 0; + _curPage = _curPage + ACE_ABOUT_INC; + if (_curPage > _pages) then {_curPage = 1}; + if (_curPage <= 0) then {_curPage = 1}; + ACE_ABOUT_INC = 0; - if (!ACE_ABOUT_RUN) then {ACE_ABOUT_RUN = true}; + if (!ACE_ABOUT_RUN) then {ACE_ABOUT_RUN = true}; - _text = ""; - _page = call compile format ["_page%1",_curPage]; - {_text = _text + _x + "
"} forEach _page; - _ctrl ctrlSetStructuredText parseText _text; + _text = ""; + _page = call compile format ["_page%1",_curPage]; + {_text = _text + _x + "
"} forEach _page; + _ctrl ctrlSetStructuredText parseText _text; - _ctrl ctrlSetFade 1; - _ctrl ctrlCommit _fadet; + _ctrl ctrlSetFade 1; + _ctrl ctrlCommit _fadet; - _time = time + _fadet + 2; - waitUntil{uisleep 1; _run = call _input; _faded = time > _time; (_run || _faded)}; - }; //while RUN + _time = time + _fadet + 2; + waitUntil{uisleep 1; _run = call _input; _faded = time > _time; (_run || _faded)}; + }; //while RUN }; ACE_ABOUT_STP = Nil; ACE_ABOUT_RUN = Nil; diff --git a/addons/main/license.sqf b/addons/main/license.sqf index e97d9c51a3..d078710247 100644 --- a/addons/main/license.sqf +++ b/addons/main/license.sqf @@ -16,10 +16,10 @@ Waiver Public Domain Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license. Other Rights In no way are any of the following rights affected by the license: - - Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations; - - The author's moral rights; - - Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights. - + - Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations; + - The author's moral rights; + - Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights. + Notice For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page. diff --git a/addons/main/script_component.hpp b/addons/main/script_component.hpp index 8c224ed41f..9a18b78a7a 100644 --- a/addons/main/script_component.hpp +++ b/addons/main/script_component.hpp @@ -4,11 +4,11 @@ // #define DEBUG_MODE_FULL #ifdef DEBUG_ENABLED_CORE - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_CORE - #define DEBUG_SETTINGS DEBUG_SETTINGS_CORE + #define DEBUG_SETTINGS DEBUG_SETTINGS_CORE #endif #include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/main/script_config.hpp b/addons/main/script_config.hpp index ac8e18fa12..e39240286e 100644 --- a/addons/main/script_config.hpp +++ b/addons/main/script_config.hpp @@ -1,38 +1,38 @@ -#define true 1 -#define false 0 +#define true 1 +#define false 0 -#define private 0 -#define protected 1 -#define public 2 +#define private 0 +#define protected 1 +#define public 2 -#define TEast 0 -#define TWest 1 -#define TGuerrila 2 -#define TCivilian 3 -#define TSideUnknown 4 -#define TEnemy 5 -#define TFriendly 6 -#define TLogic 7 +#define TEast 0 +#define TWest 1 +#define TGuerrila 2 +#define TCivilian 3 +#define TSideUnknown 4 +#define TEnemy 5 +#define TFriendly 6 +#define TLogic 7 -#define VSoft 0 -#define VArmor 1 -#define VAir 2 +#define VSoft 0 +#define VArmor 1 +#define VAir 2 -#define LockNo 0 -#define LockCadet 1 -#define LockYes 2 +#define LockNo 0 +#define LockCadet 1 +#define LockYes 2 -#define ReadAndWrite 0 -#define ReadAndCreate 1 -#define ReadOnly 2 -#define ReadOnlyVerified 3 +#define ReadAndWrite 0 +#define ReadAndCreate 1 +#define ReadOnly 2 +#define ReadOnlyVerified 3 -#define WeaponNoSlot 0 // dummy weapons -#define WeaponSlotPrimary 1 // primary weapons -#define WeaponSlotSecondary 16 // secondary weapons -#define WeaponSlotItem 256 // items -#define WeaponSlotBinocular 4096 // binocular -#define WeaponHardMounted 65536 +#define WeaponNoSlot 0 // dummy weapons +#define WeaponSlotPrimary 1 // primary weapons +#define WeaponSlotSecondary 16 // secondary weapons +#define WeaponSlotItem 256 // items +#define WeaponSlotBinocular 4096 // binocular +#define WeaponHardMounted 65536 #define CanSeeRadar 1 #define CanSeeRye 2 diff --git a/addons/main/script_debug.hpp b/addons/main/script_debug.hpp index 26475fb226..578d76cc91 100644 --- a/addons/main/script_debug.hpp +++ b/addons/main/script_debug.hpp @@ -32,15 +32,15 @@ PERFORMANCE COUNTERS SECTION #ifdef ENABLE_PERFORMANCE_COUNTERS #define CBA_fnc_addPerFrameHandler { _ret = [(_this select 0), (_this select 1), (_this select 2), #function] call CBA_fnc_addPerFrameHandler; if(isNil "ACE_PFH_COUNTER" ) then { ACE_PFH_COUNTER=[]; }; ACE_PFH_COUNTER pushBack [[_ret, __FILE__, __LINE__], [(_this select 0), (_this select 1), (_this select 2)]]; _ret } - - #define CREATE_COUNTER(x) if(isNil "ACE_COUNTERS" ) then { ACE_COUNTERS=[]; }; GVAR(DOUBLES(x,counter))=[]; GVAR(DOUBLES(x,counter)) set[0, QUOTE(GVAR(DOUBLES(x,counter)))]; GVAR(DOUBLES(x,counter)) set[1, diag_tickTime]; ACE_COUNTERS pushBack GVAR(DOUBLES(x,counter)); - #define BEGIN_COUNTER(x) if(isNil QUOTE(GVAR(DOUBLES(x,counter)))) then { CREATE_COUNTER(x) }; GVAR(DOUBLES(x,counter)) set[2, diag_tickTime]; - #define END_COUNTER(x) GVAR(DOUBLES(x,counter)) pushBack [(GVAR(DOUBLES(x,counter)) select 2), diag_tickTime]; + + #define CREATE_COUNTER(x) if(isNil "ACE_COUNTERS" ) then { ACE_COUNTERS=[]; }; GVAR(DOUBLES(x,counter))=[]; GVAR(DOUBLES(x,counter)) set[0, QUOTE(GVAR(DOUBLES(x,counter)))]; GVAR(DOUBLES(x,counter)) set[1, diag_tickTime]; ACE_COUNTERS pushBack GVAR(DOUBLES(x,counter)); + #define BEGIN_COUNTER(x) if(isNil QUOTE(GVAR(DOUBLES(x,counter)))) then { CREATE_COUNTER(x) }; GVAR(DOUBLES(x,counter)) set[2, diag_tickTime]; + #define END_COUNTER(x) GVAR(DOUBLES(x,counter)) pushBack [(GVAR(DOUBLES(x,counter)) select 2), diag_tickTime]; - #define DUMP_COUNTERS ([__FILE__, __LINE__] call ACE_DUMPCOUNTERS_FNC) + #define DUMP_COUNTERS ([__FILE__, __LINE__] call ACE_DUMPCOUNTERS_FNC) #else - #define CREATE_COUNTER(x) /* disabled */ - #define BEGIN_COUNTER(x) /* disabled */ - #define END_COUNTER(x) /* disabled */ - #define DUMP_COUNTERS /* disabled */ + #define CREATE_COUNTER(x) /* disabled */ + #define BEGIN_COUNTER(x) /* disabled */ + #define END_COUNTER(x) /* disabled */ + #define DUMP_COUNTERS /* disabled */ #endif \ No newline at end of file diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index ff2c4d615e..79f95545ca 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -43,7 +43,7 @@ #define ACE_ITEMS_CIVILIAN "ItemWatch" -#define ACE_DEFAULT_SLOTS "1 + 4 + 12* 256 + 2* 4096 + 2 + 8* 16 + 12*131072" +#define ACE_DEFAULT_SLOTS "1 + 4 + 12* 256 + 2* 4096 + 2 + 8* 16 + 12*131072" #define ACE_NOGRIP handAnim[] = {} #define ACE_DISTANCE_DEFAULT distanceZoomMin = 300; distanceZoomMax = 300 @@ -51,30 +51,30 @@ // #include "script_macros_optics.hpp" //ToDo #define ACE_NOZEROING discreteDistance[] = {}; \ - discreteDistanceInitIndex = 0; \ - weaponInfoType = "RscWeaponEmpty" + discreteDistanceInitIndex = 0; \ + weaponInfoType = "RscWeaponEmpty" #define ACE_NOTURRETZEROING discreteDistance[] = {}; \ - discreteDistanceInitIndex = 0; \ - turretInfoType = "RscWeaponEmpty" + discreteDistanceInitIndex = 0; \ + turretInfoType = "RscWeaponEmpty" #define ACE_LASER irLaserPos = "laser pos"; \ - irLaserEnd = "laser dir"; \ - irDistance = 300 + irLaserEnd = "laser dir"; \ + irDistance = 300 #define ACE_LASER_DISTANCE_VANILLA irDistance = 300 -#define ACE_NOLASER irLaserPos = "laser pos"; \ - irLaserEnd = "laser dir"; \ - irDistance = 0 +#define ACE_NOLASER irLaserPos = "laser pos"; \ + irLaserEnd = "laser dir"; \ + irDistance = 0 #define ACE_SUPPRESSED ace_suppressed = 1; \ - fireLightDuration = 0; \ - fireLightIntensity = 0 + fireLightDuration = 0; \ + fireLightIntensity = 0 // TODO: Cleanup in all the configs around -#define ACE_M_MAG(x,y) class _xx_##x {magazine = ##x; count = ##y;} -#define ACE_M_WEP(x,y) class _xx_##x {weapon = ##x; count = ##y;} +#define ACE_M_MAG(x,y) class _xx_##x {magazine = ##x; count = ##y;} +#define ACE_M_WEP(x,y) class _xx_##x {weapon = ##x; count = ##y;} #define ACE_M_ITEM(x,y) class _xx_##x {name = ##x; count = ##y;} #define ACE_M_BAG(x,y) class _xx_##x {backpack = ##x; count = ##y;} @@ -82,11 +82,11 @@ // Vehicle defines // ACE_canBeLoad = This vehicle acts as transporter, i.e you can load stuff into it // ACE_canBeCargo = This vehicle acts as cargo, i.e you can load this item into other vehicles -#define ACE_CARGO_FRONT ACE_canBeLoad = false; ACE_canBeCargo = true; ACE_canGear = false; ACE_canLoadFront = true -#define ACE_CARGO_ONLY ACE_canBeLoad = false; ACE_canBeCargo = true; ACE_canGear = false; ACE_canLoadFront = false -#define ACE_LOAD_ONLY ACE_canBeLoad = true; ACE_canBeCargo = false; ACE_canGear = false; ACE_canLoadFront = false -#define ACE_GEAR_ONLY ACE_canBeLoad = true; ACE_canBeCargo = false; ACE_canGear = true; ACE_canLoadFront = false -#define ACE_NOCARGOLOAD ACE_canBeLoad = false; ACE_canBeCargo = false; ACE_canGear = false; ACE_canLoadFront = false +#define ACE_CARGO_FRONT ACE_canBeLoad = false; ACE_canBeCargo = true; ACE_canGear = false; ACE_canLoadFront = true +#define ACE_CARGO_ONLY ACE_canBeLoad = false; ACE_canBeCargo = true; ACE_canGear = false; ACE_canLoadFront = false +#define ACE_LOAD_ONLY ACE_canBeLoad = true; ACE_canBeCargo = false; ACE_canGear = false; ACE_canLoadFront = false +#define ACE_GEAR_ONLY ACE_canBeLoad = true; ACE_canBeCargo = false; ACE_canGear = true; ACE_canLoadFront = false +#define ACE_NOCARGOLOAD ACE_canBeLoad = false; ACE_canBeCargo = false; ACE_canGear = false; ACE_canLoadFront = false // Increased FOV for tank driver // Increased Default US Tank driver optic @@ -134,32 +134,32 @@ #undef BWC_CONFIG #define BWC_CONFIG(NAME) class NAME { \ - units[] = {}; \ - weapons[] = {}; \ - requiredVersion = REQUIRED_VERSION; \ - requiredAddons[] = {}; \ - version = VERSION; \ - ACE_BWC; \ + units[] = {}; \ + weapons[] = {}; \ + requiredVersion = REQUIRED_VERSION; \ + requiredAddons[] = {}; \ + version = VERSION; \ + ACE_BWC; \ } #define ACE_FLASHLIGHT class FlashLight { \ - color[] = {0.9, 0.9, 0.7, 0.9}; \ - ambient[] = {0.1, 0.1, 0.1, 1.0}; \ - position = "flash dir"; \ - direction = "flash"; \ - angle = 30; \ - scale[] = {1, 1, 0.5}; \ - brightness = 0.1; \ - } + color[] = {0.9, 0.9, 0.7, 0.9}; \ + ambient[] = {0.1, 0.1, 0.1, 1.0}; \ + position = "flash dir"; \ + direction = "flash"; \ + angle = 30; \ + scale[] = {1, 1, 0.5}; \ + brightness = 0.1; \ + } #define ACE_SMALL_FLASHLIGHT class FlashLight { \ - color[] = {0.9, 0.9, 0.7, 0.9}; \ - ambient[] = {0.1, 0.1, 0.1, 1.0}; \ - position = "flash dir"; \ - direction = "flash"; \ - angle = 20; \ - scale[] = {0.9, 0.9, 0.4}; \ - brightness = 0.09; \ - } + color[] = {0.9, 0.9, 0.7, 0.9}; \ + ambient[] = {0.1, 0.1, 0.1, 1.0}; \ + position = "flash dir"; \ + direction = "flash"; \ + angle = 20; \ + scale[] = {0.9, 0.9, 0.4}; \ + brightness = 0.09; \ + } // Addaction defines for colored text #define ACE_TEXT_ORANGE(Text) ("" + ##Text + "") @@ -172,8 +172,8 @@ #define EGVAR(module,var) TRIPLES(PREFIX,module,var) #define QEGVAR(module,var) QUOTE(EGVAR(module,var)) -#define DGVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(GVAR(varName)) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(GVAR(varName))); }; GVAR(varName) -#define DVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(varName) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(varName)); }; varName +#define DGVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(GVAR(varName)) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(GVAR(varName))); }; GVAR(varName) +#define DVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(varName) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(varName)); }; varName #define DFUNC(var1) TRIPLES(ADDON,fnc,var1) #define DEFUNC(var1,var2) TRIPLES(DOUBLES(PREFIX,var1),fnc,var2) @@ -223,23 +223,23 @@ #ifdef DISABLE_COMPILE_CACHE - #define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf)) + #define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf)) #else - #define PREP(fncName) DFUNC(fncName) = QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf)) call SLX_XEH_COMPILE + #define PREP(fncName) DFUNC(fncName) = QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf)) call SLX_XEH_COMPILE #endif #define PREP_MODULE(folder) [] call compile preprocessFileLineNumbers QUOTE(PATHTOF(folder\__PREP__.sqf)) -#define HASH_CREATE ([] call EFUNC(common,hashCreate)) -#define HASH_SET(hash, key, val) ([hash, key, val, __FILE__, __LINE__] call EFUNC(common,hashSet)) -#define HASH_GET(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashGet)) -#define HASH_REM(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashRem)) -#define HASH_HASKEY(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashHasKey)) +#define HASH_CREATE ([] call EFUNC(common,hashCreate)) +#define HASH_SET(hash, key, val) ([hash, key, val, __FILE__, __LINE__] call EFUNC(common,hashSet)) +#define HASH_GET(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashGet)) +#define HASH_REM(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashRem)) +#define HASH_HASKEY(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashHasKey)) -#define HASHLIST_CREATELIST(keys) ([keys] call EFUNC(common,hashListCreateList)) -#define HASHLIST_CREATEHASH(hashList) ([hashList] call EFUNC(common,hashListCreateHash)) -#define HASHLIST_SELECT(hashList, index) ([hashList, index, __FILE__, __LINE__] call EFUNC(common,hashListSelect)) -#define HASHLIST_SET(hashList, index, value) ([hashList, index, value, __FILE__, __LINE__] call EFUNC(common,hashListSet)) -#define HASHLIST_PUSH(hashList, value) ([hashList, value, __FILE__, __LINE__] call EFUNC(common,hashListPush)) +#define HASHLIST_CREATELIST(keys) ([keys] call EFUNC(common,hashListCreateList)) +#define HASHLIST_CREATEHASH(hashList) ([hashList] call EFUNC(common,hashListCreateHash)) +#define HASHLIST_SELECT(hashList, index) ([hashList, index, __FILE__, __LINE__] call EFUNC(common,hashListSelect)) +#define HASHLIST_SET(hashList, index, value) ([hashList, index, value, __FILE__, __LINE__] call EFUNC(common,hashListSet)) +#define HASHLIST_PUSH(hashList, value) ([hashList, value, __FILE__, __LINE__] call EFUNC(common,hashListPush)) #include "script_debug.hpp" \ No newline at end of file diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index c8dfd56b4c..6ef5ec3f68 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -17,39 +17,39 @@ #define REQUIRED_VERSION 0.5 /* - #define DEBUG_ENABLED_ADDONS - #define DEBUG_ENABLED_ATTACHMENTS - #define DEBUG_ENABLED_weapons_backblast - #define DEBUG_ENABLED_BLOOD - #define DEBUG_ENABLED_CARTRIDGES - #define DEBUG_ENABLED_CRATERS - #define DEBUG_ENABLED_CREWPROTECTION - #define DEBUG_ENABLED_DUMMIES - #define DEBUG_ENABLED_EJECT - #define DEBUG_ENABLED_EXPLOSIVES - #define DEBUG_ENABLED_FLARES - #define DEBUG_ENABLED_FLASHBANG - #define DEBUG_ENABLED_GRENADETHROW - #define DEBUG_ENABLED_HUNTIR - #define DEBUG_ENABLED_INTERACTION - #define DEBUG_ENABLED_IRSTROBE - #define DEBUG_ENABLED_MULTI_BARREL - #define DEBUG_ENABLED_MUZZLEBLAST - #define DEBUG_ENABLED_NVG - #define DEBUG_ENABLED_weapons_overheating - #define DEBUG_ENABLED_RECOILDUST - #define DEBUG_ENABLED_ROCKET_BALLISTICS - #define DEBUG_ENABLED_SANDBAG - #define DEBUG_ENABLED_SHOTGUN - #define DEBUG_ENABLED_SIGHT_ADJUSTMENT_AT - #define DEBUG_ENABLED_SIGHT_ADJUSTMENT_GL - #define DEBUG_ENABLED_SIGHT_ADJUSTMENT_RIFLE - #define DEBUG_ENABLED_SMAW_SPOTTINGRIFLE - #define DEBUG_ENABLED_TRACERS - #define DEBUG_ENABLED_TRACKING - #define DEBUG_ENABLED_VIEWBLOCK - #define DEBUG_ENABLED_VEHICLE - #define DEBUG_ENABLED_vehicle_damage - #define DEBUG_ENABLED_WEAPONREST - #define DEBUG_ENABLED_WOUNDS + #define DEBUG_ENABLED_ADDONS + #define DEBUG_ENABLED_ATTACHMENTS + #define DEBUG_ENABLED_weapons_backblast + #define DEBUG_ENABLED_BLOOD + #define DEBUG_ENABLED_CARTRIDGES + #define DEBUG_ENABLED_CRATERS + #define DEBUG_ENABLED_CREWPROTECTION + #define DEBUG_ENABLED_DUMMIES + #define DEBUG_ENABLED_EJECT + #define DEBUG_ENABLED_EXPLOSIVES + #define DEBUG_ENABLED_FLARES + #define DEBUG_ENABLED_FLASHBANG + #define DEBUG_ENABLED_GRENADETHROW + #define DEBUG_ENABLED_HUNTIR + #define DEBUG_ENABLED_INTERACTION + #define DEBUG_ENABLED_IRSTROBE + #define DEBUG_ENABLED_MULTI_BARREL + #define DEBUG_ENABLED_MUZZLEBLAST + #define DEBUG_ENABLED_NVG + #define DEBUG_ENABLED_weapons_overheating + #define DEBUG_ENABLED_RECOILDUST + #define DEBUG_ENABLED_ROCKET_BALLISTICS + #define DEBUG_ENABLED_SANDBAG + #define DEBUG_ENABLED_SHOTGUN + #define DEBUG_ENABLED_SIGHT_ADJUSTMENT_AT + #define DEBUG_ENABLED_SIGHT_ADJUSTMENT_GL + #define DEBUG_ENABLED_SIGHT_ADJUSTMENT_RIFLE + #define DEBUG_ENABLED_SMAW_SPOTTINGRIFLE + #define DEBUG_ENABLED_TRACERS + #define DEBUG_ENABLED_TRACKING + #define DEBUG_ENABLED_VIEWBLOCK + #define DEBUG_ENABLED_VEHICLE + #define DEBUG_ENABLED_vehicle_damage + #define DEBUG_ENABLED_WEAPONREST + #define DEBUG_ENABLED_WOUNDS */ diff --git a/addons/map/script_component.hpp b/addons/map/script_component.hpp index 0c8f7429ab..3f126eb653 100644 --- a/addons/map/script_component.hpp +++ b/addons/map/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_MAP - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_MAP - #define DEBUG_SETTINGS DEBUG_SETTINGS_MAP + #define DEBUG_SETTINGS DEBUG_SETTINGS_MAP #endif #include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/maptools/XEH_preInit.sqf b/addons/maptools/XEH_preInit.sqf index 20777fb118..2da38996c3 100644 --- a/addons/maptools/XEH_preInit.sqf +++ b/addons/maptools/XEH_preInit.sqf @@ -24,8 +24,8 @@ PREP(updateMapToolMarkers); PREP(updateLineMarker); if (isServer) then { - GVAR(drawing_serverLineMarkers) = []; - publicVariable QGVAR(drawing_serverLineMarkers); + GVAR(drawing_serverLineMarkers) = []; + publicVariable QGVAR(drawing_serverLineMarkers); }; //Add Event Handlers: diff --git a/addons/maptools/functions/fnc_openMapGpsUpdate.sqf b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf index a4d25f8157..a26a02dd34 100644 --- a/addons/maptools/functions/fnc_openMapGpsUpdate.sqf +++ b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf @@ -4,8 +4,8 @@ #include "script_component.hpp" if ((!("ItemGPS" in assigneditems ACE_player)) || {isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull])}) exitWith { - ("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; //close GPS RSC - [(_this select 1)] call CBA_fnc_removePerFrameHandler; //remove frameHandler + ("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; //close GPS RSC + [(_this select 1)] call CBA_fnc_removePerFrameHandler; //remove frameHandler }; disableSerialization; diff --git a/addons/maptools/script_component.hpp b/addons/maptools/script_component.hpp index a3dad97a49..df2a8d3f62 100644 --- a/addons/maptools/script_component.hpp +++ b/addons/maptools/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_MAPTOOLS - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_MAPTOOLS - #define DEBUG_SETTINGS DEBUG_SETTINGS_MAPTOOLS + #define DEBUG_SETTINGS DEBUG_SETTINGS_MAPTOOLS #endif #include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index bb52693e91..9f0484f671 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -77,21 +77,9 @@ class ACE_Medical_Actions { callbackProgress = ""; animationPatient = ""; animationPatientUnconscious = ""; - itemConsumed = 0; + itemConsumed = 1; litter[] = {}; }; - /*class PersonalAidKit: Bandage { - displayName = ""; - displayNameProgress = ""; - items[] = {"ACE_personalAidKit"}; - treatmentLocations[] = {"All"}; - requiredMedic = 1; - treatmentTime = 15; - callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal)); - itemConsumed = 0; - animationCaller = "AinvPknlMstpSlayW[wpn]Dnon_medic"; - litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"}}, {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}, {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} }; - };*/ }; class Advanced { @@ -204,7 +192,7 @@ class ACE_Medical_Actions { displayName = ""; displayNameProgress = ""; items[] = {"ACE_surgicalKit"}; - treatmentLocations[] = {"MedicalFacility", "MedicalVehicle"}; + treatmentLocations[] = {QGVAR(useLocation_SurgicalKit)}; requiredMedic = QGVAR(medicSetting_SurgicalKit); treatmentTime = 10; callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_surgicalKit)); @@ -216,7 +204,7 @@ class ACE_Medical_Actions { displayName = ""; displayNameProgress = ""; items[] = {"ACE_personalAidKit"}; - treatmentLocations[] = {"All"}; + treatmentLocations[] = {QGVAR(useLocation_PAK)}; requiredMedic = QGVAR(medicSetting_PAK); treatmentTime = 10; callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal)); @@ -288,7 +276,7 @@ class ACE_Medical_Actions { callbackProgress = ""; animationPatient = ""; animationPatientUnconscious = ""; - itemConsumed = 0; + itemConsumed = 1; litter[] = {}; }; }; diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index 915beafd6c..0af12c0a37 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -99,6 +99,16 @@ class ACE_Settings { value = 0; values[] = {"No", "Yes"}; }; + class GVAR(useLocation_PAK) { + typeName = "SCALAR"; + value = 3; + values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"}; + }; + class GVAR(useLocation_SurgicalKit) { + typeName = "SCALAR"; + value = 2; + values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"}; + }; class GVAR(keepLocalSettingsSynced) { typeName = "BOOL"; value = 1; diff --git a/addons/medical/CfgEventHandlers.hpp b/addons/medical/CfgEventHandlers.hpp index 6330819daa..bf96b6a239 100644 --- a/addons/medical/CfgEventHandlers.hpp +++ b/addons/medical/CfgEventHandlers.hpp @@ -17,6 +17,11 @@ class Extended_Init_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_init)); }; }; + class ACE_bodyBagObject { + class ADDON { + init = QUOTE(_this call DEFUNC(dragging,initObject)); + }; + }; }; class Extended_Respawn_EventHandlers { diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index a1110019ae..13c54dfe37 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -204,7 +204,7 @@ class CfgVehicles { defaultValue = 1800; }; class medicSetting_PAK { - displayName = "Allow PAK"; + displayName = "Allow PAK (Adv)"; description = "Who can use the PAK for full heal?"; typeName = "NUMBER"; class values { @@ -214,7 +214,7 @@ class CfgVehicles { }; }; class consumeItem_PAK { - displayName = "Remove PAK on use"; + displayName = "Remove PAK on use (Adv)"; description = "Should PAK be removed on usage?"; typeName = "NUMBER"; class values { @@ -222,14 +222,30 @@ class CfgVehicles { class remove { name = "Yes"; value = 1; default = 1; }; }; }; + class useLocation_PAK { + displayName = "Locations PAK (Adv)"; + description = "Where can the personal aid kit be used?"; + typeName = "NUMBER"; + class values { + class anywhere { name = "Anywhere"; value = 0; }; + class vehicle { name = "Medical Vehicles"; value = 1; }; + class facility { name = "Medical facility"; value = 2; }; + class vehicleAndFacility { name = "Vehicles & facility"; value = 3; default = 1; }; + class disabled { name = "Disabled"; value = 4;}; + }; + }; class medicSetting_SurgicalKit: medicSetting_PAK { - displayName = "Allow Surgical kit"; + displayName = "Allow Surgical kit (Adv)"; description = "Who can use the surgical kit?"; }; class consumeItem_SurgicalKit: consumeItem_PAK { - displayName = "Remove Surgical kit"; + displayName = "Remove Surgical kit (Adv)"; description = "Should Surgical kit be removed on usage?"; }; + class useLocation_SurgicalKit: useLocation_PAK { + displayName = "Locations Surgical kit (Adv)"; + description = "Where can the Surgical kit be used?"; + }; }; class ModuleDescription { @@ -597,12 +613,26 @@ class CfgVehicles { }; }; class MapBoard_altis_F; - class ACE_bodyBag: MapBoard_altis_F { + class ACE_bodyBagObject: MapBoard_altis_F { + XEH_ENABLED; scope = 1; side = -1; model = QUOTE(PATHTOF(data\bodybag.p3d)); icon = ""; displayName = $STR_ACE_MEDICAL_BODYBAG_DISPLAY; + EGVAR(dragging,canDrag) = 1; + EGVAR(dragging,dragPosition[]) = {0,1.2,0}; + EGVAR(dragging,dragDirection) = 0; + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + distance = 5; + condition = QUOTE(true); + statement = ""; + icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa"; + selection = ""; + }; + }; }; // Medical litter classes @@ -856,7 +886,7 @@ class CfgVehicles { scope = 2; accuracy = 1000; displayName = "[ACE] Medical Supply Crate"; - model = "\A3\weapons_F\AmmoBoxes\AmmoBox_F"; + model = PATHTOF(data\ace_medcrate.p3d); author = "$STR_ACE_Common_ACETeam"; class TransportItems { class ACE_fieldDressing { diff --git a/addons/medical/XEH_init.sqf b/addons/medical/XEH_init.sqf index 0ded7d471f..2f840fe950 100644 --- a/addons/medical/XEH_init.sqf +++ b/addons/medical/XEH_init.sqf @@ -6,5 +6,5 @@ _unit = _this select 0; _unit addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}]; if (local _unit) then { - [_unit] call FUNC(init); + [_unit] call FUNC(init); }; diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 77fed65110..27f2ce07b9 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -13,6 +13,28 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"]; ["medical_woundUpdateRequest", FUNC(onWoundUpdateRequest)] call ace_common_fnc_addEventHandler; ["interactMenuClosed", {[objNull, false] call FUNC(displayPatientInformation); }] call ace_common_fnc_addEventHandler; +["medical_onUnconscious", { + if (local (_this select 0)) then { + _unit = _this select 0; + if (_this select 1) then { + _unit setVariable ["tf_globalVolume", 0.4]; + _unit setVariable ["tf_voiceVolume", 0, true]; + _unit setVariable ["tf_unable_to_use_radio", true, true]; + + _unit setVariable ["acre_sys_core_isDisabled", true, true]; + _unit setVariable ["acre_sys_core_globalVolume", 0.4]; + } else { + _unit setVariable ["tf_globalVolume", 1]; + _unit setVariable ["tf_voiceVolume", 1, true]; + _unit setVariable ["tf_unable_to_use_radio", true, true]; + + _unit setVariable ["acre_sys_core_isDisabled", true, true]; + _unit setVariable ["acre_sys_core_globalVolume", 1]; + }; + }; +}] call ace_common_fnc_addEventHandler; + + // Initialize all effects _fnc_createEffect = { private ["_type", "_layer", "_default"]; diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index fc9d68fc68..56056de0c6 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -54,6 +54,7 @@ PREP(init); PREP(isBeingCarried); PREP(isBeingDragged); PREP(isInMedicalFacility); +PREP(isInMedicalVehicle); PREP(isMedic); PREP(isMedicalVehicle); PREP(itemCheck); diff --git a/addons/medical/config.cpp b/addons/medical/config.cpp index 28e07fe4d4..a5f00bbeed 100644 --- a/addons/medical/config.cpp +++ b/addons/medical/config.cpp @@ -2,7 +2,7 @@ class CfgPatches { class ADDON { - units[] = {"ACE_medicalSupplyCrate", "ACE_fieldDressingItem", "ACE_packingBandageItem", "ACE_elasticBandageItem", "ACE_tourniquetItem", "ACE_morphineItem", "ACE_atropineItem", "ACE_epinephrineItem", "ACE_plasmaIVItem", "ACE_bloodIVItem", "ACE_salineIVItem", "ACE_quikclotItem", "ACE_personalAidKitItem", "ACE_surgicalKitItem", "ACE_bodyBagItem"}; + units[] = {"ACE_medicalSupplyCrate", "ACE_fieldDressingItem", "ACE_packingBandageItem", "ACE_elasticBandageItem", "ACE_tourniquetItem", "ACE_morphineItem", "ACE_atropineItem", "ACE_epinephrineItem", "ACE_plasmaIVItem", "ACE_bloodIVItem", "ACE_salineIVItem", "ACE_quikclotItem", "ACE_personalAidKitItem", "ACE_surgicalKitItem", "ACE_bodyBagItem", "ACE_bodyBagObject"}; weapons[] = {"ACE_fieldDressing", "ACE_packingBandage", "ACE_elasticBandage", "ACE_tourniquet", "ACE_morphine", "ACE_atropine", "ACE_epinephrine", "ACE_plasmaIV", "ACE_plasmaIV_500", "ACE_plasmaIV_250", "ACE_bloodIV", "ACE_bloodIV_500", "ACE_bloodIV_250", "ACE_salineIV", "ACE_salineIV_500", "ACE_salineIV_250", "ACE_quikclot", "ACE_personalAidKit", "ACE_surgicalKit", "ACE_bodyBag"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {ace_common, ace_interaction, ace_modules}; diff --git a/addons/medical/data/ace_medcrate.p3d b/addons/medical/data/ace_medcrate.p3d new file mode 100644 index 0000000000..4398599b99 Binary files /dev/null and b/addons/medical/data/ace_medcrate.p3d differ diff --git a/addons/medical/data/ace_medcrate_co.paa b/addons/medical/data/ace_medcrate_co.paa new file mode 100644 index 0000000000..a817bf0ae4 Binary files /dev/null and b/addons/medical/data/ace_medcrate_co.paa differ diff --git a/addons/medical/data/ace_medcrate_r.p3d b/addons/medical/data/ace_medcrate_r.p3d new file mode 100644 index 0000000000..f711996bec Binary files /dev/null and b/addons/medical/data/ace_medcrate_r.p3d differ diff --git a/addons/medical/functions/fnc_actionDropUnit.sqf b/addons/medical/functions/fnc_actionDropUnit.sqf index db1c02aced..53883c93c1 100644 --- a/addons/medical/functions/fnc_actionDropUnit.sqf +++ b/addons/medical/functions/fnc_actionDropUnit.sqf @@ -17,7 +17,7 @@ private "_caller"; _caller = _this select 0; if (!isnil QGVAR(DROP_ADDACTION)) then { - [_caller,objNull] call EFUNC(common,carryObj); - _caller removeAction GVAR(DROP_ADDACTION); + [_caller,objNull] call EFUNC(common,carryObj); + _caller removeAction GVAR(DROP_ADDACTION); GVAR(DROP_ADDACTION) = nil; }; diff --git a/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf b/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf index d657dbe152..872b9a628a 100644 --- a/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf +++ b/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf @@ -18,22 +18,14 @@ private ["_target","_caller", "_nameOfUnit", "_onPosition", "_bodyBagCreated"]; _caller = _this select 0; _target = _this select 1; -if !([_caller, "ACE_itemBodyBag"] call EFUNC(common,hasItem)) exitwith {}; - -[_caller, "ACE_itemBodyBag"] call EFUNC(common,useItem); - _nameOfUnit = [_target] call EFUNC(common,getName); if (alive _target) then { - // force kill the unit. [_target, true] call FUNC(setDead); }; _onPosition = getPos _target; deleteVehicle _target; -_bodyBagCreated = createVehicle ["ACE_bodyBag", _onPosition, [], 0, "NONE"]; +_bodyBagCreated = createVehicle ["ACE_bodyBagObject", _onPosition, [], 0, "NONE"]; // reset the position to ensure it is on the correct one. -_bodyBagCreated setPos _onPosition; - -// TODO Does this need to be something with QUOTE(DEFUNC)? -[[_bodyBagCreated], QUOTE(DEFUNC(common,revealObject)), true] call call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ +_bodyBagCreated setPos [_onPosition select 0, _onPosition select 1, (_onPosition select 2) + 0.2]; _bodyBagCreated; diff --git a/addons/medical/functions/fnc_canTreat.sqf b/addons/medical/functions/fnc_canTreat.sqf index 4cb9adf8e1..5f52759f54 100644 --- a/addons/medical/functions/fnc_canTreat.sqf +++ b/addons/medical/functions/fnc_canTreat.sqf @@ -64,10 +64,26 @@ if (!_return) exitwith {false}; if ("All" in _locations) exitwith {true}; +private [ "_medFacility", "_medVeh"]; +_medFacility = {([_caller] call FUNC(isInMedicalFacility)) || ([_target] call FUNC(isInMedicalFacility))}; +_medVeh = {([_caller] call FUNC(isInMedicalVehicle)) || ([_target] call FUNC(isInMedicalVehicle))}; + { if (_x == "field") exitwith {_return = true;}; - if (_x == "MedicalFacility" && {[_caller, _target] call FUNC(inMedicalFacility)}) exitwith {_return = true;}; - if (_x == "MedicalVehicle" && {[_caller, _target] call FUNC(inMedicalVehicle)}) exitwith {_return = true;}; + if (_x == "MedicalFacility" && _medFacility) exitwith {_return = true;}; + if (_x == "MedicalVehicle" && _medVeh) exitwith {_return = true;}; + if !(isnil _x) exitwith { + private "_val"; + _val = missionNamespace getvariable _x; + if (typeName _val == "SCALAR") then { + _return = switch (_val) do { + case 0: {true}; + case 1: _medVeh; + case 2: _medFacility; + case 3: {call _medFacility || call _medVeh}; + }; + }; + }; }foreach _locations; _return; diff --git a/addons/medical/functions/fnc_copyDeadBody.sqf b/addons/medical/functions/fnc_copyDeadBody.sqf index 68d5a356ec..8e476b8662 100644 --- a/addons/medical/functions/fnc_copyDeadBody.sqf +++ b/addons/medical/functions/fnc_copyDeadBody.sqf @@ -67,9 +67,9 @@ _newUnit selectWeapon (primaryWeapon _newUnit); // We are attaching the old unit and hiding it, so we can keep the original unit until later. _oldBody attachTo [_newUnit, [0,0,0]]; if (isMultiplayer) then { - hideObjectGlobal _oldBody; + hideObjectGlobal _oldBody; } else { - hideObject _oldBody; + hideObject _oldBody; }; _newUnit setvariable [QGVAR(copyOfUnit), _oldBody, true]; diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index b5eecbeb8d..599c2f344f 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -31,7 +31,9 @@ if (_show) then { [{ private ["_target", "_display", "_alphaLevel", "_damaged", "_availableSelections", "_openWounds", "_selectionBloodLoss", "_red", "_green", "_blue", "_alphaLevel", "_allInjuryTexts", "_lbCtrl", "_genericMessages"]; _target = (_this select 0) select 0; - if (GVAR(displayPatientInformationTarget) != _target) exitwith { + _selectionN = (_this select 0) select 1; + + if (GVAR(displayPatientInformationTarget) != _target || GVAR(currentSelectedSelectionN) != _selectionN) exitwith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; @@ -44,7 +46,7 @@ if (_show) then { _allInjuryTexts = []; _genericMessages = []; - _partText = ["STR_ACE_Interaction_Head", "STR_ACE_Interaction_Torso", "STR_ACE_Interaction_ArmLeft" ,"STR_ACE_Interaction_ArmRight" ,"STR_ACE_Interaction_LegLeft", "STR_ACE_Interaction_LegRight"] select GVAR(currentSelectedSelectionN); + _partText = ["STR_ACE_Interaction_Head", "STR_ACE_Interaction_Torso", "STR_ACE_Interaction_ArmLeft" ,"STR_ACE_Interaction_ArmRight" ,"STR_ACE_Interaction_LegLeft", "STR_ACE_Interaction_LegRight"] select _selectionN; _genericMessages pushback [localize _partText, [1, 1, 1, 1]]; if (_target getvariable[QGVAR(isBleeding), false]) then { @@ -54,7 +56,7 @@ if (_show) then { _genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_LOST_BLOOD", [1, 0.1, 0.1, 1]]; }; - if (((_target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]) select GVAR(currentSelectedSelectionN)) > 0) then { + if (((_target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]) select _selectionN) > 0) then { _genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_TOURNIQUET_APPLIED", [0.77, 0.51, 0.08, 1]]; }; if (_target getvariable[QGVAR(hasPain), false]) then { @@ -192,7 +194,7 @@ if (_show) then { (_display displayCtrl 303) ctrlSetText (_triageStatus select 0); (_display displayCtrl 303) ctrlSetBackgroundColor (_triageStatus select 2); - }, 0, [_target]] call CBA_fnc_addPerFrameHandler; + }, 0, [_target, GVAR(currentSelectedSelectionN)]] call CBA_fnc_addPerFrameHandler; } else { ("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; diff --git a/addons/medical/functions/fnc_displayTriageCard.sqf b/addons/medical/functions/fnc_displayTriageCard.sqf index c6e59fead2..5feb209b44 100644 --- a/addons/medical/functions/fnc_displayTriageCard.sqf +++ b/addons/medical/functions/fnc_displayTriageCard.sqf @@ -16,7 +16,6 @@ private ["_target", "_show"]; _target = _this select 0; _show = if (count _this > 1) then {_this select 1} else {true}; -GVAR(currentSelectedSelectionN) = if (count _this > 2) then {_this select 2} else {0}; GVAR(TriageCardTarget) = if (_show) then {_target} else {ObjNull}; diff --git a/addons/medical/functions/fnc_dropDownTriageCard.sqf b/addons/medical/functions/fnc_dropDownTriageCard.sqf index 5e763822db..6ea910b7af 100644 --- a/addons/medical/functions/fnc_dropDownTriageCard.sqf +++ b/addons/medical/functions/fnc_dropDownTriageCard.sqf @@ -22,11 +22,11 @@ if (isnil "_display") exitwith {}; _pos = [0,0,0,0]; if (_show) then { - _pos = ctrlPosition (_display displayCtrl 2001); + _pos = ctrlPosition (_display displayCtrl 2001); }; for "_idc" from 2002 to 2006 step 1 do { - _pos set [1, (_pos select 1) + (_pos select 3)]; - _ctrl = (_display displayCtrl _idc); - _ctrl ctrlSetPosition _pos; - _ctrl ctrlCommit 0; + _pos set [1, (_pos select 1) + (_pos select 3)]; + _ctrl = (_display displayCtrl _idc); + _ctrl ctrlSetPosition _pos; + _ctrl ctrlCommit 0; }; diff --git a/addons/medical/functions/fnc_handleBandageOpening.sqf b/addons/medical/functions/fnc_handleBandageOpening.sqf index eb35b3e8c5..b4e40984ae 100644 --- a/addons/medical/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical/functions/fnc_handleBandageOpening.sqf @@ -38,81 +38,81 @@ _reopeningMaxDelay = 200; _config = (ConfigFile >> "ACE_Medical_Advanced" >> "Treatment" >> "Bandaging"); if (isClass (_config >> _bandage)) then { _config = (_config >> _bandage); - _reopeningChance = getNumber (_config >> "reopeningChance"); - _reopeningMinDelay = getNumber (_config >> "reopeningMinDelay"); - _reopeningMaxDelay = getNumber (_config >> "reopeningMaxDelay") max _reopeningMinDelay; + _reopeningChance = getNumber (_config >> "reopeningChance"); + _reopeningMinDelay = getNumber (_config >> "reopeningMinDelay"); + _reopeningMaxDelay = getNumber (_config >> "reopeningMaxDelay") max _reopeningMinDelay; }; if (isClass (_config >> _className)) then { _woundTreatmentConfig = (_config >> _className); if (isNumber (_woundTreatmentConfig >> "reopeningChance")) then { - _reopeningChance = getNumber (_woundTreatmentConfig >> "reopeningChance"); - }; + _reopeningChance = getNumber (_woundTreatmentConfig >> "reopeningChance"); + }; if (isNumber (_woundTreatmentConfig >> "reopeningMinDelay")) then { - _reopeningMinDelay = getNumber (_woundTreatmentConfig >> "reopeningMinDelay"); - }; + _reopeningMinDelay = getNumber (_woundTreatmentConfig >> "reopeningMinDelay"); + }; if (isNumber (_woundTreatmentConfig >> "reopeningMaxDelay")) then { - _reopeningMaxDelay = getNumber (_woundTreatmentConfig >> "reopeningMaxDelay") max _reopeningMinDelay; - }; + _reopeningMaxDelay = getNumber (_woundTreatmentConfig >> "reopeningMaxDelay") max _reopeningMinDelay; + }; }; _bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []]; _exist = false; _injuryId = _injury select 0; { - if ((_x select 0) == _injuryId) exitwith { - _exist = true; - _existingInjury = _x; - _existingInjury set [3, (_existingInjury select 3) + _impact]; - _bandagedWounds set [_foreachIndex, _existingInjury]; - }; + if ((_x select 0) == _injuryId) exitwith { + _exist = true; + _existingInjury = _x; + _existingInjury set [3, (_existingInjury select 3) + _impact]; + _bandagedWounds set [_foreachIndex, _existingInjury]; + }; }foreach _bandagedWounds; if !(_exist) then { - // [ID, classID, bodypart, percentage treated, bloodloss rate] - _bandagedWounds pushback [_injuryId, _injury select 1, _injury select 2, _impact, _injury select 4]; + // [ID, classID, bodypart, percentage treated, bloodloss rate] + _bandagedWounds pushback [_injuryId, _injury select 1, _injury select 2, _impact, _injury select 4]; }; _target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; // Check if we are ever going to reopen this if (random(1) <= _reopeningChance) then { - _delay = _reopeningMinDelay + random(_reopeningMaxDelay - _reopeningMinDelay); - [{ - private ["_target", "_impact", "_part", "_injuryIndex", "_bandage", "_injury", "_openWounds", "_selectedInjury","_bandagedWounds","_exist"]; - _target = _this select 0; - _impact = _this select 1; - _part = _this select 2; - _injuryIndex = _this select 3; - _injury = _this select 4; + _delay = _reopeningMinDelay + random(_reopeningMaxDelay - _reopeningMinDelay); + [{ + private ["_target", "_impact", "_part", "_injuryIndex", "_bandage", "_injury", "_openWounds", "_selectedInjury","_bandagedWounds","_exist"]; + _target = _this select 0; + _impact = _this select 1; + _part = _this select 2; + _injuryIndex = _this select 3; + _injury = _this select 4; - if (alive _target) then { - _openWounds = _target getvariable [QGVAR(openWounds), []]; - if ((count _openWounds)-1 < _injuryIndex) exitwith {}; - _selectedInjury = _openWounds select _injuryIndex; - if (_selectedInjury select 0 == _injury select 0) then { // matching the IDs - _selectedInjury set [3, (_selectedInjury select 3) + _impact]; - _openWounds set [_injuryIndex, _selectedInjury]; - _target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; - if (USE_WOUND_EVENT_SYNC) then { - ["medical_propagateWound", [_target, _selectedInjury]] call EFUNC(common,globalEvent); - }; - _bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []]; - _exist = false; - _injuryId = _injury select 0; - { - if ((_x select 0) == _injuryId) exitwith { - _exist = true; - _existingInjury = _x; - _existingInjury set [3, ((_existingInjury select 3) - _impact) max 0]; - _bandagedWounds set [_foreachIndex, _existingInjury]; - }; - }foreach _bandagedWounds; + if (alive _target) then { + _openWounds = _target getvariable [QGVAR(openWounds), []]; + if ((count _openWounds)-1 < _injuryIndex) exitwith {}; + _selectedInjury = _openWounds select _injuryIndex; + if (_selectedInjury select 0 == _injury select 0) then { // matching the IDs + _selectedInjury set [3, (_selectedInjury select 3) + _impact]; + _openWounds set [_injuryIndex, _selectedInjury]; + _target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; + if (USE_WOUND_EVENT_SYNC) then { + ["medical_propagateWound", [_target, _selectedInjury]] call EFUNC(common,globalEvent); + }; + _bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []]; + _exist = false; + _injuryId = _injury select 0; + { + if ((_x select 0) == _injuryId) exitwith { + _exist = true; + _existingInjury = _x; + _existingInjury set [3, ((_existingInjury select 3) - _impact) max 0]; + _bandagedWounds set [_foreachIndex, _existingInjury]; + }; + }foreach _bandagedWounds; - if (_exist) then { - _target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; - }; - }; - // Otherwise something went wrong, we we don't reopen them.. - }; - }, [_target, _impact, _part, _injuryIndex, _injury], _delay, 0] call EFUNC(common,waitAndExecute); + if (_exist) then { + _target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; + }; + }; + // Otherwise something went wrong, we we don't reopen them.. + }; + }, [_target, _impact, _part, _injuryIndex, _injury], _delay, 0] call EFUNC(common,waitAndExecute); }; diff --git a/addons/medical/functions/fnc_handleKilled.sqf b/addons/medical/functions/fnc_handleKilled.sqf index 1a602bd702..ce0f087836 100644 --- a/addons/medical/functions/fnc_handleKilled.sqf +++ b/addons/medical/functions/fnc_handleKilled.sqf @@ -24,9 +24,9 @@ if (GVAR(level) >= 2) then { _unit setvariable [QGVAR(airwayStatus), 0]; if (USE_WOUND_EVENT_SYNC) then { - _openWounds = _unit getvariable [QGVAR(openWounds), []]; - { - ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); - }foreach _openWounds; - }; + _openWounds = _unit getvariable [QGVAR(openWounds), []]; + { + ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); + }foreach _openWounds; + }; }; diff --git a/addons/medical/functions/fnc_isInMedicalVehicle.sqf b/addons/medical/functions/fnc_isInMedicalVehicle.sqf index e610a5cf3f..cffc24410d 100644 --- a/addons/medical/functions/fnc_isInMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_isInMedicalVehicle.sqf @@ -11,6 +11,8 @@ * Public: Yes */ +#include "script_component.hpp" + private ["_unit", "_vehicle"]; _unit = _this select 0; @@ -19,5 +21,4 @@ _vehicle = vehicle _unit; if (_unit == _vehicle) exitWith {false}; if (_unit in [driver _vehicle, gunner _vehicle, commander _vehicle]) exitWith {false}; -// @todo: variable names standard? _vehicle getVariable [QGVAR(isMedic), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant") == 1] diff --git a/addons/medical/functions/fnc_isMedicalVehicle.sqf b/addons/medical/functions/fnc_isMedicalVehicle.sqf index bf13c51a6a..7be406e556 100644 --- a/addons/medical/functions/fnc_isMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_isMedicalVehicle.sqf @@ -12,8 +12,7 @@ */ #include "script_component.hpp" -private ["_veh"]; -_veh = _this select 0; +private ["_vehicle"]; +_vehicle = _this select 0; -if !(_veh getvariable [QGVAR(isMedicalVehicle), true]) exitwith {false}; // exit in case the false is set. -((getNumber(configFile >> "CfgVehicles" >> typeOf _veh >> QGVAR(isMedicalVehicle)) == 1) || (_veh getvariable [QGVAR(isMedicalVehicle), false])); +_vehicle getVariable [QGVAR(isMedic), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant") == 1] diff --git a/addons/medical/functions/fnc_moduleTreatmentConfiguration.sqf b/addons/medical/functions/fnc_moduleTreatmentConfiguration.sqf index 6ae3f7eeb8..5d88fa0f0a 100644 --- a/addons/medical/functions/fnc_moduleTreatmentConfiguration.sqf +++ b/addons/medical/functions/fnc_moduleTreatmentConfiguration.sqf @@ -32,3 +32,5 @@ if !(_activated) exitWith {}; [_logic, QGVAR(medicSetting_SurgicalKit), "medicSetting_SurgicalKit"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(consumeItem_PAK), "consumeItem_PAK"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(consumeItem_SurgicalKit), "consumeItem_SurgicalKit"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(useLocation_PAK), "useLocation_PAK"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(useLocation_SurgicalKit), "useLocation_SurgicalKit"] call EFUNC(common,readSettingFromModule); diff --git a/addons/medical/functions/fnc_onCarryObjectDropped.sqf b/addons/medical/functions/fnc_onCarryObjectDropped.sqf index 8f6dd57310..6a6a990d53 100644 --- a/addons/medical/functions/fnc_onCarryObjectDropped.sqf +++ b/addons/medical/functions/fnc_onCarryObjectDropped.sqf @@ -33,7 +33,7 @@ if (_carrying >= 0) then { _target setvariable [QGVAR(hasCopy), nil, true]; }; - _caller setvariable [QGVAR(isCarrying), -1, true]; + _caller setvariable [QGVAR(isCarrying), -1, true]; if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; }; diff --git a/addons/medical/functions/fnc_onWoundUpdateRequest.sqf b/addons/medical/functions/fnc_onWoundUpdateRequest.sqf index a32288d0a6..c160e47ea0 100644 --- a/addons/medical/functions/fnc_onWoundUpdateRequest.sqf +++ b/addons/medical/functions/fnc_onWoundUpdateRequest.sqf @@ -20,8 +20,8 @@ _lastId = _this select 1; _originOfrequest = _this select 2; if (local _unit) then { - _openWounds = _unit getvariable [QGVAR(openWounds), []]; - { - ["medical_propagateWound", [_originOfrequest], [_unit, _x]] call EFUNC(common,targetEvent); - }foreach _openWounds; + _openWounds = _unit getvariable [QGVAR(openWounds), []]; + { + ["medical_propagateWound", [_originOfrequest], [_unit, _x]] call EFUNC(common,targetEvent); + }foreach _openWounds; }; diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index 9e68d2c3e3..dcd3f98f05 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -37,7 +37,6 @@ if (!local _unit) exitwith { _unit setvariable ["ACE_isUnconscious", true, true]; _unit setUnconscious true; -// @todo: mute player? if (_unit == ACE_player) then { if (visibleMap) then {openMap false}; closeDialog 0; diff --git a/addons/medical/functions/fnc_treatment.sqf b/addons/medical/functions/fnc_treatment.sqf index d3b849b3cd..e010279be1 100644 --- a/addons/medical/functions/fnc_treatment.sqf +++ b/addons/medical/functions/fnc_treatment.sqf @@ -77,10 +77,26 @@ if (!_return) exitwith {false}; if ("All" in _locations) then { _return = true; } else { + private [ "_medFacility", "_medVeh"]; + _medFacility = {([_caller] call FUNC(isInMedicalFacility)) || ([_target] call FUNC(isInMedicalFacility))}; + _medVeh = {([_caller] call FUNC(isInMedicalVehicle)) || ([_target] call FUNC(isInMedicalVehicle))}; + { if (_x == "field") exitwith {_return = true;}; - if (_x == "MedicalFacility" && {([_caller] call FUNC(isInMedicalFacility)) || ([_target] call FUNC(isInMedicalFacility))}) exitwith {_return = true;}; - if (_x == "MedicalVehicle" && {([vehicle _caller] call FUNC(isMedicalVehicle)) || ([vehicle _target] call FUNC(isMedicalVehicle))}) exitwith {_return = true;}; + if (_x == "MedicalFacility" && _medFacility) exitwith {_return = true;}; + if (_x == "MedicalVehicle" && _medVeh) exitwith {_return = true;}; + if !(isnil _x) exitwith { + private "_val"; + _val = missionNamespace getvariable _x; + if (typeName _val == "SCALAR") then { + _return = switch (_val) do { + case 0: {true}; + case 1: _medVeh; + case 2: _medFacility; + case 3: {call _medFacility || call _medVeh}; + }; + }; + }; }foreach _locations; }; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf index 6584569227..b08057f615 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf @@ -27,7 +27,7 @@ _items = _this select 4; _specificSpot = if (count _this > 6) then {_this select 6} else {-1}; if !([_target] call FUNC(hasMedicalEnabled)) exitwith { - _this call FUNC(treatmentBasic_bandage); + _this call FUNC(treatmentBasic_bandage); }; [[_target, _className, _selectionName, _specificSpot], QUOTE(DFUNC(treatmentAdvanced_bandageLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf index ead2bf9d52..bdfb95fb2a 100644 --- a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf @@ -24,5 +24,5 @@ _className = _this select 3; [_target, false] call FUNC(setUnconscious); if (_target getvariable [QGVAR(inReviveState), false]) then { - _target setvariable [QGVAR(inReviveState), nil, true]; + _target setvariable [QGVAR(inReviveState), nil, true]; }; diff --git a/addons/medical/functions/fnc_treatmentIVLocal.sqf b/addons/medical/functions/fnc_treatmentIVLocal.sqf index b0b5ce6a7f..66ecdf9d90 100644 --- a/addons/medical/functions/fnc_treatmentIVLocal.sqf +++ b/addons/medical/functions/fnc_treatmentIVLocal.sqf @@ -37,6 +37,6 @@ _varName = format["ACE_Medical_IVVolume_%1",_typeOf]; _target setvariable [_varName, (_target getvariable [_varName, 0]) + _volumeAdded, true]; if !(_varName in GVAR(IVBags)) then { - GVAR(IVBags) pushback _varName; - publicVariable QGVAR(IVBags); + GVAR(IVBags) pushback _varName; + publicVariable QGVAR(IVBags); }; diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index 1a22e191fd..d4f853374c 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -30,12 +30,12 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; }; if (vehicle _caller == _caller) then { - [_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation); + [_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation); }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; { - (_x select 0) addItem (_x select 1); + (_x select 0) addItem (_x select 1); }foreach _usersOfItems; // Record specific callback diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index 85cfbf7e52..5910a4be86 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -28,7 +28,7 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; }; if (vehicle _caller == _caller) then { - [_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation); + [_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation); }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 0243ab5222..70506fa3e0 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -30,9 +30,6 @@ Injetar Morfina Inietta Morfina
- - Inject Atropine - Transfuse Blood Bluttransfusion diff --git a/addons/missionmodules/CfgVehicles.hpp b/addons/missionmodules/CfgVehicles.hpp index a38d651c75..6a1dc71705 100644 --- a/addons/missionmodules/CfgVehicles.hpp +++ b/addons/missionmodules/CfgVehicles.hpp @@ -1,68 +1,68 @@ class CfgVehicles { - class Logic; - class Module_F: Logic { - class ArgumentsBaseUnits { - }; - }; + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; - // TODO make a curator variant for this - class ACE_moduleAmbianceSound: Module_F { - scope = 2; - displayName = "Ambiance Sounds [ACE]"; - icon = QUOTE(PATHTOF(UI\Icon_Module_Ambient_Sounds_ca.paa)); - category = "ACE_missionModules"; - function = QUOTE(FUNC(moduleAmbianceSound)); - functionPriority = 1; - isGlobal = 1; - isTriggerActivated = 0; - author = "$STR_ACE_Common_ACETeam"; - class Arguments { - class soundFiles { - displayName = "Sounds"; - description = "Classnames of the ambiance sounds played. Seperated by ','. "; - typeName = "STRING"; - defaultValue = ""; - }; - class minimalDistance { - displayName = "Minimal Distance"; - description = "Minimal Distance"; - typeName = "NUMBER"; - defaultValue = 400; - }; - class maximalDistance { - displayName = "Maximal Distance"; - description = "Maximal Distance"; - typeName = "NUMBER"; - defaultValue = 900; - }; - class minimalDelay { - displayName = "Minimal Delay"; - description = "Minimal Delay between sounds played"; - typeName = "NUMBER"; - defaultValue = 10; - }; - class maximalDelay { - displayName = "Maximal Delay"; - description = "Maximal Delay between sounds played"; - typeName = "NUMBER"; - defaultValue = 170; - }; - class followPlayers { - displayName = "Follow Players"; - description = "Follow players. If set to false, loop will play sounds only nearby logic position."; - typeName = "BOOL"; - defaultValue = 0; - }; - class soundVolume { - displayName = "Volume"; - description = "The volume of the sounds played"; - typeName = "NUMBER"; - defaultValue = 1; - }; - }; - class ModuleDescription { - description = "Ambiance sounds loop (synced across MP)"; - sync[] = {}; - }; - }; + // TODO make a curator variant for this + class ACE_moduleAmbianceSound: Module_F { + scope = 2; + displayName = "Ambiance Sounds [ACE]"; + icon = QUOTE(PATHTOF(UI\Icon_Module_Ambient_Sounds_ca.paa)); + category = "ACE_missionModules"; + function = QUOTE(FUNC(moduleAmbianceSound)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "$STR_ACE_Common_ACETeam"; + class Arguments { + class soundFiles { + displayName = "Sounds"; + description = "Classnames of the ambiance sounds played. Seperated by ','. "; + typeName = "STRING"; + defaultValue = ""; + }; + class minimalDistance { + displayName = "Minimal Distance"; + description = "Minimal Distance"; + typeName = "NUMBER"; + defaultValue = 400; + }; + class maximalDistance { + displayName = "Maximal Distance"; + description = "Maximal Distance"; + typeName = "NUMBER"; + defaultValue = 900; + }; + class minimalDelay { + displayName = "Minimal Delay"; + description = "Minimal Delay between sounds played"; + typeName = "NUMBER"; + defaultValue = 10; + }; + class maximalDelay { + displayName = "Maximal Delay"; + description = "Maximal Delay between sounds played"; + typeName = "NUMBER"; + defaultValue = 170; + }; + class followPlayers { + displayName = "Follow Players"; + description = "Follow players. If set to false, loop will play sounds only nearby logic position."; + typeName = "BOOL"; + defaultValue = 0; + }; + class soundVolume { + displayName = "Volume"; + description = "The volume of the sounds played"; + typeName = "NUMBER"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = "Ambiance sounds loop (synced across MP)"; + sync[] = {}; + }; + }; }; diff --git a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf index 943d795b7a..c02d19aa5f 100644 --- a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf +++ b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf @@ -25,99 +25,99 @@ _activated = [_this,2,true,[true]] call BIS_fnc_param; // We only play this on the locality of the logic, since the sounds are broadcasted across the network if (_activated && local _logic) then { - _ambianceSounds = []; - _unparsedSounds = _logic getvariable ["soundFiles", ""]; - _minimalDistance = (_logic getvariable ["minimalDistance", 400]) max 1; - _maximalDistance = (_logic getvariable ["maximalDistance", 10]) max _minimalDistance; - _minDelayBetweensounds = (_logic getvariable ["minimalDelay", 10]) max 1; - _maxDelayBetweenSounds = (_logic getvariable ["maximalDelay", 170]) max _minDelayBetweensounds; - _volume = (_logic getvariable ["soundVolume", 30]) max 1; - _followPlayers = _logic getvariable ["followPlayers", false]; + _ambianceSounds = []; + _unparsedSounds = _logic getvariable ["soundFiles", ""]; + _minimalDistance = (_logic getvariable ["minimalDistance", 400]) max 1; + _maximalDistance = (_logic getvariable ["maximalDistance", 10]) max _minimalDistance; + _minDelayBetweensounds = (_logic getvariable ["minimalDelay", 10]) max 1; + _maxDelayBetweenSounds = (_logic getvariable ["maximalDelay", 170]) max _minDelayBetweensounds; + _volume = (_logic getvariable ["soundVolume", 30]) max 1; + _followPlayers = _logic getvariable ["followPlayers", false]; - _splittedList = [_unparsedSounds, ","] call BIS_fnc_splitString; + _splittedList = [_unparsedSounds, ","] call BIS_fnc_splitString; - _nilCheckPassedList = ""; - { - _x = [_x] call EFUNC(common,string_removeWhiteSpace); - _splittedList set [_foreachIndex, _x]; - }foreach _splittedList; + _nilCheckPassedList = ""; + { + _x = [_x] call EFUNC(common,string_removeWhiteSpace); + _splittedList set [_foreachIndex, _x]; + }foreach _splittedList; - _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; - { - if (isclass (missionConfigFile >> "CfgSounds" >> _x)) then { - _ambianceSounds pushback (_soundPath + (getArray(missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0)); - } else { - if (isclass (configFile >> "CfgSounds" >> _x)) then { - _ambianceSounds pushback ((getArray(configFile >> "CfgSounds" >> _x >> "sound") select 0)); - }; - }; - }foreach _splittedList; + _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; + { + if (isclass (missionConfigFile >> "CfgSounds" >> _x)) then { + _ambianceSounds pushback (_soundPath + (getArray(missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0)); + } else { + if (isclass (configFile >> "CfgSounds" >> _x)) then { + _ambianceSounds pushback ((getArray(configFile >> "CfgSounds" >> _x >> "sound") select 0)); + }; + }; + }foreach _splittedList; - if (count _ambianceSounds == 0) exitwith {}; - { - if !([".", _x, true] call BIS_fnc_inString) then { - _ambianceSounds set [_foreachIndex, _x + ".wss"]; - }; - }foreach _ambianceSounds; + if (count _ambianceSounds == 0) exitwith {}; + { + if !([".", _x, true] call BIS_fnc_inString) then { + _ambianceSounds set [_foreachIndex, _x + ".wss"]; + }; + }foreach _ambianceSounds; - [{ - private ["_args", "_logic", "_ambianceSounds", "_minimalDistance", "_maximalDistance", "_minDelayBetweensounds", "_maxDelayBetweenSounds", "_volume", "_followPlayers","_lastTimePlayed", "_newPos"]; - _args = _this select 0; - _logic = _args select 0; - _minDelayBetweensounds = _args select 4; - _maxDelayBetweenSounds = _args select 5; - _lastTimePlayed = _args select 8; + [{ + private ["_args", "_logic", "_ambianceSounds", "_minimalDistance", "_maximalDistance", "_minDelayBetweensounds", "_maxDelayBetweenSounds", "_volume", "_followPlayers","_lastTimePlayed", "_newPos"]; + _args = _this select 0; + _logic = _args select 0; + _minDelayBetweensounds = _args select 4; + _maxDelayBetweenSounds = _args select 5; + _lastTimePlayed = _args select 8; - if (!alive _logic) exitwith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; + if (!alive _logic) exitwith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; - if (time - _lastTimePlayed >= ((_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds)) then { - _ambianceSounds = _args select 1; - _minimalDistance = _args select 2; - _maximalDistance = _args select 3; + if (time - _lastTimePlayed >= ((_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds)) then { + _ambianceSounds = _args select 1; + _minimalDistance = _args select 2; + _maximalDistance = _args select 3; - _volume = _args select 6; - _followPlayers = _args select 7; + _volume = _args select 6; + _followPlayers = _args select 7; - // Find all players in session. - _allUnits = if (isMultiplayer) then {playableUnits} else {[ACE_player]}; + // Find all players in session. + _allUnits = if (isMultiplayer) then {playableUnits} else {[ACE_player]}; - // Check if there are enough players to even start playing this sound. - if (count _allUnits > 0) then { + // Check if there are enough players to even start playing this sound. + if (count _allUnits > 0) then { - // Select a target unit at random. - _targetUnit = _allUnits select (round(random((count _allUnits)-1))); + // Select a target unit at random. + _targetUnit = _allUnits select (round(random((count _allUnits)-1))); - // find the position from which we are going to play this sound from. - _newPos = (getPos _targetUnit); - if (!_followPlayers) then { - _newPos = getPos _logic; - }; + // find the position from which we are going to play this sound from. + _newPos = (getPos _targetUnit); + if (!_followPlayers) then { + _newPos = getPos _logic; + }; - // Randomize this position. - if (random(1) >= 0.5) then { - if (random(1) >= 0.5) then { - _newPos set [0, (_newPos select 0) + (_minimalDistance + random(_maximalDistance))]; - } else { - _newPos set [0, (_newPos select 0) - (_minimalDistance + random(_maximalDistance))]; - }; - } else { - if (random(1) >= 0.5) then { - _newPos set [1, (_newPos select 1) + (_minimalDistance + random(_maximalDistance))]; - } else { - _newPos set [1, (_newPos select 1) - (_minimalDistance + random(_maximalDistance))]; - }; - }; + // Randomize this position. + if (random(1) >= 0.5) then { + if (random(1) >= 0.5) then { + _newPos set [0, (_newPos select 0) + (_minimalDistance + random(_maximalDistance))]; + } else { + _newPos set [0, (_newPos select 0) - (_minimalDistance + random(_maximalDistance))]; + }; + } else { + if (random(1) >= 0.5) then { + _newPos set [1, (_newPos select 1) + (_minimalDistance + random(_maximalDistance))]; + } else { + _newPos set [1, (_newPos select 1) - (_minimalDistance + random(_maximalDistance))]; + }; + }; - // If no unit is to close to this position, we will play the sound. - if ({(_newPos distance _x < (_minimalDistance / 2))}count _allUnits == 0) then { - playSound3D [_ambianceSounds select (round(random((count _ambianceSounds)-1))), ObjNull, false, _newPos, _volume, 1, 1000]; - _args set [8, time]; - }; - }; - }; - }, 0.1, [_logic, _ambianceSounds, _minimalDistance, _maximalDistance, _minDelayBetweensounds, _maxDelayBetweenSounds, _volume, _followPlayers, time] ] call cba_fnc_addPerFrameHandler; + // If no unit is to close to this position, we will play the sound. + if ({(_newPos distance _x < (_minimalDistance / 2))}count _allUnits == 0) then { + playSound3D [_ambianceSounds select (round(random((count _ambianceSounds)-1))), ObjNull, false, _newPos, _volume, 1, 1000]; + _args set [8, time]; + }; + }; + }; + }, 0.1, [_logic, _ambianceSounds, _minimalDistance, _maximalDistance, _minDelayBetweensounds, _maxDelayBetweenSounds, _volume, _followPlayers, time] ] call cba_fnc_addPerFrameHandler; }; true; diff --git a/addons/optionsmenu/functions/fnc_exportSettings.sqf b/addons/optionsmenu/functions/fnc_exportSettings.sqf index 9ef736ac1c..3ac2455a64 100644 --- a/addons/optionsmenu/functions/fnc_exportSettings.sqf +++ b/addons/optionsmenu/functions/fnc_exportSettings.sqf @@ -44,7 +44,7 @@ _compiledConfig = " _value = format['"%1"', _value]; }; if (_typeName == "BOOL") then { - _value = if (typeOf _value == "BOOL" && {_value}) then {1} else {0}; + _value = if (typeName _value == "BOOL" && {_value}) then {1} else {0}; }; _compiledConfigEntry = format [" class %1 { diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf index 66f803b1f2..3a4c6ec561 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -16,10 +16,6 @@ #include "script_component.hpp" -if (isMultiplayer /* || !(GVAR(allowServerConfigGeneration))*/) exitwith { - closeDialog 0; -}; - // Filter only user setable setting GVAR(clientSideOptions) = []; GVAR(clientSideColors) = []; diff --git a/addons/overheating/script_component.hpp b/addons/overheating/script_component.hpp index d7ce7d2d3b..46a31e6ea3 100644 --- a/addons/overheating/script_component.hpp +++ b/addons/overheating/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_OVERHEATING - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_OVERHEATING - #define DEBUG_SETTINGS DEBUG_SETTINGS_OVERHEATING + #define DEBUG_SETTINGS DEBUG_SETTINGS_OVERHEATING #endif #include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/overpressure/script_component.hpp b/addons/overpressure/script_component.hpp index 8dac72cbbf..21f4cea704 100644 --- a/addons/overpressure/script_component.hpp +++ b/addons/overpressure/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_OVERPRESSURE - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_ENABLED_OVERPRESSURE - #define DEBUG_SETTINGS DEBUG_ENABLED_OVERPRESSURE + #define DEBUG_SETTINGS DEBUG_ENABLED_OVERPRESSURE #endif #include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/parachute/CfgVehicles.hpp b/addons/parachute/CfgVehicles.hpp index 2d8545a607..04732d0506 100644 --- a/addons/parachute/CfgVehicles.hpp +++ b/addons/parachute/CfgVehicles.hpp @@ -20,9 +20,9 @@ class CfgVehicles { author = "$STR_ACE_Common_ACETeam"; scope = 2; displayName = "$STR_ACE_Parachute_NonSteerableParachute"; - //picture = "\A3\Characters_F\data\ui\icon_b_parachute_ca.paa"; // @todo - //model = "\A3\Weapons_F\Ammoboxes\Bags\Backpack_Parachute"; // @todo - // backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable //Bis broke this in 1.40 + //picture = "\A3\Characters_F\data\ui\icon_b_parachute_ca.paa"; // @todo + //model = "\A3\Weapons_F\Ammoboxes\Bags\Backpack_Parachute"; // @todo + // backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable //Bis broke this in 1.40 ParachuteClass = "NonSteerable_Parachute_F"; maximumLoad = 0; mass = 100; diff --git a/addons/parachute/RscTitles.hpp b/addons/parachute/RscTitles.hpp index d51bcad128..c6f41a7362 100644 --- a/addons/parachute/RscTitles.hpp +++ b/addons/parachute/RscTitles.hpp @@ -1,51 +1,51 @@ class RscText; class RscPicture; class RscTitles { - class ACE_Altimeter { - idd = 9935; - enableSimulation = 1; - movingEnable = 0; - fadeIn=0; - fadeOut=1; - duration = 10e10; - onLoad = "uiNamespace setVariable ['ACE_Altimeter', _this select 0];"; - class controls { - class AltimeterImage: RscPicture { - idc = 1200; - text = PATHTOF(UI\watch_altimeter.paa); - 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; - 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; - colorText[] = {0,0,0,1}; - }; - class TimeText: RscText { - idc = 1001; - text = "00:00"; - x = 0.206094 * safezoneW + safezoneX; - y = 0.819 * safezoneH + safezoneY; - w = 0.0309375 * safezoneW; - h = 0.022 * safezoneH; - colorText[] = {0,0,0,1}; - }; - }; - }; + class ACE_Altimeter { + idd = 9935; + enableSimulation = 1; + movingEnable = 0; + fadeIn=0; + fadeOut=1; + duration = 10e10; + onLoad = "uiNamespace setVariable ['ACE_Altimeter', _this select 0];"; + class controls { + class AltimeterImage: RscPicture { + idc = 1200; + text = PATHTOF(UI\watch_altimeter.paa); + 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; + 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; + colorText[] = {0,0,0,1}; + }; + class TimeText: RscText { + idc = 1001; + text = "00:00"; + x = 0.206094 * safezoneW + safezoneX; + y = 0.819 * safezoneH + safezoneY; + w = 0.0309375 * safezoneW; + h = 0.022 * safezoneH; + colorText[] = {0,0,0,1}; + }; + }; + }; }; diff --git a/addons/parachute/functions/fnc_doLanding.sqf b/addons/parachute/functions/fnc_doLanding.sqf index 134ab8a3ea..126a3b0720 100644 --- a/addons/parachute/functions/fnc_doLanding.sqf +++ b/addons/parachute/functions/fnc_doLanding.sqf @@ -19,8 +19,8 @@ _unit = _this select 0; GVAR(PFH) = false; [_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call EFUNC(common,doAnimation); [{ - if (time >= ((_this select 0) select 0) + 1) then { - ((_this select 0) select 1) playActionNow "Crouch"; - [(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler); - }; + if (time >= ((_this select 0) select 0) + 1) then { + ((_this select 0) select 1) playActionNow "Crouch"; + [(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler); + }; }, 1, [time,_unit]] call CALLSTACK(cba_fnc_addPerFrameHandler); diff --git a/addons/parachute/functions/fnc_onEachFrame.sqf b/addons/parachute/functions/fnc_onEachFrame.sqf index be9f0e000c..dbfab16452 100644 --- a/addons/parachute/functions/fnc_onEachFrame.sqf +++ b/addons/parachute/functions/fnc_onEachFrame.sqf @@ -25,9 +25,9 @@ private ["_pos"]; _pos = getPosASL (vehicle _player); if ((lineIntersects [_pos, _pos vectorAdd [0,0,-0.5], vehicle _player, _player]) || {((ASLtoATL _pos) select 2) < 0.75}) then { - [(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(PFH) = false; + [(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(PFH) = false; // I believe this will not work for Zeus units. - deleteVehicle (vehicle _player); - [_player] call FUNC(doLanding); + deleteVehicle (vehicle _player); + [_player] call FUNC(doLanding); }; diff --git a/addons/parachute/functions/fnc_showAltimeter.sqf b/addons/parachute/functions/fnc_showAltimeter.sqf index 8e3c3d83e3..a8200fb2ca 100644 --- a/addons/parachute/functions/fnc_showAltimeter.sqf +++ b/addons/parachute/functions/fnc_showAltimeter.sqf @@ -21,26 +21,26 @@ if (isNull (uiNamespace getVariable ["ACE_Altimeter", displayNull])) exitWith {} GVAR(AltimeterActive) = true; [{ - if (!GVAR(AltimeterActive)) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler);}; - disableSerialization; - EXPLODE_4_PVT(_this select 0,_display,_unit,_oldHeight,_prevTime); - if !("ACE_Altimeter" in assignedItems _unit) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler);call FUNC(hideAltimeter);}; + if (!GVAR(AltimeterActive)) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler);}; + disableSerialization; + EXPLODE_4_PVT(_this select 0,_display,_unit,_oldHeight,_prevTime); + if !("ACE_Altimeter" in assignedItems _unit) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler);call FUNC(hideAltimeter);}; - private ["_height", "_hour", "_minute", "_descentRate","_HeightText", "_DecendRate", "_TimeText", "_curTime"]; - _HeightText = _display displayCtrl 1100; - _DecendRate = _display displayCtrl 1000; - _TimeText = _display displayCtrl 1001; - _hour = floor daytime; - _minute = floor ((daytime - _hour) * 60); + private ["_height", "_hour", "_minute", "_descentRate","_HeightText", "_DecendRate", "_TimeText", "_curTime"]; + _HeightText = _display displayCtrl 1100; + _DecendRate = _display displayCtrl 1000; + _TimeText = _display displayCtrl 1001; + _hour = floor daytime; + _minute = floor ((daytime - _hour) * 60); - _height = (getPosASL _unit) select 2; - _curTime = time; - _descentRate = floor ((_oldHeight - _height) / (_curTime - _prevTime)); + _height = (getPosASL _unit) select 2; + _curTime = time; + _descentRate = floor ((_oldHeight - _height) / (_curTime - _prevTime)); - _TimeText ctrlSetText (format ["%1:%2",[_hour, 2] call EFUNC(common,numberToDigitsString),[_minute, 2] call EFUNC(common,numberToDigitsString)]); - _HeightText ctrlSetText (format ["%1", floor(_height)]); - _DecendRate ctrlSetText (format ["%1", _descentRate max 0]); + _TimeText ctrlSetText (format ["%1:%2",[_hour, 2] call EFUNC(common,numberToDigitsString),[_minute, 2] call EFUNC(common,numberToDigitsString)]); + _HeightText ctrlSetText (format ["%1", floor(_height)]); + _DecendRate ctrlSetText (format ["%1", _descentRate max 0]); - (_this select 0) set [2, _height]; - (_this select 0) set [3, _curTime]; + (_this select 0) set [2, _height]; + (_this select 0) set [3, _curTime]; }, 0.2, [uiNamespace getVariable ["ACE_Altimeter", displayNull], _unit,floor ((getPosASL _unit) select 2), time]] call CALLSTACK(cba_fnc_addPerFrameHandler); diff --git a/addons/resting/script_component.hpp b/addons/resting/script_component.hpp index f6d28bc482..8446cb9415 100644 --- a/addons/resting/script_component.hpp +++ b/addons/resting/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_RESTING - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_RESTING - #define DEBUG_SETTINGS DEBUG_SETTINGS_RESTING + #define DEBUG_SETTINGS DEBUG_SETTINGS_RESTING #endif #include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/safemode/script_component.hpp b/addons/safemode/script_component.hpp index f76396afdf..c68b265489 100644 --- a/addons/safemode/script_component.hpp +++ b/addons/safemode/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_SAFEMODE - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_SAFEMODE - #define DEBUG_SETTINGS DEBUG_SETTINGS_SAFEMODE + #define DEBUG_SETTINGS DEBUG_SETTINGS_SAFEMODE #endif #include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/smallarms/script_component.hpp b/addons/smallarms/script_component.hpp index d9c70ca5e6..589e59433f 100644 --- a/addons/smallarms/script_component.hpp +++ b/addons/smallarms/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_SMALLARMS - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_SMALLARMS - #define DEBUG_SETTINGS DEBUG_SETTINGS_SMALLARMS + #define DEBUG_SETTINGS DEBUG_SETTINGS_SMALLARMS #endif #include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/testmissions/script_component.hpp b/addons/testmissions/script_component.hpp index c6c629ff91..da17bfb7e2 100644 --- a/addons/testmissions/script_component.hpp +++ b/addons/testmissions/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_TESTMISSIONS - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_ENABLED_TESTMISSIONS - #define DEBUG_SETTINGS DEBUG_ENABLED_TESTMISSIONS + #define DEBUG_SETTINGS DEBUG_ENABLED_TESTMISSIONS #endif #include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/vector/XEH_preInit.sqf b/addons/vector/XEH_preInit.sqf index 21ca573118..fcae0f282b 100644 --- a/addons/vector/XEH_preInit.sqf +++ b/addons/vector/XEH_preInit.sqf @@ -18,7 +18,7 @@ PREP(getHeightDistance); PREP(getRelativeAzimuthDistance); PREP(getRelativeDistance); PREP(getRelativeHeightLength); -PREP(getFallOfShort); +PREP(getFallOfShot); PREP(showAzimuth); PREP(showAzimuthInclination); PREP(showHeightDistance); @@ -26,7 +26,7 @@ PREP(showDistance); PREP(showRelativeAzimuthDistance); PREP(showRelativeDistance); PREP(showRelativeHeightLength); -PREP(showFallOfShort); +PREP(showFallOfShot); PREP(showText); PREP(nextMode); PREP(adjustBrightness); diff --git a/addons/vector/functions/fnc_convertToTexturesFOS.sqf b/addons/vector/functions/fnc_convertToTexturesFOS.sqf index 2a93f93548..3ce09e3c6c 100644 --- a/addons/vector/functions/fnc_convertToTexturesFOS.sqf +++ b/addons/vector/functions/fnc_convertToTexturesFOS.sqf @@ -30,75 +30,6 @@ _digit4 = _number mod 10; switch (_coordinate) do { case 0 : { - if (_isNegative) then { - - if (_digit1 == 0) then { - if (_digit2 == 0) then { - if (_digit3 == 0) then { - _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); - _digit1 = ""; - _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; - _digit3 = ""; - _digit4 = ""; - } else { - _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); - _digit1 = ""; - _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; - _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; - _digit4 = ""; - }; - } else { - _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); - _digit1 = ""; - _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit2]; - _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; - _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; - }; - } else { - _digit0 = ""; - _digit1 = QUOTE(PATHTOF(rsc\vector_minus.paa)); - _digit2 = QUOTE(PATHTOF(rsc\vector_minus.paa)); - _digit3 = QUOTE(PATHTOF(rsc\vector_minus.paa)); - _digit4 = QUOTE(PATHTOF(rsc\vector_minus.paa)); - }; - - } else { - - if (_digit1 == 0) then { - if (_digit2 == 0) then { - if (_digit3 == 0) then { - _digit0 = QUOTE(PATHTOF(rsc\vector_a.paa)); - _digit1 = ""; - _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; - _digit3 = ""; - _digit4 = ""; - } else { - _digit0 = QUOTE(PATHTOF(rsc\vector_a.paa)); - _digit1 = ""; - _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; - _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; - _digit4 = ""; - }; - } else { - _digit0 = QUOTE(PATHTOF(rsc\vector_a.paa)); - _digit1 = ""; - _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit2]; - _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; - _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; - }; - } else { - _digit0 = ""; - _digit1 = QUOTE(PATHTOF(rsc\vector_minus.paa)); - _digit2 = QUOTE(PATHTOF(rsc\vector_minus.paa)); - _digit3 = QUOTE(PATHTOF(rsc\vector_minus.paa)); - _digit4 = QUOTE(PATHTOF(rsc\vector_minus.paa)); - }; - }; - - }; - - case 1 : { - if (_isNegative) then { if (_digit1 == 0) then { @@ -166,6 +97,75 @@ switch (_coordinate) do { }; + case 1 : { + + if (_isNegative) then { + + if (_digit1 == 0) then { + if (_digit2 == 0) then { + if (_digit3 == 0) then { + _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit3 = ""; + _digit4 = ""; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit4 = ""; + }; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit2]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = ""; + _digit1 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit2 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit3 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit4 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + }; + + } else { + + if (_digit1 == 0) then { + if (_digit2 == 0) then { + if (_digit3 == 0) then { + _digit0 = QUOTE(PATHTOF(rsc\vector_a.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit3 = ""; + _digit4 = ""; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_a.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit4 = ""; + }; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_a.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit2]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = ""; + _digit1 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit2 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit3 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit4 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + }; + }; + + }; + case 2 : { if (_isNegative) then { diff --git a/addons/vector/functions/fnc_getFallOfShort.sqf b/addons/vector/functions/fnc_getFallOfShot.sqf similarity index 100% rename from addons/vector/functions/fnc_getFallOfShort.sqf rename to addons/vector/functions/fnc_getFallOfShot.sqf diff --git a/addons/vector/functions/fnc_onKeyDown.sqf b/addons/vector/functions/fnc_onKeyDown.sqf index 884f2af128..feb706bc02 100644 --- a/addons/vector/functions/fnc_onKeyDown.sqf +++ b/addons/vector/functions/fnc_onKeyDown.sqf @@ -128,11 +128,11 @@ switch (_this select 0) do { }; // prevent additinal modifier input if advanced mode it set, spaghetti - if (GETGVAR(isKeyDownAzimuth,false) && {GETGVAR(currentMode,"") in ["relative_azimuth+distance", "fall_of_short"]}) exitWith {}; + if (GETGVAR(isKeyDownAzimuth,false) && {GETGVAR(currentMode,"") in ["relative_azimuth+distance", "fall_of_shot"]}) exitWith {}; // toggle fos values - if (GETGVAR(currentMode,"") == "fall_of_short") exitWith { - [!(GETGVAR(FOSState,true))] call FUNC(showFallOfShort); + if (GETGVAR(currentMode,"") == "fall_of_shot") exitWith { + [!(GETGVAR(FOSState,true))] call FUNC(showFallOfShot); }; ["distance"] call FUNC(clearDisplay); diff --git a/addons/vector/functions/fnc_onKeyHold.sqf b/addons/vector/functions/fnc_onKeyHold.sqf index aca31d95a5..568ef2050c 100644 --- a/addons/vector/functions/fnc_onKeyHold.sqf +++ b/addons/vector/functions/fnc_onKeyHold.sqf @@ -198,7 +198,7 @@ switch (_this select 0) do { }; - case ("fall_of_short"): { + case ("fall_of_shot"): { private "_isReady"; _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; @@ -207,8 +207,8 @@ switch (_this select 0) do { if (!GVAR(isKeyDownAzimuth) && {!GVAR(isKeyDownDistance)}) then { if (_isReady) then { - GVAR(FOSData) = call FUNC(getFallOfShort);// - [false] call FUNC(showFallOfShort); + GVAR(FOSData) = call FUNC(getFallOfShot); + [false] call FUNC(showFallOfShot); }; [false] call FUNC(showCenter); [false] call FUNC(showP1); diff --git a/addons/vector/functions/fnc_onKeyUp.sqf b/addons/vector/functions/fnc_onKeyUp.sqf index 5fc2d84092..aa768077d9 100644 --- a/addons/vector/functions/fnc_onKeyUp.sqf +++ b/addons/vector/functions/fnc_onKeyUp.sqf @@ -65,7 +65,7 @@ switch (_this select 0) do { ["distance"] call FUNC(clearDisplay); [true] call FUNC(showP1); GVAR(pData) = [call FUNC(getDistance), call FUNC(getDirection)]; - "fall_of_short" call _fnc_setPFH; + "fall_of_shot" call _fnc_setPFH; }; }; diff --git a/addons/vector/functions/fnc_showFallOfShort.sqf b/addons/vector/functions/fnc_showFallOfShot.sqf similarity index 100% rename from addons/vector/functions/fnc_showFallOfShort.sqf rename to addons/vector/functions/fnc_showFallOfShot.sqf index 0f2040708e..45a2232daf 100644 --- a/addons/vector/functions/fnc_showFallOfShort.sqf +++ b/addons/vector/functions/fnc_showFallOfShot.sqf @@ -15,8 +15,8 @@ _fosData = GVAR(FOSData); if !(_this select 0) then { private "_digits"; - // of abscissa - _digits = [_fosData, 0] call FUNC(convertToTexturesFOS); + // of ordinate + _digits = [_fosData, 1] call FUNC(convertToTexturesFOS); (_dlgVector displayCtrl 1310) ctrlSetText (_digits select 0); (_dlgVector displayCtrl 1311) ctrlSetText (_digits select 1); @@ -24,8 +24,8 @@ if !(_this select 0) then { (_dlgVector displayCtrl 1313) ctrlSetText (_digits select 3); (_dlgVector displayCtrl 1314) ctrlSetText (_digits select 4); - // of ordinate - _digits = [_fosData, 1] call FUNC(convertToTexturesFOS); + // of abscissa + _digits = [_fosData, 0] call FUNC(convertToTexturesFOS); (_dlgVector displayCtrl 1315) ctrlSetText (_digits select 0); (_dlgVector displayCtrl 1316) ctrlSetText (_digits select 1); diff --git a/addons/weather/XEH_preClientInit.sqf b/addons/weather/XEH_preClientInit.sqf index 81b6f09fe6..b979521cdd 100644 --- a/addons/weather/XEH_preClientInit.sqf +++ b/addons/weather/XEH_preClientInit.sqf @@ -2,16 +2,16 @@ FUNC(KEEPTIME) = { - if((count GVAR(WINDSPEED)) > 0) then { - private ["_wind", "_p", "_str"]; - _wind = ACE_wind; + if((count GVAR(WINDSPEED)) > 0) then { + private ["_wind", "_p", "_str"]; + _wind = ACE_wind; - _p = _wind call CBA_fnc_vect2polar; - _str = format["Wind: %1 at %2m/s (%3MPH)\n%4", floor(_p select 1), floor(_p select 0), floor((_p select 0)*2.23693629), GVAR(WINDSPEED)]; - TRACE_2("Wind",_wind,_str); - }; + _p = _wind call CBA_fnc_vect2polar; + _str = format["Wind: %1 at %2m/s (%3MPH)\n%4", floor(_p select 1), floor(_p select 0), floor((_p select 0)*2.23693629), GVAR(WINDSPEED)]; + TRACE_2("Wind",_wind,_str); + }; }; #ifdef DEBUG_MODE_FULL - [FUNC(KEEPTIME), 0.0, []] call CBA_fnc_addPerFrameHandler; + [FUNC(KEEPTIME), 0.0, []] call CBA_fnc_addPerFrameHandler; #endif diff --git a/addons/weather/script_component.hpp b/addons/weather/script_component.hpp index abfe607257..a21d8245fd 100644 --- a/addons/weather/script_component.hpp +++ b/addons/weather/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\addons\main\script_mod.hpp" //#define DEBUG_ENABLED_WEATHER #ifdef DEBUG_ENABLED_WEATHER - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_WEATHER - #define DEBUG_SETTINGS DEBUG_SETTINGS_WEATHER + #define DEBUG_SETTINGS DEBUG_SETTINGS_WEATHER #endif #include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/wep_javelin/CfgSounds.hpp b/addons/wep_javelin/CfgSounds.hpp index 0af40b9485..a5002409ff 100644 --- a/addons/wep_javelin/CfgSounds.hpp +++ b/addons/wep_javelin/CfgSounds.hpp @@ -1,13 +1,13 @@ class CfgSounds { class ACE_Javelin_Locking { - name = "ACE_Javelin_Locking"; - sound[] = {PATHTOF(data\sounds\javelin_locking.ogg), db+0, 1.0}; - titles[] = {}; + name = "ACE_Javelin_Locking"; + sound[] = {PATHTOF(data\sounds\javelin_locking.ogg), db+0, 1.0}; + titles[] = {}; }; class ACE_Javelin_Locked { - name = "ACE_Javelin_Locked"; - sound[] = {PATHTOF(data\sounds\javelin_locked.ogg), db+0, 1.0}; - titles[] = {}; + name = "ACE_Javelin_Locked"; + sound[] = {PATHTOF(data\sounds\javelin_locked.ogg), db+0, 1.0}; + titles[] = {}; }; }; diff --git a/addons/wep_javelin/RscInGameUI.hpp b/addons/wep_javelin/RscInGameUI.hpp index e94e4c58fd..811548a9d2 100644 --- a/addons/wep_javelin/RscInGameUI.hpp +++ b/addons/wep_javelin/RscInGameUI.hpp @@ -17,34 +17,34 @@ class RscInGameUI { onUnload = "uiNameSpace setVariable ['ACE_RscOptics_javelin',nil];"; class CA_Distance: RscOpticsValue { - idc = 151; - sizeEx = "0"; - colorText[] = {0,0,0,0}; - x = 0; - y = 0; - w = 0; - h = 0; - }; + idc = 151; + sizeEx = "0"; + colorText[] = {0,0,0,0}; + x = 0; + y = 0; + w = 0; + h = 0; + }; class ACE_javelin_elements_group: RscControlsGroup - { - x = "SafezoneX"; - y = "SafezoneY"; - w = "SafezoneW"; - h = "SafezoneH"; - idc = 170; - class VScrollbar { - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - color[] = {1,1,1,0}; - width = 0.001; - }; - class HScrollbar { - color[] = {1,1,1,0}; - height = 0.001; - }; - class Controls { + { + x = "SafezoneX"; + y = "SafezoneY"; + w = "SafezoneW"; + h = "SafezoneH"; + idc = 170; + class VScrollbar { + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + color[] = {1,1,1,0}; + width = 0.001; + }; + class HScrollbar { + color[] = {1,1,1,0}; + height = 0.001; + }; + class Controls { class JavelinLocking : RscMapControl { onDraw = QUOTE(_this call FUNC(onOpticDraw)); idc = -1; @@ -52,385 +52,385 @@ class RscInGameUI { h = 0; }; - class ACE_javelin_Day_mode_off: RscPicture { - idc = 1001; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.03/4)*3*SafezoneH - SafezoneX"; - y = "SafezoneY+SafezoneH*0.031 - SafezoneY"; - w = "0.1045752* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; - h = "SafezoneH*0.1045752"; - colorText[] = {0.2941,0.2941,0.2941,1}; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\day_co.paa"; - }; - class ACE_javelin_Day_mode: ACE_javelin_Day_mode_off { - idc = 160; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class ACE_javelin_WFOV_mode_off: ACE_javelin_Day_mode_off { - idc = 1004; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.307/4)*3*SafezoneH - SafezoneX"; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\wfov_co.paa"; - }; - class ACE_javelin_WFOV_mode_group: RscControlsGroup { - x = "SafezoneX"; - y = "SafezoneY"; - w = "SafezoneW"; - h = "SafezoneH"; - idc = 163; - class VScrollbar { - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - color[] = {1,1,1,0}; - width = 0.001; - }; - class HScrollbar { - color[] = {1,1,1,0}; - height = 0.001; - }; - class Controls { - class ACE_javelin_WFOV_mode: ACE_javelin_WFOV_mode_off { - idc = -1; - y = "0.031*SafezoneH - SafezoneY"; - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.307/4)*3*SafezoneH - SafezoneX"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class StadiaL: RscLine { - x = "0.4899*SafezoneW - SafezoneX"; - y = "0.171*SafezoneH - SafezoneY"; - w = 0; - h = "0.049*SafezoneH"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class StadiaR: RscLine { - x = "0.5109*SafezoneW- SafezoneX"; - y = "0.171*SafezoneH - SafezoneY"; - w = 0; - h = "0.049*SafezoneH"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class BracketL: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.293/4)*3*SafezoneH - SafezoneX"; - y = "0.4677*SafezoneH - SafezoneY"; - w = 0; - h = "0.0646*SafezoneH"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class BracketR: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.70/4)*3*SafezoneH - SafezoneX"; - y = "0.4677*SafezoneH - SafezoneY"; - w = 0; - h = "0.0646*SafezoneH"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class BracketT: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX"; - y = "0.3535*SafezoneH - SafezoneY"; - w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; - h = 0; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class BracketB: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX"; - y = "0.6465*SafezoneH - SafezoneY"; - w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; - h = 0; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - }; - }; - class ACE_javelin_NFOV_mode_off: ACE_javelin_Day_mode_off { - idc = 1003; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.586/4)*3*SafezoneH - SafezoneX"; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\nfov_co.paa"; - }; - class ACE_javelin_NFOV_mode_group: RscControlsGroup { - x = "SafezoneX"; - y = "SafezoneY"; - w = "SafezoneW-SafezoneX"; - h = "SafezoneH-SafezoneY"; - idc = 162; - class VScrollbar { - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - color[] = {1,1,1,0}; - width = 0.001; - }; - class HScrollbar { - color[] = {1,1,1,0}; - height = 0.001; - }; - class Controls { - class ACE_javelin_NFOV_mode: ACE_javelin_NFOV_mode_off { - idc = 699003; - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.586/4)*3*SafezoneH - SafezoneX"; - y = "0.031*SafezoneH - SafezoneY"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class StadiaL: RscLine { - x = "0.4788*SafezoneW - SafezoneX"; - y = "0.171*SafezoneH - SafezoneY"; - w = 0; - h = "0.049*SafezoneH"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class StadiaR: RscLine { - x = "0.5212*SafezoneW - SafezoneX"; - y = "0.171*SafezoneH - SafezoneY"; - w = 0; - h = "0.049*SafezoneH"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class LineHL: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.01/4)*3*SafezoneH - SafezoneX"; - y = "SafezoneH*0.5 - SafezoneY"; - w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; - h = "SafezoneH*0.0"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class LineHR: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.695/4)*3*SafezoneH - SafezoneX"; - y = "SafezoneH*0.5 - SafezoneY"; - w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; - h = "SafezoneH*0.0"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class LineVT: RscLine { - x = "0.5*SafezoneW - SafezoneX"; - y = "0.171*SafezoneH - SafezoneY"; - w = 0; - h = "0.1825*SafezoneH"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class LineVB: RscLine { - x = "0.5*SafezoneW - SafezoneX"; - y = "0.6465*SafezoneH - SafezoneY"; - w = 0; - h = "0.1895*SafezoneH"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - }; - }; + class ACE_javelin_Day_mode_off: RscPicture { + idc = 1001; + x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.03/4)*3*SafezoneH - SafezoneX"; + y = "SafezoneY+SafezoneH*0.031 - SafezoneY"; + w = "0.1045752* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; + h = "SafezoneH*0.1045752"; + colorText[] = {0.2941,0.2941,0.2941,1}; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\day_co.paa"; + }; + class ACE_javelin_Day_mode: ACE_javelin_Day_mode_off { + idc = 160; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class ACE_javelin_WFOV_mode_off: ACE_javelin_Day_mode_off { + idc = 1004; + x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.307/4)*3*SafezoneH - SafezoneX"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\wfov_co.paa"; + }; + class ACE_javelin_WFOV_mode_group: RscControlsGroup { + x = "SafezoneX"; + y = "SafezoneY"; + w = "SafezoneW"; + h = "SafezoneH"; + idc = 163; + class VScrollbar { + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + color[] = {1,1,1,0}; + width = 0.001; + }; + class HScrollbar { + color[] = {1,1,1,0}; + height = 0.001; + }; + class Controls { + class ACE_javelin_WFOV_mode: ACE_javelin_WFOV_mode_off { + idc = -1; + y = "0.031*SafezoneH - SafezoneY"; + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.307/4)*3*SafezoneH - SafezoneX"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class StadiaL: RscLine { + x = "0.4899*SafezoneW - SafezoneX"; + y = "0.171*SafezoneH - SafezoneY"; + w = 0; + h = "0.049*SafezoneH"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class StadiaR: RscLine { + x = "0.5109*SafezoneW- SafezoneX"; + y = "0.171*SafezoneH - SafezoneY"; + w = 0; + h = "0.049*SafezoneH"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class BracketL: RscLine { + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.293/4)*3*SafezoneH - SafezoneX"; + y = "0.4677*SafezoneH - SafezoneY"; + w = 0; + h = "0.0646*SafezoneH"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class BracketR: RscLine { + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.70/4)*3*SafezoneH - SafezoneX"; + y = "0.4677*SafezoneH - SafezoneY"; + w = 0; + h = "0.0646*SafezoneH"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class BracketT: RscLine { + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX"; + y = "0.3535*SafezoneH - SafezoneY"; + w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; + h = 0; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class BracketB: RscLine { + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX"; + y = "0.6465*SafezoneH - SafezoneY"; + w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; + h = 0; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + }; + }; + class ACE_javelin_NFOV_mode_off: ACE_javelin_Day_mode_off { + idc = 1003; + x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.586/4)*3*SafezoneH - SafezoneX"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\nfov_co.paa"; + }; + class ACE_javelin_NFOV_mode_group: RscControlsGroup { + x = "SafezoneX"; + y = "SafezoneY"; + w = "SafezoneW-SafezoneX"; + h = "SafezoneH-SafezoneY"; + idc = 162; + class VScrollbar { + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + color[] = {1,1,1,0}; + width = 0.001; + }; + class HScrollbar { + color[] = {1,1,1,0}; + height = 0.001; + }; + class Controls { + class ACE_javelin_NFOV_mode: ACE_javelin_NFOV_mode_off { + idc = 699003; + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.586/4)*3*SafezoneH - SafezoneX"; + y = "0.031*SafezoneH - SafezoneY"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class StadiaL: RscLine { + x = "0.4788*SafezoneW - SafezoneX"; + y = "0.171*SafezoneH - SafezoneY"; + w = 0; + h = "0.049*SafezoneH"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class StadiaR: RscLine { + x = "0.5212*SafezoneW - SafezoneX"; + y = "0.171*SafezoneH - SafezoneY"; + w = 0; + h = "0.049*SafezoneH"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class LineHL: RscLine { + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.01/4)*3*SafezoneH - SafezoneX"; + y = "SafezoneH*0.5 - SafezoneY"; + w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; + h = "SafezoneH*0.0"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class LineHR: RscLine { + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.695/4)*3*SafezoneH - SafezoneX"; + y = "SafezoneH*0.5 - SafezoneY"; + w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; + h = "SafezoneH*0.0"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class LineVT: RscLine { + x = "0.5*SafezoneW - SafezoneX"; + y = "0.171*SafezoneH - SafezoneY"; + w = 0; + h = "0.1825*SafezoneH"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class LineVB: RscLine { + x = "0.5*SafezoneW - SafezoneX"; + y = "0.6465*SafezoneH - SafezoneY"; + w = 0; + h = "0.1895*SafezoneH"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + }; + }; /* - class TargetingConstrains: RscControlsGroup { - idc = 699100; - x = "SafezoneX"; - y = "SafezoneY"; - w = "SafezoneW-SafezoneX"; - h = "SafezoneH-SafezoneY"; - class VScrollbar { - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - color[] = {1,1,1,0}; - width = 0.001; - }; - class HScrollbar { - color[] = {1,1,1,0}; - height = 0.001; - }; - class Controls { - class Top: RscPicture { - idc = 699101; - text = "#(argb,8,8,3)color(1,1,1,1)"; - colorText[] = {0.2941,0.2941,0.2941,1}; - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.15*SafezoneH-SafezoneY"; - w = "(3/4)*SafezoneH"; - h = "0.21*SafezoneH"; - }; - class Bottom: Top { - idc = 699102; - y = "0.64*SafezoneH-SafezoneY"; - }; - class Left: Top { - idc = 699103; - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.36*SafezoneH-SafezoneY"; - w = "0.31*(3/4)*SafezoneH"; - h = "0.28*SafezoneH"; - }; - class Right: Left { - idc = 699104; - x = "((SafezoneW -(3/4)*SafezoneH)/2)+ 0.69*(3/4)*SafezoneH - SafezoneX"; - }; - class OpticsBorders: RscPicture { - idc = 699105; - text = PATHTOF(data\javelin_ui_border_ca.paa); - colorText[] = {0,0,0,1}; - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.15*SafezoneH-SafezoneY"; - w = "(3/4)*SafezoneH"; - h = "0.7*SafezoneH"; - }; - }; - }; + class TargetingConstrains: RscControlsGroup { + idc = 699100; + x = "SafezoneX"; + y = "SafezoneY"; + w = "SafezoneW-SafezoneX"; + h = "SafezoneH-SafezoneY"; + class VScrollbar { + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + color[] = {1,1,1,0}; + width = 0.001; + }; + class HScrollbar { + color[] = {1,1,1,0}; + height = 0.001; + }; + class Controls { + class Top: RscPicture { + idc = 699101; + text = "#(argb,8,8,3)color(1,1,1,1)"; + colorText[] = {0.2941,0.2941,0.2941,1}; + x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; + y = "0.15*SafezoneH-SafezoneY"; + w = "(3/4)*SafezoneH"; + h = "0.21*SafezoneH"; + }; + class Bottom: Top { + idc = 699102; + y = "0.64*SafezoneH-SafezoneY"; + }; + class Left: Top { + idc = 699103; + x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; + y = "0.36*SafezoneH-SafezoneY"; + w = "0.31*(3/4)*SafezoneH"; + h = "0.28*SafezoneH"; + }; + class Right: Left { + idc = 699104; + x = "((SafezoneW -(3/4)*SafezoneH)/2)+ 0.69*(3/4)*SafezoneH - SafezoneX"; + }; + class OpticsBorders: RscPicture { + idc = 699105; + text = PATHTOF(data\javelin_ui_border_ca.paa); + colorText[] = {0,0,0,1}; + x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; + y = "0.15*SafezoneH-SafezoneY"; + w = "(3/4)*SafezoneH"; + h = "0.7*SafezoneH"; + }; + }; + }; - class TargetingGate: TargetingConstrains { - idc = 699200; - class Controls { - class TargetingGateTL: TargetingConstrains { - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.15*SafezoneH - SafezoneY"; - idc = 699201; - class Controls { - class LineH: RscLine { - idc = 699210; - x = "0"; - y = "0"; - w = "0.025*(3/4)*SafezoneH"; - h = "0"; - colorText[] = {0.8745,0.8745,0.8745,1}; - }; - class LineV: LineH { - idc = 699211; - w = "0"; - h = "0.025*SafezoneH"; - }; - }; - }; - class TargetingGateTR: TargetingGateTL { - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH"; - y = "0.15*SafezoneH - SafezoneY"; - idc = 699202; - class Controls { - class LineH: RscLine { - idc = 699220; - x = "0"; - y = "0"; - w = "0.025*(3/4)*SafezoneH"; - h = "0"; - colorText[] = {0.8745,0.8745,0.8745,1}; - }; - class LineV: LineH { - idc = 699221; - x = "0.025*(3/4)*SafezoneH"; - w = "0"; - h = "0.025*SafezoneH"; - }; - }; - }; - class TargetingGateBL: TargetingGateTL { - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.825*SafezoneH - SafezoneY"; - idc = 699203; - class Controls { - class LineH: RscLine { - x = "0"; - y = "0.025*SafezoneH"; - w = "0.025*(3/4)*SafezoneH"; - h = "0"; - colorText[] = {0.8745,0.8745,0.8745,1}; - }; - class LineV: LineH { - y = "0"; - w = "0"; - h = "0.025*SafezoneH"; - }; - }; - }; - class TargetingGateBR: TargetingGateBL { - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH"; - y = "0.825*SafezoneH - SafezoneY"; - idc = 699204; - class Controls { - class LineH: RscLine { - x = "0"; - y = "0.025*SafezoneH"; - w = "0.025*(3/4)*SafezoneH"; - h = "0"; - colorText[] = {0.8745,0.8745,0.8745,1}; - }; - class LineV: LineH { - x = "0.025*(3/4)*SafezoneH"; - y = "0"; - w = "0"; - h = "0.025*SafezoneH"; - }; - }; - }; - }; - }; + class TargetingGate: TargetingConstrains { + idc = 699200; + class Controls { + class TargetingGateTL: TargetingConstrains { + x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; + y = "0.15*SafezoneH - SafezoneY"; + idc = 699201; + class Controls { + class LineH: RscLine { + idc = 699210; + x = "0"; + y = "0"; + w = "0.025*(3/4)*SafezoneH"; + h = "0"; + colorText[] = {0.8745,0.8745,0.8745,1}; + }; + class LineV: LineH { + idc = 699211; + w = "0"; + h = "0.025*SafezoneH"; + }; + }; + }; + class TargetingGateTR: TargetingGateTL { + x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH"; + y = "0.15*SafezoneH - SafezoneY"; + idc = 699202; + class Controls { + class LineH: RscLine { + idc = 699220; + x = "0"; + y = "0"; + w = "0.025*(3/4)*SafezoneH"; + h = "0"; + colorText[] = {0.8745,0.8745,0.8745,1}; + }; + class LineV: LineH { + idc = 699221; + x = "0.025*(3/4)*SafezoneH"; + w = "0"; + h = "0.025*SafezoneH"; + }; + }; + }; + class TargetingGateBL: TargetingGateTL { + x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; + y = "0.825*SafezoneH - SafezoneY"; + idc = 699203; + class Controls { + class LineH: RscLine { + x = "0"; + y = "0.025*SafezoneH"; + w = "0.025*(3/4)*SafezoneH"; + h = "0"; + colorText[] = {0.8745,0.8745,0.8745,1}; + }; + class LineV: LineH { + y = "0"; + w = "0"; + h = "0.025*SafezoneH"; + }; + }; + }; + class TargetingGateBR: TargetingGateBL { + x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH"; + y = "0.825*SafezoneH - SafezoneY"; + idc = 699204; + class Controls { + class LineH: RscLine { + x = "0"; + y = "0.025*SafezoneH"; + w = "0.025*(3/4)*SafezoneH"; + h = "0"; + colorText[] = {0.8745,0.8745,0.8745,1}; + }; + class LineV: LineH { + x = "0.025*(3/4)*SafezoneH"; + y = "0"; + w = "0"; + h = "0.025*SafezoneH"; + }; + }; + }; + }; + }; - class TargetingLines: TargetingConstrains { - idc = 699300; - class Controls { - class LineH: RscLine { - idc = 699301; - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.5*SafezoneH - SafezoneY"; - w = "(3/4)*SafezoneH"; - h = "0"; - colorText[] = {0.8745,0.8745,0.8745,1}; - }; - class LineV: RscLine { - idc = 699302; - x = "0.5*SafezoneW - SafezoneX"; - y = "0.15*SafezoneH - SafezoneY"; - w = "0"; - h = "0.7*SafezoneH"; - colorText[] = {0.8745,0.8745,0.8745,1}; - }; - }; - }; + class TargetingLines: TargetingConstrains { + idc = 699300; + class Controls { + class LineH: RscLine { + idc = 699301; + x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; + y = "0.5*SafezoneH - SafezoneY"; + w = "(3/4)*SafezoneH"; + h = "0"; + colorText[] = {0.8745,0.8745,0.8745,1}; + }; + class LineV: RscLine { + idc = 699302; + x = "0.5*SafezoneW - SafezoneX"; + y = "0.15*SafezoneH - SafezoneY"; + w = "0"; + h = "0.7*SafezoneH"; + colorText[] = {0.8745,0.8745,0.8745,1}; + }; + }; + }; */ - class ACE_javelin_SEEK_off: ACE_javelin_Day_mode_off { - idc = 699000; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.863/4)*3*SafezoneH - SafezoneX"; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\seek_co.paa"; - }; - class ACE_javelin_SEEK: ACE_javelin_SEEK_off { - idc = 166; - colorText[] = {0.2941,0.8745,0.2157,0}; - }; - class ACE_javelin_Missle_off: ACE_javelin_Day_mode_off { - idc = 1032; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (-0.134/4)*3*SafezoneH - SafezoneX"; - y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY"; - colorText[] = {0.2941,0.2941,0.2941,1}; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\missle_co.paa"; - }; - class ACE_javelin_Missle: ACE_javelin_Missle_off { - idc = 167; - colorText[] = {0.9255,0.5216,0.1216,0}; - }; - class ACE_javelin_CLU_off: ACE_javelin_Missle_off { - idc = 1027; - y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY"; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\clu_co.paa"; - }; - class ACE_javelin_HangFire_off: ACE_javelin_Missle_off { - idc = 1028; - y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY"; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\hangfire_co.paa"; - }; - class ACE_javelin_TOP_off: ACE_javelin_Day_mode_off { - idc = 699001; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; - y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY"; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\top_co.paa"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class ACE_javelin_DIR: ACE_javelin_Day_mode { - idc = 699002; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; - y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY"; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\dir_co.paa"; - colorText[] = {0.2941,0.2941,0.2941,1}; - }; - class ACE_javelin_FLTR_mode_off: ACE_javelin_Day_mode_off { - idc = 1002; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; - y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY"; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\fltr_co.paa"; - }; - class ACE_javelin_FLTR_mode: ACE_javelin_FLTR_mode_off { - idc = 161; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - }; - }; + class ACE_javelin_SEEK_off: ACE_javelin_Day_mode_off { + idc = 699000; + x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.863/4)*3*SafezoneH - SafezoneX"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\seek_co.paa"; + }; + class ACE_javelin_SEEK: ACE_javelin_SEEK_off { + idc = 166; + colorText[] = {0.2941,0.8745,0.2157,0}; + }; + class ACE_javelin_Missle_off: ACE_javelin_Day_mode_off { + idc = 1032; + x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (-0.134/4)*3*SafezoneH - SafezoneX"; + y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY"; + colorText[] = {0.2941,0.2941,0.2941,1}; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\missle_co.paa"; + }; + class ACE_javelin_Missle: ACE_javelin_Missle_off { + idc = 167; + colorText[] = {0.9255,0.5216,0.1216,0}; + }; + class ACE_javelin_CLU_off: ACE_javelin_Missle_off { + idc = 1027; + y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\clu_co.paa"; + }; + class ACE_javelin_HangFire_off: ACE_javelin_Missle_off { + idc = 1028; + y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\hangfire_co.paa"; + }; + class ACE_javelin_TOP_off: ACE_javelin_Day_mode_off { + idc = 699001; + x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; + y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\top_co.paa"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class ACE_javelin_DIR: ACE_javelin_Day_mode { + idc = 699002; + x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; + y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\dir_co.paa"; + colorText[] = {0.2941,0.2941,0.2941,1}; + }; + class ACE_javelin_FLTR_mode_off: ACE_javelin_Day_mode_off { + idc = 1002; + x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; + y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\fltr_co.paa"; + }; + class ACE_javelin_FLTR_mode: ACE_javelin_FLTR_mode_off { + idc = 161; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + }; + }; }; }; diff --git a/addons/wep_javelin/config.cpp b/addons/wep_javelin/config.cpp index fa062944fc..3cc607f0bd 100644 --- a/addons/wep_javelin/config.cpp +++ b/addons/wep_javelin/config.cpp @@ -1,13 +1,13 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { "ace_main", "ace_common", "ace_laser" }; - VERSION_CONFIG; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { "ace_main", "ace_common", "ace_laser" }; + VERSION_CONFIG; + }; }; #include "CfgEventhandlers.hpp" diff --git a/addons/wep_javelin/functions/fnc_fired.sqf b/addons/wep_javelin/functions/fnc_fired.sqf index 4e94989677..139f8f4b7e 100644 --- a/addons/wep_javelin/functions/fnc_fired.sqf +++ b/addons/wep_javelin/functions/fnc_fired.sqf @@ -5,70 +5,70 @@ TRACE_1("Launch", _this); PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); FUNC(guidance_Javelin_LOBL_DIR_PFH) = { - TRACE_1("enter", _this); - private["_pitch", "_yaw", "_wentTerminal", "_target", "_targetPos", "_curVelocity", "_missile", + TRACE_1("enter", _this); + private["_pitch", "_yaw", "_wentTerminal", "_target", "_targetPos", "_curVelocity", "_missile", "_launchPos", "_targetStartPos", "_defPitch", "_defYaw"]; - _args = _this select 0; - //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - _shooter = _args select 0; - _missile = _args select 6; - - if((count _args) > 7) then { - _saveArgs = _args select 7; - _target = _saveArgs select 0; - _targetStartPos = _saveArgs select 1; + _args = _this select 0; + //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + _shooter = _args select 0; + _missile = _args select 6; + + if((count _args) > 7) then { + _saveArgs = _args select 7; + _target = _saveArgs select 0; + _targetStartPos = _saveArgs select 1; _launchPos = _saveArgs select 2; _wentTerminal = _saveArgs select 3; - } else { + } else { _wentTerminal = false; _launchPos = getPosASL _shooter; _target = ACE_player getVariable[QGVAR(currentTarget), objNull]; _targetStartPos = ACE_player getVariable[QGVAR(currentTargetPos), [0,0,0]]; - }; - + }; + if(!alive _missile || isNull _missile || isNull _target) exitWith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; _targetPos = getPosASL _target; - _curVelocity = velocity _missile; - + _curVelocity = velocity _missile; + TRACE_4("", _target, _targetPos, _launchPos, _targetStartPos); - _addHeight = [0,0,0]; - if(!isNil "_target") then { - - _yVec = vectorDir _missile; - _zVec = vectorUp _missile; - _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); - - _missilePos = getPosASL _missile; - // player sideChat "G!"; + _addHeight = [0,0,0]; + if(!isNil "_target") then { + + _yVec = vectorDir _missile; + _zVec = vectorUp _missile; + _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); + + _missilePos = getPosASL _missile; + // player sideChat "G!"; - TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos)); - if((count _targetPos) > 0) then { - _distanceToTarget = [(_missilePos select 0), (_missilePos select 1), (_targetPos select 2)] vectorDistance _targetPos; + TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos)); + if((count _targetPos) > 0) then { + _distanceToTarget = [(_missilePos select 0), (_missilePos select 1), (_targetPos select 2)] vectorDistance _targetPos; - if( (_missilePos select 2) < (_targetPos select 2) + 60 && !_wentTerminal) then { - _addHeight = [0,0,(_targetPos select 2) + 120]; - + if( (_missilePos select 2) < (_targetPos select 2) + 60 && !_wentTerminal) then { + _addHeight = [0,0,(_targetPos select 2) + 120]; + _defPitch = 0.15; _defYaw = 0.035; TRACE_1("Climb phase", _addHeight); - } else { - _wentTerminal = true; - _this set[2, _wentTerminal]; - + } else { + _wentTerminal = true; + _this set[2, _wentTerminal]; + _defPitch = 0.15; _defYaw = 0.035; TRACE_1("TERMINAL", ""); - }; - _targetPos = _targetPos vectorAdd _addHeight; + }; + _targetPos = _targetPos vectorAdd _addHeight; - _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); - TRACE_5("", _missile, _xVec, _yVec, _zVec, _targetPos); + _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); + TRACE_5("", _missile, _xVec, _yVec, _zVec, _targetPos); _yaw = 0.0; _pitch = 0.0; @@ -88,37 +88,37 @@ FUNC(guidance_Javelin_LOBL_DIR_PFH) = { _pitch = _defPitch; }; }; - - TRACE_3("", _targetVectorSeeker, _pitch, _yaw); - - #ifdef DEBUG_MODE_FULL - drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; - - _light = "#lightpoint" createVehicleLocal (getPos _missile); - _light setLightBrightness 1.0; - _light setLightAmbient [1.0, 0.0, 0.0]; - _light setLightColor [1.0, 0.0, 0.0]; - - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _missilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; - drawLine3D [ASLtoATL _missilePos, ASLtoATL _targetPos, [1,0,0,1]]; + + TRACE_3("", _targetVectorSeeker, _pitch, _yaw); + + #ifdef DEBUG_MODE_FULL + drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; + + _light = "#lightpoint" createVehicleLocal (getPos _missile); + _light setLightBrightness 1.0; + _light setLightAmbient [1.0, 0.0, 0.0]; + _light setLightColor [1.0, 0.0, 0.0]; + + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _missilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; + drawLine3D [ASLtoATL _missilePos, ASLtoATL _targetPos, [1,0,0,1]]; - MARKERCOUNT = MARKERCOUNT + 1; - #endif - - if(accTime > 0) then { - TRACE_5("", _xVec, _yVec, _zVec, _yaw, _pitch); - _outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); - - _vectorTo = _missilePos vectorFromTo _outVector; - TRACE_3("", _missile, _outVector, _vectorTo); - _missile setVectorDirAndUp [_vectorTo, vectorUp _missile]; - }; - - #ifdef DEBUG_MODE_FULL - hintSilent format["d: %1", _distanceToTarget]; - #endif - }; - }; + MARKERCOUNT = MARKERCOUNT + 1; + #endif + + if(accTime > 0) then { + TRACE_5("", _xVec, _yVec, _zVec, _yaw, _pitch); + _outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); + + _vectorTo = _missilePos vectorFromTo _outVector; + TRACE_3("", _missile, _outVector, _vectorTo); + _missile setVectorDirAndUp [_vectorTo, vectorUp _missile]; + }; + + #ifdef DEBUG_MODE_FULL + hintSilent format["d: %1", _distanceToTarget]; + #endif + }; + }; _saveArgs = [_target,_targetStartPos, _launchPos, _wentTerminal]; _args set[7, _saveArgs ]; @@ -126,70 +126,70 @@ FUNC(guidance_Javelin_LOBL_DIR_PFH) = { }; FUNC(guidance_Javelin_LOBL_TOP_PFH) = { - TRACE_1("enter", _this); - private["_pitch", "_yaw", "_wentTerminal", "_target", "_targetPos", "_curVelocity", "_missile", + TRACE_1("enter", _this); + private["_pitch", "_yaw", "_wentTerminal", "_target", "_targetPos", "_curVelocity", "_missile", "_launchPos", "_targetStartPos", "_defPitch", "_defYaw"]; - _args = _this select 0; - //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - _shooter = _args select 0; - _missile = _args select 6; - - if((count _args) > 7) then { - _saveArgs = _args select 7; - _target = _saveArgs select 0; - _targetStartPos = _saveArgs select 1; + _args = _this select 0; + //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + _shooter = _args select 0; + _missile = _args select 6; + + if((count _args) > 7) then { + _saveArgs = _args select 7; + _target = _saveArgs select 0; + _targetStartPos = _saveArgs select 1; _launchPos = _saveArgs select 2; _wentTerminal = _saveArgs select 3; - } else { + } else { _wentTerminal = false; _launchPos = getPosASL _shooter; _target = ACE_player getVariable[QGVAR(currentTarget), objNull]; _targetStartPos = ACE_player getVariable[QGVAR(currentTargetPos), [0,0,0]]; - }; - + }; + if(!alive _missile || isNull _missile || isNull _target) exitWith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; _targetPos = getPosASL _target; - _curVelocity = velocity _missile; - + _curVelocity = velocity _missile; + TRACE_4("", _target, _targetPos, _launchPos, _targetStartPos); - _addHeight = [0,0,0]; - if(!isNil "_target") then { - - _yVec = vectorDir _missile; - _zVec = vectorUp _missile; - _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); - - _missilePos = getPosASL _missile; - // player sideChat "G!"; + _addHeight = [0,0,0]; + if(!isNil "_target") then { + + _yVec = vectorDir _missile; + _zVec = vectorUp _missile; + _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); + + _missilePos = getPosASL _missile; + // player sideChat "G!"; - TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos)); - if((count _targetPos) > 0) then { - _distanceToTarget = [(_missilePos select 0), (_missilePos select 1), (_targetPos select 2)] vectorDistance _targetPos; + TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos)); + if((count _targetPos) > 0) then { + _distanceToTarget = [(_missilePos select 0), (_missilePos select 1), (_targetPos select 2)] vectorDistance _targetPos; - if( (_missilePos select 2) < (_targetPos select 2) + 200 && !_wentTerminal) then { - _addHeight = [0,0, ( (_distanceToTarget * 2) + 400)]; - + if( (_missilePos select 2) < (_targetPos select 2) + 200 && !_wentTerminal) then { + _addHeight = [0,0, ( (_distanceToTarget * 2) + 400)]; + _defPitch = 0.25; _defYaw = 0.035; TRACE_1("Climb phase", _addHeight); - } else { - _wentTerminal = true; - _this set[2, _wentTerminal]; - + } else { + _wentTerminal = true; + _this set[2, _wentTerminal]; + _defPitch = 0.25; _defYaw = 0.25; TRACE_1("TERMINAL", ""); - }; - _targetPos = _targetPos vectorAdd _addHeight; + }; + _targetPos = _targetPos vectorAdd _addHeight; - _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); - TRACE_5("", _missile, _xVec, _yVec, _zVec, _targetPos); + _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); + TRACE_5("", _missile, _xVec, _yVec, _zVec, _targetPos); _yaw = 0.0; _pitch = 0.0; @@ -215,37 +215,37 @@ FUNC(guidance_Javelin_LOBL_TOP_PFH) = { _pitch = _defPitch; }; }; - - TRACE_3("", _targetVectorSeeker, _pitch, _yaw); - - #ifdef DEBUG_MODE_FULL - drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; - - _light = "#lightpoint" createVehicleLocal (getPos _missile); - _light setLightBrightness 1.0; - _light setLightAmbient [1.0, 0.0, 0.0]; - _light setLightColor [1.0, 0.0, 0.0]; - - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _missilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; - drawLine3D [ASLtoATL _missilePos, ASLtoATL _targetPos, [1,0,0,1]]; + + TRACE_3("", _targetVectorSeeker, _pitch, _yaw); + + #ifdef DEBUG_MODE_FULL + drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; + + _light = "#lightpoint" createVehicleLocal (getPos _missile); + _light setLightBrightness 1.0; + _light setLightAmbient [1.0, 0.0, 0.0]; + _light setLightColor [1.0, 0.0, 0.0]; + + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _missilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; + drawLine3D [ASLtoATL _missilePos, ASLtoATL _targetPos, [1,0,0,1]]; - MARKERCOUNT = MARKERCOUNT + 1; - #endif - - if(accTime > 0) then { - TRACE_5("", _xVec, _yVec, _zVec, _yaw, _pitch); - _outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); - - _vectorTo = _missilePos vectorFromTo _outVector; - TRACE_3("", _missile, _outVector, _vectorTo); - _missile setVectorDirAndUp [_vectorTo, vectorUp _missile]; - }; - - #ifdef DEBUG_MODE_FULL - hintSilent format["d: %1", _distanceToTarget]; - #endif - }; - }; + MARKERCOUNT = MARKERCOUNT + 1; + #endif + + if(accTime > 0) then { + TRACE_5("", _xVec, _yVec, _zVec, _yaw, _pitch); + _outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); + + _vectorTo = _missilePos vectorFromTo _outVector; + TRACE_3("", _missile, _outVector, _vectorTo); + _missile setVectorDirAndUp [_vectorTo, vectorUp _missile]; + }; + + #ifdef DEBUG_MODE_FULL + hintSilent format["d: %1", _distanceToTarget]; + #endif + }; + }; _saveArgs = [_target,_targetStartPos, _launchPos, _wentTerminal]; _args set[7, _saveArgs ]; @@ -253,24 +253,24 @@ FUNC(guidance_Javelin_LOBL_TOP_PFH) = { }; FUNC(guidance_Javelin_LOBL_TOP) = { - PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - - GVAR(lastTime) = time; - [FUNC(guidance_Javelin_LOBL_TOP_PFH), 0, _this] call cba_fnc_addPerFrameHandler; + PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + + GVAR(lastTime) = time; + [FUNC(guidance_Javelin_LOBL_TOP_PFH), 0, _this] call cba_fnc_addPerFrameHandler; }; FUNC(guidance_Javelin_LOBL_DIR) = { - PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - - GVAR(lastTime) = time; - [FUNC(guidance_Javelin_LOBL_DIR_PFH), 0, _this] call cba_fnc_addPerFrameHandler; + PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + + GVAR(lastTime) = time; + [FUNC(guidance_Javelin_LOBL_DIR_PFH), 0, _this] call cba_fnc_addPerFrameHandler; }; if(!local _shooter) exitWith { false }; if(_ammo == "M_Titan_AT") then { - _fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_JAV_FIREMODE_TOP]; - - switch (_fireMode) do { + _fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_JAV_FIREMODE_TOP]; + + switch (_fireMode) do { // Default to FIREMODE_DIRECT_LOAL // FIREMODE_DIRECT_LOAL case ACE_JAV_FIREMODE_DIR: { diff --git a/addons/wep_javelin/functions/fnc_onOpticDraw.sqf b/addons/wep_javelin/functions/fnc_onOpticDraw.sqf index 1bc848cb04..6a74b3ed57 100644 --- a/addons/wep_javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/wep_javelin/functions/fnc_onOpticDraw.sqf @@ -2,10 +2,10 @@ #include "script_component.hpp" //TRACE_1("enter", _this); -#define __TRACKINTERVAL 0.1 // how frequent the check should be. -#define __LOCKONTIME 1.85 // Lock on won't occur sooner -#define __LOCKONTIMERANDOM 0.3 // Deviation in lock on time -#define __SENSORSQUARE 1 // Locking on sensor square side in angles +#define __TRACKINTERVAL 0.1 // how frequent the check should be. +#define __LOCKONTIME 1.85 // Lock on won't occur sooner +#define __LOCKONTIMERANDOM 0.3 // Deviation in lock on time +#define __SENSORSQUARE 1 // Locking on sensor square side in angles #define __ConstraintTop (((ctrlPosition __JavelinIGUITargetingConstrainTop) select 1) + ((ctrlPosition (__JavelinIGUITargetingConstrainTop)) select 3)) #define __ConstraintBottom ((ctrlPosition __JavelinIGUITargetingConstrainBottom) select 1) @@ -35,9 +35,9 @@ _soundTime = _args select 4; // Find a target within the optic range _newTarget = objNull; - + // Bail on fast movement -if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && {cameraOn == ACE_player}) exitWith { // keep it steady. +if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && {cameraOn == ACE_player}) exitWith { // keep it steady. ACE_player switchCamera "INTERNAL"; }; @@ -71,7 +71,7 @@ if (isNull _newTarget) then { ACE_player setVariable [QGVAR(currentTarget),nil, false]; // Disallow fire - //if (ACE_player ammo "Javelin" > 0 || {ACE_player ammo "ACE_Javelin_Direct" > 0}) then {ACE_player setWeaponReloadingTime //[player, "Javelin", 0.2];}; + //if (ACE_player ammo "Javelin" > 0 || {ACE_player ammo "ACE_Javelin_Direct" > 0}) then {ACE_player setWeaponReloadingTime //[player, "Javelin", 0.2];}; } else { if (_newTarget distance ACE_player < 2500 // && {(call CBA_fnc_getFoV) select 1 > 7} diff --git a/addons/wep_javelin/functions/fnc_translateToWeaponSpace.sqf b/addons/wep_javelin/functions/fnc_translateToWeaponSpace.sqf index afe2436e5d..8f85005d48 100644 --- a/addons/wep_javelin/functions/fnc_translateToWeaponSpace.sqf +++ b/addons/wep_javelin/functions/fnc_translateToWeaponSpace.sqf @@ -18,9 +18,9 @@ _y = _offset select 1; _z = _offset select 2; _out = [ - ((_xVec select 0)*_x) + ((_xVec select 1)*_y) + ((_xVec select 2)*_z), - ((_yVec select 0)*_x) + ((_yVec select 1)*_y) + ((_yVec select 2)*_z), - ((_zVec select 0)*_x) + ((_zVec select 1)*_y) + ((_zVec select 2)*_z) - ]; + ((_xVec select 0)*_x) + ((_xVec select 1)*_y) + ((_xVec select 2)*_z), + ((_yVec select 0)*_x) + ((_yVec select 1)*_y) + ((_yVec select 2)*_z), + ((_zVec select 0)*_x) + ((_zVec select 1)*_y) + ((_zVec select 2)*_z) + ]; _out; \ No newline at end of file diff --git a/addons/winddeflection/functions/fnc_initalizeModule.sqf b/addons/winddeflection/functions/fnc_initalizeModule.sqf index 2833ecc54c..85d61e3bcc 100644 --- a/addons/winddeflection/functions/fnc_initalizeModule.sqf +++ b/addons/winddeflection/functions/fnc_initalizeModule.sqf @@ -15,5 +15,5 @@ if (!hasInterface) exitwith {}; // No need for this module on HC or dedicated se private ["_logic"]; _logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; if (!isNull _logic) then { - [_logic, QGVAR(EnableForAI), "EnableForAI" ] call EFUNC(common,readSettingFromModule); + [_logic, QGVAR(EnableForAI), "EnableForAI" ] call EFUNC(common,readSettingFromModule); }; \ No newline at end of file diff --git a/addons/winddeflection/functions/script_component.hpp b/addons/winddeflection/functions/script_component.hpp index 278930e4e7..eb67fc3887 100644 --- a/addons/winddeflection/functions/script_component.hpp +++ b/addons/winddeflection/functions/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_WINDDEFLECTION - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_WINDDEFLECTION - #define DEBUG_SETTINGS DEBUG_SETTINGS_WINDDEFLECTION + #define DEBUG_SETTINGS DEBUG_SETTINGS_WINDDEFLECTION #endif #include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/winddeflection/script_component.hpp b/addons/winddeflection/script_component.hpp index 047b7980e5..4af43227de 100644 --- a/addons/winddeflection/script_component.hpp +++ b/addons/winddeflection/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_WINDDEFLECTION - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_WINDDEFLECTION - #define DEBUG_SETTINGS DEBUG_SETTINGS_WINDDEFLECTION + #define DEBUG_SETTINGS DEBUG_SETTINGS_WINDDEFLECTION #endif #include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/winddeflection/stringtable.xml b/addons/winddeflection/stringtable.xml index 409ebf7523..b52100046f 100644 --- a/addons/winddeflection/stringtable.xml +++ b/addons/winddeflection/stringtable.xml @@ -3,31 +3,26 @@ - Wind Information Wind Information Informacje o wietrze Información del viento - Direction: %1 Direction: %1 Kierunek: %1 Dirección: %1 - Speed: %1 m/s Speed: %1 m/s Prędkość: %1 Velocidad: %1 m/s - Weather Information Weather Information Informacje o pogodzie Información Meteorológica - Humidity: %1% Humidity: %1% Wilgotność: %1 Humedad: %1% diff --git a/extensions/fcs/ace_fcs.cpp b/extensions/fcs/ace_fcs.cpp index bf3b8e1290..6338dd8571 100644 --- a/extensions/fcs/ace_fcs.cpp +++ b/extensions/fcs/ace_fcs.cpp @@ -58,12 +58,13 @@ double traceBullet(double initSpeed, double airFriction, double angle, double an while (i < MAXITERATIONS) { lastPosX = posX; lastPosY = posY; - simulationStep = 0.1 - 0.049 * (posX / posTargetX); velMag = sqrt(pow(velX, 2) + pow(velY, 2)); + posX += velX * simulationStep * 0.5; + posY += velY * simulationStep * 0.5; velX += simulationStep * (velX * velMag * airFriction); - velY += simulationStep * (velY * velMag * airFriction - 9.81); - posX += velX * simulationStep; - posY += velY * simulationStep; + velY += simulationStep * (velY * velMag * airFriction - 9.80665); + posX += velX * simulationStep * 0.5; + posY += velY * simulationStep * 0.5; if (posX >= posTargetX) { break; } i++; } diff --git a/tools/ace_build_tool/pabstFrankensteinBuilder.py b/tools/ace_build_tool/pabstFrankensteinBuilder.py index 43d67e187d..09b12a5dc3 100644 --- a/tools/ace_build_tool/pabstFrankensteinBuilder.py +++ b/tools/ace_build_tool/pabstFrankensteinBuilder.py @@ -48,6 +48,7 @@ import hashlib import configparser import json import traceback +import time if sys.platform == "win32": import winreg @@ -538,8 +539,8 @@ See the make.cfg file for additional build options. input("Press Enter to continue...") print("Resuming build...") continue - else: - print("WARNING: Module is stored on work drive (" + work_drive + ").") + #else: + #print("WARNING: Module is stored on work drive (" + work_drive + ").") try: # Remove the old pbo, key, and log @@ -575,15 +576,25 @@ See the make.cfg file for additional build options. if build_tool == "pboproject": try: #PABST: Convert config (run the macro'd config.cpp through CfgConvert twice to produce a de-macro'd cpp that pboProject can read without fucking up: - os.chdir(os.path.join(arma3tools_path, "CfgConvert")) shutil.copyfile(os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.backup")) - print_green("\Pabst (double converting):" + "cfgConvertGUI.exe " + os.path.join(work_drive, prefix, module, "config.cpp")) - ret = subprocess.call(["cfgConvertGUI.exe", os.path.join(work_drive, prefix, module, "config.cpp")]) - ret = subprocess.call(["cfgConvertGUI.exe", os.path.join(work_drive, prefix, module, "config.bin")]) - - # Call pboProject + os.chdir("P:\\") + cmd = [os.path.join(work_drive, "CfgConvert", "CfgConvert.exe"), "-bin", "-dst", os.path.join(work_drive, prefix, module, "config.bin"), os.path.join(work_drive, prefix, module, "config.cpp")] + ret = subprocess.call(cmd) + #ret = subprocess.call(["cfgConvertGUI.exe", os.path.join(work_drive, prefix, module, "config.cpp")]) + + if ret != 0: + print_error("CfgConvert -bin return code == " + str(ret)) + input("Press Enter to continue...") + + + cmd = [os.path.join(work_drive, "CfgConvert", "CfgConvert.exe"), "-txt", "-dst", os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.bin")] + ret = subprocess.call(cmd) + if ret != 0: + print_error("CfgConvert -txt) return code == " + str(ret)) + input("Press Enter to continue...") + if os.path.isfile(os.path.join(work_drive, prefix, module, "$NOBIN$")): print_green("$NOBIN$ Found. Proceeding with non-binarizing!") cmd = [makepboTool, "-P","-A","-L","-N","-G", os.path.join(work_drive, prefix, module),os.path.join(module_root, release_dir, project,"Addons")] @@ -625,12 +636,12 @@ See the make.cfg file for additional build options. if not build_successful: print_error("pboProject return code == " + str(ret)) print_error("Module not successfully built/signed.") - #input("Press Enter to continue...") + input("Press Enter to continue...") print ("Resuming build...") continue #PABST: cleanup config BS (you could comment this out to see the "de-macroed" cpp - print_green("\Pabst (restoring): " + os.path.join(work_drive, prefix, module, "config.cpp")) + #print_green("\Pabst (restoring): " + os.path.join(work_drive, prefix, module, "config.cpp")) os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) os.remove(os.path.join(work_drive, prefix, module, "config.bin")) os.rename(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp"))